Botan 3.8.1
Crypto and TLS for C&
Botan::Roughtime::Nonce Class Referencefinal

#include <roughtime.h>

Public Member Functions

const std::array< uint8_t, 64 > & get_nonce () const
 
 Nonce ()=default
 
 Nonce (const std::array< uint8_t, 64 > &nonce)
 
 Nonce (const std::vector< uint8_t > &nonce)
 
 Nonce (RandomNumberGenerator &rng)
 
bool operator== (const Nonce &rhs) const
 

Detailed Description

Definition at line 32 of file roughtime.h.

Constructor & Destructor Documentation

◆ Nonce() [1/4]

Botan::Roughtime::Nonce::Nonce ( )
default

References Nonce().

Referenced by Nonce(), and operator==().

◆ Nonce() [2/4]

Botan::Roughtime::Nonce::Nonce ( const std::vector< uint8_t > & nonce)

Definition at line 158 of file roughtime.cpp.

158 {
159 if(nonce.size() != 64) {
160 throw Invalid_Argument("Roughtime nonce must be 64 bytes long");
161 }
162 m_nonce = typecast_copy<std::array<uint8_t, 64>>(nonce.data());
163}
constexpr void typecast_copy(ToR &&out, FromR &&in)
Definition mem_ops.h:181

References Botan::typecast_copy().

◆ Nonce() [3/4]

Botan::Roughtime::Nonce::Nonce ( RandomNumberGenerator & rng)

Definition at line 165 of file roughtime.cpp.

165 {
166 rng.randomize(m_nonce.data(), m_nonce.size());
167}

References Botan::RandomNumberGenerator::randomize().

◆ Nonce() [4/4]

Botan::Roughtime::Nonce::Nonce ( const std::array< uint8_t, 64 > & nonce)
inline

Definition at line 38 of file roughtime.h.

38{ m_nonce = nonce; }

Member Function Documentation

◆ get_nonce()

const std::array< uint8_t, 64 > & Botan::Roughtime::Nonce::get_nonce ( ) const
inline

◆ operator==()

bool Botan::Roughtime::Nonce::operator== ( const Nonce & rhs) const
inline

Definition at line 40 of file roughtime.h.

40{ return m_nonce == rhs.m_nonce; }

References Nonce().


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