mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-06 15:53:10 +00:00
biguint mul test
This commit is contained in:
parent
1402791139
commit
62519eeb12
@ -276,4 +276,28 @@ mod tests {
|
||||
|
||||
verify(proof, &data.verifier_only, &data.common)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_biguint_mul() -> Result<()> {
|
||||
let x_value = BigUint::from_u128(123123123123123123123123123123123123).unwrap();
|
||||
let y_value = BigUint::from_u128(456456456456456456456456456456456456).unwrap();
|
||||
let expected_z_value = &x_value * &y_value;
|
||||
|
||||
type F = CrandallField;
|
||||
let config = CircuitConfig::large_config();
|
||||
let pw = PartialWitness::new();
|
||||
let mut builder = CircuitBuilder::<F, 4>::new(config);
|
||||
|
||||
let x = builder.constant_biguint(x_value);
|
||||
let y = builder.constant_biguint(y_value);
|
||||
let z = builder.mul_biguint(x, y);
|
||||
let expected_z = builder.constant_biguint(expected_z_value);
|
||||
|
||||
builder.connect_biguint(z, expected_z);
|
||||
|
||||
let data = builder.build();
|
||||
let proof = data.prove(pw).unwrap();
|
||||
|
||||
verify(proof, &data.verifier_only, &data.common)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user