Skip to content

Commit

Permalink
sha3: fix XOF reader type aliases (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Oct 18, 2022
1 parent 08d677f commit 7a187e9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

## 0.10.6 (2022-10-19)
### Fixed
- XOF reader type aliases ([#427])

[#427]: https://github.com/RustCrypto/hashes/pull/427

## 0.10.5 (2022-09-16)
### Added
- Feature-gated OID support ([#405])
Expand Down
2 changes: 1 addition & 1 deletion sha3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sha3"
version = "0.10.5"
version = "0.10.6"
description = "SHA-3 (Keccak) hash function"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions sha3/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ macro_rules! impl_shake {

#[doc = $alg_name]
#[doc = " reader state."]
pub type $reader_full = XofReaderCoreWrapper<$name>;
pub type $reader_full = XofReaderCoreWrapper<$reader>;
};
(
$name:ident, $full_name:ident, $reader:ident, $reader_full:ident,
Expand Down Expand Up @@ -395,6 +395,6 @@ macro_rules! impl_cshake {

#[doc = $alg_name]
#[doc = " reader state."]
pub type $reader_full = XofReaderCoreWrapper<$name>;
pub type $reader_full = XofReaderCoreWrapper<$reader>;
};
}
19 changes: 19 additions & 0 deletions sha3/tests/aliases.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Checks that we defined reader type aliases correctly
#![allow(dead_code)]
use sha3::digest::ExtendableOutput;

fn shake128(v: sha3::Shake128) -> sha3::Shake128Reader {
v.finalize_xof()
}

fn shake256(v: sha3::Shake256) -> sha3::Shake256Reader {
v.finalize_xof()
}

fn cshake128(v: sha3::CShake128) -> sha3::CShake128Reader {
v.finalize_xof()
}

fn cshake256(v: sha3::CShake256) -> sha3::CShake256Reader {
v.finalize_xof()
}

0 comments on commit 7a187e9

Please sign in to comment.