Skip to content

Commit

Permalink
fix: Fq2::ZETA constant value for asm feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kilic committed Aug 3, 2023
1 parent dda2371 commit d17eab2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/bn256/fq2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,12 @@ impl crate::serde::SerdeObject for Fq2 {
impl WithSmallOrderMulGroup<3> for Fq2 {
// Fq::ZETA ^2
const ZETA: Self = Fq2 {
c0: Fq::ZETA.square(),
c0: Fq::from_raw([
0x5763473177fffffe,
0xd4f263f1acdb5c4f,
0x59e26bcea0d48bac,
0x0000000000000000,
]),
c1: Fq::zero(),
};
}
Expand Down Expand Up @@ -774,6 +779,12 @@ fn test_frobenius() {
}
}

#[test]
fn test_zeta() {
let zeta = Fq2::new(Fq::ZETA.square(), Fq::zero());
assert_eq!(zeta, Fq2::ZETA);
}

#[test]
fn test_field() {
crate::tests::field::random_field_tests::<Fq2>("fq2".to_string());
Expand Down

0 comments on commit d17eab2

Please sign in to comment.