Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit bd69030

Browse files
tarcierimikelodder7
authored andcommitted
Upgrade aead/aes/aes-gcm/block-modes/chacha20poly1305 crates
Updates the following crates: - `aead` => v0.3 - `aes` => v0.4 - `aes-gcm` => v0.6.0 - `block-modes` => v0.4 - `chacha20poly1305` => v0.5.0 Some `aead` v0.3 update notes:: - `NewAead` now borrows the key, preventing unnecessary copies - `Aead` and `AeadInPlace` were split into two different traits. This lets you get rid of the stubbed out `*_in_place` methods on your `Aead` impls (introduced in #91) More release notes here: RustCrypto/traits#174 The other crate updates use the new traits and also upgrade `generic-array` to v0.14, which has MSRV 1.41+. Signed-off-by: Tony Arcieri <[email protected]>
1 parent 9a8a384 commit bd69030

File tree

11 files changed

+94
-255
lines changed

11 files changed

+94
-255
lines changed

Cargo.lock

Lines changed: 52 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libursa/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ x25519 = ["arrayref", "curve25519-dalek/std", "curve25519-dalek/u64_backend", "h
106106
x25519_asm = ["arrayref", "curve25519-dalek/nightly", "curve25519-dalek/avx2_backend", "hex", "rand", "rand_chacha", "sha2/asm", "x25519-dalek/nightly", "x25519-dalek/u64_backend", "zeroize"]
107107

108108
[dependencies]
109-
aead = { version = "0.2", optional = true }
110-
aes = { version = "0.3", optional = true }
111-
aes-gcm = { version = "0.3.0", optional = true }
109+
aead = { version = "0.3", optional = true }
110+
aes = { version = "0.4", optional = true }
111+
aes-gcm = { version = "0.6.0", optional = true }
112112
amcl = { version = "0.2", optional = true, default-features = false, features = ["bn254", "secp256k1"]}
113113
amcl_wrapper = {version = "0.3.5", features = ["bls381"], optional = true }
114114
arrayref = { version = "0.3.5", optional = true }
115115
blake2 = { version = "0.8", default-features = false, optional = true }
116-
block-modes = { version = "0.3", optional = true }
116+
block-modes = { version = "0.4", optional = true }
117117
block-padding = { version = "0.1", optional = true }
118118
clear_on_drop = { version = "0.2.3", optional = true }
119119
console_error_panic_hook = { version = "0.1.5", optional = true }
@@ -137,7 +137,7 @@ openssl = { version = "0.10", optional = true }
137137
# TODO: Find out if the wasm-bindgen feature can be made dependent on our own wasm feature
138138
rand = { version = "=0.6.5", features = ["wasm-bindgen"], optional = true }
139139
rand_chacha = { version = "=0.1.1", optional = true }
140-
rustchacha20poly1305 = { version = "0.4.1", package = "chacha20poly1305", optional = true }
140+
rustchacha20poly1305 = { version = "0.5.0", package = "chacha20poly1305", optional = true }
141141
rustlibsecp256k1 = { version = "0.3", package = "libsecp256k1", optional = true }
142142
secp256k1 = { version = "0.17", optional = true, features = ["rand", "serde"]}
143143
serde = { version = "1.0", features = ["derive"], optional = true}

libursa/src/encryption/symm/aescbc.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ macro_rules! aes_cbc_hmac_impl {
3535
impl NewAead for $name {
3636
type KeySize = $keysize;
3737

38-
fn new(key: GenericArray<u8, $keysize>) -> Self {
39-
Self { key }
38+
fn new(key: &GenericArray<u8, $keysize>) -> Self {
39+
Self { key: *key }
4040
}
4141
}
4242

@@ -99,27 +99,6 @@ macro_rules! aes_cbc_hmac_impl {
9999
Err(Error)
100100
}
101101
}
102-
103-
// TODO
104-
fn encrypt_in_place_detached(
105-
&self,
106-
_nonce: &GenericArray<u8, Self::NonceSize>,
107-
_associated_data: &[u8],
108-
_buffer: &mut [u8],
109-
) -> Result<GenericArray<u8, Self::TagSize>, Error> {
110-
unimplemented!();
111-
}
112-
113-
// TODO
114-
fn decrypt_in_place_detached(
115-
&self,
116-
_nonce: &GenericArray<u8, Self::NonceSize>,
117-
_associated_data: &[u8],
118-
_buffer: &mut [u8],
119-
_tag: &GenericArray<u8, Self::TagSize>,
120-
) -> Result<(), Error> {
121-
unimplemented!();
122-
}
123102
}
124103

125104
default_impl!($name);

libursa/src/encryption/symm/aescbc_asm.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ macro_rules! aes_cbc_hmac_impl {
3131
impl NewAead for $name {
3232
type KeySize = $keysize;
3333

34-
fn new(key: GenericArray<u8, Self::KeySize>) -> Self {
35-
Self { key }
34+
fn new(key: &GenericArray<u8, Self::KeySize>) -> Self {
35+
Self { key: *key }
3636
}
3737
}
3838

@@ -102,27 +102,6 @@ macro_rules! aes_cbc_hmac_impl {
102102
Err(Error)
103103
}
104104
}
105-
106-
// TODO
107-
fn encrypt_in_place_detached(
108-
&self,
109-
_nonce: &GenericArray<u8, Self::NonceSize>,
110-
_associated_data: &[u8],
111-
_buffer: &mut [u8],
112-
) -> Result<GenericArray<u8, Self::TagSize>, Error> {
113-
unimplemented!();
114-
}
115-
116-
// TODO
117-
fn decrypt_in_place_detached(
118-
&self,
119-
_nonce: &GenericArray<u8, Self::NonceSize>,
120-
_associated_data: &[u8],
121-
_buffer: &mut [u8],
122-
_tag: &GenericArray<u8, Self::TagSize>,
123-
) -> Result<(), Error> {
124-
unimplemented!();
125-
}
126105
}
127106

128107
default_impl!($name);

0 commit comments

Comments
 (0)