Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 01:35 AM, Thomas DuBuisson wrote: Vincent has done great work for Haskell+Crypto so I think he knows I mean nothing personal when I say cprng-aes has the right idea done the wrong way. Why a new effort vs Vincent's package? 1. cprng-aes is painfully slow. when using the haskell

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 04:56 AM, Thomas DuBuisson wrote: On May 3, 2012 5:49 PM, Ertugrul Söylemez e...@ertes.de mailto:e...@ertes.de wrote: Thomas DuBuisson thomas.dubuis...@gmail.com mailto:thomas.dubuis...@gmail.com wrote: I can't really tell whether the first two points are true.

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Ryan Newton
1. cprng-aes is painfully slow. when using the haskell AES implementation yes. with AESNI it fly, and even more when i'll have time to chunk the generation to bigger blocks (says 128 AES block at a time) One data-point -- in intel-aes I needed to do bigger blocks to get decent

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Ryan Newton
My end goal is to have the user use transparently the fastest implementation available to their architecture/cpu providing they use the high level module. I've uploaded the cpu package which allows me to detect at runtime the aes instruction (and the architecture), but i've been distracted

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Thomas DuBuisson
Vincent uses gcc header files to get the AES instructions: Header files of: #include wmmintrin.h #include tmmintrin.h And later calls of: x = _mm_aesenc_si128(m, K1); But currently you must know you have AESNI and use a flag: cabal install cryptocipher -faesni But if you

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 02:37 PM, Ryan Newton wrote: My end goal is to have the user use transparently the fastest implementation available to their architecture/cpu providing they use the high level module. I've uploaded the cpu package which allows me to detect at runtime the aes

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Brandon Allbery
On Fri, May 4, 2012 at 10:11 AM, Vincent Hanquez t...@snarc.org wrote: For the language, i think assembly is a no-no with cabal, as such it need to be embedded in gcc inline assembly if you want to have something that works (unless there's a secret way to run assembler in a portable fashion

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 02:33 PM, Ryan Newton wrote: 1. cprng-aes is painfully slow. when using the haskell AES implementation yes. with AESNI it fly, and even more when i'll have time to chunk the generation to bigger blocks (says 128 AES block at a time) One data-point -- in

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 03:05 PM, Thomas DuBuisson wrote: Vincent uses gcc header files to get the AES instructions: Header files of: #includewmmintrin.h #includetmmintrin.h And later calls of: x = _mm_aesenc_si128(m, K1); But currently you must know you have AESNI and use a flag:

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-04 Thread Vincent Hanquez
On 05/04/2012 03:18 PM, Brandon Allbery wrote: On Fri, May 4, 2012 at 10:11 AM, Vincent Hanquez t...@snarc.org mailto:t...@snarc.org wrote: For the language, i think assembly is a no-no with cabal, as such it need to be embedded in gcc inline assembly if you want to have something that

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ryan Newton
Hi Thomas, Personally, I would love to see that happen. It seems like the best way to make split acceptable. Is Brian Gladman's C implementation still best in class? In my tests even without AESNI it could exceed the traditional System.Random in performance (

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I've grown annoyed at System.Random enough (specifically, StdGen). How much, if any, pushback would there be if I put together a FFI binding to a C AES-CTR based RNG. There are many advantages: [...] I'd be tempted to pull in the

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Thomas DuBuisson
On Thu, May 3, 2012 at 5:26 PM, Ertugrul Söylemez e...@ertes.de wrote: Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I've grown annoyed at System.Random enough (specifically, StdGen). How much, if any, pushback would there be if I put together a FFI binding to a C AES-CTR based RNG.  

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Vincent has done great work for Haskell+Crypto so I think he knows I mean nothing personal when I say cprng-aes has the right idea done the wrong way. Why a new effort vs Vincent's package? 1. cprng-aes is painfully slow. 2. It doesn't use

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Thomas DuBuisson
On May 3, 2012 5:49 PM, Ertugrul Söylemez e...@ertes.de wrote: Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Vincent has done great work for Haskell+Crypto so I think he knows I mean nothing personal when I say cprng-aes has the right idea done the wrong way. Why a new effort vs