Skip to content

Commit e7735f1

Browse files
committed
Aligned to dependencies.
1 parent 63e5b4b commit e7735f1

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

Cargo.toml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bc-crypto"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
edition = "2021"
55
description = "A uniform API for cryptographic primitives used in Blockchain Commons projects"
66
authors = ["Blockchain Commons"]
@@ -12,19 +12,20 @@ categories = ["cryptography"]
1212
documentation = "https://docs.rs/bc-crypto"
1313

1414
[dependencies]
15-
bc-rand = "0.1"
16-
sha2 = "0.10.6"
17-
hmac = "0.12.1"
18-
pbkdf2 = "0.12.1"
19-
hkdf = "0.12.3"
20-
crc32fast = "1.3.2"
21-
chacha20poly1305 = "0.10.1"
22-
#k256 = {version = "0.13.1", default-features = false, features = ["ecdsa", "arithmetic"]}
23-
secp256k1 = "0.27.0"
15+
bc-rand = "^0.1.0"
16+
rand_core = "0.6.4"
17+
sha2 = "^0.10.6"
18+
hmac = "^0.12.1"
19+
pbkdf2 = "^0.12.1"
20+
hkdf = "^0.12.3"
21+
crc32fast = "^1.3.2"
22+
chacha20poly1305 = "^0.10.1"
23+
#k256 = {version = "^0.13.1", default-features = false, features = ["ecdsa", "arithmetic"]}
24+
secp256k1 = "^0.27.0"
2425
x25519-dalek = {version = "2.0.0-rc.2", features = ["static_secrets"]}
25-
thiserror = "1.0.48"
26+
thiserror = "^1.0.48"
2627

2728
[dev-dependencies]
28-
hex-literal = "0.4.1"
29-
hex = "0.4.3"
30-
version-sync = "0.9"
29+
hex-literal = "^0.4.1"
30+
hex = "^0.4.3"
31+
version-sync = "^0.9"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
```toml
2929
[dependencies]
30-
bc-crypto = "0.3.3"
30+
bc-crypto = "0.3.4"
3131
```
3232

3333
## Related Projects

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc(html_root_url = "https://docs.rs/bc-crypto/0.3.3")]
1+
#![doc(html_root_url = "https://docs.rs/bc-crypto/0.3.4")]
22
#![warn(rust_2018_idioms)]
33

44
//! # Introduction
@@ -24,7 +24,7 @@
2424
//!
2525
//! ```toml
2626
//! [dependencies]
27-
//! bc-crypto = "0.3.3"
27+
//! bc-crypto = "0.3.4"
2828
//! ```
2929
3030
pub const CRC32_SIZE: usize = 4;

src/schnorr_signing.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bc_rand::{SecureRandomNumberGenerator, RandomNumberGenerator};
1+
use bc_rand::{ RandomNumberGenerator, SecureRandomNumberGenerator};
22
use secp256k1::{Secp256k1, SecretKey, Message, KeyPair, schnorr::Signature, XOnlyPublicKey};
33
use crate::{hash::sha256, SCHNORR_SIGNATURE_SIZE, SCHNORR_PUBLIC_KEY_SIZE, ECDSA_PRIVATE_KEY_SIZE};
44

@@ -20,7 +20,12 @@ pub fn schnorr_sign(ecdsa_private_key: &[u8; ECDSA_PRIVATE_KEY_SIZE], message: i
2020

2121
/// Schnorr signs the given message using the given private key, user-defined tag,
2222
/// and random number generator.
23-
pub fn schnorr_sign_using(ecdsa_private_key: &[u8; ECDSA_PRIVATE_KEY_SIZE], message: impl AsRef<[u8]>, tag: impl AsRef<[u8]>, rng: &mut impl RandomNumberGenerator) -> [u8; SCHNORR_SIGNATURE_SIZE] {
23+
pub fn schnorr_sign_using(
24+
ecdsa_private_key: &[u8; ECDSA_PRIVATE_KEY_SIZE],
25+
message: impl AsRef<[u8]>,
26+
tag: impl AsRef<[u8]>,
27+
rng: &mut dyn RandomNumberGenerator,
28+
) -> [u8; SCHNORR_SIGNATURE_SIZE] {
2429
let mut secp = Secp256k1::new();
2530
let seed: [u8; 32] = rng.random_data(32).try_into().unwrap();
2631
secp.seeded_randomize(&seed);

0 commit comments

Comments
 (0)