inst sha2

This commit is contained in:
integritychain 2024-02-06 18:25:57 -06:00
parent 846ac8b92d
commit 44ab28ef08
4 changed files with 8 additions and 2 deletions

View file

@ -214,7 +214,7 @@ pub(crate) fn wots_pkgen<K: ArrayLength, LEN: ArrayLength, M: ArrayLength, N: Ar
// 12: wotspkADRS.setKeyPairAddress(ADRS.getKeyPairAddress())
wotspk_adrs.set_key_pair_address(adrs.get_key_pair_address());
// 13: pk ← Tlen (PK.seed, wotspkADRS,tmp) ▷ Compress public key
// 13: pk ← Tlen (PK.seed, wotspkADRS, tmp) ▷ Compress public key
let pk = (hashers.t_l)(pk_seed, &wotspk_adrs, &tmp);
// 14: return pk

View file

@ -290,6 +290,7 @@ pub(crate) mod sha2_cat_3_5 {
start += 64;
counter += 1;
}
println!("h_msg: {:?}", &result[0..4]);
result
}
@ -307,6 +308,7 @@ pub(crate) mod sha2_cat_3_5 {
],
&mut digest,
); // Note that the spec swaps order of last to params
println!("prf: {:?}", &digest[0..4]);
digest
}
@ -337,6 +339,7 @@ pub(crate) mod sha2_cat_3_5 {
//sha2_256(&[sk_prf, opt_rand, m], &mut digest);
let xxx = hmac_sha_512(sk_prf, opt_rand, m);
digest.copy_from_slice(&xxx[0..N::to_usize()]);
println!("prf_msg: {:?}", &digest[0..4]);
digest
}
@ -352,6 +355,7 @@ pub(crate) mod sha2_cat_3_5 {
],
&mut digest,
);
//println!("f: {:?}", &digest[0..4]);
digest
}
@ -370,6 +374,7 @@ pub(crate) mod sha2_cat_3_5 {
],
&mut digest,
);
println!("h: {:?} pkseed {:?} m1 {:?}", &digest[0..4], pk_seed[0], m1[0]);
digest
}

View file

@ -1,4 +1,4 @@
#![no_std]
//#![no_std]
#![deny(clippy::pedantic)]
#![deny(warnings)]
//#![deny(missing_docs)]

File diff suppressed because one or more lines are too long