Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hmac v0.12 #97

Merged
merged 1 commit into from Dec 7, 2021
Merged

hmac v0.12 #97

merged 1 commit into from Dec 7, 2021

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Nov 19, 2021

Split-off from #95

Depends on RustCrypto/traits#819 and RustCrypto/hashes#217

Notable changes:

  • Hmac now works only with hash functions which process blocks eagerly and expose block-level API (i.e. all hashes implemented in RsutCrypto/hashes except BLAKE2). It allows to use a bit more efficient state representation.
  • SimpleHmac is introduced as an alternative to Hmac which works over Digest and uses simpler code.
  • Reset functionality is now optional and gated on disabled-by-default reset feature.

/// Generic core HMAC instance, which operates over blocks.
pub struct HmacCore<D>
where
D: CoreProxy,
Copy link
Member Author

@newpavlov newpavlov Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could simplify bounds a bit by being generic over D: HashMarker + UdpateCore + FixedOutputCore + .., but it would mean that users will have to use "core" types to construct a concrete HMAC type, i.e. Hmac<Sha256Core> instead of Hmac<Sha256>.

@newpavlov newpavlov merged commit e8ca014 into master Dec 7, 2021
@newpavlov newpavlov deleted the hmac/v0.12 branch December 7, 2021 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant