No way to increment the IV #4

TomMD opened this Issue Dec 22, 2012 · 3 comments


None yet

2 participants

TomMD commented Dec 22, 2012

There's no easy/obvious way to increment the IV.


a valid point, i need to think of something for this. it will probably end up going in the crypto-types repository, and it need to allow arbitrary increment values. I've got some code for this in cprng-aes but it's inefficient.

TomMD commented Dec 31, 2012

My use of GCM actually uses Word64 and stack allocation. Representative Pseudo Haskell:

type ByteStringPtr = Ptr Word8
lowLevelAES_GCM :: Key -> Word64 -> ByteStringPtr -> ByteStringPtr -> IO ()
lowLevelAES_GCM k ctr pt ct =
   alloca word64Size $ \ptr -> do
       pokeBE ptr ctr
       aes_gcm k ptr pt ct

I'm exploring such a aes_gcm api in my knock-off "cipher-aes128" package.


now it's available in the crypto-cipher-types. Probably need to add some more methods to manipulate them but add is done.

@vincenthz vincenthz closed this Oct 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment