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

#include <digest.hpp>

Public Types

enum  { MAX_DIGEST_SIZE = MBEDTLS_MD_MAX_SIZE }
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (mbedtls_digest_uninitialized)
 
 OPENVPN_SIMPLE_EXCEPTION (mbedtls_digest_final_overflow)
 
 OPENVPN_EXCEPTION (mbedtls_digest_error)
 
 DigestContext ()
 
 DigestContext (const CryptoAlgs::Type alg)
 
 DigestContext (const CryptoAlgs::Type alg, SSLLib::Ctx)
 
 ~DigestContext ()
 
void init (const CryptoAlgs::Type alg)
 
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

 DigestContext (const DigestContext &)=delete
 
DigestContextoperator= (const DigestContext &)=delete
 
void erase ()
 
size_t size_ () const
 
void check_initialized () const
 

Static Private Member Functions

static const mbedtls_md_info_t * digest_type (const CryptoAlgs::Type alg)
 

Private Attributes

bool initialized
 
mbedtls_md_context_t ctx
 

Friends

class HMACContext
 

Detailed Description

Definition at line 30 of file digest.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_DIGEST_SIZE 

Definition at line 42 of file digest.hpp.

Constructor & Destructor Documentation

◆ DigestContext() [1/4]

openvpn::MbedTLSCrypto::DigestContext::DigestContext ( const DigestContext )
privatedelete

◆ DigestContext() [2/4]

openvpn::MbedTLSCrypto::DigestContext::DigestContext ( )
inline

Definition at line 47 of file digest.hpp.

◆ DigestContext() [3/4]

openvpn::MbedTLSCrypto::DigestContext::DigestContext ( const CryptoAlgs::Type  alg)
inline

Definition at line 52 of file digest.hpp.

◆ DigestContext() [4/4]

openvpn::MbedTLSCrypto::DigestContext::DigestContext ( const CryptoAlgs::Type  alg,
SSLLib::Ctx   
)
inline

Definition at line 59 of file digest.hpp.

◆ ~DigestContext()

openvpn::MbedTLSCrypto::DigestContext::~DigestContext ( )
inline

Definition at line 65 of file digest.hpp.

Member Function Documentation

◆ check_initialized()

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

Definition at line 148 of file digest.hpp.

Here is the caller graph for this function:

◆ digest_type()

static const mbedtls_md_info_t * openvpn::MbedTLSCrypto::DigestContext::digest_type ( const CryptoAlgs::Type  alg)
inlinestaticprivate

Definition at line 109 of file digest.hpp.

Here is the caller graph for this function:

◆ erase()

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

Definition at line 134 of file digest.hpp.

Here is the caller graph for this function:

◆ final()

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

Definition at line 89 of file digest.hpp.

◆ init()

void openvpn::MbedTLSCrypto::DigestContext::init ( const CryptoAlgs::Type  alg)
inline

Definition at line 70 of file digest.hpp.

Here is the caller graph for this function:

◆ is_initialized()

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

Definition at line 103 of file digest.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::MbedTLSCrypto::DigestContext::OPENVPN_EXCEPTION ( mbedtls_digest_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [1/2]

openvpn::MbedTLSCrypto::DigestContext::OPENVPN_SIMPLE_EXCEPTION ( mbedtls_digest_final_overflow  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/2]

openvpn::MbedTLSCrypto::DigestContext::OPENVPN_SIMPLE_EXCEPTION ( mbedtls_digest_uninitialized  )

◆ operator=()

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

◆ size()

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

Definition at line 97 of file digest.hpp.

Here is the caller graph for this function:

◆ size_()

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

Definition at line 143 of file digest.hpp.

Here is the caller graph for this function:

◆ update()

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

Definition at line 82 of file digest.hpp.

Friends And Related Symbol Documentation

◆ HMACContext

friend class HMACContext
friend

Definition at line 36 of file digest.hpp.

Member Data Documentation

◆ ctx

mbedtls_md_context_t openvpn::MbedTLSCrypto::DigestContext::ctx
private

Definition at line 157 of file digest.hpp.

◆ initialized

bool openvpn::MbedTLSCrypto::DigestContext::initialized
private

Definition at line 156 of file digest.hpp.


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