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

#include <cipher.hpp>

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

Public Types

enum  { MODE_UNDEF = -1 , ENCRYPT = kCCEncrypt , DECRYPT = kCCDecrypt }
 
enum  { MAX_IV_LENGTH = 16 , CIPH_CBC_MODE = 0 }
 

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (apple_cipher_mode_error)
 
 OPENVPN_SIMPLE_EXCEPTION (apple_cipher_uninitialized)
 
 OPENVPN_EXCEPTION (apple_cipher_error)
 
 CipherContext ()
 
 ~CipherContext ()
 
void init (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
 

Private Member Functions

 CipherContext (const CipherContext &)=delete
 
CipherContextoperator= (const CipherContext &)=delete
 
void erase ()
 
void check_initialized () const
 

Static Private Member Functions

static CCAlgorithm cipher_type (const CryptoAlgs::Type alg)
 

Private Attributes

const CryptoAlgs::Algcinfo
 
CCCryptorRef cref
 

Detailed Description

Definition at line 32 of file cipher.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODE_UNDEF 
ENCRYPT 
DECRYPT 

Definition at line 43 of file cipher.hpp.

◆ anonymous enum

anonymous enum
Enumerator
MAX_IV_LENGTH 
CIPH_CBC_MODE 

Definition at line 50 of file cipher.hpp.

Constructor & Destructor Documentation

◆ CipherContext() [1/2]

openvpn::AppleCrypto::CipherContext::CipherContext ( const CipherContext )
privatedelete

◆ CipherContext() [2/2]

openvpn::AppleCrypto::CipherContext::CipherContext ( )
inline

Definition at line 56 of file cipher.hpp.

◆ ~CipherContext()

openvpn::AppleCrypto::CipherContext::~CipherContext ( )
inline

Definition at line 61 of file cipher.hpp.

Member Function Documentation

◆ block_size()

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

Definition at line 139 of file cipher.hpp.

◆ check_initialized()

void openvpn::AppleCrypto::CipherContext::check_initialized ( ) const
inlineprivate

Definition at line 186 of file cipher.hpp.

Here is the caller graph for this function:

◆ cipher_mode()

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

Definition at line 146 of file cipher.hpp.

◆ cipher_type()

static CCAlgorithm openvpn::AppleCrypto::CipherContext::cipher_type ( const CryptoAlgs::Type  alg)
inlinestaticprivate

Definition at line 153 of file cipher.hpp.

Here is the caller graph for this function:

◆ erase()

void openvpn::AppleCrypto::CipherContext::erase ( )
inlineprivate

Definition at line 175 of file cipher.hpp.

Here is the caller graph for this function:

◆ final()

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

Definition at line 114 of file cipher.hpp.

◆ init()

void openvpn::AppleCrypto::CipherContext::init ( const CryptoAlgs::Type  alg,
const unsigned char *  key,
const int  mode 
)
inline

Definition at line 66 of file cipher.hpp.

◆ is_initialized()

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

Definition at line 128 of file cipher.hpp.

◆ iv_length()

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

Definition at line 133 of file cipher.hpp.

◆ OPENVPN_EXCEPTION()

openvpn::AppleCrypto::CipherContext::OPENVPN_EXCEPTION ( apple_cipher_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [1/2]

openvpn::AppleCrypto::CipherContext::OPENVPN_SIMPLE_EXCEPTION ( apple_cipher_mode_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/2]

openvpn::AppleCrypto::CipherContext::OPENVPN_SIMPLE_EXCEPTION ( apple_cipher_uninitialized  )

◆ operator=()

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

◆ reset()

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

Definition at line 88 of file cipher.hpp.

◆ update()

bool openvpn::AppleCrypto::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 96 of file cipher.hpp.

Member Data Documentation

◆ cinfo

const CryptoAlgs::Alg* openvpn::AppleCrypto::CipherContext::cinfo
private

Definition at line 194 of file cipher.hpp.

◆ cref

CCCryptorRef openvpn::AppleCrypto::CipherContext::cref
private

Definition at line 195 of file cipher.hpp.


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