On Tue, May 3, 2011 at 22:05, Johan Brinch <brin...@gmail.com> 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? > Are there any other high level crypto API? > > > Here's my benchmark code for CTR (easily modified to use ECB/CBC): > https://gist.github.com/954093 > > And here's my patched Benchmark/Crypto.hs: > https://gist.github.com/954099 > > > Package in question: > http://hackage.haskell.org/package/crypto-api >
Would there be anything wrong / really ugly in simply pushing those small bottlenecks into C code? Stuff like xor'ing two bytestrings or generating a block of incremental IV's (for CTR mode)? -- Johan Brinch _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe