hoon: adds +new-end, switches all +end call sites

This commit is contained in:
Joe Bryan 2020-12-01 20:42:38 -08:00
parent a8df159496
commit 4f9cba2baf
37 changed files with 178 additions and 172 deletions

View File

@ -558,7 +558,7 @@
:: correctly initialized, no need to do cleanup
::
~
?. =((end 3 4 i.t.path) 'dm--')
?. =((new-end [3 4] i.t.path) 'dm--')
~
:- =- [%pass /fixdm %agent [our.bol %chat-view] %poke %chat-view-action -]
!> ^- action:view

View File

@ -362,7 +362,7 @@
(gth expiry-time.a expiry-time.b)
|= [cookie=@uv session:eyre]
%- pairs
:~ 'cookie'^s+(end 3 4 (rsh 3 2 (scot %x (shax cookie))))
:~ 'cookie'^s+(new-end [3 4] (rsh 3 2 (scot %x (shax cookie))))
'expiry'^(time expiry-time)
'channels'^(numb ~(wyt in channels))
==

View File

@ -1340,7 +1340,7 @@
%+ murn ~(tap by dir:.^(arch %cy pax))
|= [=term ~]
^- (unit [^term tank])
?. =(app (end 3 (met 3 app) term))
?. =(app (new-end [3 (met 3 app)] term))
~
?~ =<(fil .^(arch %cy (weld pax ~[term %hoon])))
~
@ -1352,7 +1352,7 @@
%+ murn ~(tap by var)
|= [name=term =cage]
^- (unit [term tank])
?. =(variable (end 3 (met 3 variable) name))
?. =(variable (new-end [3 (met 3 variable)] name))
~
`[name (sell q.cage)]
::
@ -1371,7 +1371,7 @@
%+ murn
~(tap by dir:.^(arch %cy pfix))
|= [=term ~]
?. =(gen (end 3 (met 3 gen) term))
?. =(gen (new-end [3 (met 3 gen)] term))
~
?~ =<(fil .^(arch %cy (weld pfix ~[term %hoon])))
~
@ -1386,7 +1386,7 @@
%+ murn
~(tap by dir:.^(arch %cy pax))
|= [=term ~]
?. =(gen (end 3 (met 3 gen) term))
?. =(gen (new-end [3 (met 3 gen)] term))
~
?~ =<(fil .^(arch %cy (weld pax ~[term %hoon])))
~

View File

@ -323,7 +323,7 @@
?+ path (on-peek:def path)
[%x %clay %base %hash ~]
=/ versions (base-hash:version [our now]:bowl)
``hash+!>(?~(versions 0v0 (end 0 25 i.versions)))
``hash+!>(?~(versions 0v0 (new-end [0 25] i.versions)))
==
++ on-agent on-agent:def
++ on-fail on-fail:def

View File

@ -94,8 +94,8 @@
%- ~(rep by dir)
|= [[file=@t ~] out=(unit @t)]
?^ out out
?. ?& =((end 3 6 file) 'index.')
!=('sj.' (end 3 3 (swp 3 file)))
?. ?& =((new-end [3 6] file) 'index.')
!=('sj.' (new-end [3 3] (swp 3 file)))
==
out
``@t`(rsh 3 6 file)

View File

@ -72,7 +72,7 @@
|= [=mark =vase]
^- step:agent:gall
|^
=/ fin (end 3 4 mark)
=/ fin (new-end [3 4] mark)
?: =(%drum fin) poke-drum
?: =(%helm fin) poke-helm
?: =(%kiln fin) poke-kiln

View File

@ -27,7 +27,7 @@
==
=/ c (to-wain:format a)
?~ c "~"
?. =(':: ' (end 3 4 i.c))
?. =(':: ' (new-end [3 4] i.c))
"<undocumented>"
(trip i.c)
::

View File

@ -28,7 +28,7 @@
%+ turn (gulf min-child max-child)
|= child=@ud
=/ who=ship (cat 4 star child)
=/ ticket=@q (end 3 8 (shas who eny))
=/ ticket=@q (new-end [3 8] (shas who eny))
=/ owner=address
=< addr.keys
::NOTE ~zod because invite wallet convention

View File

@ -23,7 +23,7 @@
=/ mon=ship
?^ arg
mon.arg
(add our (lsh 5 1 (end 5 1 (shaz eny))))
(add our (lsh 5 1 (new-end 5 (shaz eny))))
=/ seg=ship (sein:title our now mon)
?. =(our seg)
%- %- slog :_ ~

View File

@ -17,11 +17,11 @@
=/ cub (pit:nu:crub:crypto 512 bur)
::
=/ pub=pass pub:ex:cub
=/ mag=cord (end 3 1 pub)
=/ mag=cord (new-end 3 pub)
?> =('b' mag)
=/ bod=@ (rsh 3 1 pub)
=/ cry=@ (rsh 8 1 bod)
=/ sgn=@ (end 8 1 bod)
=/ sgn=@ (new-end 8 bod)
%+ print leaf+" authentication: 0x{(render-hex-bytes:ethereum 32 sgn)}"
%+ print leaf+" networking: 0x{(render-hex-bytes:ethereum 32 cry)}"
%+ print leaf+"ethereum public keys:"

View File

