From 484e5d8d5b9d001af4ce5796b9837bbc704bebea Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Mon, 18 Dec 2023 20:37:28 +0000 Subject: [PATCH] fix incorrect FFI binding for pubkey_combine --- Cargo-minimal.lock | 2 +- Cargo-recent.lock | 2 +- secp256k1-sys/CHANGELOG.md | 4 ++++ secp256k1-sys/Cargo.toml | 2 +- secp256k1-sys/src/lib.rs | 4 ++-- src/key.rs | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 8ecb0ee..e83dee2 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.1" +version = "0.9.2" dependencies = [ "cc", "libc", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 502204a..21f5eba 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -194,7 +194,7 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.1" +version = "0.9.2" dependencies = [ "cc", "libc", diff --git a/secp256k1-sys/CHANGELOG.md b/secp256k1-sys/CHANGELOG.md index 6030bb2..327792a 100644 --- a/secp256k1-sys/CHANGELOG.md +++ b/secp256k1-sys/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.9.2 - 2023-12-18 + +* Fix incorrect FFI binding for `secp256k1_pubkey_combine` + # 0.9.1 - 2023-12-07 * Patch out any instances of printf in upstream [#663](https://github.com/rust-bitcoin/rust-secp256k1/pull/663) diff --git a/secp256k1-sys/Cargo.toml b/secp256k1-sys/Cargo.toml index 7fd3d52..50cef78 100644 --- a/secp256k1-sys/Cargo.toml +++ b/secp256k1-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secp256k1-sys" -version = "0.9.1" +version = "0.9.2" authors = [ "Dawid Ciężarkiewicz ", "Andrew Poelstra ", "Steven Roose " ] diff --git a/secp256k1-sys/src/lib.rs b/secp256k1-sys/src/lib.rs index b0e2489..b755633 100644 --- a/secp256k1-sys/src/lib.rs +++ b/secp256k1-sys/src/lib.rs @@ -724,7 +724,7 @@ extern "C" { pub fn secp256k1_ec_pubkey_combine(cx: *const Context, out: *mut PublicKey, ins: *const *const PublicKey, - n: c_int) + n: size_t) -> c_int; #[cfg_attr(not(rust_secp_no_symbol_renaming), link_name = "rustsecp256k1_v0_9_1_ecdh")] @@ -1306,7 +1306,7 @@ mod fuzz_dummy { pub unsafe fn secp256k1_ec_pubkey_combine(cx: *const Context, out: *mut PublicKey, ins: *const *const PublicKey, - n: c_int) + n: size_t) -> c_int { check_context_flags(cx, 0); assert!(n >= 1); diff --git a/src/key.rs b/src/key.rs index 3b28852..84255cf 100644 --- a/src/key.rs +++ b/src/key.rs @@ -676,7 +676,7 @@ impl PublicKey { ffi::secp256k1_context_no_precomp, &mut ret, ptrs.as_c_ptr(), - keys.len() as i32, + keys.len(), ) == 1 { Ok(PublicKey(ret))