mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-06 20:20:34 +00:00
Use constants where applicable in field implementations
Co-authored-by: str4d <jack@electriccoin.co>
This commit is contained in:
parent
81345e0cf1
commit
0101014268
2 changed files with 6 additions and 4 deletions
|
|
@ -816,7 +816,7 @@ fn test_zeta() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_root_of_unity() {
|
fn test_root_of_unity() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Fp::ROOT_OF_UNITY.pow_vartime(&[1 << 32, 0, 0, 0]),
|
Fp::ROOT_OF_UNITY.pow_vartime(&[1 << Fp::S, 0, 0, 0]),
|
||||||
Fp::one()
|
Fp::one()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -833,7 +833,8 @@ fn test_inv_2() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delta() {
|
fn test_delta() {
|
||||||
assert_eq!(Fp::DELTA, Fp::from(5).pow(&[1u64 << Fp::S, 0, 0, 0]));
|
assert_eq!(Fp::DELTA, GENERATOR.pow(&[1u64 << Fp::S, 0, 0, 0]));
|
||||||
|
assert_eq!(Fp::DELTA, Fp::multiplicative_generator().pow(&[1u64 << Fp::S, 0, 0, 0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_pointer_width = "64"))]
|
#[cfg(not(target_pointer_width = "64"))]
|
||||||
|
|
|
||||||
|
|
@ -815,7 +815,7 @@ fn test_zeta() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_root_of_unity() {
|
fn test_root_of_unity() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Fq::ROOT_OF_UNITY.pow_vartime(&[1 << 32, 0, 0, 0]),
|
Fq::ROOT_OF_UNITY.pow_vartime(&[1 << Fq::S, 0, 0, 0]),
|
||||||
Fq::one()
|
Fq::one()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -832,7 +832,8 @@ fn test_inv_2() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_delta() {
|
fn test_delta() {
|
||||||
assert_eq!(Fq::DELTA, Fq::from(5).pow(&[1u64 << Fq::S, 0, 0, 0]));
|
assert_eq!(Fq::DELTA, GENERATOR.pow(&[1u64 << Fq::S, 0, 0, 0]));
|
||||||
|
assert_eq!(Fq::DELTA, Fq::multiplicative_generator().pow(&[1u64 << Fq::S, 0, 0, 0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_pointer_width = "64"))]
|
#[cfg(not(target_pointer_width = "64"))]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue