-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This Haskell package provides AES encryption with optional hardware acceleration. Further, it provides statistically sound, splittable random number generation based on AES. The package is nothing more than a wrapper around the Intel-provided AESNI sample library that also bundles a fallback portable software implementation by Brian Gladman.
The package includes C and assembly sources. Also included are prebuilt
dynamic libraries for these sources to make the build process less
fragile. (Rebuilding requires the yasm
assembler.) But prebuilt
shared libraries are not included for all platforms yet.
(Volunteers needed!)
Here are some example results from an Intel X5680 processor:
How many random numbers can we generate in a second on one thread?
First, timing with System.Random interface:
14,482,725 random ints generated [System.Random stdGen]
16,061 random ints generated [PureHaskell/reference]
32,309 random ints generated [PureHaskell]
2,401,893 random ints generated [Gladman unbuffered]
15,980,625 random ints generated [Gladman buffered]
2,329,500 random ints generated [IntelAES unbuffered]
32,383,799 random ints generated [IntelAES buffered]
Comparison to C's rand():
71,347,778 random ints generated [rand in Haskell loop]
Regarding portability, see this ticket. And look here for API documentation.