On Saturday, 19 December 2015 at 22:15:14 UTC, Guillaume Chatelet wrote:
The last version of the code is available here and is feature complete AFAICT

Last concern, I declared blockSize in bytes where std.digest.digest says it should be in bits. Why does it need to be bits ? It looks like HMAC (which needs it) is explicitly making sure it's always a multiple of 8 bits.

I was the one who introduced it, and I chose bits instead of bytes because I didn't want to exclude the possibility that there are hashing algos that have a block size not divisible by 8. The algorithms are usually described in terms of bits, not bytes, so it's not unconceivable that such hash functions exist, though I don't know any. (Of course, HMAC wouldn't work with those, but that doesn't mean that other algorithms couldn't.)

I'd suggest you change `blockSize` to the number of bits, and introduce an enum `blockSizeInBytes` for internal use.

Reply via email to