Botan 3.14.1
Crypto and TLS for C&
Botan::TLS::Record_Nonce Class Referencefinal

#include <tls_record.h>

Public Member Functions

std::span< uint8_t > get ()
std::span< const uint8_t > get () const
 Record_Nonce ()=default
 Record_Nonce (size_t len)

Static Public Attributes

static constexpr size_t MAX_NONCE_LEN = 16

Detailed Description

A TLS record nonce, stored inline to avoid an allocation per record

Definition at line 40 of file tls_record.h.

Constructor & Destructor Documentation

◆ Record_Nonce() [1/2]

Botan::TLS::Record_Nonce::Record_Nonce ( )
default

◆ Record_Nonce() [2/2]

Botan::TLS::Record_Nonce::Record_Nonce ( size_t len)
inlineexplicit

Definition at line 47 of file tls_record.h.

47: m_len(len) { BOTAN_ARG_CHECK(len <= MAX_NONCE_LEN, "Nonce is too long"); }
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:33
static constexpr size_t MAX_NONCE_LEN
Definition tls_record.h:43

References BOTAN_ARG_CHECK, and MAX_NONCE_LEN.

Member Function Documentation

◆ get() [1/2]

std::span< uint8_t > Botan::TLS::Record_Nonce::get ( )
inline

Definition at line 49 of file tls_record.h.

49{ return std::span{m_nonce}.first(m_len); }

Referenced by Botan::TLS::Connection_Cipher_State::aead_nonce(), and Botan::TLS::Connection_Cipher_State::aead_nonce().

◆ get() [2/2]

std::span< const uint8_t > Botan::TLS::Record_Nonce::get ( ) const
inline

Definition at line 51 of file tls_record.h.

51{ return std::span{m_nonce}.first(m_len); }

Member Data Documentation

◆ MAX_NONCE_LEN

size_t Botan::TLS::Record_Nonce::MAX_NONCE_LEN = 16
staticconstexpr

Definition at line 43 of file tls_record.h.

Referenced by Record_Nonce().


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