#include <cipheraead.hpp>
|
| CipherContextAEAD (const CipherContextAEAD &)=delete |
|
CipherContextAEAD & | operator= (const CipherContextAEAD &)=delete |
|
| CipherContextAEAD (CipherContextAEAD &&other) noexcept |
|
CipherContextAEAD & | operator= (CipherContextAEAD &&other) |
|
| OPENVPN_EXCEPTION (openssl_gcm_error) |
|
bool constexpr | requires_authtag_at_end () |
|
| CipherContextAEAD ()=default |
|
| ~CipherContextAEAD () |
|
void | init (SSLLib::Ctx libctx, const CryptoAlgs::Type alg, const unsigned char *key, const unsigned int keysize, const int mode) |
|
void | encrypt (const unsigned char *input, unsigned char *output, size_t length, const unsigned char *iv, unsigned char *tag, const unsigned char *ad, size_t ad_len) |
|
const Crypto::AEADUsageLimit & | get_usage_limit () |
|
bool | decrypt (const unsigned char *input, unsigned char *output, size_t length, const unsigned char *iv, const unsigned char *tag, const unsigned char *ad, size_t ad_len) |
|
bool | is_initialized () const |
|
Definition at line 30 of file cipheraead.hpp.
◆ CIPHER_unique_ptr
◆ evp_cipher_type
◆ anonymous enum
Enumerator |
---|
MODE_UNDEF | |
ENCRYPT | |
DECRYPT | |
Definition at line 62 of file cipheraead.hpp.
◆ anonymous enum
◆ CipherContextAEAD() [1/3]
openvpn::OpenSSLCrypto::CipherContextAEAD::CipherContextAEAD |
( |
const CipherContextAEAD & |
| ) |
|
|
delete |
◆ CipherContextAEAD() [2/3]
openvpn::OpenSSLCrypto::CipherContextAEAD::CipherContextAEAD |
( |
CipherContextAEAD && |
other | ) |
|
|
inlinenoexcept |
◆ CipherContextAEAD() [3/3]
openvpn::OpenSSLCrypto::CipherContextAEAD::CipherContextAEAD |
( |
| ) |
|
|
default |
◆ ~CipherContextAEAD()
openvpn::OpenSSLCrypto::CipherContextAEAD::~CipherContextAEAD |
( |
| ) |
|
|
inline |
◆ check_initialized()
void openvpn::OpenSSLCrypto::CipherContextAEAD::check_initialized |
( |
| ) |
const |
|
inlineprivate |
◆ cipher_type()
◆ decrypt()
bool openvpn::OpenSSLCrypto::CipherContextAEAD::decrypt |
( |
const unsigned char * |
input, |
|
|
unsigned char * |
output, |
|
|
size_t |
length, |
|
|
const unsigned char * |
iv, |
|
|
const unsigned char * |
tag, |
|
|
const unsigned char * |
ad, |
|
|
size_t |
ad_len |
|
) |
| |
|
inline |
Decrypts AEAD encrypted data. Note that if tag is the nullptr the tag is assumed to be part of input and at the end of the input. The length parameter of input includes the tag in this case
- Parameters
-
input | Input data to decrypt |
output | Where decrypted data will be written to |
iv | IV of the encrypted data. |
length | length the of the data, this includes the tag at the end if tag is not a nullptr. |
ad | start of the additional data |
ad_len | length of the additional data |
tag | location of the tag to use or nullptr if at the end of the input |
This API of OpenSSL does not modify the tag it is given but the function signature always expects a modifiable tag, so we have to const cast it to get around this restriction
Definition at line 202 of file cipheraead.hpp.
◆ encrypt()
void openvpn::OpenSSLCrypto::CipherContextAEAD::encrypt |
( |
const unsigned char * |
input, |
|
|
unsigned char * |
output, |
|
|
size_t |
length, |
|
|
const unsigned char * |
iv, |
|
|
unsigned char * |
tag, |
|
|
const unsigned char * |
ad, |
|
|
size_t |
ad_len |
|
) |
| |
|
inline |
◆ free_cipher_context()
void openvpn::OpenSSLCrypto::CipherContextAEAD::free_cipher_context |
( |
| ) |
|
|
inlineprivate |
◆ get_usage_limit()
Returns the AEAD usage limit associated with this AEAD cipher instance to check the limits
Definition at line 183 of file cipheraead.hpp.
◆ init()
void openvpn::OpenSSLCrypto::CipherContextAEAD::init |
( |
SSLLib::Ctx |
libctx, |
|
|
const CryptoAlgs::Type |
alg, |
|
|
const unsigned char * |
key, |
|
|
const unsigned int |
keysize, |
|
|
const int |
mode |
|
) |
| |
|
inline |
◆ is_initialized()
bool openvpn::OpenSSLCrypto::CipherContextAEAD::is_initialized |
( |
| ) |
const |
|
inline |
◆ is_supported()
◆ OPENVPN_EXCEPTION()
openvpn::OpenSSLCrypto::CipherContextAEAD::OPENVPN_EXCEPTION |
( |
openssl_gcm_error |
| ) |
|
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ requires_authtag_at_end()
bool constexpr openvpn::OpenSSLCrypto::CipherContextAEAD::requires_authtag_at_end |
( |
| ) |
|
|
inlineconstexpr |
◆ aead_usage_limit_
◆ ctx
EVP_CIPHER_CTX* openvpn::OpenSSLCrypto::CipherContextAEAD::ctx = nullptr |
|
private |
The documentation for this class was generated from the following file: