Skip to content
35 changes: 17 additions & 18 deletions src/signature/generalized_xmss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ mod tests {
inc_encoding::target_sum::TargetSumEncoding,
signature::test_templates::test_signature_scheme_correctness,
symmetric::{
message_hash::{MessageHash, poseidon::PoseidonMessageHashW1},
message_hash::{
MessageHash,
poseidon::{PoseidonMessageHash, PoseidonMessageHashW1},
},
prf::shake_to_field::ShakePRFtoF,
tweak_hash::poseidon::PoseidonTweakW1L5,
},
Expand Down Expand Up @@ -666,17 +669,15 @@ mod tests {
assert_eq!(rho1, rho2);
}

/*#[test]
pub fn test_large_base_sha() {
#[test]
pub fn test_large_base_poseidon() {
// Note: do not use these parameters, they are just for testing
type PRF = ShaPRF<24, 8>;
type TH = ShaTweak192192;

// use chunk size 8
type MH = ShaMessageHash<24, 8, 32, 8>;
const TARGET_SUM: usize = 1 << 12;
type PRF = ShakePRFtoF<4, 4>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use this? We want to be as close as possible to the old test configuration I think

Suggested change
type PRF = ShakePRFtoF<4, 4>;
type PRF = ShakePRFtoF<24, 8>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood , will revert them back

type TH = PoseidonTweakHash<4, 4, 2, 8, 8>;
type MH = PoseidonMessageHash<4, 4, 2, 8, 256, 2, 9>;
const TARGET_SUM: usize = 8 * (256 - 1) / 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we can't have

Suggested change
const TARGET_SUM: usize = 8 * (256 - 1) / 2;
const TARGET_SUM: usize = 1 << 12;

type IE = TargetSumEncoding<MH, TARGET_SUM>;
const LOG_LIFETIME: usize = 10;
const LOG_LIFETIME: usize = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use this?

Suggested change
const LOG_LIFETIME: usize = 6;
const LOG_LIFETIME: usize = 10;

type Sig = GeneralizedXMSSSignatureScheme<PRF, IE, TH, LOG_LIFETIME>;

Sig::internal_consistency_check();
Expand All @@ -686,23 +687,21 @@ mod tests {
}

#[test]
pub fn test_large_dimension_sha() {
pub fn test_large_dimension_poseidon() {
// Note: do not use these parameters, they are just for testing
type PRF = ShaPRF<24, 8>;
type TH = ShaTweak192192;

// use 256 chunks
type MH = ShaMessageHash<24, 8, 256, 1>;
type PRF = ShakePRFtoF<8, 4>;
type TH = PoseidonTweakHash<4, 8, 2, 8, 256>;
type MH = PoseidonMessageHash<4, 4, 8, 256, 2, 2, 9>;
const TARGET_SUM: usize = 128;
type IE = TargetSumEncoding<MH, TARGET_SUM>;
const LOG_LIFETIME: usize = 10;
const LOG_LIFETIME: usize = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use this as before?

Suggested change
const LOG_LIFETIME: usize = 6;
const LOG_LIFETIME: usize = 10;

type Sig = GeneralizedXMSSSignatureScheme<PRF, IE, TH, LOG_LIFETIME>;

Sig::internal_consistency_check();

test_signature_scheme_correctness::<Sig>(2, 0, Sig::LIFETIME as usize);
test_signature_scheme_correctness::<Sig>(19, 0, Sig::LIFETIME as usize);
}*/
}

#[test]
pub fn test_expand_activation_time() {
Expand Down