OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::CipherContext< CRYPTO_API > Class Template Reference

#include <cipher.hpp>

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (cipher_mode_error)
 
 OPENVPN_SIMPLE_EXCEPTION (cipher_uninitialized)
 
 OPENVPN_SIMPLE_EXCEPTION (cipher_init_insufficient_key_material)
 
 OPENVPN_SIMPLE_EXCEPTION (cipher_internal_error)
 
 OPENVPN_SIMPLE_EXCEPTION (cipher_output_buffer)
 
 CipherContext ()
 
 CipherContext (const CryptoAlgs::Type cipher, const StaticKey &key, const int mode)
 
bool defined () const
 
size_t iv_length () const
 
int cipher_mode () const
 
size_t output_size (const size_t in_size) const
 
void init (SSLLib::Ctx libctx, const CryptoAlgs::Type cipher, const StaticKey &key, const int mode)
 
size_t encrypt (const unsigned char *iv, unsigned char *out, const size_t out_size, const unsigned char *in, const size_t in_size)
 
size_t decrypt (const unsigned char *iv, unsigned char *out, const size_t out_size, const unsigned char *in, const size_t in_size)
 
size_t encrypt_decrypt (const unsigned char *iv, unsigned char *out, const size_t out_size, const unsigned char *in, const size_t in_size)
 

Private Attributes

int mode_
 
CRYPTO_API::CipherContext ctx
 

Detailed Description

template<typename CRYPTO_API>
class openvpn::CipherContext< CRYPTO_API >

Definition at line 27 of file cipher.hpp.

Constructor & Destructor Documentation

◆ CipherContext() [1/2]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::CipherContext ( )
inline

Definition at line 37 of file cipher.hpp.

◆ CipherContext() [2/2]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::CipherContext ( const CryptoAlgs::Type  cipher,
const StaticKey key,
const int  mode 
)
inline

Definition at line 42 of file cipher.hpp.

Member Function Documentation

◆ cipher_mode()

template<typename CRYPTO_API >
int openvpn::CipherContext< CRYPTO_API >::cipher_mode ( ) const
inline

Definition at line 60 of file cipher.hpp.

◆ decrypt()

template<typename CRYPTO_API >
size_t openvpn::CipherContext< CRYPTO_API >::decrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  out_size,
const unsigned char *  in,
const size_t  in_size 
)
inline

Definition at line 101 of file cipher.hpp.

◆ defined()

template<typename CRYPTO_API >
bool openvpn::CipherContext< CRYPTO_API >::defined ( ) const
inline

Definition at line 48 of file cipher.hpp.

◆ encrypt()

template<typename CRYPTO_API >
size_t openvpn::CipherContext< CRYPTO_API >::encrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  out_size,
const unsigned char *  in,
const size_t  in_size 
)
inline

Definition at line 90 of file cipher.hpp.

◆ encrypt_decrypt()

template<typename CRYPTO_API >
size_t openvpn::CipherContext< CRYPTO_API >::encrypt_decrypt ( const unsigned char *  iv,
unsigned char *  out,
const size_t  out_size,
const unsigned char *  in,
const size_t  in_size 
)
inline

Definition at line 112 of file cipher.hpp.

Here is the caller graph for this function:

◆ init()

template<typename CRYPTO_API >
void openvpn::CipherContext< CRYPTO_API >::init ( SSLLib::Ctx  libctx,
const CryptoAlgs::Type  cipher,
const StaticKey key,
const int  mode 
)
inline

Definition at line 71 of file cipher.hpp.

Here is the caller graph for this function:

◆ iv_length()

template<typename CRYPTO_API >
size_t openvpn::CipherContext< CRYPTO_API >::iv_length ( ) const
inline

Definition at line 54 of file cipher.hpp.

◆ OPENVPN_SIMPLE_EXCEPTION() [1/5]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( cipher_init_insufficient_key_material  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/5]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( cipher_internal_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [3/5]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( cipher_mode_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [4/5]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( cipher_output_buffer  )

◆ OPENVPN_SIMPLE_EXCEPTION() [5/5]

template<typename CRYPTO_API >
openvpn::CipherContext< CRYPTO_API >::OPENVPN_SIMPLE_EXCEPTION ( cipher_uninitialized  )

◆ output_size()

template<typename CRYPTO_API >
size_t openvpn::CipherContext< CRYPTO_API >::output_size ( const size_t  in_size) const
inline

Definition at line 66 of file cipher.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ctx

template<typename CRYPTO_API >
CRYPTO_API::CipherContext openvpn::CipherContext< CRYPTO_API >::ctx
private

Definition at line 131 of file cipher.hpp.

◆ mode_

template<typename CRYPTO_API >
int openvpn::CipherContext< CRYPTO_API >::mode_
private

Definition at line 130 of file cipher.hpp.


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