worked sleep.h

doc sleep.3 needs rename
This commit is contained in:
2025-10-02 11:55:48 -04:00
parent 9faba97d1b
commit ad77f1e37f
11 changed files with 75 additions and 16 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,7 +4,7 @@ breaking out of Node-JS jail and enabling both C and Scheme env
dis dis
dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181 dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181
Warning: this may publicly expose your IP and the old tools are unmaintained
you might discuss here you might discuss here
cabal://cf2caf3a1c4fd299471d315416b6cc3d9c5f7c678046652fb70ede4ff16698db cabal://cf2caf3a1c4fd299471d315416b6cc3d9c5f7c678046652fb70ede4ff16698db
@@ -20,10 +20,12 @@ i implement the SLEEP spec as a C header (similar to REST with HTML)
then i provide FFI bindings so you can call easily from scheme then i provide FFI bindings so you can call easily from scheme
i also have a novel solution for hyperswarm-dht (i think) i also have a novel solution for hyperswarm-dht (i think)
what this means and what this does is what this means and what this does:
this is a p2p program that does away with the client-server model, here be a p2p program that does away with the client-server model,
and enables you to basically share any directory in your system as a torrent (basically esentially) and enables you to basically share any directory in your system as a torrent (basically esentially)
the 'thang' part is the client, eventually i'm targetting wasm
"why? when hyper:// is here now with so cool much better justwerks dApps(Decentralized Apps)???" "why? when hyper:// is here now with so cool much better justwerks dApps(Decentralized Apps)???"
I like the sound of dat:// better, this is cooler no offense, and the scope of this project is longevity and community archival. I like the sound of dat:// better, this is cooler no offense, and the scope of this project is longevity and community archival.

View File

@@ -7,12 +7,22 @@
.Nd call a dat method .Nd call a dat method
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl d Ar debug
.
.Oo .Oo
.Op Fl t Ar type .Op Fl c Ar create
.Ar method .Oo
.Op Ar argument ... .Op Fl d Ar debug
.Oo
.Op Fl s Ar sync
.Oo
.Op Fl t Ar type
.Oo
.Op Fl v Ar version
.Ar method
.Op Ar argument ...
.Oc .Oc
.Sh DESCRIPTION .Sh DESCRIPTION
[WIP] dis dat mf thang [WIP] dis dat mf thang
@@ -27,7 +37,7 @@ its there
"Dat" was first written about by Mathias Buus Madsen & Maxwell Ogden (c) 2015 "Dat" was first written about by Mathias Buus Madsen & Maxwell Ogden (c) 2015
.Nm .Nm
was written and directed by was written and directed by
.An churtzan Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519 .An 𝖼̴̸͍͚͍̝͓̘͌̽͑̚͝͝𝗁̵̸̻͇̘̝̞͍̈́̔̾̾̓͘𝗎̸̴̡̼͕̻̦̓́̓̈́͘͜͠𝗋̸̵̡͎̼͇͖͊͐͆͜͝͝𝗍̸̸͕̠̼̙͚̻͆́̈́̒͛͝𝗓̵̴̢̟̝͎̝̪̓̀̕̚͝𝖺̸̸͚͓̠͕͕̒̒́͋͜͝͠𝗇̴̵͙̞͇̙͕̐͋̈́͌͒͜ Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519
.Sh BUGS .Sh BUGS
.Pp .Pp
Go ahead an fix em ;) Go ahead an fix em ;)

16
docs/sleep.3 Normal file
View File

@@ -0,0 +1,16 @@
.TH SLEEP 3 "September 2025" "Dat-Thang LTS" "Libary Functions Manual"
.SH NAME
.SH SYNOPSIS
.nf
.B #include <sleep.h>
.SH DESCRIPTION
.SH RETURN VALUES
.SH FILES
.SH AUTHORS
.SH NOTES

View File

@@ -1,9 +1,6 @@
// TODO implement SLEEP
#ifndef SLEEP_H #ifndef SLEEP_H
#define SLEEP_H #define SLEEP_H
// TODO implement SLEEP
#include "key.h"
/*metadata.key /*metadata.key
metadata.signatures metadata.signatures
metadata.bitfield metadata.bitfield
@@ -13,5 +10,39 @@ content.key
content.signatures content.signatures
content.bitfield content.bitfield
content.tree*/ content.tree*/
#include "key.h"
#include <stdint.h>
#include <stddef.h>
// test
#include <assert.h>
#endif /* NURSERY_H */ #define SLEEP_HEADER_SIZE 32u
#define SLEEP_ALGO_BLAKE2B "BLAKE2b"
#define SLEEP_ALGO_ED25519 "Ed25519"
typedef struct sleep_header {
uint32_t magic_be;
uint8_t version;
uint16_t entry_size_be;
uint8_t algo_len;
char algo[24];
} sleep_header_t;
// crypto helpers
#ifdef SLEEP_SALT
int sleep_gen_ed25519(uint8_t pubkey[32], uint8_t seckey[64]);
// sign
int sleep_sign_ed25519(const uint8_t *msg, size_t msglen,
const uint8_t seckey[64], uint8_t sig_out[64]);
// verify
int sleep_verify_ed25519(const uint8_t *msg, size_t msglen,
const uint8_t pubkey[32], const uint8_t sig[64]);
// discovery
int sleep_compute_discovery_key(const uint8_t pubkey[32], uint8_t out32[32]);
#endif /* SLEEP_SALT */
// function decs
#endif /* SLEEP_H */