mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-12 17:01:31 +01:00
More NIST curves (#142)
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
This commit is contained in:
7
secp256r1/src/fields/fq.rs
Normal file
7
secp256r1/src/fields/fq.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use ark_ff::fields::{Fp256, MontBackend, MontConfig};
|
||||
|
||||
#[derive(MontConfig)]
|
||||
#[modulus = "115792089210356248762697446949407573530086143415290314195533631308867097853951"]
|
||||
#[generator = "2"]
|
||||
pub struct FqConfig;
|
||||
pub type Fq = Fp256<MontBackend<FqConfig, 4>>;
|
||||
7
secp256r1/src/fields/fr.rs
Normal file
7
secp256r1/src/fields/fr.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use ark_ff::fields::{Fp256, MontBackend, MontConfig};
|
||||
|
||||
#[derive(MontConfig)]
|
||||
#[modulus = "115792089210356248762697446949407573529996955224135760342422259061068512044369"]
|
||||
#[generator = "11"]
|
||||
pub struct FrConfig;
|
||||
pub type Fr = Fp256<MontBackend<FrConfig, 4>>;
|
||||
8
secp256r1/src/fields/mod.rs
Normal file
8
secp256r1/src/fields/mod.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
pub mod fq;
|
||||
pub use self::fq::*;
|
||||
|
||||
pub mod fr;
|
||||
pub use self::fr::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
5
secp256r1/src/fields/tests.rs
Normal file
5
secp256r1/src/fields/tests.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
use crate::{Fq, Fr};
|
||||
use ark_algebra_test_templates::*;
|
||||
|
||||
test_field!(fr; Fr; mont_prime_field);
|
||||
test_field!(fq; Fq; mont_prime_field);
|
||||
Reference in New Issue
Block a user