|
Sunshine master
Self-hosted game stream host for Moonlight.
|
AES-CBC cipher helper used for block-mode encryption and decryption. More...
#include <src/crypto.h>
Public Member Functions | |
| cbc_t (cbc_t &&) noexcept=default | |
| Construct an AES-CBC cipher helper with key material and IV state. | |
| cbc_t (const crypto::aes_t &key, bool padding=true) | |
| Construct an AES-CBC cipher helper with key material and IV state. | |
| 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 |
| Assign state from another instance while preserving ownership semantics. | |
Additional Inherited Members | |
Public Attributes inherited from crypto::cipher::cipher_t | |
| cipher_ctx_t | decrypt_ctx |
| Decrypt ctx. | |
| cipher_ctx_t | encrypt_ctx |
| Encrypt ctx. | |
| aes_t | key |
| AES key used by the cipher context. | |
| bool | padding |
| Enables block padding for the cipher. | |
AES-CBC cipher helper used for block-mode encryption and decryption.
| crypto::cipher::cbc_t::cbc_t | ( | const crypto::aes_t & | key, |
| bool | padding = true ) |
Construct an AES-CBC cipher helper with key material and IV state.
| key | AES key material used to initialize the cipher. |
| padding | Whether the cipher should use block padding. |
| 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())
| 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. |
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.
Assign state from another instance while preserving ownership semantics.