Skip to content

Commit

Permalink
ripemd: release v0.1.2 (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Sep 16, 2022
1 parent fc3e726 commit 00f013a
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 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 ripemd/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.1.2 (2022-09-16)
### Added
- RIPEMD-128 algorithm ([#406])

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

## 0.1.1 (2022-02-17)
### Fixed
- Minimal versions build ([#363])
Expand Down
2 changes: 1 addition & 1 deletion ripemd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ripemd"
version = "0.1.1"
version = "0.1.2"
description = "Pure Rust implementation of the RIPEMD hash functions"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand Down
Binary file modified ripemd/tests/data/ripemd128.blb
Binary file not shown.
56 changes: 56 additions & 0 deletions ripemd/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ new_test!(ripemd160_main, "ripemd160", Ripemd160, fixed_reset_test);
new_test!(ripemd256_main, "ripemd256", Ripemd256, fixed_reset_test);
new_test!(ripemd320_main, "ripemd320", Ripemd320, fixed_reset_test);

#[test]
fn ripemd128_1mil_a() {
let mut h = Ripemd128::new();
let buf = [b'a'; 1000];
for _ in 0..1000 {
h.update(&buf[..]);
}
assert_eq!(
h.finalize(),
hex!("4a7f5723f954eba1216c9d8f6320431f").into()
);
}

#[test]
fn ripemd128_rand() {
let mut h = Ripemd128::new();
Expand All @@ -21,6 +34,19 @@ fn ripemd128_rand() {
);
}

#[test]
fn ripemd160_1mil_a() {
let mut h = Ripemd160::new();
let buf = [b'a'; 1000];
for _ in 0..1000 {
h.update(&buf[..]);
}
assert_eq!(
h.finalize(),
hex!("52783243c1697bdbe16d37f97f68f08325dc1528").into()
);
}

#[test]
fn ripemd160_rand() {
let mut h = Ripemd160::new();
Expand All @@ -31,6 +57,19 @@ fn ripemd160_rand() {
);
}

#[test]
fn ripemd256_1mil_a() {
let mut h = Ripemd256::new();
let buf = [b'a'; 1000];
for _ in 0..1000 {
h.update(&buf[..]);
}
assert_eq!(
h.finalize(),
hex!("ac953744e10e31514c150d4d8d7b677342e33399788296e43ae4850ce4f97978").into()
);
}

#[test]
fn ripemd256_rand() {
let mut h = Ripemd256::new();
Expand All @@ -41,6 +80,23 @@ fn ripemd256_rand() {
);
}

#[test]
#[rustfmt::skip]
fn ripemd320_1mil_a() {
let mut h = Ripemd320::new();
let buf = [b'a'; 1000];
for _ in 0..1000 {
h.update(&buf[..]);
}
assert_eq!(
h.finalize(),
hex!("
bdee37f4371e20646b8b0d862dda16292ae36f40
965e8c8509e63d1dbddecc503e2b63eb9245bb66
").into()
);
}

#[test]
#[rustfmt::skip]
fn ripemd320_rand() {
Expand Down

0 comments on commit 00f013a

Please sign in to comment.