
20 Jun
2007
20 Jun
'07
8:23 p.m.
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.