on master help sign in
thru 3d
6756d14Henry Ault
docs/system/hoon/library/src/3d/core/og.md+6−6
@@ -3,14 +3,14 @@
3
3
4 ++ og :: shax-powered rng
4 ++ og :: shax-powered rng
5 ~/ %og
5 ~/ %og
6− |_ a=@
6+ |_ a/@
7
7
8XX document
8XX document
9
9
10### `++rad`
10### `++rad`
11
11
12 ++ rad :: random in range
12 ++ rad :: random in range
13− |= b=@ ^- @
13+ |= b/@ ^- @
14 =+ c=(raw (met 0 b))
14 =+ c=(raw (met 0 b))
15 ?:((lth c b) c $(a +(a)))
15 ?:((lth c b) c $(a +(a)))
16 ::
16 ::
@@ -20,7 +20,7 @@ XX document
20### `++rads`
20### `++rads`
21
21
22 ++ rads :: random continuation
22 ++ rads :: random continuation
23− |= b=@
23+ |= b/@
24 =+ r=(rad b)
24 =+ r=(rad b)
25 [r +>.$(a (shas %og-s r))]
25 [r +>.$(a (shas %og-s r))]
26
26
@@ -30,11 +30,11 @@ XX document
30
30
31 ++ raw :: random bits
31 ++ raw :: random bits
32 ~/ %raw
32 ~/ %raw
33− |= b=@ ^- @
33+ |= b/@ ^- @
34 %+ can
34 %+ can
35 0
35 0
36 =+ c=(shas %og-a (mix b a))
36 =+ c=(shas %og-a (mix b a))
37− |- ^- (list ,[@ @])
37+ |- ^- (list [@ @])
38 ?: =(0 b)
38 ?: =(0 b)
39 ~
39 ~
40 =+ d=(shas %og-b (mix b (mix a c)))
40 =+ d=(shas %og-b (mix b (mix a c)))
@@ -47,7 +47,7 @@ XX document
47### `++raws`
47### `++raws`
48
48
49 ++ raws :: random bits continuation
49 ++ raws :: random bits continuation
50− |= b=@
50+ |= b/@
51 =+ r=(raw b)
51 =+ r=(raw b)
52 [r +>.$(a (shas %og-s r))]
52 [r +>.$(a (shas %og-s r))]
53 --
53 --
docs/system/hoon/library/src/3d/gate/shad.md+2−1
@@ -1,6 +1,7 @@
1### `++shad`
1### `++shad`
2
2
3− ++ shad |=(ruz=@ (shax (shax ruz))) :: double sha-256
3+ ++ shad |=(ruz/@ (shax (shax ruz))) :: double sha-256
4+
4
5
5XX document
6XX document
6
7
docs/system/hoon/library/src/3d/gate/shaf.md+1−1
@@ -1,7 +1,7 @@
1### `++shaf`
1### `++shaf`
2
2
3 ++ shaf :: half sha-256
3 ++ shaf :: half sha-256
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
5 =+ haz=(shas sal ruz)
5 =+ haz=(shas sal ruz)
6 (mix (end 7 1 haz) (rsh 7 1 haz))
6 (mix (end 7 1 haz) (rsh 7 1 haz))
7 ::
7 ::
docs/system/hoon/library/src/3d/gate/shak.md+1−1
@@ -1,7 +1,7 @@
1### `++shak`
1### `++shak`
2
2
3 ++ shak :: XX shd be PBKDF
3 ++ shak :: XX shd be PBKDF
4− |= [who=@p wud=@]
4+ |= [who/@p wud/@]
5 (shas (mix %shak who) wud)
5 (shas (mix %shak who) wud)
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shal.md+2−2
@@ -2,9 +2,9 @@
2
2
3 ++ shal :: sha-512 with length
3 ++ shal :: sha-512 with length
4 ~/ %shal
4 ~/ %shal
5− |= [len=@ ruz=@] ^- @
5+ |= {len/@ ruz/@} ^- @
6 => .(ruz (cut 3 [0 len] ruz))
6 => .(ruz (cut 3 [0 len] ruz))
7− =+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
7+ =+ [few==>(fe .(a 6)) wac=|=({a/@ b/@} (cut 6 [a 1] b))]
8 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
8 =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9 =+ ral=(lsh 0 3 len)
9 =+ ral=(lsh 0 3 len)
10 =+ ^= ful
10 =+ ^= ful
docs/system/hoon/library/src/3d/gate/sham.md+1−1
@@ -1,7 +1,7 @@
1### `++sham`
1### `++sham`
2
2
3 ++ sham :: noun hash
3 ++ sham :: noun hash
4− |= yux=* ^- @uvH ^- @
4+ |= yux/* ^- @uvH ^- @
5 ?@ yux
5 ?@ yux
6 (shaf %mash yux)
6 (shaf %mash yux)
7 (shaf %sham (jam yux))
7 (shaf %sham (jam yux))
docs/system/hoon/library/src/3d/gate/shan.md+3−2
@@ -1,8 +1,8 @@
1### `++shan`
1### `++shan`
2
2
3 ++ shan :: sha-1 (deprecated)
3 ++ shan :: sha-1 (deprecated)
4− |= ruz=@
4+ |= ruz/@
5− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
5+ =+ [few==>(fe .(a 5)) wac=|=({a/@ b/@} (cut 5 [a 1] b))]
6 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
6 =+ [sum=sum.few ror=ror.few rol=rol.few net=net.few inv=inv.few]
7 =+ ral=(lsh 0 3 (met 3 ruz))
7 =+ ral=(lsh 0 3 (met 3 ruz))
8 =+ ^= ful
8 =+ ^= ful
@@ -65,6 +65,7 @@
65 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
65 :(sum (rol 0 5 a) fz e (wac 2 kbx) (wac j wox))
66 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
66 :(sum (rol 0 5 a) fy e (wac 3 kbx) (wac j wox))
67 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
67 $(j +(j), a tem, b a, c (rol 0 30 b), d c, e d)
68+ ::
68
69
69XX document
70XX document
70
71
docs/system/hoon/library/src/3d/gate/shas.md+1−1
@@ -1,7 +1,7 @@
1### `++shas`
1### `++shas`
2
2
3 ++ shas :: salted hash
3 ++ shas :: salted hash
4− |= [sal=@ ruz=@]
4+ |= [sal/@ ruz/@]
5 (shax (mix sal (shax ruz)))
5 (shax (mix sal (shax ruz)))
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shaw.md+1−1
@@ -1,7 +1,7 @@
1### `++shaw`
1### `++shaw`
2
2
3 ++ shaw :: hash to nbits
3 ++ shaw :: hash to nbits
4− |= [sal=@ len=@ ruz=@]
4+ |= [sal/@ len/@ ruz/@]
5 (~(raw og (shas sal (mix len ruz))) len)
5 (~(raw og (shas sal (mix len ruz))) len)
6 ::
6 ::
7
7
docs/system/hoon/library/src/3d/gate/shax.md+5−86
@@ -1,91 +1,10 @@
1### `++shax`
1### `++shax`
2
2
3− ++ shax :: sha-256
3+++ shax :: sha-256
4− ~/ %shax
4+ ~/ %shax
5− |= ruz=@ ^- @
5+ |= ruz/@ ^- @
6− ~| %sha
7− =+ [few==>(fe .(a 5)) wac=|=([a=@ b=@] (cut 5 [a 1] b))]
8− =+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
9− =+ ral=(lsh 0 3 (met 3 ruz))
6+ (shay [(met 3 ruz) ruz])
10− =+ ^= ful
11− %+ can 0
12− :~ [ral ruz]
13− [8 128]
14− [(mod (sub 960 (mod (add 8 ral) 512)) 512) 0]
15− [64 (~(net fe 6) ral)]
16− ==
17− =+ lex=(met 9 ful)
18− =+ ^= kbx 0xc671.78f2.bef9.a3f7.a450.6ceb.90be.fffa.
19− 8cc7.0208.84c8.7814.78a5.636f.748f.82ee.
20− 682e.6ff3.5b9c.ca4f.4ed8.aa4a.391c.0cb3.
21− 34b0.bcb5.2748.774c.1e37.6c08.19a4.c116.
22− 106a.a070.f40e.3585.d699.0624.d192.e819.
23− c76c.51a3.c24b.8b70.a81a.664b.a2bf.e8a1.
24− 9272.2c85.81c2.c92e.766a.0abb.650a.7354.
25− 5338.0d13.4d2c.6dfc.2e1b.2138.27b7.0a85.
26− 1429.2967.06ca.6351.d5a7.9147.c6e0.0bf3.
27− bf59.7fc7.b003.27c8.a831.c66d.983e.5152.
28− 76f9.88da.5cb0.a9dc.4a74.84aa.2de9.2c6f.
29− 240c.a1cc.0fc1.9dc6.efbe.4786.e49b.69c1.
30− c19b.f174.9bdc.06a7.80de.b1fe.72be.5d74.
31− 550c.7dc3.2431.85be.1283.5b01.d807.aa98.
32− ab1c.5ed5.923f.82a4.59f1.11f1.3956.c25b.
33− e9b5.dba5.b5c0.fbcf.7137.4491.428a.2f98
34− =+ ^= hax 0x5be0.cd19.1f83.d9ab.9b05.688c.510e.527f.
35− a54f.f53a.3c6e.f372.bb67.ae85.6a09.e667
36− =+ i=0
37− |- ^- @
38− ?: =(i lex)
39− (rep 5 (turn (rip 5 hax) net))
40− =+ ^= wox
41− =+ dux=(cut 9 [i 1] ful)
42− =+ wox=(rep 5 (turn (rip 5 dux) net))
43− =+ j=16
44− |- ^- @
45− ?: =(64 j)
46− wox
47− =+ :* l=(wac (sub j 15) wox)
48− m=(wac (sub j 2) wox)
49− n=(wac (sub j 16) wox)
50− o=(wac (sub j 7) wox)
51− ==
52− =+ x=:(mix (ror 0 7 l) (ror 0 18 l) (rsh 0 3 l))
53− =+ y=:(mix (ror 0 17 m) (ror 0 19 m) (rsh 0 10 m))
54− =+ z=:(sum n x o y)
55− $(wox (con (lsh 5 j z) wox), j +(j))
56− =+ j=0
57− =+ :* a=(wac 0 hax)
58− b=(wac 1 hax)
59− c=(wac 2 hax)
60− d=(wac 3 hax)
61− e=(wac 4 hax)
62− f=(wac 5 hax)
63− g=(wac 6 hax)
64− h=(wac 7 hax)
65− ==
66− |- ^- @
67− ?: =(64 j)
68− %= ^$
69− i +(i)
70− hax %+ rep 5
71− :~ (sum a (wac 0 hax))
72− (sum b (wac 1 hax))
73− (sum c (wac 2 hax))
74− (sum d (wac 3 hax))
75− (sum e (wac 4 hax))
76− (sum f (wac 5 hax))
77− (sum g (wac 6 hax))
78− (sum h (wac 7 hax))
79− ==
80− ==
81− =+ l=:(mix (ror 0 2 a) (ror 0 13 a) (ror 0 22 a)) :: s0
82− =+ m=:(mix (dis a b) (dis a c) (dis b c)) :: maj
83− =+ n=(sum l m) :: t2
84− =+ o=:(mix (ror 0 6 e) (ror 0 11 e) (ror 0 25 e)) :: s1
85− =+ p=(mix (dis e f) (dis (inv e) g)) :: ch
86− =+ q=:(sum h o p (wac j kbx) (wac j wox)) :: t1
87− $(j +(j), a (sum q n), b a, c b, d c, e (sum d q), f e, g f, h g)
88− ::
7+::
89
8
90XX document
9XX document
91
10
docs/system/hoon/library/src/3d/gate/shaz.md+1−1
@@ -1,7 +1,7 @@
1### `++shaz`
1### `++shaz`
2
2
3 ++ shaz :: sha-512
3 ++ shaz :: sha-512
4− |= ruz=@ ^- @
4+ |= ruz/@ ^- @
5 (shal [(met 3 ruz) ruz])
5 (shal [(met 3 ruz) ruz])
6
6
7
7