mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 19:57:48 +02:00
calculate crypto key length from key type
This commit is contained in:
parent
609cd401bb
commit
bd2b96627c
10 changed files with 79 additions and 29 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue