@@ -12,11 +12,9 @@ pub const G2_ADD_BASE_GAS_FEE: u64 = 600;
12
12
pub const G2_MSM_ADDRESS : u64 = 0x0e ;
13
13
pub const G2_MSM_BASE_GAS_FEE : u64 = 22500 ;
14
14
pub const PAIRING_ADDRESS : u64 = 0x0f ;
15
- // TODO: Why does this have PAIRING twice?
16
- pub const PAIRING_PAIRING_OFFSET_BASE : u64 = 37700 ;
15
+ pub const PAIRING_OFFSET_BASE : u64 = 37700 ;
17
16
pub const MSM_MULTIPLIER : u64 = 1000 ;
18
- // TODO: Why does this have PAIRING twice?
19
- pub const PAIRING_PAIRING_MULTIPLIER_BASE : u64 = 32600 ;
17
+ pub const PAIRING_MULTIPLIER_BASE : u64 = 32600 ;
20
18
21
19
/// Discounts table for G1 MSM as a vector of pairs `[k, discount]`.
22
20
pub static DISCOUNT_TABLE_G1_MSM : [ u16 ; 128 ] = [
@@ -28,7 +26,7 @@ pub static DISCOUNT_TABLE_G1_MSM: [u16; 128] = [
28
26
544 , 543 , 542 , 541 , 540 , 540 , 539 , 538 , 537 , 536 , 536 , 535 , 534 , 533 , 532 , 532 , 531 , 530 , 529 ,
29
27
528 , 528 , 527 , 526 , 525 , 525 , 524 , 523 , 522 , 522 , 521 , 520 , 520 , 519 ,
30
28
] ;
31
- // Discounts table for G2 MSM as a vector of pairs `[k, discount]`:
29
+ /// Discounts table for G2 MSM as a vector of pairs `[k, discount]`:
32
30
pub static DISCOUNT_TABLE_G2_MSM : [ u16 ; 128 ] = [
33
31
1000 , 1000 , 923 , 884 , 855 , 832 , 812 , 796 , 782 , 770 , 759 , 749 , 740 , 732 , 724 , 717 , 711 , 704 ,
34
32
699 , 693 , 688 , 683 , 679 , 674 , 670 , 666 , 663 , 659 , 655 , 652 , 649 , 646 , 643 , 640 , 637 , 634 , 632 ,
@@ -83,19 +81,11 @@ pub const NBITS: usize = 256;
83
81
///
84
82
/// Note: The input to the G1 addition precompile is 2 G1 elements.
85
83
pub const G1_ADD_INPUT_LENGTH : usize = 2 * PADDED_G1_LENGTH ;
86
- /// G1_OUTPUT_LENGTH specifies the number of bytes that the EVM will use
87
- /// to represent a G1 element.
88
- // TODO: can we remove this since it is just `PADDED_G1_LENGTH`?
89
- pub const G1_OUTPUT_LENGTH : usize = PADDED_G1_LENGTH ;
90
84
/// G1_MSM_INPUT_LENGTH specifies the number of bytes that each MSM input pair should have.
91
85
///
92
86
/// Note: An MSM pair is a G1 element and a scalar. The input to the MSM precompile will have `n`
93
87
/// of these pairs.
94
88
pub const G1_MSM_INPUT_LENGTH : usize = PADDED_G1_LENGTH + SCALAR_LENGTH ;
95
- /// G1_INPUT_ITEM_LENGTH specifies the number of bytes that the EVM will use to represent
96
- /// a G1 element.
97
- // TODO: can we remove this since it is just `PADDED_G1_LENGTH`?
98
- pub const G1_INPUT_ITEM_LENGTH : usize = PADDED_G1_LENGTH ;
99
89
100
90
/// PADDED_G2_LENGTH specifies the number of bytes that the EVM will use to represent
101
91
/// a G2 element.
@@ -113,26 +103,17 @@ pub const G2_ADD_INPUT_LENGTH: usize = 2 * PADDED_G2_LENGTH;
113
103
/// Note: An MSM pair is a G2 element and a scalar. The input to the MSM will have `n`
114
104
/// of these pairs.
115
105
pub const G2_MSM_INPUT_LENGTH : usize = PADDED_G2_LENGTH + SCALAR_LENGTH ;
116
- /// G2_OUTPUT_LENGTH specifies the number of bytes that the EVM will use
117
- /// to represent a G2 element.
118
- // TODO: can we remove this since it is just `PADDED_G2_LENGTH`
119
- pub const G2_OUTPUT_LENGTH : usize = PADDED_G2_LENGTH ;
120
- /// G2_INPUT_ITEM_LENGTH specifies the number of bytes that the EVM will use to represent
121
- /// a G2 element.
122
- // TODO: can we remove this since it is just `PADDED_G2_LENGTH`
123
- pub const G2_INPUT_ITEM_LENGTH : usize = 256 ;
124
106
125
107
/// PAIRING_INPUT_LENGTH specifies the number of bytes that each Pairing input pair should have.
126
108
///
127
109
/// Note: An Pairing input-pair is a G2 element and a G1 element. The input to the Pairing will have `n`
128
110
/// of these pairs.
129
111
pub const PAIRING_INPUT_LENGTH : usize = PADDED_G1_LENGTH + PADDED_G2_LENGTH ;
130
112
131
- /// PADDING_LENGTH specifies the number of bytes that an FP_ELEMENT is padded by.
113
+ /// FP_PAD_BY specifies the number of bytes that an FP_ELEMENT is padded by to make it 32 byte aligned .
132
114
///
133
115
/// Note: This should be equal to PADDED_FP_LENGTH - FP_LENGTH.
134
- /// TODO: Should likely rename this to FP_PADDING_LENGTH, since other objects are also padded
135
- pub const PADDING_LENGTH : usize = 16 ;
116
+ pub const FP_PAD_BY : usize = 16 ;
136
117
137
118
// Big-endian non-Montgomery form.
138
119
pub const MODULUS_REPR : [ u8 ; 48 ] = [
0 commit comments