]> git.codecow.com Git - Monocypher.git/commitdiff
Renamed crypto_sign_sha512_ctx into crypto_sign_ed25519_ctx
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 13:29:16 +0000 (14:29 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 13:29:16 +0000 (14:29 +0100)
Also renamed crypto_check_sha512_ctx into crypto_check_ed25519_ctx

This is for consistency with the naming of the functions themselves.

src/optional/ed25519.c
src/optional/ed25519.h

index 5279c2ee5fe8ff9518e37435fcc241a95b2ac5d4..1313cf779f2a71776382d35f4789a203de61b560 100644 (file)
@@ -207,17 +207,17 @@ void crypto_sha512(u8 *hash, const u8 *message, size_t message_size)
 
 static void sha512_vtable_init(void *ctx)
 {
-    crypto_sha512_init(&((crypto_sign_sha512_ctx*)ctx)->hash);
+    crypto_sha512_init(&((crypto_sign_ed25519_ctx*)ctx)->hash);
 }
 
 static void sha512_vtable_update(void *ctx, const u8 *m, size_t s)
 {
-    crypto_sha512_update(&((crypto_sign_sha512_ctx*)ctx)->hash, m, s);
+    crypto_sha512_update(&((crypto_sign_ed25519_ctx*)ctx)->hash, m, s);
 }
 
 static void sha512_vtable_final(void *ctx, u8 *h)
 {
-    crypto_sha512_final(&((crypto_sign_sha512_ctx*)ctx)->hash, h);
+    crypto_sha512_final(&((crypto_sign_ed25519_ctx*)ctx)->hash, h);
 }
 
 const crypto_sign_vtable crypto_sha512_vtable = {
@@ -225,7 +225,7 @@ const crypto_sign_vtable crypto_sha512_vtable = {
     sha512_vtable_init,
     sha512_vtable_update,
     sha512_vtable_final,
-    sizeof(crypto_sign_sha512_ctx),
+    sizeof(crypto_sign_ed25519_ctx),
 };
 
 ///////////////
@@ -260,7 +260,7 @@ void crypto_ed25519_sign(u8        signature [64],
                          const u8  public_key[32],
                          const u8 *message, size_t message_size)
 {
-    crypto_sign_sha512_ctx ctx;
+    crypto_sign_ed25519_ctx ctx;
     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);
@@ -273,7 +273,7 @@ int crypto_ed25519_check(const u8  signature [64],
                          const u8  public_key[32],
                          const u8 *message, size_t message_size)
 {
-    crypto_check_sha512_ctx ctx;
+    crypto_check_ed25519_ctx ctx;
     crypto_ed25519_check_init((void*)&ctx, signature, public_key);
     crypto_ed25519_check_update((void*)&ctx, message, message_size);
     return crypto_ed25519_check_final((void*)&ctx);
index 981140e48bb0a0dc5f2443726ed51fdf17b2cd8f..e22c86b1fc931eeb14543fa9acead4346560181c 100644 (file)
@@ -22,8 +22,8 @@ typedef struct {
 typedef struct {
     crypto_sign_ctx_abstract ctx;
     crypto_sha512_ctx        hash;
-} crypto_sign_sha512_ctx;
-typedef crypto_sign_sha512_ctx crypto_check_sha512_ctx;
+} crypto_sign_ed25519_ctx;
+typedef crypto_sign_ed25519_ctx crypto_check_ed25519_ctx;
 
 // SHA 512
 // -------