mirror of
https://github.com/codex-storage/nim-codex-dht.git
synced 2025-02-12 03:47:07 +00:00
use full secret hash including prefix byte 0x02 / 0x03
This commit is contained in:
parent
486d5f2326
commit
9cb9f6677f
@ -89,7 +89,7 @@ func ecdhSharedSecretFull*(seckey: PrivateKey, pubkey: PublicKey): SharedSecretF
|
|||||||
proc ecdhRaw*(
|
proc ecdhRaw*(
|
||||||
priv: PrivateKey,
|
priv: PrivateKey,
|
||||||
pub: PublicKey
|
pub: PublicKey
|
||||||
): Result[SharedSecret, cstring] =
|
): Result[SharedSecretFull, cstring] =
|
||||||
## emulate old ecdhRaw style keys
|
## emulate old ecdhRaw style keys
|
||||||
##
|
##
|
||||||
## this includes a leading 0x02 or 0x03
|
## this includes a leading 0x02 or 0x03
|
||||||
@ -98,4 +98,4 @@ proc ecdhRaw*(
|
|||||||
if priv.scheme != Secp256k1 or pub.scheme != Secp256k1:
|
if priv.scheme != Secp256k1 or pub.scheme != Secp256k1:
|
||||||
return err "Must use secp256k1 scheme".cstring
|
return err "Must use secp256k1 scheme".cstring
|
||||||
|
|
||||||
ok ecdhSharedSecret(priv.skkey, pub.skkey)
|
ok ecdhSharedSecretFull(priv, pub)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user