@@ -5,18 +5,18 @@ use amcl_wrapper::group_elem::{GroupElement, GroupElementVector};
5
5
use amcl_wrapper:: group_elem_g1:: { G1LookupTable , G1Vector , G1 } ;
6
6
use amcl_wrapper:: group_elem_g2:: { G2Vector , G2 } ;
7
7
8
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
9
+ pub struct GrothSigkey ( pub FieldElement ) ;
10
+
8
11
macro_rules! impl_GrothS {
9
- ( $GrothSetupParams: ident, $GrothSigkey : ident , $ GrothVerkey: ident, $GrothSig: ident, $GrothS: ident, $vk_group: ident, $msg_group: ident, $GVector: ident ) => {
12
+ ( $GrothSetupParams: ident, $GrothVerkey: ident, $GrothSig: ident, $GrothS: ident, $vk_group: ident, $msg_group: ident, $GVector: ident ) => {
10
13
#[ derive( Clone , Debug , Serialize , Deserialize ) ]
11
14
pub struct $GrothSetupParams {
12
15
pub g1: G1 ,
13
16
pub g2: G2 ,
14
17
pub y: $GVector,
15
18
}
16
19
17
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
18
- pub struct $GrothSigkey( pub FieldElement ) ;
19
-
20
20
#[ derive( Clone , Debug , Serialize , Deserialize ) ]
21
21
pub struct $GrothVerkey( pub $vk_group) ;
22
22
@@ -88,7 +88,6 @@ macro_rules! impl_GrothSig_randomize {
88
88
89
89
impl_GrothS ! (
90
90
Groth1SetupParams ,
91
- Groth1Sigkey ,
92
91
Groth1Verkey ,
93
92
Groth1Sig ,
94
93
GrothS1 ,
@@ -99,7 +98,6 @@ impl_GrothS!(
99
98
100
99
impl_GrothS ! (
101
100
Groth2SetupParams ,
102
- Groth2Sigkey ,
103
101
Groth2Verkey ,
104
102
Groth2Sig ,
105
103
GrothS2 ,
@@ -124,17 +122,17 @@ macro_rules! var_time_mul_scl_mul_with_same_field_element {
124
122
impl GrothS1 {
125
123
impl_GrothS_setup ! ( Groth1SetupParams , G1 , G1Vector ) ;
126
124
127
- pub fn keygen ( setup_params : & Groth1SetupParams ) -> ( Groth1Sigkey , Groth1Verkey ) {
125
+ pub fn keygen ( setup_params : & Groth1SetupParams ) -> ( GrothSigkey , Groth1Verkey ) {
128
126
let sk = FieldElement :: random ( ) ;
129
127
let vk = & setup_params. g2 * & sk;
130
- ( Groth1Sigkey ( sk) , Groth1Verkey ( vk) )
128
+ ( GrothSigkey ( sk) , Groth1Verkey ( vk) )
131
129
}
132
130
}
133
131
134
132
impl Groth1Sig {
135
133
pub fn new (
136
134
messages : & [ G1 ] ,
137
- sk : & Groth1Sigkey ,
135
+ sk : & GrothSigkey ,
138
136
setup_params : & Groth1SetupParams ,
139
137
) -> DelgResult < Self > {
140
138
impl_GrothSig_new ! (
@@ -252,17 +250,17 @@ impl Groth1Sig {
252
250
impl GrothS2 {
253
251
impl_GrothS_setup ! ( Groth2SetupParams , G2 , G2Vector ) ;
254
252
255
- pub fn keygen ( setup_params : & Groth2SetupParams ) -> ( Groth2Sigkey , Groth2Verkey ) {
253
+ pub fn keygen ( setup_params : & Groth2SetupParams ) -> ( GrothSigkey , Groth2Verkey ) {
256
254
let sk = FieldElement :: random ( ) ;
257
255
let vk = & setup_params. g1 * & sk;
258
- ( Groth2Sigkey ( sk) , Groth2Verkey ( vk) )
256
+ ( GrothSigkey ( sk) , Groth2Verkey ( vk) )
259
257
}
260
258
}
261
259
262
260
impl Groth2Sig {
263
261
pub fn new (
264
262
messages : & [ G2 ] ,
265
- sk : & Groth2Sigkey ,
263
+ sk : & GrothSigkey ,
266
264
setup_params : & Groth2SetupParams ,
267
265
) -> DelgResult < Self > {
268
266
impl_GrothSig_new ! (
0 commit comments