pub struct CipherAES {
pub infos: CryptographicInformation,
pub sharedsecret: Vec<u8>,
}Expand description
Represents the AES cipher for encryption and decryption processes. It holds cryptographic information and a shared secret for operations.
Fields§
§infos: CryptographicInformationImplementations§
Source§impl CipherAES
Provides AES encryption functionality, handling cryptographic information and shared secrets.
impl CipherAES
Provides AES encryption functionality, handling cryptographic information and shared secrets.
Sourcepub fn new(infos: CryptographicInformation) -> Self
pub fn new(infos: CryptographicInformation) -> Self
Sourcepub fn get_data(&self) -> Result<Vec<u8>, CryptError>
pub fn get_data(&self) -> Result<Vec<u8>, CryptError>
Retrieves the current data intended for encryption or decryption.
§Returns
The data as a vector of bytes (Vec<u8>) or a CryptError if the content cannot be accessed.
Retrieves the shared secret key.
§Returns
A reference to the shared secret as a byte vector or a CryptError if it cannot be accessed.
Sourcepub fn aes_cbc_encrypt(&mut self) -> Result<Vec<u8>, CryptError>
pub fn aes_cbc_encrypt(&mut self) -> Result<Vec<u8>, CryptError>
Encrypts the provided data using AES-256 in CBC mode. This function securely generates an IV for each encryption operation.
Sourcepub fn aes_cbc_decrypt(
&mut self,
ciphertext: &[u8],
) -> Result<Vec<u8>, CryptError>
pub fn aes_cbc_decrypt( &mut self, ciphertext: &[u8], ) -> Result<Vec<u8>, CryptError>
Decrypts data encrypted using AES-256 in CBC mode. Assumes the IV is prepended to the ciphertext.
Trait Implementations§
Source§impl CryptographicFunctions for CipherAES
impl CryptographicFunctions for CipherAES
impl StructuralPartialEq for CipherAES
Auto Trait Implementations§
impl Freeze for CipherAES
impl RefUnwindSafe for CipherAES
impl Send for CipherAES
impl Sync for CipherAES
impl Unpin for CipherAES
impl UnwindSafe for CipherAES
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