From 85ee8a0bb13f35c26cb5b710dd4796d981c9cae8 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Sat, 6 Jan 2018 13:46:05 +0100 Subject: [PATCH] removed useless check If the public key is not in the curve, the verification will simply fail. There is little point verifying the validity of a signing public key, since you have to trust its origin in the first place. --- src/monocypher.c | 6 ------ src/monocypher.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/monocypher.c b/src/monocypher.c index b4828f1..334b0cd 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -1602,12 +1602,6 @@ void crypto_sign(u8 signature[64], crypto_sign_final (&ctx, signature); } -int crypto_check_public_key(const u8 public_key[32]) -{ - ge A; // wasted result. - return ge_frombytes_neg(&A, public_key); -} - void crypto_check_init(crypto_check_ctx *ctx, const u8 signature[64], const u8 public_key[32]) diff --git a/src/monocypher.h b/src/monocypher.h index 4014b50..9e2b035 100644 --- a/src/monocypher.h +++ b/src/monocypher.h @@ -180,8 +180,6 @@ void crypto_sign(uint8_t signature [64], const uint8_t public_key[32], // optional, may be 0 const uint8_t *message, size_t message_size); -int crypto_check_public_key(const uint8_t public_key[32]); - // EdDSA check context. Do not rely on its contents or its size, they // may change without notice. typedef struct { -- 2.47.3