From b5e28c9d97487b04eb92a1705699222d8a2e244c Mon Sep 17 00:00:00 2001 From: GarmashAlex Date: Thu, 12 Feb 2026 23:22:26 +0300 Subject: [PATCH 1/3] fix(bash-hash): use bit size in AlgorithmName output --- bash-hash/src/block_api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-hash/src/block_api.rs b/bash-hash/src/block_api.rs index 607883e1e..5884a2a0d 100644 --- a/bash-hash/src/block_api.rs +++ b/bash-hash/src/block_api.rs @@ -113,7 +113,7 @@ impl Reset for BashHashCore { impl AlgorithmName for BashHashCore { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "BashHash{}", OS::USIZE) + write!(f, "BashHash{}", OS::USIZE * 8) } } From 170a09ae3d945d6615afd1ba3d87eb06fec02d97 Mon Sep 17 00:00:00 2001 From: GarmashAlex Date: Thu, 12 Feb 2026 23:22:49 +0300 Subject: [PATCH 2/3] add test --- bash-hash/tests/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bash-hash/tests/mod.rs b/bash-hash/tests/mod.rs index 50126fee3..82f4d04cb 100644 --- a/bash-hash/tests/mod.rs +++ b/bash-hash/tests/mod.rs @@ -46,3 +46,13 @@ test_bash_rand!( digest::hash_serialization_test!(bash256_serialization, BashHash256); digest::hash_serialization_test!(bash384_serialization, BashHash384); digest::hash_serialization_test!(bash512_serialization, BashHash512); + +#[test] +fn algorithm_name() { + let s = format!("{:?}", BashHash256::new()); + assert!(s.contains("BashHash256"), "expected BashHash256, got: {s}"); + let s = format!("{:?}", BashHash384::new()); + assert!(s.contains("BashHash384"), "expected BashHash384, got: {s}"); + let s = format!("{:?}", BashHash512::new()); + assert!(s.contains("BashHash512"), "expected BashHash512, got: {s}"); +} From 80428e52f6cd2466f203e3cd25f286256c5c6f19 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 13 Feb 2026 13:01:19 +0300 Subject: [PATCH 3/3] remove test --- bash-hash/tests/mod.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bash-hash/tests/mod.rs b/bash-hash/tests/mod.rs index 82f4d04cb..50126fee3 100644 --- a/bash-hash/tests/mod.rs +++ b/bash-hash/tests/mod.rs @@ -46,13 +46,3 @@ test_bash_rand!( digest::hash_serialization_test!(bash256_serialization, BashHash256); digest::hash_serialization_test!(bash384_serialization, BashHash384); digest::hash_serialization_test!(bash512_serialization, BashHash512); - -#[test] -fn algorithm_name() { - let s = format!("{:?}", BashHash256::new()); - assert!(s.contains("BashHash256"), "expected BashHash256, got: {s}"); - let s = format!("{:?}", BashHash384::new()); - assert!(s.contains("BashHash384"), "expected BashHash384, got: {s}"); - let s = format!("{:?}", BashHash512::new()); - assert!(s.contains("BashHash512"), "expected BashHash512, got: {s}"); -}