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
376376 let z = Scalar :: < C > :: reduce ( & bits2field :: < C > ( prehash) ?) ;
377377
378378 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 ( )
384384 } else {
385385 r. to_repr ( )
386386 } ;
387387
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 ( ) ;
394393
395394 let r_inv = * r. invert ( ) ;
396395 let u1 = -( r_inv * z) ;
Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ where
108108
109109 /// Initialize [`VerifyingKey`] from an [`EncodedPoint`].
110110 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 ( )
112113 . map ( |public_key| Self { inner : public_key } )
113114 . ok_or_else ( Error :: new)
114115 }
You can’t perform that action at this time.
0 commit comments