From 50fc83a8e85be8e84863843b64ead07de839ccae Mon Sep 17 00:00:00 2001 From: Lucas Meier Date: Fri, 29 Mar 2024 10:07:46 -0700 Subject: [PATCH] Use separate personalization string for fmd scalar hash BREAKING: This will break old clues and their detection --- crates/crypto/decaf377-fmd/src/hash.rs | 2 +- crates/crypto/decaf377-fmd/src/lib.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/crypto/decaf377-fmd/src/hash.rs b/crates/crypto/decaf377-fmd/src/hash.rs index d8567ceaaa..d613e3d99a 100644 --- a/crates/crypto/decaf377-fmd/src/hash.rs +++ b/crates/crypto/decaf377-fmd/src/hash.rs @@ -18,7 +18,7 @@ pub fn to_scalar(point: &[u8; 32], n: u8, bits: &[u8]) -> Fr { assert_eq!(bits.len(), 3); let hash = blake2b_simd::Params::default() - .personal(b"decaf377-fmd.bit") + .personal(b"decaf377-fmd.sca") .to_state() .update(point) .update(&[n]) diff --git a/crates/crypto/decaf377-fmd/src/lib.rs b/crates/crypto/decaf377-fmd/src/lib.rs index 0114aa2105..d54c58b2cb 100644 --- a/crates/crypto/decaf377-fmd/src/lib.rs +++ b/crates/crypto/decaf377-fmd/src/lib.rs @@ -20,4 +20,3 @@ pub use error::Error; pub use precision::Precision; pub(crate) use precision::MAX_PRECISION; -