Make EVP_PKEY_bits return 253 for Ed25519. OpenSSL returns 253, not 256, for both X25519 and Ed25519. https://crypto.stackexchange.com/questions/62024/x25519-why-openssl-shows-253-bits Change-Id: Ia1289ed3abaecf79a178476a61af724ac351671d Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/36787 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/evp/p_ed25519_asn1.c b/crypto/evp/p_ed25519_asn1.c index bd44b3f..1f996cf 100644 --- a/crypto/evp/p_ed25519_asn1.c +++ b/crypto/evp/p_ed25519_asn1.c
@@ -196,7 +196,7 @@ static int ed25519_size(const EVP_PKEY *pkey) { return 64; } -static int ed25519_bits(const EVP_PKEY *pkey) { return 256; } +static int ed25519_bits(const EVP_PKEY *pkey) { return 253; } const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { EVP_PKEY_ED25519,