[Haskell-cafe] haskell crypto is reaaaaaaaaaally slow
David Roundy
droundy at darcs.net
Wed Jun 20 16:57:59 EDT 2007
As its name implies, ByteString stores a string of bytes, which are Word8.
It's a replacement for a list, not for Word8.
David
On Wed, Jun 20, 2007 at 09:23:51PM +0100, Dominic Steinitz wrote:
> I'm probably missing something here but writing MD5 (and for that matter
> SHA1) requires bit twiddling operations (Data.Bits) and these aren't
> defined for ByteString. For example, SHA1 defines the following function
> and it's not clear to me how you'd implement this for ByteString rather
> than Word8.
>
> f n x y z
> | n <= 19 = (x .&. y) .|. ((complement x) .&. z)
> | n <= 39 = x `xor` y `xor` z
> | n <= 59 = (x .&. y) .|. (x .&. z) .|. (y .&. z)
> | n <= 79 = x `xor` y `xor` z
>
> I'd love to have blazzingly fast implementations for all the functions
> in the crypto library so if anyone feels inclined, any contributions
> would be very gratefully accepted. Unfortunately, I don't have the time
> to do this myself.
>
> Dominic.
More information about the Haskell-Cafe
mailing list