Skip to content

Commit b505bba

Browse files
authored
blake2: fix reset feature and test in ci (RustCrypto#342)
1 parent 162f73e commit b505bba

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/blake2.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ jobs:
4545
- 1.41.0 # MSRV
4646
- stable
4747
steps:
48-
- uses: actions/checkout@v1
49-
- uses: actions-rs/toolchain@v1
50-
with:
51-
profile: minimal
52-
toolchain: ${{ matrix.rust }}
53-
override: true
54-
- run: cargo test --no-default-features
55-
- run: cargo test
48+
- uses: actions/checkout@v1
49+
- uses: actions-rs/toolchain@v1
50+
with:
51+
profile: minimal
52+
toolchain: ${{ matrix.rust }}
53+
override: true
54+
- run: cargo test --no-default-features
55+
- run: cargo test
56+
- run: cargo test --features reset
5657
simd:
5758
runs-on: ubuntu-latest
5859
steps:

blake2/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- `Blake2b` and `Blake2s` renamed into `Blake2b512` and `Blake2s256` respectively.
1212
New `Blake2b` and `Blake2s` are generic over output size. `VarBlake2b` and `VarBlake2s`
1313
renamed into `Blake2bVar` and `Blake2sVar` respectively. ([#217])
14+
- Hasher reset functionality moved behind a new non-default feature, `reset`.
15+
This must be enabled to use the methods `reset`, `finalize_reset` and `finalize_into_reset`.
1416

1517
### Removed
1618
- `Blake2b` and `Blake2s` no longer support MAC functionality. ([#217])

blake2/src/macros.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ macro_rules! blake2_mac_impl {
404404
key_block,
405405
..
406406
} = self;
407-
core.finalize_variable_core(buffer, out);
407+
let mut full_res = Default::default();
408+
core.finalize_variable_core(buffer, &mut full_res);
409+
out.copy_from_slice(&full_res[..OutSize::USIZE]);
408410
core.reset();
409411
*buffer = LazyBuffer::new(key_block);
410412
}

0 commit comments

Comments
 (0)