Skip to content

Commit 12b09dd

Browse files
committed
update dependencies
1 parent e8d2b14 commit 12b09dd

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ keywords = ["cryptography"]
1212
categories = ["cryptography"] # https://crates.io/category_slugs
1313

1414
[dependencies]
15-
bc-rand = "^0.4.1"
16-
rand = "^0.8.5"
17-
sha2 = "^0.10.6"
18-
hmac = "^0.12.1"
19-
pbkdf2 = "^0.12.1"
20-
hkdf = "^0.12.3"
15+
bc-rand = { git = "https://github.com/willrnch/bc-rand-rust.git", rev = "4013ca45388a9bc1c8ca822ba09b551886857e31" }
16+
rand = "^0.9.2"
17+
sha2 = "0.11.0-rc.2"
18+
hmac = "0.13.0-rc.1"
19+
pbkdf2 = "0.13.0-rc.1"
20+
hkdf = "0.13.0-rc.1"
2121
crc32fast = "^1.3.2"
22-
chacha20poly1305 = "^0.10.1"
22+
chacha20poly1305 = "0.11.0-rc.1"
2323
secp256k1 = "^0.30.0"
24-
x25519-dalek = { version = "2.0.0-rc.2", features = ["static_secrets"] }
24+
x25519-dalek = { version = "3.0.0-pre.1", features = ["static_secrets"] }
2525
thiserror = "^2.0"
2626
hex = "^0.4.3"
27-
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }
27+
ed25519-dalek = { version = "3.0.0-pre.1", features = ["rand_core"] }
2828
scrypt = { version = "0.11.0", default-features = false }
29-
argon2 = "0.5.3"
29+
argon2 = "0.6.0-rc.1"
3030

3131
[dev-dependencies]
32-
hex-literal = "^0.4.1"
32+
hex-literal = "^1.0.0"
3333
hex = "^0.4.3"
3434
version-sync = "^0.9"

src/ed25519_signing.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
use chacha20poly1305::aead::rand_core::CryptoRngCore;
2-
use ed25519_dalek::{Signature, SigningKey, ed25519::signature::Signer};
1+
use ed25519_dalek::ed25519::signature::Signer;
2+
use ed25519_dalek::SigningKey;
3+
use ed25519_dalek::Signature;
4+
use rand::CryptoRng;
35

46
pub const ED25519_PUBLIC_KEY_SIZE: usize = ed25519_dalek::PUBLIC_KEY_LENGTH;
57
pub const ED25519_PRIVATE_KEY_SIZE: usize = ed25519_dalek::SECRET_KEY_LENGTH;
68
pub const ED25519_SIGNATURE_SIZE: usize = ed25519_dalek::SIGNATURE_LENGTH;
79

8-
pub fn ed25519_new_private_key_using(
9-
rng: &mut impl CryptoRngCore,
10-
) -> [u8; ED25519_PRIVATE_KEY_SIZE] {
10+
pub fn ed25519_new_private_key_using(rng: &mut impl CryptoRng) -> [u8; ED25519_PRIVATE_KEY_SIZE] {
1111
SigningKey::generate(rng).to_bytes()
1212
}
1313

src/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use hkdf::Hkdf;
2-
use hmac::{Hmac, Mac};
2+
use hmac::{Hmac, KeyInit, Mac};
33
use pbkdf2::pbkdf2_hmac;
44
use sha2::{Digest, Sha256, Sha512};
55

src/symmetric_encryption.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use chacha20poly1305::{AeadInPlace, ChaCha20Poly1305, KeyInit};
1+
use chacha20poly1305::{AeadInOut, ChaCha20Poly1305, KeyInit};
22

33
use crate::Result;
44

@@ -19,7 +19,11 @@ pub fn aead_chacha20_poly1305_encrypt_with_aad(
1919
let cipher = ChaCha20Poly1305::new(key.into());
2020
let mut buffer = plaintext.as_ref().to_vec();
2121
let auth = cipher
22-
.encrypt_in_place_detached(nonce.into(), aad.as_ref(), &mut buffer)
22+
.encrypt_inout_detached(
23+
nonce.into(),
24+
aad.as_ref(),
25+
buffer.as_mut_slice().into()
26+
)
2327
.unwrap();
2428
(buffer, auth.to_vec().try_into().unwrap())
2529
}
@@ -52,11 +56,11 @@ where
5256
{
5357
let cipher = ChaCha20Poly1305::new(key.into());
5458
let mut buffer = ciphertext.as_ref().to_vec();
55-
cipher.decrypt_in_place_detached(
59+
cipher.decrypt_inout_detached(
5660
nonce.into(),
5761
aad.as_ref(),
58-
&mut buffer,
59-
auth.into(),
62+
buffer.as_mut_slice().into(),
63+
auth.into()
6064
)?;
6165
Ok(buffer)
6266
}

0 commit comments

Comments
 (0)