OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::Crypto::AEADUsageLimit Class Reference

#include <aead_usage_limit.hpp>

Public Member Functions

 AEADUsageLimit ()=default
 
 AEADUsageLimit (openvpn::CryptoAlgs::Type type)
 
void update (const std::size_t outlen)
 
bool usage_limit_reached () const
 
bool usage_limit_warn () const
 

Static Public Attributes

static constexpr size_t aead_blocksize = 16
 

Private Attributes

uint64_t invocations = 0
 
uint64_t plaintext_blocks = 0
 
uint64_t limit = openvpn::CryptoAlgs::gcm_limit
 

Detailed Description

Counts the number of plaintext blocks and cipher invocations to determine the limit for an AEAD cipher like GCM For more details see the OpenVPN RFC and the related documents

Definition at line 22 of file aead_usage_limit.hpp.

Constructor & Destructor Documentation

◆ AEADUsageLimit() [1/2]

openvpn::Crypto::AEADUsageLimit::AEADUsageLimit ( )
default

◆ AEADUsageLimit() [2/2]

openvpn::Crypto::AEADUsageLimit::AEADUsageLimit ( openvpn::CryptoAlgs::Type  type)
inline

Definition at line 32 of file aead_usage_limit.hpp.

Member Function Documentation

◆ update()

void openvpn::Crypto::AEADUsageLimit::update ( const std::size_t  outlen)
inline

Update the limit calculation with the amount of data encrypted

Definition at line 43 of file aead_usage_limit.hpp.

Here is the caller graph for this function:

◆ usage_limit_reached()

bool openvpn::Crypto::AEADUsageLimit::usage_limit_reached ( ) const
inline

Returns true if the limit that is considered for the usage of the AEAD ciphers has been reached

Definition at line 52 of file aead_usage_limit.hpp.

◆ usage_limit_warn()

bool openvpn::Crypto::AEADUsageLimit::usage_limit_warn ( ) const
inline

Returns true if we are 7/8 of the usage limit. We use this limit to trigger a renegotiation

Definition at line 61 of file aead_usage_limit.hpp.

Member Data Documentation

◆ aead_blocksize

constexpr size_t openvpn::Crypto::AEADUsageLimit::aead_blocksize = 16
staticconstexpr

Definition at line 40 of file aead_usage_limit.hpp.

◆ invocations

uint64_t openvpn::Crypto::AEADUsageLimit::invocations = 0
private

Definition at line 24 of file aead_usage_limit.hpp.

◆ limit

uint64_t openvpn::Crypto::AEADUsageLimit::limit = openvpn::CryptoAlgs::gcm_limit
private

Usage limit of plaintext_block + invocations, initialise with AES-GCM limit to be on safe side

Definition at line 27 of file aead_usage_limit.hpp.

◆ plaintext_blocks

uint64_t openvpn::Crypto::AEADUsageLimit::plaintext_blocks = 0
private

Definition at line 25 of file aead_usage_limit.hpp.


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