zuse: fixes bug in aes-256-siv iv calculation (+s2vc:aes:crypto)
:: :: ++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
