Skip to content

Commit

Permalink
blake2: fix reset feature and test in ci (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommilligan authored Jan 5, 2022
1 parent 162f73e commit b505bba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
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

0 comments on commit b505bba

Please sign in to comment.