@@ -395,11 +395,11 @@ impl core::hash::Hash for XOnlyPublicKey {
395
395
#[ repr( C ) ]
396
396
#[ derive( Copy , Clone ) ]
397
397
#[ cfg_attr( secp256k1_fuzz, derive( PartialEq , Eq , PartialOrd , Ord , Hash ) ) ]
398
- pub struct KeyPair ( [ c_uchar ; 96 ] ) ;
399
- impl_array_newtype ! ( KeyPair , c_uchar, 96 ) ;
400
- impl_raw_debug ! ( KeyPair ) ;
398
+ pub struct Keypair ( [ c_uchar ; 96 ] ) ;
399
+ impl_array_newtype ! ( Keypair , c_uchar, 96 ) ;
400
+ impl_raw_debug ! ( Keypair ) ;
401
401
402
- impl KeyPair {
402
+ impl Keypair {
403
403
/// Creates an "uninitialized" FFI keypair which is zeroed out
404
404
///
405
405
/// # Safety
@@ -421,7 +421,7 @@ impl KeyPair {
421
421
/// that you obtained from the FFI interface of the same version of this
422
422
/// library.
423
423
pub unsafe fn from_array_unchecked ( data : [ c_uchar ; 96 ] ) -> Self {
424
- KeyPair ( data)
424
+ Keypair ( data)
425
425
}
426
426
427
427
/// Returns the underlying FFI opaque representation of the x-only public key
@@ -480,33 +480,33 @@ pub fn non_secure_erase_impl<T>(dst: &mut T, src: T) {
480
480
}
481
481
482
482
#[ cfg( not( secp256k1_fuzz) ) ]
483
- impl PartialOrd for KeyPair {
484
- fn partial_cmp ( & self , other : & KeyPair ) -> Option < core:: cmp:: Ordering > {
483
+ impl PartialOrd for Keypair {
484
+ fn partial_cmp ( & self , other : & Keypair ) -> Option < core:: cmp:: Ordering > {
485
485
Some ( self . cmp ( other) )
486
486
}
487
487
}
488
488
489
489
#[ cfg( not( secp256k1_fuzz) ) ]
490
- impl Ord for KeyPair {
491
- fn cmp ( & self , other : & KeyPair ) -> core:: cmp:: Ordering {
490
+ impl Ord for Keypair {
491
+ fn cmp ( & self , other : & Keypair ) -> core:: cmp:: Ordering {
492
492
let this = self . public_key ( ) ;
493
493
let that = other. public_key ( ) ;
494
494
this. cmp ( & that)
495
495
}
496
496
}
497
497
498
498
#[ cfg( not( secp256k1_fuzz) ) ]
499
- impl PartialEq for KeyPair {
499
+ impl PartialEq for Keypair {
500
500
fn eq ( & self , other : & Self ) -> bool {
501
501
self . cmp ( other) == core:: cmp:: Ordering :: Equal
502
502
}
503
503
}
504
504
505
505
#[ cfg( not( secp256k1_fuzz) ) ]
506
- impl Eq for KeyPair { }
506
+ impl Eq for Keypair { }
507
507
508
508
#[ cfg( not( secp256k1_fuzz) ) ]
509
- impl core:: hash:: Hash for KeyPair {
509
+ impl core:: hash:: Hash for Keypair {
510
510
fn hash < H : core:: hash:: Hasher > ( & self , state : & mut H ) {
511
511
// To hash the key pair we just hash the serialized public key. Since any change to the
512
512
// secret key would also be a change to the public key this is a valid one way function from
@@ -592,13 +592,13 @@ extern "C" {
592
592
#[ cfg_attr( not( rust_secp_no_symbol_renaming) , link_name = "rustsecp256k1_v0_8_1_keypair_sec" ) ]
593
593
pub fn secp256k1_keypair_sec ( cx : * const Context ,
594
594
output_seckey : * mut c_uchar ,
595
- keypair : * const KeyPair )
595
+ keypair : * const Keypair )
596
596
-> c_int ;
597
597
598
598
#[ cfg_attr( not( rust_secp_no_symbol_renaming) , link_name = "rustsecp256k1_v0_8_1_keypair_pub" ) ]
599
599
pub fn secp256k1_keypair_pub ( cx : * const Context ,
600
600
output_pubkey : * mut PublicKey ,
601
- keypair : * const KeyPair )
601
+ keypair : * const Keypair )
602
602
-> c_int ;
603
603
}
604
604
@@ -702,7 +702,7 @@ extern "C" {
702
702
cx : * const Context ,
703
703
sig : * mut c_uchar ,
704
704
msg32 : * const c_uchar ,
705
- keypair : * const KeyPair ,
705
+ keypair : * const Keypair ,
706
706
aux_rand32 : * const c_uchar
707
707
) -> c_int ;
708
708
@@ -713,7 +713,7 @@ extern "C" {
713
713
sig : * mut c_uchar ,
714
714
msg : * const c_uchar ,
715
715
msg_len : size_t ,
716
- keypair : * const KeyPair ,
716
+ keypair : * const Keypair ,
717
717
extra_params : * const SchnorrSigExtraParams ,
718
718
) -> c_int ;
719
719
@@ -730,7 +730,7 @@ extern "C" {
730
730
#[ cfg_attr( not( rust_secp_no_symbol_renaming) , link_name = "rustsecp256k1_v0_8_1_keypair_create" ) ]
731
731
pub fn secp256k1_keypair_create (
732
732
cx : * const Context ,
733
- keypair : * mut KeyPair ,
733
+ keypair : * mut Keypair ,
734
734
seckey : * const c_uchar ,
735
735
) -> c_int ;
736
736
@@ -776,13 +776,13 @@ extern "C" {
776
776
cx : * const Context ,
777
777
pubkey : * mut XOnlyPublicKey ,
778
778
pk_parity : * mut c_int ,
779
- keypair : * const KeyPair
779
+ keypair : * const Keypair
780
780
) -> c_int ;
781
781
782
782
#[ cfg_attr( not( rust_secp_no_symbol_renaming) , link_name = "rustsecp256k1_v0_8_1_keypair_xonly_tweak_add" ) ]
783
783
pub fn secp256k1_keypair_xonly_tweak_add (
784
784
cx : * const Context ,
785
- keypair : * mut KeyPair ,
785
+ keypair : * mut Keypair ,
786
786
tweak32 : * const c_uchar ,
787
787
) -> c_int ;
788
788
@@ -1316,12 +1316,12 @@ mod fuzz_dummy {
1316
1316
cx : * const Context ,
1317
1317
sig64 : * mut c_uchar ,
1318
1318
msg32 : * const c_uchar ,
1319
- keypair : * const KeyPair ,
1319
+ keypair : * const Keypair ,
1320
1320
_aux_rand32 : * const c_uchar
1321
1321
) -> c_int {
1322
1322
check_context_flags ( cx, SECP256K1_START_SIGN ) ;
1323
1323
// Check context is built for signing
1324
- let mut new_kp = KeyPair :: new ( ) ;
1324
+ let mut new_kp = Keypair :: new ( ) ;
1325
1325
if secp256k1_keypair_create ( cx, & mut new_kp, ( * keypair) . 0 . as_ptr ( ) ) != 1 {
1326
1326
return 0 ;
1327
1327
}
@@ -1341,7 +1341,7 @@ mod fuzz_dummy {
1341
1341
sig : * mut c_uchar ,
1342
1342
msg : * const c_uchar ,
1343
1343
_msg_len : size_t ,
1344
- keypair : * const KeyPair ,
1344
+ keypair : * const Keypair ,
1345
1345
_extra_params : * const SchnorrSigExtraParams ,
1346
1346
) -> c_int {
1347
1347
secp256k1_schnorrsig_sign ( cx, sig, msg, keypair, ptr:: null ( ) )
@@ -1350,7 +1350,7 @@ mod fuzz_dummy {
1350
1350
// Extra keys
1351
1351
pub unsafe fn secp256k1_keypair_create (
1352
1352
cx : * const Context ,
1353
- keypair : * mut KeyPair ,
1353
+ keypair : * mut Keypair ,
1354
1354
seckey : * const c_uchar ,
1355
1355
) -> c_int {
1356
1356
check_context_flags ( cx, SECP256K1_START_SIGN ) ;
@@ -1419,7 +1419,7 @@ mod fuzz_dummy {
1419
1419
cx : * const Context ,
1420
1420
pubkey : * mut XOnlyPublicKey ,
1421
1421
pk_parity : * mut c_int ,
1422
- keypair : * const KeyPair
1422
+ keypair : * const Keypair
1423
1423
) -> c_int {
1424
1424
check_context_flags ( cx, 0 ) ;
1425
1425
if !pk_parity. is_null ( ) {
@@ -1431,7 +1431,7 @@ mod fuzz_dummy {
1431
1431
1432
1432
pub unsafe fn secp256k1_keypair_xonly_tweak_add (
1433
1433
cx : * const Context ,
1434
- keypair : * mut KeyPair ,
1434
+ keypair : * mut Keypair ,
1435
1435
tweak32 : * const c_uchar ,
1436
1436
) -> c_int {
1437
1437
check_context_flags ( cx, SECP256K1_START_VERIFY ) ;
0 commit comments