mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 12:17:49 +02:00
moved ML-KEM code to PostQuntum.h/.cpp
This commit is contained in:
parent
459be02d18
commit
4c5d0116f8
7 changed files with 201 additions and 163 deletions
|
@ -183,23 +183,6 @@ namespace crypto
|
|||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if OPENSSL_PQ
|
||||
constexpr size_t GetMLKEMPublicKeyLen (i2p::data::CryptoKeyType type)
|
||||
{
|
||||
if (type <= i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD ||
|
||||
type - i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD > (int)MLKEMS.size ()) return 0;
|
||||
return std::get<1>(MLKEMS[type - i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD - 1]);
|
||||
}
|
||||
|
||||
constexpr size_t GetMLKEMCipherTextLen (i2p::data::CryptoKeyType type)
|
||||
{
|
||||
if (type <= i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD ||
|
||||
type - i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD > (int)MLKEMS.size ()) return 0;
|
||||
return std::get<2>(MLKEMS[type - i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD - 1]);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue