Skip to content

Commit

Permalink
SFT-3610: Update secp256k1 to 0.29.
Browse files Browse the repository at this point in the history
* Cargo.lock: Update lockfile.
* Cargo.toml (dependencies) <secp256k1>: Update to 0.29.
* src/secp256k1.rs: Fix breaking changes.
  • Loading branch information
jeandudey committed May 10, 2024
1 parent 83939cc commit 2fb2451
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
46 changes: 23 additions & 23 deletions extmod/foundation-rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extmod/foundation-rust/Cargo.toml
Expand Up @@ -44,7 +44,7 @@ default-features = false
features = ["critical-section"]

[dependencies.secp256k1]
version = "0.27"
version = "0.29"
default-features = false
features = ["rand"]

Expand Down
6 changes: 3 additions & 3 deletions extmod/foundation-rust/src/secp256k1.rs
Expand Up @@ -3,7 +3,7 @@

use once_cell::sync::Lazy;
use secp256k1::{
ffi::types::AlignedType, AllPreallocated, KeyPair, Message, Secp256k1,
ffi::types::AlignedType, AllPreallocated, Keypair, Message, Secp256k1,
};

/// cbindgen:ignore
Expand All @@ -28,10 +28,10 @@ pub extern "C" fn secp256k1_sign_schnorr(
secret_key: &[u8; 32],
signature: &mut [u8; 64],
) {
let keypair = KeyPair::from_seckey_slice(&PRE_ALLOCATED_CTX, secret_key)
let keypair = Keypair::from_seckey_slice(&PRE_ALLOCATED_CTX, secret_key)
.expect("invalid secret key");

let msg = Message::from_slice(data).unwrap();
let msg = Message::from_digest_slice(data).unwrap();
let sig =
PRE_ALLOCATED_CTX.sign_schnorr_with_rng(&msg, &keypair, &mut rng());
signature.copy_from_slice(sig.as_ref());
Expand Down

0 comments on commit 2fb2451

Please sign in to comment.