|
|
| cbc_t (cbc_t &&) noexcept=default |
| |
|
| cbc_t (const crypto::aes_t &key, bool padding=true) |
| |
| int | encrypt (const std::string_view &plaintext, std::uint8_t *cipher, aes_t *iv) |
| | Encrypts the plaintext using AES CBC mode. length of cipher must be at least: round_to_pkcs7_padded(plaintext.size())
|
| |
|
cbc_t & | operator= (cbc_t &&) noexcept=default |
| |
◆ encrypt()
| int crypto::cipher::cbc_t::encrypt |
( |
const std::string_view & | plaintext, |
|
|
std::uint8_t * | cipher, |
|
|
aes_t * | iv ) |
Encrypts the plaintext using AES CBC mode. length of cipher must be at least: round_to_pkcs7_padded(plaintext.size())
- Parameters
-
| plaintext | The plaintext data to be encrypted. |
| cipher | The buffer where the resulting ciphertext will be written. |
| iv | The initialization vector to be used for the encryption. |
- Returns
- The total length of the ciphertext written into cipher. Returns -1 in case of an error.
This function encrypts the given plaintext using the AES key in CBC mode. The initialization vector (IV) is also provided. The function handles the creation and initialization of the encryption context, and manages the encryption process. The resulting ciphertext is written into the cipher buffer.
The documentation for this class was generated from the following files: