@@ -79,20 +79,20 @@ impl<P: Bls12Config> AllocVar<G1Prepared<P>, P::Fp> for G1PreparedVar<P> {
79
79
impl < P : Bls12Config > ToBytesGadget < P :: Fp > for G1PreparedVar < P > {
80
80
#[ inline]
81
81
#[ tracing:: instrument( target = "r1cs" ) ]
82
- fn to_bytes ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
83
- let mut bytes = self . 0 . x . to_bytes ( ) ?;
84
- let y_bytes = self . 0 . y . to_bytes ( ) ?;
85
- let inf_bytes = self . 0 . infinity . to_bytes ( ) ?;
82
+ fn to_bytes_le ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
83
+ let mut bytes = self . 0 . x . to_bytes_le ( ) ?;
84
+ let y_bytes = self . 0 . y . to_bytes_le ( ) ?;
85
+ let inf_bytes = self . 0 . infinity . to_bytes_le ( ) ?;
86
86
bytes. extend_from_slice ( & y_bytes) ;
87
87
bytes. extend_from_slice ( & inf_bytes) ;
88
88
Ok ( bytes)
89
89
}
90
90
91
91
#[ tracing:: instrument( target = "r1cs" ) ]
92
- fn to_non_unique_bytes ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
93
- let mut bytes = self . 0 . x . to_non_unique_bytes ( ) ?;
94
- let y_bytes = self . 0 . y . to_non_unique_bytes ( ) ?;
95
- let inf_bytes = self . 0 . infinity . to_non_unique_bytes ( ) ?;
92
+ fn to_non_unique_bytes_le ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
93
+ let mut bytes = self . 0 . x . to_non_unique_bytes_le ( ) ?;
94
+ let y_bytes = self . 0 . y . to_non_unique_bytes_le ( ) ?;
95
+ let inf_bytes = self . 0 . infinity . to_non_unique_bytes_le ( ) ?;
96
96
bytes. extend_from_slice ( & y_bytes) ;
97
97
bytes. extend_from_slice ( & inf_bytes) ;
98
98
Ok ( bytes)
@@ -174,21 +174,21 @@ impl<P: Bls12Config> AllocVar<G2Prepared<P>, P::Fp> for G2PreparedVar<P> {
174
174
impl < P : Bls12Config > ToBytesGadget < P :: Fp > for G2PreparedVar < P > {
175
175
#[ inline]
176
176
#[ tracing:: instrument( target = "r1cs" ) ]
177
- fn to_bytes ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
177
+ fn to_bytes_le ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
178
178
let mut bytes = Vec :: new ( ) ;
179
179
for coeffs in & self . ell_coeffs {
180
- bytes. extend_from_slice ( & coeffs. 0 . to_bytes ( ) ?) ;
181
- bytes. extend_from_slice ( & coeffs. 1 . to_bytes ( ) ?) ;
180
+ bytes. extend_from_slice ( & coeffs. 0 . to_bytes_le ( ) ?) ;
181
+ bytes. extend_from_slice ( & coeffs. 1 . to_bytes_le ( ) ?) ;
182
182
}
183
183
Ok ( bytes)
184
184
}
185
185
186
186
#[ tracing:: instrument( target = "r1cs" ) ]
187
- fn to_non_unique_bytes ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
187
+ fn to_non_unique_bytes_le ( & self ) -> Result < Vec < UInt8 < P :: Fp > > , SynthesisError > {
188
188
let mut bytes = Vec :: new ( ) ;
189
189
for coeffs in & self . ell_coeffs {
190
- bytes. extend_from_slice ( & coeffs. 0 . to_non_unique_bytes ( ) ?) ;
191
- bytes. extend_from_slice ( & coeffs. 1 . to_non_unique_bytes ( ) ?) ;
190
+ bytes. extend_from_slice ( & coeffs. 0 . to_non_unique_bytes_le ( ) ?) ;
191
+ bytes. extend_from_slice ( & coeffs. 1 . to_non_unique_bytes_le ( ) ?) ;
192
192
}
193
193
Ok ( bytes)
194
194
}
0 commit comments