From 4fe40cff7cc1cd3f165c1c8902a710a514a10ea5 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Sun, 1 Dec 2019 14:29:16 +0100 Subject: [PATCH] Renamed crypto_sign_sha512_ctx into crypto_sign_ed25519_ctx 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 | 12 ++++++------ src/optional/ed25519.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/optional/ed25519.c b/src/optional/ed25519.c index 5279c2e..1313cf7 100644 --- a/src/optional/ed25519.c +++ b/src/optional/ed25519.c @@ -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); diff --git a/src/optional/ed25519.h b/src/optional/ed25519.h index 981140e..e22c86b 100644 --- a/src/optional/ed25519.h +++ b/src/optional/ed25519.h @@ -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 // ------- -- 2.47.3