Skip to content

Commit

Permalink
Downgrade secp256k1 to 0.27.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoquick committed Oct 31, 2023
1 parent 720a6e1 commit eb0c38a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "carbonado"
version = "0.3.4"
version = "0.3.5"
edition = "2021"
license = "MIT"
description = "An apocalypse-resistant data storage format for the truly paranoid."
Expand All @@ -23,7 +23,7 @@ libsecp256k1 = { version = "0.7.1", features = ["std"] }
log = "0.4.19"
nom = "7.1.3"
pretty_env_logger = "0.5.0"
secp256k1 = { version = "0.28.0", features = [
secp256k1 = { version = "0.27.0", features = [
"global-context",
"rand-std",
"serde",
Expand Down
10 changes: 5 additions & 5 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl TryFrom<&File> for Header {
let signature = Signature::from_compact(&signature)?;

// Verify hash against signature
signature.verify(&Message::from_digest_slice(&hash)?, &pubkey)?;
signature.verify(&Message::from_slice(&hash)?, &pubkey)?;

let hash = bao::Hash::try_from(hash)?;

Expand Down Expand Up @@ -132,7 +132,7 @@ impl TryFrom<&[u8]> for Header {
let signature = Signature::from_compact(signature)?;

// Verify hash against signature
signature.verify(&Message::from_digest_slice(hash)?, &pubkey)?;
signature.verify(&Message::from_slice(hash)?, &pubkey)?;

let hash: [u8; 32] = hash[0..32].try_into()?;
let hash = bao::Hash::try_from(hash)?;
Expand Down Expand Up @@ -180,7 +180,7 @@ impl TryFrom<Bytes> for Header {
let signature = Signature::from_compact(signature)?;

// Verify hash against signature
signature.verify(&Message::from_digest_slice(hash)?, &pubkey)?;
signature.verify(&Message::from_slice(hash)?, &pubkey)?;

let hash: [u8; 32] = hash[0..32].try_into()?;
let hash = bao::Hash::try_from(hash)?;
Expand Down Expand Up @@ -228,7 +228,7 @@ impl TryFrom<&Bytes> for Header {
let signature = Signature::from_compact(signature)?;

// Verify hash against signature
signature.verify(&Message::from_digest_slice(hash)?, &pubkey)?;
signature.verify(&Message::from_slice(hash)?, &pubkey)?;

let hash: [u8; 32] = hash[0..32].try_into()?;
let hash = bao::Hash::try_from(hash)?;
Expand Down Expand Up @@ -266,7 +266,7 @@ impl Header {
padding_len: u32,
metadata: Option<[u8; 8]>,
) -> Result<Self, CarbonadoError> {
let msg = Message::from_digest_slice(hash)?;
let msg = Message::from_slice(hash)?;
let pubkey = PublicKey::from_slice(pk)?;
let signature = SecretKey::from_slice(sk)?.sign_ecdsa(msg);
let hash = decode_bao_hash(hash)?;
Expand Down

0 comments on commit eb0c38a

Please sign in to comment.