Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libsecp256k1 dep to 0.3.0 #1258

Merged
merged 3 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protobuf = "2.3"
quick-error = "1.2"
rand = "0.6"
rw-stream-sink = { version = "0.1.1", path = "../misc/rw-stream-sink" }
libsecp256k1 = { version = "0.2.2", optional = true }
libsecp256k1 = { version = "0.3.0", optional = true }
sha2 = "0.8.0"
smallvec = "0.6"
tokio-executor = "0.1.4"
Expand Down Expand Up @@ -56,4 +56,3 @@ tokio-mock-task = "0.1"
[features]
default = ["secp256k1"]
secp256k1 = ["libsecp256k1"]

5 changes: 1 addition & 4 deletions core/src/identity/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ impl SecretKey {
pub fn sign_hash(&self, msg: &[u8]) -> Result<Vec<u8>, SigningError> {
let m = Message::parse_slice(msg)
.map_err(|_| SigningError::new("failed to parse secp256k1 digest"))?;
secp256k1::sign(&m, &self.0)
.map(|s| s.0.serialize_der().as_ref().into())
.map_err(|_| SigningError::new("failed to create secp256k1 signature"))
Ok(secp256k1::sign(&m, &self.0).0.serialize_der().as_ref().into())
}
}

Expand Down Expand Up @@ -190,4 +188,3 @@ mod tests {
assert_eq!(sk_bytes, [0; 32]);
}
}