Merge pull request #523 from nuttycom/update_secp256k1

Update to secp256k1 v0.21
This commit is contained in:
Kris Nuttycombe 2022-04-06 17:30:35 -06:00 committed by GitHub
commit 43c18d000f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View File

@ -19,6 +19,6 @@ panic = 'abort'
codegen-units = 1
[patch.crates-io]
hdwallet = { git = "https://github.com/nuttycom/hdwallet", rev = "576683b9f2865f1118c309017ff36e01f84420c9" }
hdwallet = { git = "https://github.com/nuttycom/hdwallet", rev = "9b4c1bdbe0517e3a7a8f285d6048a37d472ba3bc" }
zcash_encoding = { path = "components/zcash_encoding" }
zcash_note_encryption = { path = "components/zcash_note_encryption" }

View File

@ -29,7 +29,7 @@ proptest = { version = "1.0.0", optional = true }
protobuf = "~2.27.1" # MSRV 1.52.1
rand_core = "0.6"
ripemd = { version = "0.1", optional = true }
secp256k1 = { version = "0.20", optional = true }
secp256k1 = { version = "0.21", optional = true }
sha2 = { version = "0.10.1", optional = true }
subtle = "2.2.3"
time = "0.2"

View File

@ -21,7 +21,7 @@ jubjub = "0.8"
protobuf = "~2.27.1" # MSRV 1.52.1
rand_core = "0.6"
rusqlite = { version = "0.24", features = ["bundled", "time"] }
secp256k1 = { version = "0.20" }
secp256k1 = { version = "0.21" }
time = "0.2"
zcash_client_backend = { version = "0.5", path = "../zcash_client_backend" }
zcash_primitives = { version = "0.5", path = "../zcash_primitives" }

View File

@ -41,7 +41,7 @@ proptest = { version = "1.0.0", optional = true }
rand = "0.8"
rand_core = "0.6"
ripemd = { version = "0.1", optional = true }
secp256k1 = { version = "0.20", optional = true }
secp256k1 = { version = "0.21", optional = true }
sha2 = "0.9"
subtle = "2.2.3"
zcash_encoding = { version = "0.0", path = "../components/zcash_encoding" }

View File

@ -46,7 +46,7 @@ impl AccountPrivKey {
pub fn derive_external_secret_key(
&self,
child_index: u32,
) -> Result<secp256k1::key::SecretKey, hdwallet::error::Error> {
) -> Result<secp256k1::SecretKey, hdwallet::error::Error> {
self.0
.derive_private_key(KeyIndex::Normal(0))?
.derive_private_key(KeyIndex::Normal(child_index))
@ -58,7 +58,7 @@ impl AccountPrivKey {
pub fn derive_internal_secret_key(
&self,
child_index: u32,
) -> Result<secp256k1::key::SecretKey, hdwallet::error::Error> {
) -> Result<secp256k1::SecretKey, hdwallet::error::Error> {
self.0
.derive_private_key(KeyIndex::Normal(1))?
.derive_private_key(KeyIndex::Normal(child_index))
@ -135,7 +135,7 @@ impl AccountPubKey {
/// Derives the P2PKH transparent address corresponding to the given pubkey.
#[deprecated(note = "This function will be removed from the public API in an upcoming refactor.")]
pub fn pubkey_to_address(pubkey: &secp256k1::key::PublicKey) -> TransparentAddress {
pub fn pubkey_to_address(pubkey: &secp256k1::PublicKey) -> TransparentAddress {
TransparentAddress::PublicKey(
*ripemd::Ripemd160::digest(Sha256::digest(&pubkey.serialize())).as_ref(),
)

View File

@ -241,7 +241,7 @@ impl Bundle<Unauthorized> {
);
let msg = secp256k1::Message::from_slice(sighash.as_ref()).expect("32 bytes");
let sig = self.authorization.secp.sign(&msg, &info.sk);
let sig = self.authorization.secp.sign_ecdsa(&msg, &info.sk);
// Signature has to have "SIGHASH_ALL" appended to it
let mut sig_bytes: Vec<u8> = sig.serialize_der()[..].to_vec();