@ -16,10 +16,10 @@
?. =(1 (met 3 tam))
tam
=/ zaz=(list [p=knot ~])
(skim van |=([a=term ~] =(tam (end 3 1 a))))
(skim van |=([a=term ~] =(tam (new-end 3 a))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz
=/ tip (end 3 1 nam)
=/ tip (new-end 3 nam)
=/ bip ?:(=('z' tip) %$ tip)
=/ way ?:(=('z' tip) (welp top /sys/[nam]) (welp top /sys/vane/[nam]))
=/ fil .^(@ %cx (welp way /hoon))

View File

@ -56,7 +56,7 @@
++ take
|= b=@ud
^- [v=@ x=@]
:- (end 3 b x)
:- (new-end [3 b] x)
(rsh 3 b x)
--
=^ k x (take 33)
@ -219,7 +219,7 @@
|= [vw=@u t=tape]
=+ x=(de-base58:mimes:html t)
=+ hash=(sha-256l:sha 32 (sha-256:sha (rsh 3 4 x)))
?> =((end 3 4 x) (rsh 3 28 hash))
?> =((new-end [3 4] x) (rsh 3 28 hash))
(cut 3 [vw (sub (met 3 x) (add 4 vw))] x)
::
++ hash160

View File

@ -23,7 +23,7 @@
::
=/ pieces
|- ^- (list @)
:- (end 0 11 dat.bits)
:- (new-end [0 11] dat.bits)
?: (lte wid.bits 11) ~
$(bits [(sub wid.bits 11) (rsh 0 11 dat.bits)])
::

View File

@ -142,7 +142,7 @@
++ bit
|= [len=@ud dat=@ux]
^- (unit [len=@ud dat=@ux])
?. =(0 (end 3 1 dat)) ~
?. =(0 (new-end 3 dat)) ~
:+ ~
(mul 8 (dec len))
(rsh 3 1 dat)
@ -188,7 +188,7 @@
=/ [nex=@ len=@]
:: faz: meaningful bits in fuz
::
=/ faz (end 0 7 fuz)
=/ faz (new-end [0 7] fuz)
?: =(0 (cut 0 [7 1] fuz))
[0 faz]
[faz (rep 3 (flop (scag faz t.q.tub)))]

View File

@ -1058,7 +1058,7 @@
%+ welp
cad.pom
?~ buf.say.inp ~
:(welp "<" (scow %p (end 4 1 (sham buf.say.inp))) "> ")
:(welp "<" (scow %p (new-end 4 (sham buf.say.inp))) "> ")
::
++ ta-yan :: yank
(snag (sub num.kil pos.kil) old.kil)

View File

@ -168,10 +168,10 @@
?. =(1 (met 3 nam))
nam
=/ zaz=(list [p=knot ~])
(skim van |=([a=term ~] =(nam (end 3 1 a))))
(skim van |=([a=term ~] =(nam (new-end 3 a))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz
=+ tip=(end 3 1 nam)
=+ tip=(new-end 3 nam)
=+ zus==('z' tip)
=+ way=?:(zus (welp top /sys/[nam]) (welp top /sys/vane/[nam]))
=+ fil=.^(@ %cx (welp way /hoon))

View File

@ -96,8 +96,8 @@
=+ =< [pub=pub:ex sec=sec:ex]
(pit:nu:crub:crypto 256 seed)
:- ^= auth
:- (rsh 3 1 (end 3 33 pub))
(rsh 3 1 (end 3 33 sec))
:- (rsh 3 1 (new-end [3 33] pub))
(rsh 3 1 (new-end [3 33] sec))
^= crypt
:- (rsh 3 33 pub)
(rsh 3 33 sec)

View File

@ -87,7 +87,7 @@
%+ skim ids
|= [id=cord *]
^- ?(%.y %.n)
=(sid (end 3 (met 3 sid) id))
=(sid (new-end [3 (met 3 sid)] id))
::
:: Get the longest prefix of a list of identifiers.
::
@ -101,14 +101,14 @@
|- ^- term
?: (gth n last)
term.i.matches
=/ prefix (end 3 n term.i.matches)
=/ prefix (new-end [3 n] term.i.matches)
?: |- ^- ?
?| ?=(~ t.matches)
?& =(prefix (end 3 n term.i.t.matches))
?& =(prefix (new-end [3 n] term.i.t.matches))
$(t.matches t.t.matches)
== ==
$(n +(n))
(end 3 (dec n) term.i.matches)
(new-end [3 (dec n)] term.i.matches)
::
:: Run +find-type safely, printing the first line of the stack trace on
:: error.
@ -369,7 +369,7 @@
:- %leaf
=/ c (to-wain:format a)
?~ c "~"
?. =(':: ' (end 3 4 i.c))
?. =(':: ' (new-end [3 4] i.c))
"<undocumented>"
(trip i.c)
--

View File

@ -39,7 +39,7 @@
['\\' i.mil $(mil t.mil)]
?: (lte ' ' i.mil)
[i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (new-end 2 i.mil)) $(mil t.mil)]
::
++ deal |=(lum=* (dish dole lum))
++ dial

View File

@ -88,8 +88,8 @@
::
++ mu
|_ [top=@ bot=@]
++ zag [p=(end 4 1 (add top bot)) q=bot]
++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
++ zag [p=(new-end 4 (add top bot)) q=bot]
++ zig [p=(new-end 4 (add top (sub 0x1.0000 bot))) q=bot]
++ zug (mix (lsh 4 1 top) bot)
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ -111,7 +111,7 @@
?: =(0 len)
~
=> .(len (dec len))
=+ mog=(zyft :(mix mig (end 3 1 len) (cut 3 [len 1] pyn)))
=+ mog=(zyft :(mix mig (new-end 3 len) (cut 3 [len 1] pyn)))
[[1 mog] $(mig mog)]
::
++ wred :: restore structure
@ -129,7 +129,7 @@
~
=> .(len (dec len))
=+ mog=(cut 3 [len 1] cry)
[[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
[[1 :(mix mig (new-end 3 len) (zyrt mog))] $(mig mog)]
::
++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))

View File

@ -62,7 +62,7 @@
|- ^- wain
?~ a
[(rap 3 ['-----END ' lab '-----' ~]) ~]
[(end 3 64 a) $(a (rsh 3 64 a))]
[(new-end [3 64] a) $(a (rsh 3 64 a))]
:: +de:pem: PEM decode
::
++ de

View File

@ -330,17 +330,17 @@
++ get-public-key-from-pass
|= a=pass
^- [@ @]
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
=+ [mag=(new-end 3 a) bod=(rsh 3 1 a)]
~| %not-crub-pubkey ?> =('b' mag)
[cry=(rsh 8 1 bod) sgn=(end 8 1 bod)]
[cry=(rsh 8 1 bod) sgn=(new-end 8 bod)]
::
::
++ get-private-key-from-ring
|= a=ring
^- [@ @]
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
=+ [mag=(new-end 3 a) bod=(rsh 3 1 a)]
~| %not-crub-seckey ?> =('B' mag)
=+ [c=(rsh 8 1 bod) s=(end 8 1 bod)]
=+ [c=(rsh 8 1 bod) s=(new-end 8 bod)]
:: todo: do we puck here?
[c s]
:: +ship-life-to-pubid: fetches public key information from jael

View File

@ -101,6 +101,6 @@
::
++ has-test-prefix
|= a=term ^- ?
=((end 3 5 a) 'test-')
=((new-end [3 5] a) 'test-')
--

View File

@ -10,7 +10,7 @@
%- cook :_ nuck:so
|= =coin
?> ?=(%$ -.coin)
?> ?=(%u (end 3 1 p.p.coin))
?> ?=(%u (new-end 3 p.p.coin))
`@`q.p.coin
::
++ grab

View File

@ -17,7 +17,7 @@
^- (map term knot)
%- ~(run by inf:(static:cram (ream mud)))
|= a=dime ^- cord
?+ (end 3 1 p.a) (scot a)
?+ (new-end 3 p.a) (scot a)
%t q.a
==
--

View File

@ -17,7 +17,7 @@
^- (map term knot)
%- ~(run by inf:(static:cram (ream mud)))
|= a=dime ^- cord
?+ (end 3 1 p.a) (scot a)
?+ (new-end 3 p.a) (scot a)
%t q.a
==
--

View File

@ -1100,7 +1100,7 @@
::
:: XX vane and care are concatenated
::
=/ lal (end 3 1 cyr)
=/ lal (new-end 3 cyr)
=/ ren ;;(@t (rsh 3 1 cyr))
?. (~(has by van.mod) lal)
~

View File

@ -842,7 +842,7 @@
|= [a=bloq b=(list [p=step q=@])]
^- @
?~ b 0
(add (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
(add (new-end [a p.i.b] q.i.b) (lsh a p.i.b $(b t.b)))
::
++ cat :: concatenate
~/ %cat
@ -852,13 +852,19 @@
++ cut :: slice
~/ %cut
|= [a=bloq [b=step c=step] d=@]
(end a c (rsh a b d))
(new-end [a c] (rsh a b d))
::
++ end :: tail
~/ %end
|= [a=bloq b=step c=@]
(mod c (bex (mul (bex a) b)))
::
++ new-end :: tail
~/ %new-end
|= [a=bite b=@]
=/ [=bloq =step] ?^(a a [a *step])
(mod b (bex (mul (bex bloq) step)))
::
++ fil :: fill bloqstream
~/ %fil
|= [a=bloq b=step c=@]
@ -899,7 +905,7 @@
|- ^- @
?~ b 0
%+ add $(i +(i), b t.b)
(lsh bloq (mul step i) (end bloq step i.b))
(lsh bloq (mul step i) (new-end [bloq step] i.b))
::
++ rev
:: reverses block order, accounting for leading zeroes
@ -910,7 +916,7 @@
~/ %rev
|= [boz=bloq len=@ud dat=@]
^- @
=. dat (end boz len dat)
=. dat (new-end [boz len] dat)
%^ lsh boz
(sub len (met boz dat))
(swp boz dat)
@ -921,7 +927,7 @@
=/ [=bloq =step] ?^(a a [a *step])
^- (list @)
?: =(0 b) ~
[(end bloq step b) $(b (rsh bloq step b))]
[(new-end [bloq step] b) $(b (rsh bloq step b))]
::
++ rsh :: right-shift
~/ %rsh
@ -983,7 +989,7 @@
=+ g=(mod c f)
(sit (con (rsh b g e) (lsh b (sub f g) e)))
++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
++ sit |=(b=@ (end a 1 b)) :: enforce modulo
++ sit |=(b=@ (new-end a b)) :: enforce modulo
--
:: ::
:::: 2d: bit logic ::
@ -1001,8 +1007,8 @@
c +(c)
d %+ add d
%^ lsh 0 c
?& =(0 (end 0 1 a))
=(0 (end 0 1 b))
?& =(0 (new-end 0 a))
=(0 (new-end 0 b))
==
==
::
@ -1018,8 +1024,8 @@
c +(c)
d %+ add d
%^ lsh 0 c
?| =(0 (end 0 1 a))
=(0 (end 0 1 b))
?| =(0 (new-end 0 a))
=(0 (new-end 0 b))
==
==
::
@ -1034,7 +1040,7 @@
a (rsh 0 1 a)
b (rsh 0 1 b)
c +(c)
d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
d (add d (lsh 0 c =((new-end 0 a) (new-end 0 b))))
==
::
++ not |= [a=bloq b=@ c=@] :: binary not (sized)
@ -1047,7 +1053,7 @@
~% %muk ..muk ~
=+ ~(. fe 5)
|= [syd=@ len=@ key=@]
=. syd (end 5 1 syd)
=. syd (new-end 5 syd)
=/ pad (sub len (met 3 key))
=/ data (weld (rip 3 key) (reap pad 0))
=/ nblocks (div len 4) :: intentionally off-by-one
@ -1115,7 +1121,7 @@
|- ^- @F
?: =(8 i) fal
=/ haz=@F (muk syd wyd key)
=/ ham=@F (mix (rsh 0 31 haz) (end 0 31 haz))
=/ ham=@F (mix (rsh 0 31 haz) (new-end [0 31] haz))
?.(=(0 ham) ham $(i +(i), syd +(syd)))
--
:: ::
@ -1139,7 +1145,7 @@
$(a -.a, b -.b)
?. ?=(@ b) &
|-
=+ [c=(end 3 1 a) d=(end 3 1 b)]
=+ [c=(new-end 3 a) d=(new-end 3 b)]
?: =(c d)
$(a (rsh 3 1 a), b (rsh 3 1 b))
(lth c d)
@ -2080,7 +2086,7 @@
=+ b=(met 0 a)
=+ c=(met 0 b)
:- (add (add c c) b)
(cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
(cat 0 (bex c) (mix (new-end [0 (dec c)] b) (lsh 0 (dec c) a)))
::
++ rub :: length-decode
~/ %rub
@ -2174,7 +2180,7 @@
1
=+ d=$(b (rsh 0 1 b))
=+ e=(pro d d)
?:(=(0 (end 0 1 b)) e (pro c e))
?:(=(0 (new-end 0 b)) e (pro c e))
::
++ fra
|= [b=@ c=@]
@ -2201,7 +2207,7 @@
++ si :: signed integer
^?
|%
++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
++ abs |=(a=@s (add (new-end 0 a) (rsh 0 1 a))) :: absolute value
++ dif |= [a=@s b=@s] :: subtraction
(sum a (new !(syn b) (abs b)))
++ dul |= [a=@s b=@] :: modulus
@ -2228,7 +2234,7 @@
(new & (sub +.d +.c))
(new | (add +.c +.d))
++ sun |=(a=@u (mul 2 a)) :: @u to @s
++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
++ syn |=(a=@s =(0 (new-end 0 a))) :: sign test
++ cmp |= [a=@s b=@s] :: compare
^- @s
?: =(a b)
@ -2364,7 +2370,7 @@
:: every fn has a unique representation of this kind
++ uni
|= [a=[e=@s a=@u]]
|- ?: =((end 0 1 a.a) 1) a
|- ?: =((new-end 0 a.a) 1) a
$(a.a (rsh 0 1 a.a), e.a (sum:si e.a --1))
::
:: expands to either full precision or to denormalized
@ -2399,7 +2405,7 @@
?: (gth m prc) (^sub m prc) 0 :: reduce precision
%- abs:si ?: =(den %i) --0 :: enforce min. exp
?: =((cmp:si e.a emn) -1) (dif:si emn e.a) --0
=^ b a :- (end 0 q a.a)
=^ b a :- (new-end [0 q] a.a)
a(e (sum:si e.a (sun:si q)), a (rsh 0 q a.a))
::
?~ a.a
@ -2505,7 +2511,7 @@
=+ x=(abs:si e.a)
=+ y=(rsh 0 x a.a)
?: |(=(r %d) =(r %z)) [%f & --0 y]
=+ z=(end 0 x a.a)
=+ z=(new-end [0 x] a.a)
?: |(=(r %u) =(r %a)) [%f & --0 ?~(z y +(y))]
=+ i=(bex (dec x))
?: &(=(z i) =((dis y 1) 0)) [%f & --0 y]
@ -2764,7 +2770,7 @@
?> (^lth ma +(p))
?: s.a `@r`a.a (^add a.a sb)
=+ q=(sum:si (dif:si e.a me) --1)
=+ r=(^add (lsh 0 p (abs:si q)) (end 0 p a.a))
=+ r=(^add (lsh 0 p (abs:si q)) (new-end [0 p] a.a))
?: s.a r (^add r sb)
::
++ sig :: get sign
@ -3179,12 +3185,12 @@
^- tarp
=+ sec=(rsh 6 1 now)
=+ ^= fan
=+ [muc=4 raw=(end 6 1 now)]
=+ [muc=4 raw=(new-end 6 now)]
|- ^- (list @ux)
?: |(=(0 raw) =(0 muc))
~
=> .(muc (dec muc))
[(cut 4 [muc 1] raw) $(raw (end 4 muc raw))]
[(cut 4 [muc 1] raw) $(raw (new-end [4 muc] raw))]
=+ day=(div sec day:yo)
=> .(sec (mod sec day:yo))
=+ hor=(div sec hor:yo)
@ -3225,7 +3231,7 @@
=+ dis=?:(lep 366 365)
?. (lth day dis)
=+ ner=+(yer)
$(yer ner, day (sub day dis), lep =(0 (end 0 2 ner)))
$(yer ner, day (sub day dis), lep =(0 (new-end [0 2] ner)))
|- ^- [y=@ud m=@ud d=@ud]
=+ [mot=0 cah=?:(lep moy:yo moh:yo)]
|- ^- [y=@ud m=@ud d=@ud]
@ -3283,7 +3289,7 @@
++ shaf :: half sha-256
|= [sal=@ ruz=@]
=+ haz=(shas sal ruz)
(mix (end 7 1 haz) (rsh 7 1 haz))
(mix (new-end 7 haz) (rsh 7 1 haz))
::
++ sham :: 128bit noun hash
|= yux=* ^- @uvH ^- @
@ -3599,7 +3605,7 @@
~
=+ d=(shas %og-b (mix b (mix a c)))
?: (lth b 256)
[[b (end 0 b d)] ~]
[[b (new-end [0 b] d)] ~]
[[256 d] $(c d, b (sub b 256))]
::
++ raws :: random bits
@ -3722,7 +3728,7 @@
?: =(0 len)
~
=> .(len (dec len))
=+ mog=(zyft :(mix mig (end 3 1 len) (cut 3 [len 1] pyn)))
=+ mog=(zyft :(mix mig (new-end 3 len) (cut 3 [len 1] pyn)))
[[1 mog] $(mig mog)]
::
++ wred :: restore structure
@ -3740,7 +3746,7 @@
~
=> .(len (dec len))
=+ mog=(cut 3 [len 1] cry)
[[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
[[1 :(mix mig (new-end 3 len) (zyrt mog))] $(mig mog)]
::
++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
@ -4139,7 +4145,7 @@
++ tok
|= a=@ux ^- @ux
=+ b=(pad a)
=- (~(net fe 5) (end 3 4 (shay 32 -)))
=- (~(net fe 5) (new-end [3 4] (shay 32 -)))
(shay (add b (met 3 a)) (lsh 3 b (swp 3 a)))
::
++ pad |=(a=@ =+(b=(met 3 a) ?:((gte b 21) 0 (sub 21 b))))
@ -4147,7 +4153,7 @@
++ den
|= a=@ux ^- (unit @ux)
=+ b=(rsh 3 4 a)
?. =((tok b) (end 3 4 a))
?. =((tok b) (new-end [3 4] a))
~
`b
--
@ -4161,7 +4167,7 @@
|-
?: =(0 a)
&
=+ vis=(end 3 1 a)
=+ vis=(new-end 3 a)
?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
$(a (rsh 3 1 a))
==
@ -4202,7 +4208,7 @@
?: (gth (met 5 a) 1)
%+ weld
$(a (rsh 5 1 a), b (sub b 4))
`tape`['-' '-' $(a (end 5 1 a), b 4)]
`tape`['-' '-' $(a (new-end 5 a), b 4)]
?: =(0 b)
['~' ~]
?: (lte b 1)
@ -4210,10 +4216,10 @@
|- ^- tape
?: =(2 b)
=+ c=(rsh 3 1 a)
=+ d=(end 3 1 a)
=+ d=(new-end 3 a)
(weld (trip (tod:po c)) (trip (tos:po (mix c d))))
=+ c=(rsh 3 2 a)
=+ d=(end 3 2 a)
=+ d=(new-end [3 2] a)
(weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
::
++ ruv
@ -4269,7 +4275,7 @@
++ sane :: atom sanity
|= a=@ta
|= b=@ ^- ?
?. =(%t (end 3 1 a))
?. =(%t (new-end 3 a))
:: XX more and better sanity
::
&
@ -4296,7 +4302,7 @@
==
|- ^- ?
?: =(0 b) &
=+ cur=(end 3 1 b)
=+ cur=(new-end 3 b)
?: &((lth cur 32) !=(10 cur)) |
=+ len=(teff cur)
?& |(=(1 len) =+(i=1 |-(|(=(i len) &((gte (cut 3 [i 1] b) 128) $(i +(i)))))))
@ -4325,11 +4331,11 @@
|= a=@ ^- tape
?: =(0 (met 3 a))
~
[^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
[^-(@ta (new-end 3 a)) $(a (rsh 3 1 a))]
::
++ teff :: length utf8
|= a=@t ^- @
=+ b=(end 3 1 a)
=+ b=(new-end 3 a)
?: =(0 b)
?>(=(`@`0 a) 0)
?> |((gte b 32) =(10 b))
@ -4353,7 +4359,7 @@
%4 [[24 6] [16 6] [8 6] [0 3] ~]
==
|=([p=@ q=@] [q (cut 0 [p q] a)])
?> =((tuft c) (end 3 b a))
?> =((tuft c) (new-end [3 b] a))
[c $(a (rsh 3 b a))]
::
++ tuba :: utf8 to utf32 tape
@ -4374,25 +4380,25 @@
|- ^- (list @)
?: =(`@`0 a)
~
=+ b=(end 5 1 a)
=+ b=(new-end 5 a)
=+ c=$(a (rsh 5 1 a))
?: (lte b 0x7f)
[b c]
?: (lte b 0x7ff)
:* (mix 0b1100.0000 (cut 0 [6 5] b))
(mix 0b1000.0000 (end 0 6 b))
(mix 0b1000.0000 (new-end [0 6] b))
c
==
?: (lte b 0xffff)
:* (mix 0b1110.0000 (cut 0 [12 4] b))
(mix 0b1000.0000 (cut 0 [6 6] b))
(mix 0b1000.0000 (end 0 6 b))
(mix 0b1000.0000 (new-end [0 6] b))
c
==
:* (mix 0b1111.0000 (cut 0 [18 3] b))
(mix 0b1000.0000 (cut 0 [12 6] b))
(mix 0b1000.0000 (cut 0 [6 6] b))
(mix 0b1000.0000 (end 0 6 b))
(mix 0b1000.0000 (new-end [0 6] b))
c
==
::
@ -4432,13 +4438,13 @@
|- ^- (list @)
?: =(`@`0 a)
~
=+ b=(end 3 1 a)
=+ b=(new-end 3 a)
=+ c=(rsh 3 1 a)
?: =('.' b)
[' ' $(a c)]
?. =('~' b)
[b $(a c)]
=> .(b (end 3 1 c), c (rsh 3 1 c))
=> .(b (new-end 3 c), c (rsh 3 1 c))
?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
^= d
=+ d=0
@ -4447,7 +4453,7 @@
[d c]
?< =(0 c)
%= $
b (end 3 1 c)
b (new-end 3 c)
c (rsh 3 1 c)
d %+ add (mul 16 d)
%+ sub b
@ -4466,7 +4472,7 @@
?: =(`@`0 a)
~
=+ b=(teff a)
=+ c=(taft (end 3 b a))
=+ c=(taft (new-end [3 b] a))
=+ d=$(a (rsh 3 b a))
?: ?| &((gte c 'a') (lte c 'z'))
&((gte c '0') (lte c '9'))
@ -4481,7 +4487,7 @@
['.' d]
=. e (dec e)
=+ f=(rsh 2 e c)
[(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
[(add ?:((lte f 9) 48 87) f) $(c (new-end [2 e] c))]
::
%' ' ['.' d]
%'.' ['~' '.' d]
@ -4941,7 +4947,7 @@
|- ^- (like @t)
?: =(`@`0 daf)
[p=p.tub q=[~ u=[p=fad q=tub]]]
?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
?: |(?=(~ q.tub) !=((new-end 3 daf) i.q.tub))
(fail tub)
$(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
::
@ -5434,8 +5440,8 @@
--
++ mu
|_ [top=@ bot=@]
++ zag [p=(end 4 1 (add top bot)) q=bot]
++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
++ zag [p=(new-end 4 (add top bot)) q=bot]
++ zig [p=(new-end 4 (add top (sub 0x1.0000 bot))) q=bot]
++ zug (mix (lsh 4 1 top) bot)
--
++ ne
@ -5464,7 +5470,7 @@
?~ p.lot
['_' '_' rep]
['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
=+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
=+ [yed=(new-end 3 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
|- ^- tape
?+ yed (z-co q.p.lot)
%c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
@ -5525,7 +5531,7 @@
rep =/ log (cut 4 [imp 1] sxz)
;: weld
(trip (tos:po (rsh 3 1 log)))
(trip (tod:po (end 3 1 log)))
(trip (tod:po (new-end 3 log)))
?:(=((mod imp 4) 0) ?:(=(imp 0) "" "--") "-")
rep
== ==
@ -5854,7 +5860,7 @@
~+
=+ ^= neg
|= [syn=? mol=dime] ^- dime
?> =('u' (end 3 1 p.mol))
?> =('u' (new-end 3 p.mol))
[(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
;~ pfix hep
;~ pose
@ -7291,7 +7297,7 @@
[0 %$]
=+ tyl=(rsh 3 (dec len) mot)
?: &((gte tyl 'A') (lte tyl 'Z'))
[(sub tyl 64) (end 3 (dec len) mot)]
[(sub tyl 64) (new-end [3 (dec len)] mot)]
[0 mot]
=+ [yoz=(fiz yaz) wux=(fiz wix)]
?& ?| =(0 p.yoz)
@ -7300,7 +7306,7 @@
==
|- ?| =(%$ p.yoz)
=(%$ p.wux)
?& =((end 3 1 p.yoz) (end 3 1 p.wux))
?& =((new-end 3 p.yoz) (new-end 3 p.wux))
$(p.yoz (rsh 3 1 p.yoz), p.wux (rsh 3 1 p.wux))
==
==
@ -11042,7 +11048,7 @@
['\\' i.mil $(mil t.mil)]
?: (lte ' ' i.mil)
[i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (new-end 2 i.mil)) $(mil t.mil)]
::
++ deal |=(lum=* (dish dole lum))
++ dial

View File

@ -926,7 +926,7 @@
::
:: Logic duplicates +com:nu:crub:crypto and +sure:as:crub:crypto.
::
=/ key (end 8 1 (rsh 3 1 public-key.open-packet))
=/ key (new-end 8 (rsh 3 1 public-key.open-packet))
?> (veri:ed:crypto signature signed key)
:: store comet as peer in our state
::
@ -1551,7 +1551,7 @@
=/ pumps=(list message-pump-state)
%+ murn ~(tap by snd.peer-state)
|= [=bone =message-pump-state]
?: =(0 (end 0 1 bone))
?: =(0 (new-end 0 bone))
~
`u=message-pump-state
:: clogged: are five or more response messages unsent to this peer?
@ -1780,11 +1780,11 @@
^+ peer-core
:: if odd bone, ack is on "subscription update" message; no-op
::
?: =(1 (end 0 1 bone))
?: =(1 (new-end 0 bone))
peer-core
:: even bone; is this bone a nack-trace bone?
::
?: =(1 (end 0 1 (rsh 0 1 bone)))
?: =(1 (new-end 0 (rsh 0 1 bone)))
:: nack-trace bone; assume .ok, clear nack from |message-sink
::
=/ target-bone=^bone (mix 0b10 bone)
@ -1870,9 +1870,9 @@
:: even bone, 1 second bit: nack-trace %boon message
::
++ on-sink-memo
?: =(1 (end 0 1 bone))
?: =(1 (new-end 0 bone))
on-sink-plea
?: =(0 (end 0 1 (rsh 0 1 bone)))
?: =(0 (new-end 0 (rsh 0 1 bone)))
on-sink-boon
on-sink-nack-trace
:: +on-sink-boon: handle response message received by |message-sink
@ -2903,10 +2903,10 @@
|= [=public-key =private-key]
^- symmetric-key
::
?> =('b' (end 3 1 public-key))
?> =('b' (new-end 3 public-key))
=. public-key (rsh 8 1 (rsh 3 1 public-key))
::
?> =('B' (end 3 1 private-key))
?> =('B' (new-end 3 private-key))
=. private-key (rsh 8 1 (rsh 3 1 private-key))
::
`@`(shar:ed:crypto public-key private-key)
@ -2979,22 +2979,22 @@
^- packet
:: first 32 (2^5) bits are header; the rest is body
::
=/ header (end 5 1 blob)
=/ header (new-end 5 blob)
=/ body (rsh 5 1 blob)
::
=/ version (end 0 3 header)
=/ version (new-end [0 3] header)
=/ checksum (cut 0 [3 20] header)
=/ sndr-size (decode-ship-size (cut 0 [23 2] header))
=/ rcvr-size (decode-ship-size (cut 0 [25 2] header))
=/ encrypted ?+((cut 0 [27 5] header) !! %0 %.y, %1 %.n)
::
=/ =dyad
:- sndr=(end 3 sndr-size body)
:- sndr=(new-end [3 sndr-size] body)
rcvr=(cut 3 [sndr-size rcvr-size] body)
::
?. =(protocol-version version)
~| %ames-protocol^version^dyad !!
?. =(checksum (end 0 20 (mug body)))
?. =(checksum (new-end [0 20] (mug body)))
~| %ames-checksum^dyad !!
::
=+ ~| %ames-invalid-packet

View File

@ -1978,7 +1978,7 @@
|= =term
=/ vane=@t (path-to-cord data /sys/vane/[term]/hoon)
%- emit
=/ tip (end 3 1 term)
=/ tip (new-end 3 term)
=/ =path /sys/vane/[term]/hoon
[hen %pass /reload %d %flog %veer tip path vane]
--
@ -3839,7 +3839,7 @@
=+ pac=(of-wain (lurk:differ (to-wain (cat 3 txt '\0a')) dif))
?~ pac
''
(end 3 (dec (met 3 pac)) pac)
(new-end [3 (dec (met 3 pac))] pac)
::
:: Gets an arch (directory listing) at a node.
::

View File

@ -332,7 +332,7 @@
control-duct hen
beak bek
agent &+agent
nonce (scot %uw (end 5 1 (shas %yoke-nonce eny)))
nonce (scot %uw (new-end 5 (shas %yoke-nonce eny)))
==
::
=/ old mo-core

View File

@ -1045,7 +1045,7 @@
=/ who (slaw %p i.tyl)
?~ who [~ ~]
=/ sec (~(got by jaw.own.pki.lex) lyf.own.pki.lex)
``[%noun !>((end 6 1 (shaf %pass (shax sec))))]
``[%noun !>((new-end 6 (shaf %pass (shax sec))))]
::
%life
?. ?=([@ ~] tyl) [~ ~]

View File

@ -2316,7 +2316,7 @@
:: :: ++pram:number
++ pram :: rabin-miller
|= a=@ ^- ?
?: ?| =(0 (end 0 1 a))
?: ?| =(0 (new-end 0 a))
=(1 a)
=+ b=1
|- ^- ?
@ -2328,7 +2328,7 @@
=+ ^= b
=+ [s=(dec a) t=0]
|- ^- [s=@ t=@]
?: =(0 (end 0 1 s))
?: =(0 (new-end 0 s))
$(s (rsh 0 1 s), t +(t))
[s t]
?> =((mul s.b (bex t.b)) (dec a))
@ -3199,7 +3199,7 @@
~/ %en
|= txt=@
^- (trel @uxH @ud @ux)
=+ [k1=(rsh 7 1 key) k2=(end 7 1 key)]
=+ [k1=(rsh 7 1 key) k2=(new-end 7 key)]
=+ iv=(s2va k1 (weld vec (limo ~[txt])))
=+ len=(met 3 txt)
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
@ -3212,7 +3212,7 @@
~/ %de
|= [iv=@H len=@ txt=@]
^- (unit @ux)
=+ [k1=(rsh 7 1 key) k2=(end 7 1 key)]
=+ [k1=(rsh 7 1 key) k2=(new-end 7 key)]
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
=+ ^= pln
(~(de ctra k2 7 len hib) txt)
@ -3229,7 +3229,7 @@
~/ %en
|= txt=@
^- (trel @uxH @ud @ux)
=+ [k1=(rsh 6 3 key) k2=(end 6 3 key)]
=+ [k1=(rsh 6 3 key) k2=(new-end [6 3] key)]
=+ iv=(s2vb k1 (weld vec (limo ~[txt])))
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
=+ len=(met 3 txt)
@ -3241,7 +3241,7 @@
~/ %de
|= [iv=@H len=@ txt=@]
^- (unit @ux)
=+ [k1=(rsh 6 3 key) k2=(end 6 3 key)]
=+ [k1=(rsh 6 3 key) k2=(new-end [6 3] key)]
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
=+ ^= pln
(~(de ctrb k2 7 len hib) txt)
@ -3258,7 +3258,7 @@
~/ %en
|= txt=@
^- (trel @uxH @ud @ux)
=+ [k1=(rsh 8 1 key) k2=(end 8 1 key)]
=+ [k1=(rsh 8 1 key) k2=(new-end 8 key)]
=+ iv=(s2vc k1 (weld vec (limo ~[txt])))
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
=+ len=(met 3 txt)
@ -3271,7 +3271,7 @@
~/ %de
|= [iv=@H len=@ txt=@]
^- (unit @ux)
=+ [k1=(rsh 8 1 key) k2=(end 8 1 key)]
=+ [k1=(rsh 8 1 key) k2=(new-end 8 key)]
=* hib (dis iv 0xffff.ffff.ffff.ffff.7fff.ffff.7fff.ffff)
=+ ^= pln
(~(de ctrc k2 7 len hib) txt)
@ -3445,7 +3445,7 @@
=+ exp=(shal (rsh 0 3 b) (suck sek))
=. exp (dis exp (can 0 ~[[3 0] [251 (fil 0 251 1)]]))
=. exp (con exp (lsh 3 31 0b100.0000))
=+ prv=(end 8 1 exp)
=+ prv=(new-end 8 exp)
=+ crv=(fra.fq (sum.fq 1 pub) (dif.fq 1 pub))
(curt prv crv)
:: :: ++sign:ed:crypto
@ -3507,7 +3507,7 @@
=+ few==>(fe .(a 5))
=+ ^= rot
|= [a=@ b=@]
(mix (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
(mix (new-end 5 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
=+ ^= lea
|= [a=@ b=@]
(net:few (sum:few (net:few a) (net:few b)))
@ -3623,7 +3623,7 @@
:: :: ++hml:scr:crypto
++ hml :: w+length
|= [k=@ kl=@ t=@ tl=@]
=> .(k (end 3 kl k), t (end 3 tl t))
=> .(k (new-end [3 kl] k), t (new-end [3 tl] t))
=+ b=64
=? k (gth kl b) (shay kl k)
=+ ^= q %+ shay (add b tl)
@ -3639,7 +3639,7 @@
++ pbl :: w+length
~/ %pbl
|= [p=@ pl=@ s=@ sl=@ c=@ d=@]
=> .(p (end 3 pl p), s (end 3 sl s))
=> .(p (new-end [3 pl] p), s (new-end [3 sl] s))
=+ h=32
::
:: max key length 1GB
@ -3662,7 +3662,7 @@
=+ q=(hml p pl u ?:(=(k 1) (add sl 4) h))
$(u q, f (mix f q), k +(k))
$(t (add t (lsh 3 (mul (dec j) h) f)), j +(j))
(end 3 d t)
(new-end [3 d] t)
:: :: ++hsh:scr:crypto
++ hsh :: scrypt
~/ %hsh
@ -3673,7 +3673,7 @@
~/ %hsl
|= [p=@ pl=@ s=@ sl=@ n=@ r=@ z=@ d=@]
=| v=(list (list @))
=> .(p (end 3 pl p), s (end 3 sl s))
=> .(p (new-end [3 pl] p), s (new-end [3 sl] s))
=+ u=(mul (mul 128 r) z)
::
:: n is power of 2; max 1GB memory
@ -3730,7 +3730,7 @@
|= [bpk=pass msg=@]
^- @ux
?~ sek ~| %pubkey-only !!
?> =('b' (end 3 1 bpk))
?> =('b' (new-end 3 bpk))
=+ pk=(rsh 8 1 (rsh 3 1 bpk))
=+ shar=(shax (shar:ed pk cry.u.sek))
=+ smsg=(sign msg)
@ -3740,7 +3740,7 @@
|= [bpk=pass txt=@]
^- (unit @ux)
?~ sek ~| %pubkey-only !!
?> =('b' (end 3 1 bpk))
?> =('b' (new-end 3 bpk))
=+ pk=(rsh 8 1 (rsh 3 1 bpk))
=+ shar=(shax (shar:ed pk cry.u.sek))
=+ ;;([iv=@ len=@ cph=@] (cue txt))
@ -3777,7 +3777,7 @@
++ pac :: private fingerprint
^- @uvG
?~ sek ~| %pubkey-only !!
(end 6 1 (shaf %bcod sec))
(new-end 6 (shaf %bcod sec))
:: :: ++pub:ex:crub:crypto
++ pub :: public key
^- pass
@ -3796,21 +3796,21 @@
|= [w=@ seed=@]
=+ wid=(add (div w 8) ?:(=((mod w 8) 0) 0 1))
=+ bits=(shal wid seed)
=+ [c=(rsh 8 1 bits) s=(end 8 1 bits)]
=+ [c=(rsh 8 1 bits) s=(new-end 8 bits)]
..nu(pub [cry=(puck:ed c) sgn=(puck:ed s)], sek `[cry=c sgn=s])
:: :: ++nol:nu:crub:crypto
++ nol :: activate secret
|= a=ring
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
=+ [mag=(new-end 3 a) bod=(rsh 3 1 a)]
~| %not-crub-seckey ?> =('B' mag)
=+ [c=(rsh 8 1 bod) s=(end 8 1 bod)]
=+ [c=(rsh 8 1 bod) s=(new-end 8 bod)]
..nu(pub [cry=(puck:ed c) sgn=(puck:ed s)], sek `[cry=c sgn=s])
:: :: ++com:nu:crub:crypto
++ com :: activate public
|= a=pass
=+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
=+ [mag=(new-end 3 a) bod=(rsh 3 1 a)]
~| %not-crub-pubkey ?> =('b' mag)
..nu(pub [cry=(rsh 8 1 bod) sgn=(end 8 1 bod)], sek ~)
..nu(pub [cry=(rsh 8 1 bod) sgn=(new-end 8 bod)], sek ~)
-- ::nu
-- ::crub
:: ::
@ -4191,8 +4191,8 @@
:: out: bytes output by haj
|* [[haj=$-([@u @] @) boq=@u out=@u] key=byts msg=byts]
:: ensure key and message fit signaled lengths
=. dat.key (end 3 wid.key dat.key)
=. dat.msg (end 3 wid.msg dat.msg)
=. dat.key (new-end [3 wid.key] dat.key)
=. dat.msg (new-end [3 wid.msg] dat.msg)
:: keys longer than block size are shortened by hashing
=? dat.key (gth wid.key boq) (haj wid.key dat.key)
=? wid.key (gth wid.key boq) out
@ -4249,7 +4249,7 @@
++ decompress-point
|= compressed=@
^- point
=/ x=@ (end 3 bytes compressed)
=/ x=@ (new-end [3 bytes] compressed)
?> =(3 (mod p.domain 4))
=/ fop field-p
=+ [fadd fmul fpow]=[sum.fop pro.fop exp.fop]
@ -4465,7 +4465,7 @@
(sub n.domain.c s)
=? rp s-high
[x.rp (sub p.domain.c y.rp)]
=/ v (end 0 1 y.rp)
=/ v (new-end 0 y.rp)
=? v (gte x.rp n.domain.c)
(add v 2)
[v x.rp s]
@ -4486,7 +4486,7 @@
=+ [fadd fmul fpow]=[sum.fop pro.fop exp.fop]
=/ ysq (fadd (fpow 3 x) b.domain.c)
=/ beta (fpow (rsh 0 2 +(p.domain.c)) ysq)
=/ y ?: =((end 0 1 v.sig) (end 0 1 beta))
=/ y ?: =((new-end 0 v.sig) (new-end 0 beta))
beta
(sub p.domain.c beta)
?> =(0 (dif.fop ysq (fmul y y)))
@ -4577,7 +4577,7 @@
=. v
%- mod-word
:^ v 12 16
(cury mix (end 0 64 t))
(cury mix (new-end [0 64] t))
=. v
%- mod-word
:^ v 13 16
@ -4594,7 +4594,7 @@
?: =(i 12)
:: xor upper and lower halves of v into state h
=. h (mix h (rsh 6 8 v))
(mix h (end 6 8 v))
(mix h (new-end [6 8] v))
:: select message mixing schedule and mix v
=. s (snag (mod i 10) sigma)
=. v (do-mix 0 4 8 12 0 1)
@ -4644,8 +4644,8 @@
=. out (max 1 (min out 64))
=. wid.msg (min wid.msg (bex 128))
=. wid.key (min wid.key 64)
=. dat.msg (end 3 wid.msg dat.msg)
=. dat.key (end 3 wid.key dat.key)
=. dat.msg (new-end [3 wid.msg] dat.msg)
=. dat.key (new-end [3 wid.key] dat.key)
:: initialize state vector
=+ h=iv
:: mix key length and output length into h0
@ -4901,7 +4901,7 @@
|= a=@
^- (pair @ @)
:- (rev 3 4 (rsh 5 1 a))
(rev 3 4 (end 5 1 a))
(rev 3 4 (new-end 5 a))
::
:: iterate over the entire segment length
::
@ -5113,7 +5113,7 @@
=+ fed=~(. fe 6)
=* sum sum:fed
=* ror ror:fed
=+ end=(cury (cury end 5) 1)
=+ end=(cury new-end 5)
=. a :(sum a b :(mul 2 (end a) (end b)))
=. d (ror 0 32 (mix d a))
=. c :(sum c d :(mul 2 (end c) (end d)))
@ -5377,7 +5377,7 @@
++ pbkdf
::TODO jet me! ++hmac:hmac is an example
|* [[prf=$-([byts byts] @) out=@u] p=byts s=byts c=@ d=@]
=> .(dat.p (end 3 p), dat.s (end 3 s))
=> .(dat.p (new-end [3 wid.p] dat.p), dat.s (new-end [3 wid.s] dat.s))
::
:: max key length 1GB
:: max iterations 2^28
@ -5411,7 +5411,7 @@
(prf [wid.p (rev 3 p)] [- (rev 3 - u)])
$(u q, f (mix f q), k +(k))
$(t (add t (lsh 3 (mul (dec j) out) f)), j +(j))
(rev 3 d (end 3 d t))
(rev 3 d (new-end [3 d] t))
--
-- ::crypto
:: ::::
@ -6176,7 +6176,7 @@
++ en
~/ %en
|= a=octs ^- cord
(crip ((x-co:co (mul p.a 2)) (end 3 p.a q.a)))
(crip ((x-co:co (mul p.a 2)) (new-end [3 p.a] q.a)))
::
++ de
~/ %de
@ -6201,7 +6201,7 @@
|- ^- tape
?~ pad
~
=+ d=(end 0 6 pad)
=+ d=(new-end [0 6] pad)
[(cut 3 [d 1] cha) $(pad (rsh 0 6 pad))]
(weld (flop (slag poc sif)) (reap poc '='))
:: :: ++de-base64:mimes:
@ -6582,7 +6582,7 @@
=('_' tap)
==
[tap ~]
['%' (xen (rsh 0 4 tap)) (xen (end 0 4 tap)) ~]
['%' (xen (rsh 0 4 tap)) (xen (new-end [0 4] tap)) ~]
:: :: ++de-urlt:html
++ de-urlt :: url decode
|= tep=tape
@ -6790,7 +6790,7 @@
|= a=(list @t)
=+ b=(flop a)
?> ?=(^ b)
=+ c=(end 3 1 i.b)
=+ c=(new-end 3 i.b)
?.(&((gte c 'a') (lte c 'z')) ~ [~ u=b])
(most dot dlab)
::
@ -6970,10 +6970,10 @@
=/ mir (clan who)
?- mir
%czar who
%king (end 3 1 who)
%duke (end 4 1 who)
%earl (end 5 1 who)
%pawn (end 4 1 who)
%king (new-end 3 who)
%duke (new-end 4 who)
%earl (new-end 5 who)
%pawn (new-end 4 who)
==
--
|%
@ -8336,7 +8336,7 @@
++ address-from-pub
=, keccak:crypto
|= pub=@
%^ end 3 20
%+ new-end [3 20]
%+ keccak-256 64
(rev 3 64 pub)
::

View File

@ -427,7 +427,7 @@
++ get-public
|= [who=@p lyfe=life typ=?(%auth %crypt)]
=/ bod (rsh 3 1 pub:ex:(get-keys who lyfe))
=+ [enc=(rsh 8 1 bod) aut=(end 8 1 bod)]
=+ [enc=(rsh 8 1 bod) aut=(new-end 8 bod)]
?: =(%auth typ)
aut
enc

View File

@ -25,7 +25,7 @@
%+ request-batch-rpc-loose:ethio url
%+ turn (scag step-size txs)
|= tx=@ux
:- `(scot %ux (end 3 10 tx))
:- `(scot %ux (new-end [3 10] tx))
[%eth-send-raw-transaction tx]
:: parse tx hashes out of responses, bailing on submission failure
::
@ -42,9 +42,9 @@
==
::
%error
?: ?| =('known transaction' (end 3 17 message.res))
=('Known transaction' (end 3 17 message.res))
=('Transaction with the same ' (end 3 26 message.res))
?: ?| =('known transaction' (new-end [3 17] message.res))
=('Known transaction' (new-end [3 17] message.res))
=('Transaction with the same ' (new-end [3 26] message.res))
==
~& [%sent-a-known-transaction--skipping id.res]
$(responses t.responses)

View File

@ -71,7 +71,7 @@
::
++ has-test-prefix
|= a=term ^- ?
=((end 3 5 a) 'test-')
=((new-end [3 5] a) 'test-')
::
++ find-test-files
=| fiz=(set [=beam test=(unit term)])

View File

@ -20,7 +20,7 @@
%+ category
:: only first 100 chars, meme happens for super long values
::
(trip (end 3 100 msg))
(trip (new-end [3 100] msg))
%+ expect-eq
!> out.i.ves
!> `@ux`(ripemd-160 wid (rev 3 wid msg))