Perform constant time comparison of keys and signatures. (#24)

Bump version to 0.5.1.
This commit is contained in:
Eugene Kabanov 2020-07-30 17:48:40 +03:00 committed by GitHub
parent bf6cc94a3c
commit fb9699702b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@
import
strformat, typetraits,
stew/[byteutils, objects, results],
stew/[byteutils, objects, results, ctops],
./secp256k1_abi
from nimcrypto/utils import burnMem
@ -418,15 +418,15 @@ proc random*(T: type SkKeyPair, rng: FoolproofRng): T =
func `==`*(lhs, rhs: SkPublicKey): bool =
## Compare Secp256k1 `public key` objects for equality.
lhs.toRaw() == rhs.toRaw()
CT.isEqual(lhs.toRaw(), rhs.toRaw())
func `==`*(lhs, rhs: SkSignature): bool =
## Compare Secp256k1 `signature` objects for equality.
lhs.toRaw() == rhs.toRaw()
CT.isEqual(lhs.toRaw(), rhs.toRaw())
func `==`*(lhs, rhs: SkRecoverableSignature): bool =
## Compare Secp256k1 `recoverable signature` objects for equality.
lhs.toRaw() == rhs.toRaw()
CT.isEqual(lhs.toRaw(), rhs.toRaw())
func sign*(key: SkSecretKey, msg: SkMessage): SkSignature =
## Sign message `msg` using private key `key` and return signature object.

View File

@ -1,7 +1,7 @@
mode = ScriptMode.Verbose
packageName = "secp256k1"
version = "0.5.0"
version = "0.5.1"
author = "Status Research & Development GmbH"
description = "A wrapper for the libsecp256k1 C library"
license = "Apache License 2.0"