No instance for BlockCipher #6

TomMD opened this Issue Dec 22, 2012 · 6 comments


None yet
3 participants

TomMD commented Dec 22, 2012

I understand you don't like the performance implications of crypto-api and would like to resolve those. Could you again tell me what the situation is/was with the mkBlocks - it was too slow for you, or too slow without proper rewrite rules? I can add all the modes to the BlockCipher instance but that isn't ideal.


vincenthz commented Dec 22, 2012

the mkBlocks problem was for cryptohash. although i'm pretty sure that it will hurt performance massively more for ciphers, if you end up calling a cipher primitive just for 1 block.

The problem with the blockcipher instance is it will kill performance of every single modes. The obvious thing that kill performance is having to load/unload the key between memory and the SSE registers. This is why you can't go back to haskell after doing one block. In general it's true for others stuff as well, like loading/unloading the IV or even in a non SSE context.

This is also present at the C level btw; this is why the C source contains lots of similar functions instead of using a more modular approach.


singpolyma commented Aug 8, 2013

This is also an issue for me, since the removal of these instances breaks all my stuff. Is this a wontfix on your end again? Should I create my own package for these instances?

singpolyma referenced this issue in singpolyma/OpenPGP-CryptoAPI Aug 8, 2013


Updated to build against current interfaces. #4


TomMD commented Aug 8, 2013

Most modes are also now part of the BlockCiper class. GCM is notably lacking.


vincenthz commented Sep 1, 2013

Sorry that it breaks your stuff, but AES is part of crypto-cipher-types now. It's probably not very hard to get a wrapper type for crypto-api though, and probably a ciphers equivalent to cryptohash-cryptoapi is possible.

vincenthz closed this Sep 1, 2013


singpolyma commented Sep 2, 2013

@vincenthz Are you planning to have a crypto-cipher-cryptoapi package, or should I produce one?


vincenthz commented Sep 4, 2013

No i'm not planning doing that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment