fix const use

This commit is contained in:
Rostyslav Tyshko 2025-04-18 08:17:40 -04:00
parent 35cc38a947
commit b85633fa6e
2 changed files with 6 additions and 7 deletions

View File

@ -112,10 +112,9 @@ mod tests {
Aes256Gcm, Aes256Gcm,
}; };
use constants_types::{CipherText, Nonce}; use constants_types::{CipherText, Nonce};
use constants_types::{NULLIFIER_SECRET_CONST, VIEVING_SECRET_CONST}; use constants_types::{NULLIFIER_SECRET_CONST, VIEWING_SECRET_CONST};
use elliptic_curve::ff::Field; use elliptic_curve::ff::Field;
use elliptic_curve::group::prime::PrimeCurveAffine; use elliptic_curve::group::prime::PrimeCurveAffine;
use elliptic_curve::group::GroupEncoding;
use k256::{AffinePoint, ProjectivePoint, Scalar}; use k256::{AffinePoint, ProjectivePoint, Scalar};
use super::*; use super::*;
@ -360,9 +359,9 @@ mod tests {
); );
println!( println!(
"Nullifier constant {:?}", "Nullifier constant {:?}",
hex::encode(NULLIFIER_SECRET_CONST) hex::encode(*NULLIFIER_SECRET_CONST)
); );
println!("Viewing constatnt {:?}", hex::encode(VIEVING_SECRET_CONST)); println!("Viewing constatnt {:?}", hex::encode(*VIEWING_SECRET_CONST));
println!(); println!();
println!("======Holders======"); println!("======Holders======");

View File

@ -4,7 +4,7 @@ use k256::{AffinePoint, FieldBytes, Scalar};
use rand::{rngs::OsRng, RngCore}; use rand::{rngs::OsRng, RngCore};
use sha2::{digest::FixedOutput, Digest}; use sha2::{digest::FixedOutput, Digest};
use super::constants_types::{NULLIFIER_SECRET_CONST, VIEVING_SECRET_CONST}; use super::constants_types::{NULLIFIER_SECRET_CONST, VIEWING_SECRET_CONST};
#[derive(Debug)] #[derive(Debug)]
///Seed holder. Non-clonable to ensure that different holders use different seeds. ///Seed holder. Non-clonable to ensure that different holders use different seeds.
@ -63,7 +63,7 @@ impl TopSecretKeyHolder {
let mut hasher = sha2::Sha256::new(); let mut hasher = sha2::Sha256::new();
hasher.update(self.secret_spending_key.to_bytes()); hasher.update(self.secret_spending_key.to_bytes());
hasher.update(NULLIFIER_SECRET_CONST); hasher.update(*NULLIFIER_SECRET_CONST);
let hash = <TreeHashType>::from(hasher.finalize_fixed()); let hash = <TreeHashType>::from(hasher.finalize_fixed());
@ -74,7 +74,7 @@ impl TopSecretKeyHolder {
let mut hasher = sha2::Sha256::new(); let mut hasher = sha2::Sha256::new();
hasher.update(self.secret_spending_key.to_bytes()); hasher.update(self.secret_spending_key.to_bytes());
hasher.update(VIEVING_SECRET_CONST); hasher.update(*VIEWING_SECRET_CONST);
let hash = <TreeHashType>::from(hasher.finalize_fixed()); let hash = <TreeHashType>::from(hasher.finalize_fixed());