Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion skein/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ 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.0 (2023-06-09)
## 0.1.1 (2025-04-23)
### Fixed
- Implementation for output sizes not multiple of 8 ([#682])

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

## 0.1.0 (2023-06-09) [YANKED]
- Initial release ([#483])

[#483]: https://github.com/RustCrypto/hashes/pull/483
2 changes: 1 addition & 1 deletion skein/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "skein"
version = "0.1.0"
version = "0.1.1"
description = "Skein hash functions"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions skein/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ macro_rules! define_hasher {
block[..8].copy_from_slice(&(i as u64).to_le_bytes());
Self::process_block(&mut ctr, &block, 8);

for (src, dst) in ctr.x.iter().zip(chunk.chunks_exact_mut(8)) {
dst.copy_from_slice(&src.to_le_bytes());
for (src, dst) in ctr.x.iter().zip(chunk.chunks_mut(8)) {
dst.copy_from_slice(&src.to_le_bytes()[..dst.len()]);
}
}
}
Expand Down
17 changes: 15 additions & 2 deletions skein/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use hex_literal::hex;
use skein::{
consts::{U128, U32, U64},
consts::{U128, U32, U64, U7},
digest::{dev::fixed_test, new_test},
Skein1024, Skein256, Skein512,
Digest, Skein1024, Skein256, Skein512,
};

new_test!(skein256_32, "skein256_32", Skein256<U32>, fixed_test);
Expand All @@ -11,3 +12,15 @@ new_test!(skein512_64, "skein512_64", Skein512<U64>, fixed_test);
new_test!(skein1024_32, "skein1024_32", Skein1024<U32>, fixed_test);
new_test!(skein1024_64, "skein1024_64", Skein1024<U64>, fixed_test);
new_test!(skein1024_128, "skein1024_128", Skein1024<U128>, fixed_test);

/// Regression tests for https://github.com/RustCrypto/hashes/issues/681
#[test]
fn skein_uncommon_sizes() {
let s = "hello world";
let h = Skein256::<U7>::digest(s);
assert_eq!(h[..], hex!("31bffb70f5dafe")[..]);
let h = Skein512::<U7>::digest(s);
assert_eq!(h[..], hex!("ee6004efedd69c")[..]);
let h = Skein1024::<U7>::digest(s);
assert_eq!(h[..], hex!("a2808b638681c6")[..]);
}