mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
complete implementation of RedDSA
This commit is contained in:
parent
c797ac4268
commit
ff44bcc489
4 changed files with 100 additions and 7 deletions
|
@ -338,12 +338,13 @@ namespace data
|
|||
case SIGNING_KEY_TYPE_ECDSA_SHA512_P521:
|
||||
return new i2p::crypto::ECDSAP521Verifier ();
|
||||
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
return new i2p::crypto::EDDSA25519Verifier ();
|
||||
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256:
|
||||
return new i2p::crypto::GOSTR3410_256_Verifier (i2p::crypto::eGOSTR3410CryptoProA);
|
||||
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512:
|
||||
return new i2p::crypto::GOSTR3410_512_Verifier (i2p::crypto::eGOSTR3410TC26A512);
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
return new i2p::crypto::RedDSA25519Verifier ();
|
||||
case SIGNING_KEY_TYPE_RSA_SHA256_2048:
|
||||
case SIGNING_KEY_TYPE_RSA_SHA384_3072:
|
||||
case SIGNING_KEY_TYPE_RSA_SHA512_4096:
|
||||
|
@ -611,7 +612,6 @@ namespace data
|
|||
LogPrint (eLogError, "Identity: RSA signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported");
|
||||
break;
|
||||
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
m_Signer.reset (new i2p::crypto::EDDSA25519Signer (m_SigningPrivateKey, IsOfflineSignature () ? nullptr: m_Public->GetStandardIdentity ().certificate - i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH)); // TODO: remove public key check
|
||||
break;
|
||||
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256:
|
||||
|
@ -620,6 +620,9 @@ namespace data
|
|||
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512:
|
||||
m_Signer.reset (new i2p::crypto::GOSTR3410_512_Signer (i2p::crypto::eGOSTR3410TC26A512, m_SigningPrivateKey));
|
||||
break;
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
m_Signer.reset (new i2p::crypto::RedDSA25519Signer (m_SigningPrivateKey));
|
||||
break;
|
||||
default:
|
||||
LogPrint (eLogError, "Identity: Signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported");
|
||||
}
|
||||
|
@ -704,7 +707,6 @@ namespace data
|
|||
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA");
|
||||
// no break here
|
||||
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub);
|
||||
break;
|
||||
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256:
|
||||
|
@ -713,6 +715,9 @@ namespace data
|
|||
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512:
|
||||
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410TC26A512, priv, pub);
|
||||
break;
|
||||
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519:
|
||||
i2p::crypto::CreateRedDSA25519RandomKeys (priv, pub);
|
||||
break;
|
||||
default:
|
||||
LogPrint (eLogWarning, "Identity: Signing key type ", (int)type, " is not supported. Create DSA-SHA1");
|
||||
i2p::crypto::CreateDSARandomKeys (priv, pub); // DSA-SHA1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue