@@ -86,7 +86,7 @@ pub use crate::verifying::VerifyingKey;
86
86
87
87
use core:: { fmt, ops:: Add } ;
88
88
use elliptic_curve:: {
89
- FieldBytes , FieldBytesSize , ScalarPrimitive ,
89
+ FieldBytes , FieldBytesSize , ScalarValue ,
90
90
array:: { Array , ArraySize , typenum:: Unsigned } ,
91
91
} ;
92
92
@@ -208,8 +208,8 @@ pub type SignatureBytes<C> = Array<u8, SignatureSize<C>>;
208
208
/// [IEEE P1363]: https://en.wikipedia.org/wiki/IEEE_P1363
209
209
#[ derive( Clone , Eq , PartialEq ) ]
210
210
pub struct Signature < C : EcdsaCurve > {
211
- r : ScalarPrimitive < C > ,
212
- s : ScalarPrimitive < C > ,
211
+ r : ScalarValue < C > ,
212
+ s : ScalarValue < C > ,
213
213
}
214
214
215
215
impl < C > Signature < C >
@@ -258,8 +258,8 @@ where
258
258
/// - `Err(err)` if the `r` and/or `s` component of the signature is
259
259
/// out-of-range when interpreted as a big endian integer.
260
260
pub fn from_scalars ( r : impl Into < FieldBytes < C > > , s : impl Into < FieldBytes < C > > ) -> Result < Self > {
261
- let r = ScalarPrimitive :: from_slice ( & r. into ( ) ) . map_err ( |_| Error :: new ( ) ) ?;
262
- let s = ScalarPrimitive :: from_slice ( & s. into ( ) ) . map_err ( |_| Error :: new ( ) ) ?;
261
+ let r = ScalarValue :: from_slice ( & r. into ( ) ) . map_err ( |_| Error :: new ( ) ) ?;
262
+ let s = ScalarValue :: from_slice ( & s. into ( ) ) . map_err ( |_| Error :: new ( ) ) ?;
263
263
264
264
if r. is_zero ( ) . into ( ) || s. is_zero ( ) . into ( ) {
265
265
return Err ( Error :: new ( ) ) ;
@@ -327,7 +327,7 @@ where
327
327
/// [1]: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki
328
328
pub fn normalize_s ( & self ) -> Self {
329
329
let mut result = self . clone ( ) ;
330
- let s_inv = ScalarPrimitive :: from ( -self . s ( ) ) ;
330
+ let s_inv = ScalarValue :: from ( -self . s ( ) ) ;
331
331
result. s . conditional_assign ( & s_inv, self . s . is_high ( ) ) ;
332
332
result
333
333
}
@@ -524,8 +524,8 @@ where
524
524
525
525
impl < C : EcdsaCurve > Zeroize for Signature < C > {
526
526
fn zeroize ( & mut self ) {
527
- self . r = ScalarPrimitive :: ONE ;
528
- self . s = ScalarPrimitive :: ONE ;
527
+ self . r = ScalarValue :: ONE ;
528
+ self . s = ScalarValue :: ONE ;
529
529
}
530
530
}
531
531
0 commit comments