Skip to content

Commit

Permalink
Change deprecated functions (#1438)
Browse files Browse the repository at this point in the history
Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com>
  • Loading branch information
Bushstar and prasannavl authored Sep 9, 2022
1 parent 76987d1 commit 21bfbff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void CKey::MakeNewKey(bool fCompressedIn) {
bool CKey::Negate()
{
assert(fValid);
return secp256k1_ec_privkey_negate(secp256k1_context_sign, keydata.data());
return secp256k1_ec_seckey_negate(secp256k1_context_sign, keydata.data());
}

CPrivKey CKey::GetPrivKey() const {
Expand Down Expand Up @@ -284,7 +284,7 @@ bool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const
}
memcpy(ccChild.begin(), vout.data()+32, 32);
memcpy((unsigned char*)keyChild.begin(), begin(), 32);
bool ret = secp256k1_ec_privkey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data());
bool ret = secp256k1_ec_seckey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data());
keyChild.fCompressed = true;
keyChild.fValid = ret;
return ret;
Expand Down
4 changes: 2 additions & 2 deletions src/spv/support/BRKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ static void _ctx_init()
int BRSecp256k1ModAdd(UInt256 *a, const UInt256 *b)
{
std::call_once(_ctx_once, _ctx_init);
return secp256k1_ec_privkey_tweak_add(_ctx, (unsigned char *)a, (const unsigned char *)b);
return secp256k1_ec_seckey_tweak_add(_ctx, (unsigned char *)a, (const unsigned char *)b);
}

// multiplies 256bit big endian ints a and b (mod secp256k1 order) and stores the result in a
// returns true on success
int BRSecp256k1ModMul(UInt256 *a, const UInt256 *b)
{
std::call_once(_ctx_once, _ctx_init);
return secp256k1_ec_privkey_tweak_mul(_ctx, (unsigned char *)a, (const unsigned char *)b);
return secp256k1_ec_seckey_tweak_mul(_ctx, (unsigned char *)a, (const unsigned char *)b);
}

// multiplies secp256k1 generator by 256bit big endian int i and stores the result in p
Expand Down

0 comments on commit 21bfbff

Please sign in to comment.