From 9cb9f6677f94ca261ae928a43eac7b1b5a7b9ed6 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Mon, 17 Jul 2023 20:04:58 -0700 Subject: [PATCH] use full secret hash including prefix byte 0x02 / 0x03 --- codexdht/private/eth/p2p/discoveryv5/crypto.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codexdht/private/eth/p2p/discoveryv5/crypto.nim b/codexdht/private/eth/p2p/discoveryv5/crypto.nim index a62cb42..2ba3939 100644 --- a/codexdht/private/eth/p2p/discoveryv5/crypto.nim +++ b/codexdht/private/eth/p2p/discoveryv5/crypto.nim @@ -89,7 +89,7 @@ func ecdhSharedSecretFull*(seckey: PrivateKey, pubkey: PublicKey): SharedSecretF proc ecdhRaw*( priv: PrivateKey, pub: PublicKey -): Result[SharedSecret, cstring] = +): Result[SharedSecretFull, cstring] = ## emulate old ecdhRaw style keys ## ## this includes a leading 0x02 or 0x03 @@ -98,4 +98,4 @@ proc ecdhRaw*( if priv.scheme != Secp256k1 or pub.scheme != Secp256k1: return err "Must use secp256k1 scheme".cstring - ok ecdhSharedSecret(priv.skkey, pub.skkey) + ok ecdhSharedSecretFull(priv, pub)