Botan 3.6.1
Crypto and TLS for C&
dilithium_types.h
Go to the documentation of this file.
1/*
2 * Strong Type definitions used throughout the Dilithium implementation
3 *
4 * (C) 2024 Jack Lloyd
5 * (C) 2024 René Meusel, Rohde & Schwarz Cybersecurity
6 *
7 * Botan is released under the Simplified BSD License (see license.txt)
8 */
9
10#ifndef BOTAN_DILITHIUM_TYPES_H_
11#define BOTAN_DILITHIUM_TYPES_H_
12
13#include <botan/secmem.h>
14#include <botan/strong_type.h>
15#include <botan/internal/dilithium_polynomial.h>
16
17namespace Botan {
18
19class Dilithium_PublicKeyInternal;
20class Dilithium_PrivateKeyInternal;
21
25
28
29/// Principal seed used to generate Dilithium key pairs
30using DilithiumSeedRandomness = Strong<secure_vector<uint8_t>, struct DilithiumSeedRandomness_>;
31
32/// Public seed to sample the polynomial matrix A from
33using DilithiumSeedRho = Strong<std::vector<uint8_t>, struct DilithiumPublicSeed_>;
34
35/// Private seed to sample the polynomial vectors s1 and s2 from
36using DilithiumSeedRhoPrime = Strong<secure_vector<uint8_t>, struct DilithiumSeedRhoPrime_>;
37
38/// Optional randomness 'rnd' used for rho prime computation in ML-DSA
39using DilithiumOptionalRandomness = Strong<secure_vector<uint8_t>, struct DilithiumOptionalRandomness_>;
40
41/// Private seed K used during signing
43
44/// Serialized private key data
45using DilithiumSerializedPrivateKey = Strong<secure_vector<uint8_t>, struct DilithiumSerializedPrivateKey_>;
46
47/// Serialized public key data (result of pkEncode(pk))
48using DilithiumSerializedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumSerializedPublicKey_>;
49
50/// Hash value of the serialized public key data
51/// (result of H(BytesToBits(pkEncode(pk)), also referred to as 'tr')
52using DilithiumHashedPublicKey = Strong<std::vector<uint8_t>, struct DilithiumHashedPublicKey_>;
53
54/// Representation of the message to be signed
55using DilithiumMessageRepresentative = Strong<std::vector<uint8_t>, struct DilithiumMessageRepresentative_>;
56
57/// Serialized signature data
58using DilithiumSerializedSignature = Strong<std::vector<uint8_t>, struct DilithiumSerializedSignature_>;
59
60/// Serialized representation of a commitment w1
61using DilithiumSerializedCommitment = Strong<std::vector<uint8_t>, struct DilithiumSerializedCommitment_>;
62
63/// Hash of the message representative and the signer's commitment
64using DilithiumCommitmentHash = Strong<std::vector<uint8_t>, struct DilithiumCommitmentHash_>;
65
66/// Internal representation of a Dilithium key pair
68 std::pair<std::shared_ptr<Dilithium_PublicKeyInternal>, std::shared_ptr<Dilithium_PrivateKeyInternal>>;
69
70} // namespace Botan
71
72#endif
std::pair< std::shared_ptr< Dilithium_PublicKeyInternal >, std::shared_ptr< Dilithium_PrivateKeyInternal > > DilithiumInternalKeypair
Internal representation of a Dilithium key pair.