mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-11 16:31:36 +01:00
Upgrade to work with latest ark-ff (#95)
Co-authored-by: Sun <huachuang20@gmail.com>
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
use crate::{Fq, FQ_ONE};
|
||||
use ark_ff::{
|
||||
field_new,
|
||||
fields::fp2::{Fp2, Fp2Parameters},
|
||||
fields::fp2::{Fp2, Fp2Config},
|
||||
MontFp, QuadExt,
|
||||
};
|
||||
|
||||
pub type Fq2 = Fp2<Fq2Parameters>;
|
||||
use crate::{Fq, FQ_ONE};
|
||||
|
||||
pub struct Fq2Parameters;
|
||||
pub type Fq2 = Fp2<Fq2Config>;
|
||||
|
||||
impl Fp2Parameters for Fq2Parameters {
|
||||
pub struct Fq2Config;
|
||||
|
||||
impl Fp2Config for Fq2Config {
|
||||
type Fp = Fq;
|
||||
|
||||
// non_residue = 13
|
||||
#[rustfmt::skip]
|
||||
const NONRESIDUE: Fq = field_new!(Fq, "13");
|
||||
const NONRESIDUE: Fq = MontFp!(Fq, "13");
|
||||
|
||||
// qnr = (8, 1)
|
||||
const QUADRATIC_NONRESIDUE: (Self::Fp, Self::Fp) = (field_new!(Fq, "8"), FQ_ONE);
|
||||
const QUADRATIC_NONRESIDUE: Fq2 = QuadExt!(MontFp!(Fq, "8"), FQ_ONE);
|
||||
|
||||
// Coefficients:
|
||||
// [1, 41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600]
|
||||
// see https://github.com/o1-labs/snarky/blob/2cf5ef3a14989e57c17518832b3c52590068fc48/src/camlsnark_c/libsnark-caml/depends/libff/libff/algebra/curves/mnt753/mnt4753/mnt4753_init.cpp
|
||||
const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp] = &[
|
||||
FQ_ONE,
|
||||
field_new!(Fq, "41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600"),
|
||||
MontFp!(Fq, "41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600"),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user