From ad77f1e37f5bbc0ecb51e8205caafdd78f8a65ce Mon Sep 17 00:00:00 2001 From: divo <418@cryspace.space> Date: Thu, 2 Oct 2025 11:55:48 -0400 Subject: [PATCH] worked sleep.h doc sleep.3 needs rename --- .dat/content.bitfield | Bin 3616 -> 3616 bytes .dat/content.signatures | Bin 7392 -> 7648 bytes .dat/content.tree | Bin 9192 -> 9512 bytes .dat/metadata.bitfield | Bin 3616 -> 3616 bytes .dat/metadata.data | Bin 3637 -> 3901 bytes .dat/metadata.signatures | Bin 4128 -> 4384 bytes .dat/metadata.tree | Bin 5112 -> 5432 bytes README.txt | 10 ++++++---- docs/dat.1 | 24 ++++++++++++++++------- docs/sleep.3 | 16 +++++++++++++++ inc/sleep.h | 41 ++++++++++++++++++++++++++++++++++----- 11 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 docs/sleep.3 diff --git a/.dat/content.bitfield b/.dat/content.bitfield index e8a027a1a555f3a9c6e8342b0c042d34219c122e..660fda41c0b35a44875b86a9f397920c2a774011 100644 GIT binary patch delta 31 ncmZ1=vp{BoF4LE~&5kS|nI|i-$T0nTvDuO3KKo`_9%d#0z=sPE delta 32 ocmZ1=vp{BoF4Ol1n;ls`GEY`ukzstX*^%Ww`$Pwp#R@!30M2y_I{*Lx diff --git a/.dat/content.signatures b/.dat/content.signatures index 75ab232499d2b8d523af7c7e8be9e8f50533dba9..240e30cd70f6687d133fef02e43908d41b47661f 100644 GIT binary patch delta 266 zcmV+l0rmdiIp906;2eKCId80Rq9gq)ZN8m6xw#B+V)P-`k1>1U*`7veY0=mWRz-!5Qrwu2 z^Hb#^yE$tU7f0;c03%MUo%6+4uGdl2JWZjj?Jekp2L@Q|`#MFHlZkfv%!~dIu_<#2 z(qI!9C13?BwR(OK9_0GRPLS3%4HCFtEefqc)$P8 Q#x^tKo)5u&h_?cT0GqvofdBvi delta 7 OcmaE0{lId=0~r7ixdY(< diff --git a/.dat/content.tree b/.dat/content.tree index 691107137d5cb7e4465299916c64b8be9b44f92d..c5e88532d14680627e1890cd076145e787a56323 100644 GIT binary patch delta 318 zcmaFizQSw63}ubrhd&JbcKTRc`RLTUA=~@%Q{&HLwUch61vx!Nf58_&JBXIXQuPWX~}?(iz{tIr|o81_Ty$s8gQ sAa`h}oV2vvalT=b=02n7Zx;QM`C_4CTp;BJz_3L^vlOP}TqdO>+ja diff --git a/.dat/metadata.bitfield b/.dat/metadata.bitfield index 62d0e7c4b2af2d15bfba031a037d2cf42027cf41..2607b2770d0c06699571c532679814beb3b958c7 100644 GIT binary patch delta 35 rcmZ1=vp{Bo2IGg#hAiKiCo8ZBF#g+Y$nuGu^^1c8!-dTnJUSrUP(oXkP^p|W+nj!2?m8v{2Gh~#TNT-tYdO`vEu)l zS;ig^N{XA2gIP$FjfIJcoq>y6KP5l8SU)APM9&aO_bqk}MuQTIjW5$ST0GY@!FY_$=IDP4g801nx0pVbO7e1) zCExA14pYctoLdTiSk6d$%yjOAiD=jVAaM_uAW{{J$U7@L#9RK9C z3`dzD>KHksHZwo-i>#RCc$9hi^yzs$x2xXRw=2KPXJ_4gAkgAx3)DQ9npv9DHmvRF ze%u{vDm=mI$7FU^kv=bVDWCW=A1X4;-A+LjcIGKph8Q$onY2pl?89lhH##m`bM0Gk T^v~;spX6pdT>1YORGljTg=Kh^ delta 7 Ocmdm?^+SEb4`Bcgk^{W} diff --git a/README.txt b/README.txt index ad27d5d..2d1da51 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ breaking out of Node-JS jail and enabling both C and Scheme env dis dat://59d8099399510e23a3c693fb5887b7bba1586f4117f7ef1c5872622ada0c1181 - +Warning: this may publicly expose your IP and the old tools are unmaintained you might discuss here 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 i also have a novel solution for hyperswarm-dht (i think) -what this means and what this does is -this is a p2p program that does away with the client-server model, +what this means and what this does: +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) +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)???" I like the sound of dat:// better, this is cooler no offense, and the scope of this project is longevity and community archival. @@ -37,4 +39,4 @@ i'm using C because ez libraries, assert is the ultimate hack, and scheme becaus LICENSE see LICENSE -This is My Software \ No newline at end of file +This is My Software diff --git a/docs/dat.1 b/docs/dat.1 index 8b57b5c..76308da 100644 --- a/docs/dat.1 +++ b/docs/dat.1 @@ -7,12 +7,22 @@ .Nd call a dat method .Sh SYNOPSIS .Nm -.Op Fl d Ar debug -. -.Oo -.Op Fl t Ar type -.Ar method -.Op Ar argument ... +.Oo +.Op Fl c Ar create + .Oo + .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 .Sh DESCRIPTION [WIP] dis dat mf thang @@ -27,7 +37,7 @@ its there "Dat" was first written about by Mathias Buus Madsen & Maxwell Ogden (c) 2015 .Nm was written and directed by -.An churtzan Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519 +.An 饾柤檀蜐蜐蛯蛵蜌蛵谈探虤蛻虧蛽虡饾梺痰蛣虜叹袒蛧虡谈叹蜆虛虧虨蛵饾棊谈蜆蛢蜖碳獭蜁檀蛠虛蛣蜏袒苔饾棆谈蛫蜐蛺蛶碳蛧痰蛦蜐蜄獭蜏饾棈谈蛦蛠蜐蜁虪碳谈蛣虙蜎虣蜌袒饾棑痰虝蜐虤虩挞虧檀虛蛝蛶虧酞饾柡谈蜐虙蜖蜌蛽虪谈虙蛠蛬蜁蜏蜁饾棁檀虗蛬蛣蜋虨蛧痰蛯蛼蜏虣蜁 Aq @4c3NtV5p+7MRCwinLcD+dVMgz2rGbX2wF/ZtDxBA/Lw=.ed25519 .Sh BUGS .Pp Go ahead an fix em ;) diff --git a/docs/sleep.3 b/docs/sleep.3 new file mode 100644 index 0000000..8289ca5 --- /dev/null +++ b/docs/sleep.3 @@ -0,0 +1,16 @@ +.TH SLEEP 3 "September 2025" "Dat-Thang LTS" "Libary Functions Manual" +.SH NAME + +.SH SYNOPSIS +.nf +.B #include + +.SH DESCRIPTION + +.SH RETURN VALUES + +.SH FILES + +.SH AUTHORS + +.SH NOTES diff --git a/inc/sleep.h b/inc/sleep.h index 2eb10eb..9d0d7de 100644 --- a/inc/sleep.h +++ b/inc/sleep.h @@ -1,9 +1,6 @@ -// TODO implement SLEEP #ifndef SLEEP_H #define SLEEP_H - -#include "key.h" - +// TODO implement SLEEP /*metadata.key metadata.signatures metadata.bitfield @@ -13,5 +10,39 @@ content.key content.signatures content.bitfield content.tree*/ +#include "key.h" +#include +#include +// test +#include -#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 */