61 m_public_key_hash_bytes(public_key_hash_size(m_mode)),
62 m_commitment_hash_full_bytes(commitment_hash_full_size(m_mode)) {
63 switch(m_mode.
mode()) {
64 case Botan::DilithiumMode::Dilithium4x4:
65 case Botan::DilithiumMode::Dilithium4x4_AES:
66 case Botan::DilithiumMode::ML_DSA_4x4:
67 m_tau = DilithiumTau::_39;
68 m_lambda = DilithiumLambda::_128;
69 m_gamma1 = DilithiumGamma1::ToThe17th;
70 m_gamma2 = DilithiumGamma2::Qminus1DevidedBy88;
73 m_eta = DilithiumEta::_2;
74 m_beta = DilithiumBeta::_78;
75 m_omega = DilithiumOmega::_80;
77 case Botan::DilithiumMode::Dilithium6x5:
78 case Botan::DilithiumMode::Dilithium6x5_AES:
79 case Botan::DilithiumMode::ML_DSA_6x5:
80 m_tau = DilithiumTau::_49;
81 m_lambda = DilithiumLambda::_192;
82 m_gamma1 = DilithiumGamma1::ToThe19th;
83 m_gamma2 = DilithiumGamma2::Qminus1DevidedBy32;
86 m_eta = DilithiumEta::_4;
87 m_beta = DilithiumBeta::_196;
88 m_omega = DilithiumOmega::_55;
90 case Botan::DilithiumMode::Dilithium8x7:
91 case Botan::DilithiumMode::Dilithium8x7_AES:
92 case Botan::DilithiumMode::ML_DSA_8x7:
93 m_tau = DilithiumTau::_60;
94 m_lambda = DilithiumLambda::_256;
95 m_gamma1 = DilithiumGamma1::ToThe19th;
96 m_gamma2 = DilithiumGamma2::Qminus1DevidedBy32;
99 m_eta = DilithiumEta::_2;
100 m_beta = DilithiumBeta::_120;
101 m_omega = DilithiumOmega::_75;
104 BOTAN_ASSERT_UNREACHABLE();
107 const auto s1_bytes = 32 * m_l *
bitlen(2 * m_eta);
108 const auto s2_bytes = 32 * m_k *
bitlen(2 * m_eta);
109 const auto t0_bytes = 32 * m_k *
D;
110 const auto t1_bytes = 32 * m_k * (
bitlen(
static_cast<uint32_t
>(
Q) - 1) -
D);
111 const auto z_bytes = 32 * m_l * (1 +
bitlen(m_gamma1 - 1));
112 const auto hint_bytes = m_omega + m_k;
114 m_private_key_bytes =
117 m_signature_bytes = m_commitment_hash_full_bytes + z_bytes + hint_bytes;
118 m_serialized_commitment_bytes = 32 * m_k *
bitlen(((
Q - 1) / (2 * m_gamma2)) - 1);