-
Notifications
You must be signed in to change notification settings - Fork 139
Add AES Key Wrap algorithm (RFC 3394) #59
Comments
I also have some code which does this. It seems to me it would be a good fit for cryptonite to avoid duplication in other projects. |
yes, please add, we would'nt live to the crypto kitchen sink otherwise ;-) The BlockCipher128 constraint/class is slightly unfortunate but needed to make the algorithm block-size=128 bits only. |
Ok, would you mind reviewing my implementation[1] and suggesting where you Implementation notes:
[1] https://github.com/frasertweedale/hs-jose/blob/jwe/src/Crypto/JOSE/AESKW.hs |
Sorry it's taken me a long time to get round to looking at this. I'm also rather nervous about using impure ptr-based code in Haskell and don't consider myself an expert at all (see #57). Vincent can probably comment on what's safe to use. I did wonder whether it makes much difference in terms of performance, especially in a case like this when the plaintext will always be so small. I put together a benchmark for the two approaches: https://gist.github.com/tekul/d8875bcde7c32bc3d04d The times are pretty much the same, but bizarrely, the pure code is consistently about 12% faster. I have no idea why that might be. Maybe because of the use of
|
I implemented the AES Key Wrap algorithm (RFC 3394) using
cryptonite primitives and am wondering if upstream is receptive to
adopting the algorithm in cryptonite itself?
Current API:
It is defined for all
BlockCipher128
because despite the name,the algorithm only requires a 128-bit block size. It does not use
any feature of
BlockCipher128
though - only ECB.The text was updated successfully, but these errors were encountered: