haskell-crypto / cryptonite

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

Make numeric algorithm properties (e.g. hashDigestSize) type-level nats. #71

Closed Ericson2314 closed 8 years ago

Ericson2314 commented 8 years ago

The undefined trick is fine for internal code, feels but a little sketchy for user code. This also guarantees they are constants, and potentially opens the doors for compile-time-sized arrays etc.

vincenthz commented 8 years ago

There's nothing I would like more than to move to Proxy and more type level stuff, but cryptonite still supports 7.0 onwards, and some API predates many of the type level capabilities, and breaking the API there is just not going to happen.

Ericson2314 commented 8 years ago

Ah gotcha, I came from deprecated https://hackage.haskell.org/package/cryptohash, and just kinda assumed this was therefore a rethink/API in flux.