Update key.rs to use the new seckey functions

This commit is contained in:
Elichai Turkel 2020-05-13 14:52:18 +03:00 committed by Andrew Poelstra
parent 51ca1557ae
commit c69d43d84e
2 changed files with 3 additions and 4 deletions

View File

@ -167,7 +167,6 @@ mod tests {
use rand::thread_rng; use rand::thread_rng;
use super::SharedSecret; use super::SharedSecret;
use super::super::Secp256k1; use super::super::Secp256k1;
use Error;
#[test] #[test]
fn ecdh() { fn ecdh() {

View File

@ -154,7 +154,7 @@ impl SecretKey {
&mut self &mut self
) { ) {
unsafe { unsafe {
let res = ffi::secp256k1_ec_privkey_negate( let res = ffi::secp256k1_ec_seckey_negate(
ffi::secp256k1_context_no_precomp, ffi::secp256k1_context_no_precomp,
self.as_mut_c_ptr() self.as_mut_c_ptr()
); );
@ -174,7 +174,7 @@ impl SecretKey {
return Err(Error::InvalidTweak); return Err(Error::InvalidTweak);
} }
unsafe { unsafe {
if ffi::secp256k1_ec_privkey_tweak_add( if ffi::secp256k1_ec_seckey_tweak_add(
ffi::secp256k1_context_no_precomp, ffi::secp256k1_context_no_precomp,
self.as_mut_c_ptr(), self.as_mut_c_ptr(),
other.as_c_ptr(), other.as_c_ptr(),
@ -199,7 +199,7 @@ impl SecretKey {
return Err(Error::InvalidTweak); return Err(Error::InvalidTweak);
} }
unsafe { unsafe {
if ffi::secp256k1_ec_privkey_tweak_mul( if ffi::secp256k1_ec_seckey_tweak_mul(
ffi::secp256k1_context_no_precomp, ffi::secp256k1_context_no_precomp,
self.as_mut_c_ptr(), self.as_mut_c_ptr(),
other.as_c_ptr(), other.as_c_ptr(),