-
Notifications
You must be signed in to change notification settings - Fork 142
Closed as not planned
Closed as not planned
Copy link
Description
Hello,
I started to get problems using Aes256::new() from aes crate recently.
Trying to use Aes256 with a key of type cipher::{generic_array::GenericArray like this:
use aes::Aes256;
use cipher::{generic_array::GenericArray, BlockEncrypt, KeyInit};
Aes256::new(GenericArray::from_slice(&full_key));...now gives error:
error: use of deprecated struct `cipher::generic_array::GenericArray`: please upgrade to generic-array 1.x
|
6 | use cipher::{generic_array::GenericArray, BlockEncrypt, KeyInit};
| ^^^^^^^^^^^^
|
= note: `-D deprecated` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(deprecated)]`
(I use latest version of aes and cipher crates, i.e., v0.8.4 and v0.4.4, respectively)
However, if I try to follow your instruction "please upgrade to generic-array 1.x" by explicitly adding generic_array version 1.3.3 to the dependencies in Cargo.toml and using generic_array::GenericArray like this:
use aes::Aes256;
use cipher::{BlockEncrypt, KeyInit};
use generic_array::GenericArray;
Aes256::new(GenericArray::from_slice(&full_key));...we get this error:
error[E0308]: mismatched types
|
40 | let cipher = Aes256::new(GenericArray::from_slice(&full_key));
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&GenericArray<u8, UInt<..., ...>>`, found `&GenericArray<u8, _>`
| |
| arguments to this function are incorrect
|
note: two different versions of crate `generic_array` are being used; two types coming from two different versions of the same crate are different types even if they look the same
--> C:\Users\user\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\generic-array-1.3.3\src\lib.rs:470:1
What exactly am I supposed to do here? 😕
(And yes, I know that I could simply add an #[allow()] to ignore the depreciation warning, but that's not really nice 😟)
Thanks for any advice!
Regards.
Metadata
Metadata
Assignees
Labels
No labels