mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 22:33:06 +03:00
zuse: fixes bug in aes-256-siv iv calculation (+s2vc:aes:crypto)
This commit is contained in:
parent
bb45a47de4
commit
0ddeb6526b
@ -3682,22 +3682,19 @@
|
||||
:: :: ++s2vc:aes:crypto
|
||||
++ s2vc :: AES-256 S2V
|
||||
~/ %s2vc
|
||||
|= {key/@I ads/(list @)}
|
||||
=+ res=(macc key `16 0x0)
|
||||
%^ macc key ~
|
||||
|- ^- @uxH
|
||||
|= [key=@I ads=(list @)]
|
||||
?~ ads (macc key `16 0x1)
|
||||
=/ res (macc key `16 0x0)
|
||||
%+ macc key
|
||||
|- ^- [[~ @ud] @uxH]
|
||||
?~ t.ads
|
||||
?: (gte (xeb i.ads) 128)
|
||||
(mix i.ads res)
|
||||
%+ mix
|
||||
(doub res)
|
||||
(mpad (met 3 i.ads) i.ads)
|
||||
=/ wyt (met 3 i.ads)
|
||||
?: (gte wyt 16)
|
||||
[`wyt (mix i.ads res)]
|
||||
[`16 (mix (doub res) (mpad wyt i.ads))]
|
||||
%= $
|
||||
res %+ mix
|
||||
(doub res)
|
||||
(macc key ~ i.ads)
|
||||
ads t.ads
|
||||
res (mix (doub res) (macc key ~ i.ads))
|
||||
==
|
||||
:: :: ++siva:aes:crypto
|
||||
++ siva :: AES-128 SIV
|
||||
|
Loading…
Reference in New Issue
Block a user