1use ark_ec::{
2 models::CurveConfig,
3 short_weierstrass::{self as sw, SWCurveConfig},
4};
5use ark_ff::{Field, MontFp};
6
7use crate::{fq::Fq, fr::Fr};
8
9#[cfg(test)]
10mod tests;
11
12pub type Affine = sw::Affine<Config>;
13pub type Projective = sw::Projective<Config>;
14
15#[derive(Copy, Clone, Default, PartialEq, Eq)]
16pub struct Config;
17
18impl CurveConfig for Config {
19 type BaseField = Fq;
20 type ScalarField = Fr;
21
22 const COFACTOR: &'static [u64] = &[0x1];
24
25 #[rustfmt::skip]
27 const COFACTOR_INV: Fr = Fr::ONE;
28}
29
30impl SWCurveConfig for Config {
31 const COEFF_A: Fq =
33 MontFp!("115792089210356248762697446949407573530594504085698471288169790229257723883796");
34
35 const COEFF_B: Fq =
37 MontFp!("81531206846337786915455327229510804132577517753388365729879493166393691077718");
38
39 const GENERATOR: Affine = Affine::new_unchecked(G_GENERATOR_X, G_GENERATOR_Y);
41
42 #[cfg(feature = "zero-flag")]
48 type ZeroFlag = ();
49}
50
51pub const G_GENERATOR_X: Fq = MontFp!("3");
54
55pub const G_GENERATOR_Y: Fq =
58 MontFp!("40902200210088653215032584946694356296222563095503428277299570638400093548589");