calculate crypto key length from key type

This commit is contained in:
orignal 2025-03-18 19:23:13 -04:00
parent 609cd401bb
commit bd2b96627c
10 changed files with 79 additions and 29 deletions

View file

@ -10,6 +10,7 @@
#include "I2PEndian.h"
#include "Log.h"
#include "Timestamp.h"
#include "CryptoKey.h"
#include "Identity.h"
namespace i2p
@ -658,8 +659,7 @@ namespace data
size_t PrivateKeys::GetPrivateKeyLen () const
{
// private key length always 256, but type 4
return (m_Public->GetCryptoKeyType () == CRYPTO_KEY_TYPE_ECIES_X25519_AEAD) ? 32 : 256;
return i2p::crypto::GetCryptoPrivateKeyLen (m_Public->GetCryptoKeyType ());
}
uint8_t * PrivateKeys::GetPadding()