Skip to content

Commit c20a724

Browse files
author
willr-republic
committed
update dependencies
1 parent d1cbc91 commit c20a724

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

Cargo.toml

Lines changed: 7 additions & 7 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.0"
16-
rand = "^0.8.5"
15+
bc-rand = { git = "https://github.com/willrnch/bc-rand-rust.git", rev = "f6c187b211a39f159567fc6981d1676f015f88d7" }
16+
rand = "^0.9.2"
1717
sha2 = "^0.10.6"
1818
hmac = "^0.12.1"
1919
pbkdf2 = "^0.12.1"
2020
hkdf = "^0.12.3"
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
use chacha20poly1305::aead::rand_core::CryptoRngCore;
21
use ed25519_dalek::ed25519::signature::Signer;
32
use ed25519_dalek::SigningKey;
43
use ed25519_dalek::Signature;
4+
use rand::CryptoRng;
55

66
pub const ED25519_PUBLIC_KEY_SIZE: usize = ed25519_dalek::PUBLIC_KEY_LENGTH;
77
pub const ED25519_PRIVATE_KEY_SIZE: usize = ed25519_dalek::SECRET_KEY_LENGTH;
88
pub const ED25519_SIGNATURE_SIZE: usize = ed25519_dalek::SIGNATURE_LENGTH;
99

10-
pub fn ed25519_new_private_key_using(rng: &mut impl CryptoRngCore) -> [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/symmetric_encryption.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use chacha20poly1305::{ChaCha20Poly1305, KeyInit, AeadInPlace};
1+
use chacha20poly1305::{aead::{inout::InOutBuf, Aead, AeadInPlace, Payload}, AeadInOut, ChaCha20Poly1305, KeyInit};
2+
23
use crate::Result;
34

45
pub const SYMMETRIC_KEY_SIZE: usize = 32;
@@ -17,7 +18,7 @@ pub fn aead_chacha20_poly1305_encrypt_with_aad(
1718
) -> (Vec<u8>, [u8; SYMMETRIC_AUTH_SIZE]) {
1819
let cipher = ChaCha20Poly1305::new(key.into());
1920
let mut buffer = plaintext.as_ref().to_vec();
20-
let auth = cipher.encrypt_in_place_detached(nonce.into(), aad.as_ref(), &mut buffer).unwrap();
21+
let auth = cipher.encrypt_inout_detached(nonce.into(), aad.as_ref(), buffer.as_mut_slice().into()).unwrap();
2122
(buffer, auth.to_vec().try_into().unwrap())
2223
}
2324

@@ -49,7 +50,7 @@ pub fn aead_chacha20_poly1305_decrypt_with_aad<D1, D2>(
4950
{
5051
let cipher = ChaCha20Poly1305::new(key.into());
5152
let mut buffer = ciphertext.as_ref().to_vec();
52-
cipher.decrypt_in_place_detached(nonce.into(), aad.as_ref(), &mut buffer, auth.into())?;
53+
cipher.decrypt_inout_detached(nonce.into(), aad.as_ref(), buffer.as_mut_slice().into(), auth.into())?;
5354
Ok(buffer)
5455
}
5556

0 commit comments

Comments
 (0)