]> git.codecow.com Git - Monocypher.git/commitdiff
Fix Ed25519 secret_key size
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 1 Mar 2023 19:48:22 +0000 (20:48 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Wed, 1 Mar 2023 19:50:20 +0000 (20:50 +0100)
All EdDSA and Ed25519 secret keys are 64 bytes of course.
Fortunately this does not affect the generated code.

Fixes #258

doc/crypto_ed25519_sign.3monocypher
src/optional/monocypher-ed25519.c
src/optional/monocypher-ed25519.h

index db83fbf421f542d6a3c41700533dad81501f1f43..6418c94417a363adecc810a49769da3f26b2bbd8 100644 (file)
@@ -49,7 +49,7 @@
 .\" with this software.  If not, see
 .\" <https://creativecommons.org/publicdomain/zero/1.0/>
 .\"
-.Dd February 25, 2022
+.Dd March 01, 2022
 .Dt CRYPTO_ED25519_SIGN 3MONOCYPHER
 .Os
 .Sh NAME
@@ -84,7 +84,7 @@
 .Ft void
 .Fo crypto_ed25519_ph_sign
 .Fa "uint8_t signature[64]"
-.Fa "const uint8_t secret_key[32]"
+.Fa "const uint8_t secret_key[64]"
 .Fa "const uint8_t message_hash[64]"
 .Fc
 .Ft int
index b76503ade19dd7fd2318f28df212e127746a118e..5e4dcdf89daae7c214eddce47d498ad3ce1e6b47 100644 (file)
@@ -463,7 +463,7 @@ static void ed25519_dom_sign(u8 signature [64], const u8 secret_key[32],
        WIPE_BUFFER(r);
 }
 
-void crypto_ed25519_sign(u8 signature [64], const u8 secret_key[32],
+void crypto_ed25519_sign(u8 signature [64], const u8 secret_key[64],
                          const u8 *message, size_t message_size)
 {
        ed25519_dom_sign(signature, secret_key, 0, 0, message, message_size);
@@ -479,7 +479,7 @@ int crypto_ed25519_check(const u8 signature[64], const u8 public_key[32],
 
 static const u8 domain[34] = "SigEd25519 no Ed25519 collisions\1";
 
-void crypto_ed25519_ph_sign(uint8_t signature[64], const uint8_t secret_key[32],
+void crypto_ed25519_ph_sign(uint8_t signature[64], const uint8_t secret_key[64],
                             const uint8_t message_hash[64])
 {
        ed25519_dom_sign(signature, secret_key, domain, sizeof(domain),
index 9334a899e1a0ef56e42ef0a25ea591edeb015cb0..d7aa004123e1d38b891fdabd4171fbf9957242ae 100644 (file)
@@ -119,7 +119,7 @@ void crypto_ed25519_key_pair(uint8_t secret_key[64],
                              uint8_t public_key[32],
                              uint8_t seed[32]);
 void crypto_ed25519_sign(uint8_t        signature [64],
-                         const uint8_t  secret_key[32],
+                         const uint8_t  secret_key[64],
                          const uint8_t *message, size_t message_size);
 int crypto_ed25519_check(const uint8_t  signature [64],
                          const uint8_t  public_key[32],
@@ -127,7 +127,7 @@ int crypto_ed25519_check(const uint8_t  signature [64],
 
 // Pre-hash variants
 void crypto_ed25519_ph_sign(uint8_t       signature   [64],
-                            const uint8_t secret_key  [32],
+                            const uint8_t secret_key  [64],
                             const uint8_t message_hash[64]);
 int crypto_ed25519_ph_check(const uint8_t signature   [64],
                             const uint8_t public_key  [32],