Skip to content

blake2: fix reset feature and test in ci #342

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

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/blake2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ jobs:
- 1.41.0 # MSRV
- stable
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: cargo test --no-default-features
- run: cargo test
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --features reset
simd:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions blake2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Blake2b` and `Blake2s` renamed into `Blake2b512` and `Blake2s256` respectively.
New `Blake2b` and `Blake2s` are generic over output size. `VarBlake2b` and `VarBlake2s`
renamed into `Blake2bVar` and `Blake2sVar` respectively. ([#217])
- Hasher reset functionality moved behind a new non-default feature, `reset`.
This must be enabled to use the methods `reset`, `finalize_reset` and `finalize_into_reset`.

### Removed
- `Blake2b` and `Blake2s` no longer support MAC functionality. ([#217])
Expand Down
4 changes: 3 additions & 1 deletion blake2/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ macro_rules! blake2_mac_impl {
key_block,
..
} = self;
core.finalize_variable_core(buffer, out);
let mut full_res = Default::default();
core.finalize_variable_core(buffer, &mut full_res);
out.copy_from_slice(&full_res[..OutSize::USIZE]);
core.reset();
*buffer = LazyBuffer::new(key_block);
}
Expand Down