1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
use crate::bls12_377::{Fq, Fr};
use snarkvm_models::{
curves::{ModelParameters, SWModelParameters, Zero},
field,
};
use snarkvm_utilities::biginteger::{BigInteger256, BigInteger384};
#[derive(Clone, Default, PartialEq, Eq)]
pub struct Bls12_377G1Parameters;
impl ModelParameters for Bls12_377G1Parameters {
type BaseField = Fq;
type ScalarField = Fr;
}
impl SWModelParameters for Bls12_377G1Parameters {
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) = (G1_GENERATOR_X, G1_GENERATOR_Y);
const COEFF_A: Fq = field!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0]));
const COEFF_B: Fq = field!(
Fq,
BigInteger384([
0x2cdffffffffff68,
0x51409f837fffffb1,
0x9f7db3a98a7d3ff2,
0x7b4e97b76e7c6305,
0x4cf495bf803c84e8,
0x8d6661e2fdf49a,
])
);
const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
const COFACTOR_INV: Fr = field!(
Fr,
BigInteger256([
2013239619100046060,
4201184776506987597,
2526766393982337036,
1114629510922847535,
])
);
#[inline(always)]
fn mul_by_a(_: &Self::BaseField) -> Self::BaseField {
Self::BaseField::zero()
}
}
pub const G1_GENERATOR_X: Fq = field!(
Fq,
BigInteger384([
0x260f33b9772451f4,
0xc54dd773169d5658,
0x5c1551c469a510dd,
0x761662e4425e1698,
0xc97d78cc6f065272,
0xa41206b361fd4d,
])
);
pub const G1_GENERATOR_Y: Fq = field!(
Fq,
BigInteger384([
0x8193961fb8cb81f3,
0x638d4c5f44adb8,
0xfafaf3dad4daf54a,
0xc27849e2d655cd18,
0x2ec3ddb401d52814,
0x7da93326303c71,
])
);