Closed jbis9051 closed 2 years ago
I replaced Hmac with SimpleHmac. An alternative would be to create a SimpleHkdf.
Using SimpleHmac is preferable because it will allow hashes like the BLAKE family to be used. See: https://github.com/BLAKE3-team/BLAKE3/issues/223
Wonder if I can make it generic over Hmac implementation. The user could provide Hmac or SimpleHmac depending on what they need. We would reexport Hmac and SimpleHmac.
I'd like to ideally get the interface to Hkdf<Sha256, SimpleHmac>
. I've currently (not pushed yet) gotten it to Hkdf<Sha256, SimpleHmac<Sha256>>
.
So this is another option. We make the Hmac implementation generic so the user can provide SimpleHmac or Hmac depending on the algo they used. I think it's better than simply replacing Hmac with SimpleHmac.
@tarcieri if you like this approach, I can add a couple tests for testing both Hmac and SimpleHmac. I could also either reexport Hmac and SimpleHmac or remove the dependency. I'd also add a note in the docs on how this works.
A couple considerations:
Do we really want users to be able to pass anything to Hkdf? Maybe we should add a dummy trait to restrict passing either Hmac
Fixes #54