[Haskell-cafe] Crypto-api performance

Daniel Fischer daniel.is.fischer at googlemail.com
Tue May 3 23:14:07 CEST 2011

On Tuesday 03 May 2011 22:05:17, Johan Brinch wrote:
> Does anyone have experience with the crypto-api package?
> It seems to define a nice common API for block ciphers, hash functions
> and prng's. However, I get very low performance using it.
> I ran its benchmark on a NOP block cipher, where encryptBlock k = id,
> and it's still very slow.
> After expanded the included block cipher benchmark (which uses ECB) to
> include CBC and CTR I got the following:
> ECB: 30 MB/s -- somewhat slow
> CBC: 12 MB/s -- very slow
> CTR: 4 MB/s -- why is adding a counter so bad?
> Have anyone else benchmarked this and if so with what results?

Neither benchmarked nor used it, but just to make sure:
did you notice that the comment says 128KB strings for ps and lps, but they 
are in fact 1MB strings:

-- 128KB strings
ps = B.replicate (2^20) 0
lps = L.replicate (2^20) 0

? If not, the throughput would look much better, wouldn't it?

More information about the Haskell-Cafe mailing list