]> git.codecow.com Git - Monocypher.git/commitdiff
Added aliases for Ed25519
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 11:26:47 +0000 (12:26 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 11:26:47 +0000 (12:26 +0100)
src/optional/ed25519.c
src/optional/ed25519.h

index cc1da19b68750ba1ec914529ce78cd0ffc4ebbe8..3782994ba5ca4049295dda1787a3d69d5f61612f 100644 (file)
@@ -261,11 +261,11 @@ void crypto_ed25519_sign(u8        signature [64],
                          const u8 *message, size_t message_size)
 {
     crypto_sign_sha512_ctx ctx;
-    crypto_ed25519_sign_init_first_pass((void*)&ctx, secret_key, public_key);
-    crypto_sign_update                 ((void*)&ctx, message, message_size);
-    crypto_sign_init_second_pass       ((void*)&ctx);
-    crypto_sign_update                 ((void*)&ctx, message, message_size);
-    crypto_sign_final                  ((void*)&ctx, signature);
+    crypto_ed25519_sign_init_first_pass ((void*)&ctx, secret_key, public_key);
+    crypto_ed25519_sign_update          ((void*)&ctx, message, message_size);
+    crypto_ed25519_sign_init_second_pass((void*)&ctx);
+    crypto_ed25519_sign_update          ((void*)&ctx, message, message_size);
+    crypto_ed25519_sign_final           ((void*)&ctx, signature);
 
 }
 
@@ -275,7 +275,7 @@ int crypto_ed25519_check(const u8  signature [64],
 {
     crypto_check_sha512_ctx ctx;
     crypto_ed25519_check_init((void*)&ctx, signature, public_key);
-    crypto_check_update((void*)&ctx, message, message_size);
-    return crypto_check_final((void*)&ctx);
+    crypto_ed25519_check_update((void*)&ctx, message, message_size);
+    return crypto_ed25519_check_final((void*)&ctx);
 }
 
index fa40cb7ba7e78646cb73fe05dae0bcc29f9d4bba..3753c210d0a6b24c6618ce33778189285a11ddb7 100644 (file)
@@ -53,13 +53,20 @@ int crypto_ed25519_check(const uint8_t  signature [64],
                          const uint8_t  public_key[32],
                          const uint8_t *message, size_t message_size);
 
-// Init functions for the incremental interface
+// Incremental interface
 void crypto_ed25519_sign_init_first_pass(crypto_sign_ctx_abstract *ctx,
                                          const uint8_t secret_key[32],
                                          const uint8_t public_key[32]);
+#define crypto_ed25519_sign_update crypto_sign_update
+#define crypto_ed25519_sign_init_second_pass crypto_sign_init_second_pass
+// use crypto_ed25519_sign_update() again.
+#define crypto_ed25519_sign_final crypto_sign_final
+
 void crypto_ed25519_check_init(crypto_check_ctx_abstract *ctx,
                                const uint8_t signature[64],
                                const uint8_t public_key[32]);
+#define crypto_ed25519_check_update crypto_check_update
+#define crypto_ed25519_check_final crypto_check_final
 
 
 #endif // ED25519_H