Perform constant time comparison of keys and signatures. (#24)
Bump version to 0.5.1.
This commit is contained in:
parent
bf6cc94a3c
commit
fb9699702b
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
strformat, typetraits,
|
strformat, typetraits,
|
||||||
stew/[byteutils, objects, results],
|
stew/[byteutils, objects, results, ctops],
|
||||||
./secp256k1_abi
|
./secp256k1_abi
|
||||||
|
|
||||||
from nimcrypto/utils import burnMem
|
from nimcrypto/utils import burnMem
|
||||||
|
@ -418,15 +418,15 @@ proc random*(T: type SkKeyPair, rng: FoolproofRng): T =
|
||||||
|
|
||||||
func `==`*(lhs, rhs: SkPublicKey): bool =
|
func `==`*(lhs, rhs: SkPublicKey): bool =
|
||||||
## Compare Secp256k1 `public key` objects for equality.
|
## Compare Secp256k1 `public key` objects for equality.
|
||||||
lhs.toRaw() == rhs.toRaw()
|
CT.isEqual(lhs.toRaw(), rhs.toRaw())
|
||||||
|
|
||||||
func `==`*(lhs, rhs: SkSignature): bool =
|
func `==`*(lhs, rhs: SkSignature): bool =
|
||||||
## Compare Secp256k1 `signature` objects for equality.
|
## Compare Secp256k1 `signature` objects for equality.
|
||||||
lhs.toRaw() == rhs.toRaw()
|
CT.isEqual(lhs.toRaw(), rhs.toRaw())
|
||||||
|
|
||||||
func `==`*(lhs, rhs: SkRecoverableSignature): bool =
|
func `==`*(lhs, rhs: SkRecoverableSignature): bool =
|
||||||
## Compare Secp256k1 `recoverable signature` objects for equality.
|
## Compare Secp256k1 `recoverable signature` objects for equality.
|
||||||
lhs.toRaw() == rhs.toRaw()
|
CT.isEqual(lhs.toRaw(), rhs.toRaw())
|
||||||
|
|
||||||
func sign*(key: SkSecretKey, msg: SkMessage): SkSignature =
|
func sign*(key: SkSecretKey, msg: SkMessage): SkSignature =
|
||||||
## Sign message `msg` using private key `key` and return signature object.
|
## Sign message `msg` using private key `key` and return signature object.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mode = ScriptMode.Verbose
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
packageName = "secp256k1"
|
packageName = "secp256k1"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
author = "Status Research & Development GmbH"
|
author = "Status Research & Development GmbH"
|
||||||
description = "A wrapper for the libsecp256k1 C library"
|
description = "A wrapper for the libsecp256k1 C library"
|
||||||
license = "Apache License 2.0"
|
license = "Apache License 2.0"
|
||||||
|
|
Loading…
Reference in New Issue