|
Hermes 0.7.0
Linux game streaming host
|
Public Member Functions | |
| gcm_t (gcm_t &&) noexcept=default | |
| gcm_t & | operator= (gcm_t &&) noexcept=default |
| gcm_t (const crypto::aes_t &key, bool padding=true) | |
| int | encrypt (const std::string_view &plaintext, std::uint8_t *tag, std::uint8_t *ciphertext, aes_t *iv) |
| Encrypts the plaintext using AES GCM mode. | |
| int | encrypt (const std::string_view &plaintext, std::uint8_t *tagged_cipher, aes_t *iv) |
| Encrypts the plaintext using AES GCM mode. length of cipher must be at least: round_to_pkcs7_padded(plaintext.size()) + crypto::cipher::tag_size. | |
| int | decrypt (const std::string_view &cipher, std::vector< std::uint8_t > &plaintext, aes_t *iv) |
Additional Inherited Members | |
| Public Attributes inherited from crypto::cipher::cipher_t | |
| cipher_ctx_t | decrypt_ctx |
| cipher_ctx_t | encrypt_ctx |
| aes_t | key |
| bool | padding |
| crypto::cipher::gcm_t::gcm_t | ( | const crypto::aes_t & | key, |
| bool | padding = true ) |
Definition at line 342 of file crypto.cpp.
| int crypto::cipher::gcm_t::decrypt | ( | const std::string_view & | cipher, |
| std::vector< std::uint8_t > & | plaintext, | ||
| aes_t * | iv ) |
Definition at line 145 of file crypto.cpp.
| int crypto::cipher::gcm_t::encrypt | ( | const std::string_view & | plaintext, |
| std::uint8_t * | tag, | ||
| std::uint8_t * | ciphertext, | ||
| aes_t * | iv ) |
Encrypts the plaintext using AES GCM mode.
| plaintext | The plaintext data to be encrypted. |
| tag | The buffer where the GCM tag will be written. |
| ciphertext | 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 GCM 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 and the GCM tag are written into the tagged_cipher buffer.
Definition at line 184 of file crypto.cpp.
| int crypto::cipher::gcm_t::encrypt | ( | const std::string_view & | plaintext, |
| std::uint8_t * | tagged_cipher, | ||
| aes_t * | iv ) |
Encrypts the plaintext using AES GCM mode. length of cipher must be at least: round_to_pkcs7_padded(plaintext.size()) + crypto::cipher::tag_size.
| plaintext | The plaintext data to be encrypted. |
| tagged_cipher | The buffer where the resulting ciphertext and GCM tag will be written. |
| iv | The initialization vector to be used for the encryption. |
Definition at line 214 of file crypto.cpp.