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

eax: Allow variable tag length #231

Merged
merged 1 commit into from
Oct 18, 2020
Merged

Conversation

Flakebi
Copy link
Contributor

@Flakebi Flakebi commented Oct 17, 2020

Implemented analogous to ccm by passing a second generic argument to
Eax.

Fixes #220.

This change should be mostly backwards compatible, apart from exporting the generic Tag instead of pub type Tag = GenericArray<u8, U16>;
It should be easy to make keep it completely backwards compatible if that’s better.

@codecov-io
Copy link

codecov-io commented Oct 17, 2020

Codecov Report

Merging #231 into master will decrease coverage by 0.17%.
The diff coverage is 29.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
- Coverage   83.40%   83.22%   -0.18%     
==========================================
  Files          31       31              
  Lines        1115     1121       +6     
==========================================
+ Hits          930      933       +3     
- Misses        185      188       +3     
Impacted Files Coverage Δ
eax/src/online.rs 0.00% <0.00%> (ø)
eax/src/lib.rs 90.90% <100.00%> (+0.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e4d072...8874ea1. Read the comment docs.

@tarcieri tarcieri requested a review from newpavlov October 17, 2020 18:36
@newpavlov newpavlov mentioned this pull request Oct 18, 2020
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

As a temporary solution it looks good to me, but in future I would prefer to have the "hazmat" methods discussed in the parent issue.


impl TagSize for U1 {}
impl TagSize for U2 {}
impl TagSize for U3 {}
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure we want to allow such short tags? Also I think it should be possible to specify a range bound using typenum without introducing the sealed trait (see typenum::type_operators), though the current approach is simple and easier to understand, so we can leave it as-is.

Implemented analogous to ccm by passing a second generic argument to
Eax.
@Flakebi
Copy link
Contributor Author

Flakebi commented Oct 18, 2020

I changed the TagSize to be >= U4 and <= U16 and also put back the original eax::Tag alias, so the change should be backwards compatible.

@tarcieri
Copy link
Member

@Flakebi LGTM, and matches the ccm crate

@tarcieri tarcieri merged commit 0a28591 into RustCrypto:master Oct 18, 2020
@Flakebi Flakebi deleted the partial-tag branch October 18, 2020 15:23
@Flakebi Flakebi mentioned this pull request Feb 25, 2021
@tarcieri tarcieri mentioned this pull request Apr 30, 2021
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.

Partial tag comparison
4 participants