@@ -440,7 +440,7 @@ mod fuzz_dummy {
440
440
use self :: std:: { ptr, mem} ;
441
441
use self :: std:: boxed:: Box ;
442
442
use types:: * ;
443
- use :: { Signature , Context , NonceFn , EcdhHashFn , PublicKey , SharedSecret ,
443
+ use :: { Signature , Context , NonceFn , EcdhHashFn , PublicKey ,
444
444
SECP256K1_START_NONE , SECP256K1_START_VERIFY , SECP256K1_START_SIGN ,
445
445
SECP256K1_SER_COMPRESSED , SECP256K1_SER_UNCOMPRESSED } ;
446
446
@@ -769,7 +769,7 @@ mod fuzz_dummy {
769
769
/// Sets out to point[0..16]||scalar[0..16]
770
770
pub unsafe fn secp256k1_ecdh (
771
771
cx : * const Context ,
772
- out : * mut SharedSecret ,
772
+ out : * mut c_uchar ,
773
773
point : * const PublicKey ,
774
774
scalar : * const c_uchar ,
775
775
_hashfp : EcdhHashFn ,
@@ -782,13 +782,13 @@ mod fuzz_dummy {
782
782
ptr:: copy ( scalar, scalar_prefix[ ..] . as_mut_ptr ( ) , 16 ) ;
783
783
784
784
if ( * point) . 0 [ 0 ..16 ] > scalar_prefix[ 0 ..16 ] {
785
- ( * out ) . 0 [ 0 .. 16 ] . copy_from_slice ( & ( * point) . 0 [ 0 .. 16 ] ) ;
786
- ptr:: copy ( scalar, ( * out) . 0 [ 16 .. 32 ] . as_mut_ptr ( ) , 16 ) ;
785
+ ptr :: copy ( ( * point) . as_ptr ( ) , out , 16 ) ;
786
+ ptr:: copy ( scalar, out. offset ( 16 ) , 16 ) ;
787
787
} else {
788
- ptr:: copy ( scalar, ( * out) . 0 [ 0 .. 16 ] . as_mut_ptr ( ) , 16 ) ;
789
- ( * out ) . 0 [ 16 .. 32 ] . copy_from_slice ( & ( * point ) . 0 [ 0 .. 16 ] ) ;
788
+ ptr:: copy ( scalar, out, 16 ) ;
789
+ ptr :: copy ( ( * point ) . as_ptr ( ) , out . offset ( 16 ) , 16 ) ;
790
790
}
791
- ( * out) . 0 [ 16 ] = 0x00 ; // result should always be a valid secret key
791
+ ( * out. offset ( 16 ) ) = 0x00 ; // result should always be a valid secret key
792
792
1
793
793
}
794
794
}
0 commit comments