|
|
@ -77,6 +77,7 @@ namespace data |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)type, " is not supported"); |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)type, " is not supported"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t padding = 128 - i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH; // 96 = 128 - 32
|
|
|
|
size_t padding = 128 - i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH; // 96 = 128 - 32
|
|
|
|
RAND_bytes (m_StandardIdentity.signingKey, padding); |
|
|
|
RAND_bytes (m_StandardIdentity.signingKey, padding); |
|
|
@ -331,6 +332,7 @@ namespace data |
|
|
|
case SIGNING_KEY_TYPE_ECDSA_SHA512_P521: |
|
|
|
case SIGNING_KEY_TYPE_ECDSA_SHA512_P521: |
|
|
|
return new i2p::crypto::ECDSAP521Verifier (); |
|
|
|
return new i2p::crypto::ECDSAP521Verifier (); |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
return new i2p::crypto::EDDSA25519Verifier (); |
|
|
|
return new i2p::crypto::EDDSA25519Verifier (); |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
return new i2p::crypto::GOSTR3410_256_Verifier (i2p::crypto::eGOSTR3410CryptoProA); |
|
|
|
return new i2p::crypto::GOSTR3410_256_Verifier (i2p::crypto::eGOSTR3410CryptoProA); |
|
|
@ -603,6 +605,7 @@ namespace data |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
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
|
|
|
|
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; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
@ -695,6 +698,7 @@ namespace data |
|
|
|
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA"); |
|
|
|
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA"); |
|
|
|
// no break here
|
|
|
|
// no break here
|
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub); |
|
|
|
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|