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

#include <hmac.hpp>

Collaboration diagram for openvpn::AppleCrypto::HMACContext:
[legend]

Public Types

enum  { MAX_HMAC_SIZE = DigestContext::MAX_DIGEST_SIZE , MAX_HMAC_KEY_SIZE = 128 }
 

Public Member Functions

 OPENVPN_EXCEPTION (digest_cannot_be_used_with_hmac)
 
 OPENVPN_SIMPLE_EXCEPTION (hmac_uninitialized)
 
 OPENVPN_SIMPLE_EXCEPTION (hmac_keysize_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 Types

enum  State { PRE = 0 , PARTIAL , READY }
 

Private Member Functions

 HMACContext (const HMACContext &)=delete
 
HMACContextoperator= (const HMACContext &)=delete
 
void cond_reset (const bool force_init)
 

Private Attributes

int state
 
const DigestInfoinfo
 
CCHmacAlgorithm hmac_alg
 
size_t key_size_
 
size_t digest_size_
 
unsigned char key_ [MAX_HMAC_KEY_SIZE]
 
CCHmacContext ctx
 

Detailed Description

Definition at line 28 of file hmac.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_HMAC_SIZE 
MAX_HMAC_KEY_SIZE 

Definition at line 38 of file hmac.hpp.

◆ State

Enumerator
PRE 
PARTIAL 
READY 

Definition at line 118 of file hmac.hpp.

Constructor & Destructor Documentation

◆ HMACContext() [1/3]

openvpn::AppleCrypto::HMACContext::HMACContext ( const HMACContext )
privatedelete

◆ HMACContext() [2/3]

openvpn::AppleCrypto::HMACContext::HMACContext ( )
inline

Definition at line 44 of file hmac.hpp.

◆ HMACContext() [3/3]

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

Definition at line 49 of file hmac.hpp.

◆ ~HMACContext()

openvpn::AppleCrypto::HMACContext::~HMACContext ( )
inline

Definition at line 54 of file hmac.hpp.

Member Function Documentation

◆ cond_reset()

void openvpn::AppleCrypto::HMACContext::cond_reset ( const bool  force_init)
inlineprivate

Definition at line 103 of file hmac.hpp.

Here is the caller graph for this function:

◆ final()

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

Definition at line 83 of file hmac.hpp.

◆ init()

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

Definition at line 58 of file hmac.hpp.

Here is the caller graph for this function:

◆ is_initialized()

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

Definition at line 97 of file hmac.hpp.

Here is the caller graph for this function:

◆ OPENVPN_EXCEPTION()

openvpn::AppleCrypto::HMACContext::OPENVPN_EXCEPTION ( digest_cannot_be_used_with_hmac  )

◆ OPENVPN_SIMPLE_EXCEPTION() [1/2]

openvpn::AppleCrypto::HMACContext::OPENVPN_SIMPLE_EXCEPTION ( hmac_keysize_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/2]

openvpn::AppleCrypto::HMACContext::OPENVPN_SIMPLE_EXCEPTION ( hmac_uninitialized  )

◆ operator=()

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

◆ reset()

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

Definition at line 72 of file hmac.hpp.

◆ size()

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

Definition at line 90 of file hmac.hpp.

Here is the caller graph for this function:

◆ update()

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

Definition at line 77 of file hmac.hpp.

Member Data Documentation

◆ ctx

CCHmacContext openvpn::AppleCrypto::HMACContext::ctx
private

Definition at line 131 of file hmac.hpp.

◆ digest_size_

size_t openvpn::AppleCrypto::HMACContext::digest_size_
private

Definition at line 129 of file hmac.hpp.

◆ hmac_alg

CCHmacAlgorithm openvpn::AppleCrypto::HMACContext::hmac_alg
private

Definition at line 127 of file hmac.hpp.

◆ info

const DigestInfo* openvpn::AppleCrypto::HMACContext::info
private

Definition at line 126 of file hmac.hpp.

◆ key_

unsigned char openvpn::AppleCrypto::HMACContext::key_[MAX_HMAC_KEY_SIZE]
private

Definition at line 130 of file hmac.hpp.

◆ key_size_

size_t openvpn::AppleCrypto::HMACContext::key_size_
private

Definition at line 128 of file hmac.hpp.

◆ state

int openvpn::AppleCrypto::HMACContext::state
private

Definition at line 124 of file hmac.hpp.


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