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

#include <hmac.hpp>

Public Types

enum  { MAX_HMAC_SIZE = MBEDTLS_MD_MAX_SIZE }
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (mbedtls_hmac_uninitialized)
 
 OPENVPN_EXCEPTION (mbedtls_hmac_error)
 
 HMACContext ()
 
 HMACContext (const CryptoAlgs::Type digest, const unsigned char *key, const size_t key_size)
 
 ~HMACContext ()
 
void init (const CryptoAlgs::Type digest, const unsigned char *key, const size_t key_size)
 
void reset ()
 
void update (const unsigned char *in, const size_t size)
 
size_t final (unsigned char *out)
 
size_t size () const
 
bool is_initialized () const
 

Private Member Functions

 HMACContext (const HMACContext &)=delete
 
HMACContextoperator= (const HMACContext &)=delete
 
void erase ()
 
size_t size_ () const
 
void check_initialized () const
 

Private Attributes

bool initialized
 
mbedtls_md_context_t ctx
 

Detailed Description

Definition at line 26 of file hmac.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_HMAC_SIZE 

Definition at line 35 of file hmac.hpp.

Constructor & Destructor Documentation

◆ HMACContext() [1/3]

openvpn::MbedTLSCrypto::HMACContext::HMACContext ( const HMACContext )
privatedelete

◆ HMACContext() [2/3]

openvpn::MbedTLSCrypto::HMACContext::HMACContext ( )
inline

Definition at line 40 of file hmac.hpp.

◆ HMACContext() [3/3]

openvpn::MbedTLSCrypto::HMACContext::HMACContext ( const CryptoAlgs::Type  digest,
const unsigned char *  key,
const size_t  key_size 
)
inline

Definition at line 45 of file hmac.hpp.

◆ ~HMACContext()

openvpn::MbedTLSCrypto::HMACContext::~HMACContext ( )
inline

Definition at line 51 of file hmac.hpp.

Member Function Documentation

◆ check_initialized()

void openvpn::MbedTLSCrypto::HMACContext::check_initialized ( ) const
inlineprivate

Definition at line 116 of file hmac.hpp.

Here is the caller graph for this function:

◆ erase()

void openvpn::MbedTLSCrypto::HMACContext::erase ( )
inlineprivate

Definition at line 102 of file hmac.hpp.

Here is the caller graph for this function:

◆ final()

size_t openvpn::MbedTLSCrypto::HMACContext::final ( unsigned char *  out)
inline

Definition at line 82 of file hmac.hpp.

Here is the caller graph for this function:

◆ init()

void openvpn::MbedTLSCrypto::HMACContext::init ( const CryptoAlgs::Type  digest,
const unsigned char *  key,
const size_t  key_size 
)
inline

Definition at line 56 of file hmac.hpp.

Here is the caller graph for this function:

◆ is_initialized()

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

Definition at line 96 of file hmac.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::MbedTLSCrypto::HMACContext::OPENVPN_EXCEPTION ( mbedtls_hmac_error  )

◆ OPENVPN_SIMPLE_EXCEPTION()

openvpn::MbedTLSCrypto::HMACContext::OPENVPN_SIMPLE_EXCEPTION ( mbedtls_hmac_uninitialized  )

◆ operator=()

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

◆ reset()

void openvpn::MbedTLSCrypto::HMACContext::reset ( )
inline

Definition at line 68 of file hmac.hpp.

Here is the caller graph for this function:

◆ size()

size_t openvpn::MbedTLSCrypto::HMACContext::size ( ) const
inline

Definition at line 90 of file hmac.hpp.

Here is the caller graph for this function:

◆ size_()

size_t openvpn::MbedTLSCrypto::HMACContext::size_ ( ) const
inlineprivate

Definition at line 111 of file hmac.hpp.

Here is the caller graph for this function:

◆ update()

void openvpn::MbedTLSCrypto::HMACContext::update ( const unsigned char *  in,
const size_t  size 
)
inline

Definition at line 75 of file hmac.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ctx

mbedtls_md_context_t openvpn::MbedTLSCrypto::HMACContext::ctx
private

Definition at line 125 of file hmac.hpp.

◆ initialized

bool openvpn::MbedTLSCrypto::HMACContext::initialized
private

Definition at line 124 of file hmac.hpp.


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