Skip to content

Commit b9cfa40

Browse files
author
Yeastplume
authored
Commit to pubkey fix (#68)
* commit_to_pubkey fix * version bump for next release * retrigger build
1 parent 8f69584 commit b9cfa40

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22

33
name = "grin_secp256k1zkp"
4-
version = "0.7.8"
4+
version = "0.7.9"
55
authors = [ "Grin Developers <[email protected]>",
6-
"Dawid Ciężarkiewicz <[email protected]>",
6+
"Dawid Ciężarkiewicz <[email protected]>",
77
"Andrew Poelstra <[email protected]>" ]
88
license = "CC0-1.0"
99
homepage = "https://grin.mw"

src/pedersen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ impl Commitment {
9898
/// Creates from a pubkey
9999
pub fn from_pubkey(secp: &Secp256k1, pk: &key::PublicKey) -> Result<Self, Error> {
100100
unsafe {
101-
let mut commit = Self::blank();
102-
if ffi::secp256k1_pubkey_to_pedersen_commitment(secp.ctx, commit.as_mut_ptr(), &pk.0) == 1 {
103-
Ok(commit)
101+
let mut commit_i = [0; constants::PEDERSEN_COMMITMENT_SIZE_INTERNAL];
102+
if ffi::secp256k1_pubkey_to_pedersen_commitment(secp.ctx, commit_i.as_mut_ptr(), &pk.0 as *const _) == 1 {
103+
Ok(secp.commit_ser(commit_i)?)
104104
} else {
105105
Err(InvalidCommit)
106106
}

0 commit comments

Comments
 (0)