OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::MbedTLSCrypto::CipherContext Class Reference

#include <cipher.hpp>

Inheritance diagram for openvpn::MbedTLSCrypto::CipherContext:
[legend]
Collaboration diagram for openvpn::MbedTLSCrypto::CipherContext:
[legend]

Public Types

enum  { MODE_UNDEF = MBEDTLS_OPERATION_NONE , ENCRYPT = MBEDTLS_ENCRYPT , DECRYPT = MBEDTLS_DECRYPT }
 
enum  { MAX_IV_LENGTH = MBEDTLS_MAX_IV_LENGTH , CIPH_CBC_MODE = MBEDTLS_MODE_CBC }
 
- Public Types inherited from openvpn::MbedTLSCrypto::CipherContextCommon
enum  { MODE_UNDEF = MBEDTLS_OPERATION_NONE , ENCRYPT = MBEDTLS_ENCRYPT , DECRYPT = MBEDTLS_DECRYPT }
 

Public Member Functions

 OPENVPN_EXCEPTION (mbedtls_cipher_error)
 
 CipherContext ()=default
 
 ~CipherContext ()
 
void init (SSLLib::Ctx libctx, const CryptoAlgs::Type alg, const unsigned char *key, const int mode)
 
void reset (const unsigned char *iv)
 
bool update (unsigned char *out, const size_t max_out_size, const unsigned char *in, const size_t in_size, size_t &out_acc)
 
bool final (unsigned char *out, const size_t max_out_size, size_t &out_acc)
 
bool is_initialized () const
 
size_t iv_length () const
 
size_t block_size () const
 
int cipher_mode () const
 
- Public Member Functions inherited from openvpn::MbedTLSCrypto::CipherContextCommon
 OPENVPN_SIMPLE_EXCEPTION (mbedtls_cipher_mode_error)
 
 OPENVPN_SIMPLE_EXCEPTION (mbedtls_cipher_uninitialized)
 
bool constexpr requires_authtag_at_end ()
 

Static Public Member Functions

static bool is_supported (SSLLib::Ctx libctx, const CryptoAlgs::Type alg)
 

Private Member Functions

 CipherContext (const CipherContext &)=delete
 
CipherContextoperator= (const CipherContext &)=delete
 

Static Private Member Functions

static const mbedtls_cipher_info_t * cipher_type (const CryptoAlgs::Type alg)
 

Additional Inherited Members

- Protected Member Functions inherited from openvpn::MbedTLSCrypto::CipherContextCommon
 CipherContextCommon ()=default
 
virtual ~CipherContextCommon ()
 
 CipherContextCommon (const CipherContextCommon &other)=delete
 
CipherContextCommonoperator= (const CipherContextCommon &other)=delete
 
 CipherContextCommon (CipherContextCommon &&other) noexcept
 
CipherContextCommonoperator= (CipherContextCommon &&other)
 
void erase ()
 
void check_initialized () const
 
- Static Protected Member Functions inherited from openvpn::MbedTLSCrypto::CipherContextCommon
static void check_mode (int mode)
 
- Protected Attributes inherited from openvpn::MbedTLSCrypto::CipherContextCommon
bool initialized = false
 
mbedtls_cipher_context_t ctx
 

Detailed Description

Definition at line 107 of file cipher.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODE_UNDEF 
ENCRYPT 
DECRYPT 

Definition at line 117 of file cipher.hpp.

◆ anonymous enum

anonymous enum
Enumerator
MAX_IV_LENGTH 
CIPH_CBC_MODE 

Definition at line 125 of file cipher.hpp.

Constructor & Destructor Documentation

◆ CipherContext() [1/2]

openvpn::MbedTLSCrypto::CipherContext::CipherContext ( const CipherContext )
privatedelete

◆ CipherContext() [2/2]

openvpn::MbedTLSCrypto::CipherContext::CipherContext ( )
default

◆ ~CipherContext()

openvpn::MbedTLSCrypto::CipherContext::~CipherContext ( )
inline

Definition at line 133 of file cipher.hpp.

Member Function Documentation

◆ block_size()

size_t openvpn::MbedTLSCrypto::CipherContext::block_size ( ) const
inline

Definition at line 218 of file cipher.hpp.

◆ cipher_mode()

int openvpn::MbedTLSCrypto::CipherContext::cipher_mode ( ) const
inline

Definition at line 225 of file cipher.hpp.

◆ cipher_type()

static const mbedtls_cipher_info_t * openvpn::MbedTLSCrypto::CipherContext::cipher_type ( const CryptoAlgs::Type  alg)
inlinestaticprivate

Definition at line 232 of file cipher.hpp.

Here is the caller graph for this function:

◆ final()

bool openvpn::MbedTLSCrypto::CipherContext::final ( unsigned char *  out,
const size_t  max_out_size,
size_t &  out_acc 
)
inline

Definition at line 194 of file cipher.hpp.

◆ init()

void openvpn::MbedTLSCrypto::CipherContext::init ( SSLLib::Ctx  libctx,
const CryptoAlgs::Type  alg,
const unsigned char *  key,
const int  mode 
)
inline

Definition at line 143 of file cipher.hpp.

◆ is_initialized()

bool openvpn::MbedTLSCrypto::CipherContext::is_initialized ( ) const
inline

Definition at line 207 of file cipher.hpp.

◆ is_supported()

static bool openvpn::MbedTLSCrypto::CipherContext::is_supported ( SSLLib::Ctx  libctx,
const CryptoAlgs::Type  alg 
)
inlinestatic

Definition at line 138 of file cipher.hpp.

◆ iv_length()

size_t openvpn::MbedTLSCrypto::CipherContext::iv_length ( ) const
inline

Definition at line 212 of file cipher.hpp.

Here is the caller graph for this function:

◆ OPENVPN_EXCEPTION()

openvpn::MbedTLSCrypto::CipherContext::OPENVPN_EXCEPTION ( mbedtls_cipher_error  )

◆ operator=()

CipherContext & openvpn::MbedTLSCrypto::CipherContext::operator= ( const CipherContext )
privatedelete

◆ reset()

void openvpn::MbedTLSCrypto::CipherContext::reset ( const unsigned char *  iv)
inline

Definition at line 168 of file cipher.hpp.

◆ update()

bool openvpn::MbedTLSCrypto::CipherContext::update ( unsigned char *  out,
const size_t  max_out_size,
const unsigned char *  in,
const size_t  in_size,
size_t &  out_acc 
)
inline

Definition at line 177 of file cipher.hpp.


The documentation for this class was generated from the following file: