@@ -101,9 +101,6 @@ impl RandomScalars {
101
101
}
102
102
}
103
103
104
- #[ cfg( feature = "__private_bbs_fixtures_generator_api" ) ]
105
- use crate :: common:: util:: vec_to_byte_array;
106
-
107
104
/// A struct to hold a trace of the signature generation operation
108
105
#[ derive( Debug , Clone ) ]
109
106
pub struct SignatureTrace {
@@ -122,23 +119,6 @@ impl Default for SignatureTrace {
122
119
}
123
120
}
124
121
125
- impl SignatureTrace {
126
- /// Helper function to get a new signature trace from Vec inputs
127
- #[ cfg_attr(
128
- docsrs,
129
- doc( cfg( feature = "__private_bbs_fixtures_generator_api" ) )
130
- ) ]
131
- #[ cfg( feature = "__private_bbs_fixtures_generator_api" ) ]
132
- pub fn new_from_vec ( B : Vec < u8 > , domain : Vec < u8 > ) -> Self {
133
- Self {
134
- B : vec_to_byte_array :: < OCTET_POINT_G1_LENGTH > ( & B )
135
- . expect ( "Invalid B" ) ,
136
- domain : vec_to_byte_array :: < OCTET_SCALAR_LENGTH > ( & domain)
137
- . expect ( "Invalid domain" ) ,
138
- }
139
- }
140
- }
141
-
142
122
/// A struct to hold a trace of the proof generation operation
143
123
#[ derive( Debug , Clone ) ]
144
124
pub struct ProofTrace {
@@ -170,35 +150,17 @@ impl Default for ProofTrace {
170
150
}
171
151
172
152
impl ProofTrace {
173
- /// Helper function to deserialize the ProofTrace struct
174
- #[ cfg( feature = "__private_bbs_fixtures_generator_api" ) ]
175
- pub fn new_from_vec (
176
- // TODO: Change to be &mut self and remove the random_scalars: default.
177
- A_bar : Vec < u8 > ,
178
- B_bar : Vec < u8 > ,
179
- T : Vec < u8 > ,
180
- domain : Vec < u8 > ,
181
- challenge : Vec < u8 > ,
182
- ) -> Self {
183
- Self {
184
- random_scalars : RandomScalars :: default ( ) ,
185
- A_bar : vec_to_byte_array :: < OCTET_POINT_G1_LENGTH > ( & A_bar )
186
- . expect ( "Invalid A_bar" ) ,
187
- B_bar : vec_to_byte_array :: < OCTET_POINT_G1_LENGTH > ( & B_bar )
188
- . expect ( "Invalid B_bar" ) ,
189
- T : vec_to_byte_array :: < OCTET_POINT_G1_LENGTH > ( & T )
190
- . expect ( "Invalid T" ) ,
191
- domain : vec_to_byte_array :: < OCTET_SCALAR_LENGTH > ( & domain)
192
- . expect ( "Invalid domain" ) ,
193
- challenge : vec_to_byte_array :: < OCTET_SCALAR_LENGTH > ( & challenge)
194
- . expect ( "Invalid challenge" ) ,
195
- }
196
- }
197
-
198
- pub ( crate ) fn new_from_init_res ( & mut self , init_res : & ProofInitResult ) {
153
+ pub ( crate ) fn new_with_init_res (
154
+ & mut self ,
155
+ init_res : & ProofInitResult ,
156
+ challenge : Challenge ,
157
+ random_scalars : RandomScalars ,
158
+ ) {
199
159
self . A_bar = point_to_octets_g1 ( & init_res. A_bar ) ;
200
160
self . B_bar = point_to_octets_g1 ( & init_res. B_bar ) ;
201
161
self . T = point_to_octets_g1 ( & init_res. T ) ;
202
162
self . domain = init_res. domain . to_bytes_be ( ) ;
163
+ self . challenge = challenge. 0 . to_bytes_be ( ) ;
164
+ self . random_scalars = random_scalars;
203
165
}
204
166
}
0 commit comments