Botan 3.5.0
Crypto and TLS for C&
Botan::DilithiumMode Class Reference

#include <dilithium.h>

Public Types

enum  Mode {
  Dilithium4x4 = 1 , Dilithium4x4_AES , Dilithium6x5 , Dilithium6x5_AES ,
  Dilithium8x7 , Dilithium8x7_AES
}
 

Public Member Functions

 DilithiumMode (const OID &oid)
 
 DilithiumMode (Mode mode)
 
 DilithiumMode (std::string_view str)
 
bool is_aes () const
 
bool is_modern () const
 
Mode mode () const
 
OID object_identifier () const
 
std::string to_string () const
 

Detailed Description

Definition at line 21 of file dilithium.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Dilithium4x4 
Dilithium4x4_AES 
Dilithium6x5 
Dilithium6x5_AES 
Dilithium8x7 
Dilithium8x7_AES 

Definition at line 23 of file dilithium.h.

Constructor & Destructor Documentation

◆ DilithiumMode() [1/3]

Botan::DilithiumMode::DilithiumMode ( Mode mode)
inline

Definition at line 26 of file dilithium.h.

26: m_mode(mode) {}
Mode mode() const
Definition dilithium.h:40

◆ DilithiumMode() [2/3]

Botan::DilithiumMode::DilithiumMode ( const OID & oid)
explicit

Definition at line 88 of file dilithium.cpp.

88: m_mode(dilithium_mode_from_string(oid.to_formatted_string())) {}

◆ DilithiumMode() [3/3]

Botan::DilithiumMode::DilithiumMode ( std::string_view str)
explicit

Definition at line 90 of file dilithium.cpp.

90: m_mode(dilithium_mode_from_string(str)) {}

Member Function Documentation

◆ is_aes()

bool Botan::DilithiumMode::is_aes ( ) const
inline

Definition at line 34 of file dilithium.h.

34 {
35 return m_mode == Dilithium4x4_AES || m_mode == Dilithium6x5_AES || m_mode == Dilithium8x7_AES;
36 }

Referenced by Botan::Dilithium_Symmetric_Primitives::create().

◆ is_modern()

bool Botan::DilithiumMode::is_modern ( ) const
inline

◆ mode()

Mode Botan::DilithiumMode::mode ( ) const
inline

Definition at line 40 of file dilithium.h.

40{ return m_mode; }

Referenced by Botan::DilithiumModeConstants::DilithiumModeConstants().

◆ object_identifier()

OID Botan::DilithiumMode::object_identifier ( ) const

Definition at line 92 of file dilithium.cpp.

92 {
94}
std::string to_string() const
Definition dilithium.cpp:96
static OID from_string(std::string_view str)
Definition asn1_oid.cpp:86

References Botan::OID::from_string(), and to_string().

Referenced by Botan::DilithiumModeConstants::oid().

◆ to_string()

std::string Botan::DilithiumMode::to_string ( ) const

Definition at line 96 of file dilithium.cpp.

96 {
97 switch(m_mode) {
99 return "Dilithium-4x4-r3";
101 return "Dilithium-4x4-AES-r3";
103 return "Dilithium-6x5-r3";
105 return "Dilithium-6x5-AES-r3";
107 return "Dilithium-8x7-r3";
109 return "Dilithium-8x7-AES-r3";
110 }
111
113}
#define BOTAN_ASSERT_UNREACHABLE()
Definition assert.h:137

References BOTAN_ASSERT_UNREACHABLE, Dilithium4x4, Dilithium4x4_AES, Dilithium6x5, Dilithium6x5_AES, Dilithium8x7, and Dilithium8x7_AES.

Referenced by object_identifier().


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