pub struct AesKey(/* private fields */);
Expand description
The key used to encrypt or decrypt cipher blocks.
Implementations§
source§impl AesKey
impl AesKey
sourcepub fn new_encrypt(key: &[u8]) -> Result<AesKey, KeyError>
pub fn new_encrypt(key: &[u8]) -> Result<AesKey, KeyError>
Prepares a key for encryption.
Failure
Returns an error if the key is not 128, 192, or 256 bits.
This corresponds to AES_set_encrypt_key
.
sourcepub fn new_decrypt(key: &[u8]) -> Result<AesKey, KeyError>
pub fn new_decrypt(key: &[u8]) -> Result<AesKey, KeyError>
Prepares a key for decryption.
Failure
Returns an error if the key is not 128, 192, or 256 bits.
This corresponds to AES_set_decrypt_key
.
Auto Trait Implementations§
impl RefUnwindSafe for AesKey
impl Send for AesKey
impl Sync for AesKey
impl Unpin for AesKey
impl UnwindSafe for AesKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more