Get at the length field of sha-512

This lets us take the hash of old-world strings with a bunch of trailing
zero bytes.
This commit is contained in:
Steve Dee 2014-01-21 15:01:14 -08:00
parent 1af62de359
commit 6aa1ca3c73

View File

@ -3519,11 +3519,14 @@
[[256 d] $(c d, b (sub b 256))]
--
++ shaz :: sha-512
~/ %shaz
|= ruz=@ ^- @
(shal [(met 3 ruz) ruz])
++ shal :: sha-512 with length
~/ %shal
|= [len=@ ruz=@] ^- @
=+ [few==>(fe .(a 6)) wac=|=([a=@ b=@] (cut 6 [a 1] b))]
=+ [sum=sum.few ror=ror.few net=net.few inv=inv.few]
=+ ral=(lsh 0 3 (met 3 ruz))
=+ ral=(lsh 0 3 len)
=+ ^= ful
%+ can 0
:~ [ral ruz]