Commit a25b316 1 parent 45e3366 commit a25b316 Copy full SHA for a25b316
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -140,12 +140,12 @@ macro_rules! new_curve_impl {
140
140
#[ allow( non_upper_case_globals) ]
141
141
const [ < $name _FLAG_BITS >] : u8 =
142
142
if $spare_bits == 1 {
143
- 0b0111_1111
143
+ 0b1000_0000
144
144
} else if $spare_bits == 2 {
145
- 0b0011_1111
145
+ 0b1100_0000
146
146
} else {
147
147
//$spare_bits == 0
148
- 0b0000_0000
148
+ 0b1111_1111
149
149
} ;
150
150
151
151
impl group:: GroupEncoding for $name_affine {
@@ -175,7 +175,7 @@ macro_rules! new_curve_impl {
175
175
} ;
176
176
177
177
// Clear flag bits
178
- tmp[ [ < $name _FLAG_BYTE_INDEX>] ] & = [ < $name _FLAG_BITS >] ;
178
+ tmp[ [ < $name _FLAG_BYTE_INDEX>] ] | = [ < $name _FLAG_BITS >] ;
179
179
180
180
// Get x-coordinate
181
181
let mut xbytes = [ 0u8 ; $base:: size( ) ] ;
@@ -329,7 +329,7 @@ macro_rules! new_curve_impl {
329
329
let identity_flag = Choice :: from( ( ( bytes[ flag_idx ] & IS_IDENTITY_MASK ) >> IS_IDENTITY_SHIFT ) ) ;
330
330
331
331
// Clear flags.
332
- bytes[ flag_idx] & = [ < $name _FLAG_BITS >] ;
332
+ bytes[ flag_idx] | = [ < $name _FLAG_BITS >] ;
333
333
identity_flag
334
334
} else {
335
335
// With 0 and 1 spare bit there is no identity flag, so we just rely
You can’t perform that action at this time.
0 commit comments