Skip to main content

nova_snark/provider/
pasta.rs

1//! This module implements the Nova traits for `pallas::Point`, `pallas::Scalar`, `vesta::Point`, `vesta::Scalar`.
2use crate::{
3  impl_traits,
4  provider::{
5    msm::{msm, msm_small, msm_small_with_max_num_bits},
6    traits::{DlogGroup, DlogGroupExt},
7  },
8  traits::{Group, PrimeFieldExt, TranscriptReprTrait},
9};
10use digest::{ExtendableOutput, Update};
11use ff::FromUniformBytes;
12use halo2curves::{
13  group::{cofactor::CofactorCurveAffine, Curve, Group as AnotherGroup},
14  pasta::{Pallas, PallasAffine, Vesta, VestaAffine},
15  CurveAffine, CurveExt,
16};
17use num_bigint::BigInt;
18use num_integer::Integer;
19use num_traits::{Num, ToPrimitive};
20use rayon::prelude::*;
21use sha3::Shake256;
22
23/// Re-exports that give access to the standard aliases used in the code base, for pallas
24pub mod pallas {
25  pub use halo2curves::pasta::{Fp as Base, Fq as Scalar, Pallas as Point, PallasAffine as Affine};
26}
27
28/// Re-exports that give access to the standard aliases used in the code base, for vesta
29pub mod vesta {
30  pub use halo2curves::pasta::{Fp as Scalar, Fq as Base, Vesta as Point, VestaAffine as Affine};
31}
32
33impl_traits!(
34  pallas,
35  Pallas,
36  PallasAffine,
37  "40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001",
38  "40000000000000000000000000000000224698fc094cf91b992d30ed00000001"
39);
40
41impl_traits!(
42  vesta,
43  Vesta,
44  VestaAffine,
45  "40000000000000000000000000000000224698fc094cf91b992d30ed00000001",
46  "40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001"
47);