mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
reset nonce to 0 before payload encrypt/decrypt for ML-KEM-512
This commit is contained in:
parent
2f2ecc32d2
commit
3afe6455b2
1 changed files with 7 additions and 0 deletions
|
@ -334,7 +334,10 @@ namespace garlic
|
|||
// static key, fs is apk
|
||||
#if OPENSSL_PQ
|
||||
if (m_PQKeys)
|
||||
{
|
||||
SetRemoteStaticKey (i2p::data::CRYPTO_KEY_TYPE_ECIES_MLKEM512_X25519_AEAD, fs);
|
||||
CreateNonce (0, nonce); // reset nonce
|
||||
}
|
||||
else
|
||||
#endif
|
||||
SetRemoteStaticKey (i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD, fs);
|
||||
|
@ -600,6 +603,10 @@ namespace garlic
|
|||
{
|
||||
GetOwner ()->Decrypt (m_RemoteStaticKey, sharedSecret, m_RemoteStaticKeyType); // x25519 (ask, bpk)
|
||||
MixKey (sharedSecret);
|
||||
#if OPENSSL_PQ
|
||||
if (m_RemoteStaticKeyType == i2p::data::CRYPTO_KEY_TYPE_ECIES_MLKEM512_X25519_AEAD)
|
||||
CreateNonce (0, nonce); // reset nonce
|
||||
#endif
|
||||
}
|
||||
else
|
||||
CreateNonce (1, nonce);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue