haskell-crypto / cryptonite

lowlevel set of cryptographic primitives for haskell
Other
226 stars 139 forks source link

Can't implement hash functions #44

Closed centromere closed 8 years ago

centromere commented 9 years ago

I'd like to use the HMAC functionality of cryptonite with an unsupported hash function (BLAKE2b/s), but I am unable to do so because the HashAlgorithm class is not exported.

vincenthz commented 9 years ago

I'ld like to think it's by design, so that someone would contribute the BLAKE2s/b implementation :)

There should be almost everything needed to generate the haskell bits, (in the gen directory), so it's "just" missing the C implementation in cbits/

centromere commented 9 years ago

The entries in Gen.hs look like this:

, GenHashModule "SHA512"    "sha512.h"    "sha512"    256 64 128 []

BLAKE2 has a variable output length. What's the best way to proceed?

vincenthz commented 9 years ago

I haven't look at the specific, but I would assume just like SHA3 or Skein that have variable output length, the best is to specialize it to whichever length are commonly used.

centromere commented 8 years ago

This is no longer relevant to me.