Skip to content
39 changes: 38 additions & 1 deletion 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 @@ -704,6 +707,40 @@ mod tests {
test_signature_scheme_correctness::<Sig>(19, 0, Sig::LIFETIME as usize);
}*/
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the old commented tests


#[test]
pub fn test_large_base_poseidon() {
// Note: do not use these parameters, they are just for testing
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 = 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();

test_signature_scheme_correctness::<Sig>(0, 0, Sig::LIFETIME as usize);
test_signature_scheme_correctness::<Sig>(11, 0, Sig::LIFETIME as usize);
}

#[test]
pub fn test_large_dimension_poseidon() {
// Note: do not use these parameters, they are just for testing
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 = 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() {
const LOG_LIFETIME: usize = 4;
Expand Down