pub struct AesKey(_);
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
.