Skip to content

Commit 7a187e9

Browse files
authored
sha3: fix XOF reader type aliases (#427)
1 parent 08d677f commit 7a187e9

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sha3/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.10.6 (2022-10-19)
9+
### Fixed
10+
- XOF reader type aliases ([#427])
11+
12+
[#427]: https://github.com/RustCrypto/hashes/pull/427
13+
814
## 0.10.5 (2022-09-16)
915
### Added
1016
- Feature-gated OID support ([#405])

sha3/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sha3"
3-
version = "0.10.5"
3+
version = "0.10.6"
44
description = "SHA-3 (Keccak) hash function"
55
authors = ["RustCrypto Developers"]
66
license = "MIT OR Apache-2.0"

sha3/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ macro_rules! impl_shake {
204204

205205
#[doc = $alg_name]
206206
#[doc = " reader state."]
207-
pub type $reader_full = XofReaderCoreWrapper<$name>;
207+
pub type $reader_full = XofReaderCoreWrapper<$reader>;
208208
};
209209
(
210210
$name:ident, $full_name:ident, $reader:ident, $reader_full:ident,
@@ -395,6 +395,6 @@ macro_rules! impl_cshake {
395395

396396
#[doc = $alg_name]
397397
#[doc = " reader state."]
398-
pub type $reader_full = XofReaderCoreWrapper<$name>;
398+
pub type $reader_full = XofReaderCoreWrapper<$reader>;
399399
};
400400
}

sha3/tests/aliases.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//! Checks that we defined reader type aliases correctly
2+
#![allow(dead_code)]
3+
use sha3::digest::ExtendableOutput;
4+
5+
fn shake128(v: sha3::Shake128) -> sha3::Shake128Reader {
6+
v.finalize_xof()
7+
}
8+
9+
fn shake256(v: sha3::Shake256) -> sha3::Shake256Reader {
10+
v.finalize_xof()
11+
}
12+
13+
fn cshake128(v: sha3::CShake128) -> sha3::CShake128Reader {
14+
v.finalize_xof()
15+
}
16+
17+
fn cshake256(v: sha3::CShake256) -> sha3::CShake256Reader {
18+
v.finalize_xof()
19+
}

0 commit comments

Comments
 (0)