File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -376,21 +376,20 @@ where
376
376
let z = Scalar :: < C > :: reduce ( & bits2field :: < C > ( prehash) ?) ;
377
377
378
378
let r_bytes = if recovery_id. is_x_reduced ( ) {
379
- Option :: < C :: Uint > :: from (
380
- C :: Uint :: decode_field_bytes ( & r . to_repr ( ) ) . checked_add ( & C :: ORDER ) ,
381
- )
382
- . ok_or_else ( Error :: new) ?
383
- . encode_field_bytes ( )
379
+ C :: Uint :: decode_field_bytes ( & r . to_repr ( ) )
380
+ . checked_add ( & C :: ORDER )
381
+ . into_option ( )
382
+ . ok_or_else ( Error :: new) ?
383
+ . encode_field_bytes ( )
384
384
} else {
385
385
r. to_repr ( )
386
386
} ;
387
387
388
- let R : ProjectivePoint < C > = Option :: < AffinePoint < C > > :: from ( AffinePoint :: < C > :: decompress (
389
- & r_bytes,
390
- u8:: from ( recovery_id. is_y_odd ( ) ) . into ( ) ,
391
- ) )
392
- . ok_or_else ( Error :: new) ?
393
- . into ( ) ;
388
+ let R : ProjectivePoint < C > =
389
+ AffinePoint :: < C > :: decompress ( & r_bytes, u8:: from ( recovery_id. is_y_odd ( ) ) . into ( ) )
390
+ . into_option ( )
391
+ . ok_or_else ( Error :: new) ?
392
+ . into ( ) ;
394
393
395
394
let r_inv = * r. invert ( ) ;
396
395
let u1 = -( r_inv * z) ;
Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ where
108
108
109
109
/// Initialize [`VerifyingKey`] from an [`EncodedPoint`].
110
110
pub fn from_encoded_point ( public_key : & EncodedPoint < C > ) -> Result < Self > {
111
- Option :: from ( PublicKey :: < C > :: from_encoded_point ( public_key) )
111
+ PublicKey :: < C > :: from_encoded_point ( public_key)
112
+ . into_option ( )
112
113
. map ( |public_key| Self { inner : public_key } )
113
114
. ok_or_else ( Error :: new)
114
115
}
You can’t perform that action at this time.
0 commit comments