From d9846bba7472a6501b8960c7fe40b3a09c083983 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Mon, 7 Apr 2025 14:44:42 -0500 Subject: [PATCH] crypto: make ec_point comparable --- src/crypto/crypto.h | 1 + tests/crypto/main.cpp | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index 9687652..a4e0e77 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -371,6 +371,7 @@ inline const unsigned char* to_bytes(const crypto::ec_scalar &scalar) { return & inline unsigned char* to_bytes(crypto::ec_point &point) { return &reinterpret_cast(point); } inline const unsigned char* to_bytes(const crypto::ec_point &point) { return &reinterpret_cast(point); } +CRYPTO_MAKE_HASHABLE(ec_point) CRYPTO_MAKE_HASHABLE(public_key) CRYPTO_MAKE_HASHABLE_CONSTANT_TIME(secret_key) CRYPTO_MAKE_HASHABLE_CONSTANT_TIME(public_key_memsafe) diff --git a/tests/crypto/main.cpp b/tests/crypto/main.cpp index 045ffc0..6b87b80 100644 --- a/tests/crypto/main.cpp +++ b/tests/crypto/main.cpp @@ -49,10 +49,6 @@ bool operator !=(const ec_scalar &a, const ec_scalar &b) { return 0 != memcmp(&a, &b, sizeof(ec_scalar)); } -bool operator !=(const ec_point &a, const ec_point &b) { - return 0 != memcmp(&a, &b, sizeof(ec_point)); -} - bool operator !=(const key_derivation &a, const key_derivation &b) { return 0 != memcmp(&a, &b, sizeof(key_derivation)); }