diff options
author | Matt Caswell <matt@openssl.org> | 2017-11-28 18:23:51 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-02-20 12:59:30 +0000 |
commit | 22bcc9cb7fbd1433924bd9738cb34f9dfbb35c91 (patch) | |
tree | 3c9482cf70678b05dfd58e9dfe8bb257e3d2a910 /crypto/ec/curve448 | |
parent | ff489fb4725b120a9da05d339595bc7799c53802 (diff) |
Fix the ED448 key lengths
Unlike X448 the key lengths for ED448 are 57 bytes (as opposed to 56)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)
Diffstat (limited to 'crypto/ec/curve448')
-rw-r--r-- | crypto/ec/curve448/curve448_lcl.h | 14 | ||||
-rw-r--r-- | crypto/ec/curve448/eddsa.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/crypto/ec/curve448/curve448_lcl.h b/crypto/ec/curve448/curve448_lcl.h index 2228dc88d2..e1b0461a23 100644 --- a/crypto/ec/curve448/curve448_lcl.h +++ b/crypto/ec/curve448/curve448_lcl.h @@ -7,20 +7,20 @@ void X448_public_from_private(uint8_t out_public_value[56], const uint8_t private_key[56]); int ED448_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, - const uint8_t public_key[56], const uint8_t private_key[56], + const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len); int ED448_verify(const uint8_t *message, size_t message_len, - const uint8_t signature[112], const uint8_t public_key[56], + const uint8_t signature[114], const uint8_t public_key[57], const uint8_t *context, size_t context_len); int ED448ph_sign(uint8_t *out_sig, const uint8_t hash[64], - const uint8_t public_key[56], const uint8_t private_key[56], + const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len); -int ED448ph_verify(const uint8_t hash[64], const uint8_t signature[112], - const uint8_t public_key[56], const uint8_t *context, +int ED448ph_verify(const uint8_t hash[64], const uint8_t signature[114], + const uint8_t public_key[57], const uint8_t *context, size_t context_len); -int ED448_public_from_private(uint8_t out_public_key[56], - const uint8_t private_key[56]); +int ED448_public_from_private(uint8_t out_public_key[57], + const uint8_t private_key[57]); diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c index 5aeec24e08..b627d510f8 100644 --- a/crypto/ec/curve448/eddsa.c +++ b/crypto/ec/curve448/eddsa.c @@ -364,7 +364,7 @@ decaf_error_t decaf_ed448_verify_prehash ( } int ED448_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, - const uint8_t public_key[56], const uint8_t private_key[56], + const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len) { @@ -375,7 +375,7 @@ int ED448_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, int ED448_verify(const uint8_t *message, size_t message_len, - const uint8_t signature[112], const uint8_t public_key[56], + const uint8_t signature[114], const uint8_t public_key[57], const uint8_t *context, size_t context_len) { return decaf_ed448_verify(signature, public_key, message, message_len, 0, @@ -383,7 +383,7 @@ int ED448_verify(const uint8_t *message, size_t message_len, } int ED448ph_sign(uint8_t *out_sig, const uint8_t hash[64], - const uint8_t public_key[56], const uint8_t private_key[56], + const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len) { return decaf_ed448_sign_prehash(out_sig, private_key, public_key, hash, @@ -391,16 +391,16 @@ int ED448ph_sign(uint8_t *out_sig, const uint8_t hash[64], } -int ED448ph_verify(const uint8_t hash[64], const uint8_t signature[112], - const uint8_t public_key[56], const uint8_t *context, +int ED448ph_verify(const uint8_t hash[64], const uint8_t signature[114], + const uint8_t public_key[57], const uint8_t *context, size_t context_len) { return decaf_ed448_verify_prehash(signature, public_key, hash, context, context_len) == DECAF_SUCCESS; } -int ED448_public_from_private(uint8_t out_public_key[56], - const uint8_t private_key[56]) +int ED448_public_from_private(uint8_t out_public_key[57], + const uint8_t private_key[57]) { return decaf_ed448_derive_public_key(out_public_key, private_key) == DECAF_SUCCESS; |