Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
pubkey
dilithium
dilithium_common
dilithium_keys.cpp
Go to the documentation of this file.
1
/*
2
* Crystals Dilithium Internal Key Types
3
*
4
* (C) 2024 Jack Lloyd
5
* 2024 René Meusel - Rohde & Schwarz Cybersecurity
6
*
7
* Botan is released under the Simplified BSD License (see license.txt)
8
*/
9
10
#include <botan/internal/dilithium_keys.h>
11
12
#if defined(BOTAN_HAS_DILITHIUM) || defined(BOTAN_HAS_DILITHIUM_AES)
13
#include <botan/internal/dilithium_round3_symmetric_primitives.h>
14
#endif
15
16
#if defined(BOTAN_HAS_ML_DSA)
17
#include <botan/internal/ml_dsa_impl.h>
18
#endif
19
20
namespace
Botan
{
21
22
std::unique_ptr<Dilithium_Keypair_Codec>
Dilithium_Keypair_Codec::create
(
DilithiumMode
mode) {
23
#if defined(BOTAN_HAS_DILITHIUM) || defined(BOTAN_HAS_DILITHIUM_AES)
24
if
(mode.
is_dilithium_round3
()) {
25
return
std::make_unique<Dilithium_Expanded_Keypair_Codec>();
26
}
27
#endif
28
29
#if defined(BOTAN_HAS_ML_DSA)
30
if
(mode.
is_ml_dsa
()) {
31
return
std::make_unique<ML_DSA_Expanding_Keypair_Codec>();
32
}
33
#endif
34
35
throw
Not_Implemented
(
"requested ML-DSA/Dilithium mode is not implemented in this build"
);
36
}
22
std::unique_ptr<Dilithium_Keypair_Codec>
Dilithium_Keypair_Codec::create
(
DilithiumMode
mode) {
…
}
37
38
}
// namespace Botan
Botan::DilithiumMode
Definition
dilithium.h:21
Botan::DilithiumMode::is_dilithium_round3
bool is_dilithium_round3() const
Definition
dilithium.h:48
Botan::DilithiumMode::is_ml_dsa
bool is_ml_dsa() const
Definition
dilithium.cpp:106
Botan::Dilithium_Keypair_Codec::create
static std::unique_ptr< Dilithium_Keypair_Codec > create(DilithiumMode mode)
Definition
dilithium_keys.cpp:22
Botan::Not_Implemented
Definition
exceptn.h:334
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0