avoid borrow, breaks logging (#604)
This commit is contained in:
parent
1681197d67
commit
1d4f7c7a43
|
@ -201,14 +201,18 @@ proc verify*[T: byte|char](sig: SkSignature, msg: openarray[T],
|
||||||
let h = sha256.digest(msg)
|
let h = sha256.digest(msg)
|
||||||
verify(secp256k1.SkSignature(sig), SkMessage(h.data), secp256k1.SkPublicKey(key))
|
verify(secp256k1.SkSignature(sig), SkMessage(h.data), secp256k1.SkPublicKey(key))
|
||||||
|
|
||||||
func clear*(key: var SkPrivateKey) {.borrow.}
|
func clear*(key: var SkPrivateKey) = clear(secp256k1.SkSecretKey(key))
|
||||||
|
|
||||||
proc `$`*(key: SkPrivateKey): string {.borrow.}
|
func `$`*(key: SkPrivateKey): string = $secp256k1.SkSecretKey(key)
|
||||||
proc `$`*(key: SkPublicKey): string {.borrow.}
|
func `$`*(key: SkPublicKey): string = $secp256k1.SkPublicKey(key)
|
||||||
proc `$`*(key: SkSignature): string {.borrow.}
|
func `$`*(key: SkSignature): string = $secp256k1.SkSignature(key)
|
||||||
proc `$`*(key: SkKeyPair): string {.borrow.}
|
func `$`*(key: SkKeyPair): string = $secp256k1.SkKeyPair(key)
|
||||||
|
|
||||||
proc `==`*(a, b: SkPrivateKey): bool {.borrow.}
|
func `==`*(a, b: SkPrivateKey): bool =
|
||||||
proc `==`*(a, b: SkPublicKey): bool {.borrow.}
|
secp256k1.SkSecretKey(a) == secp256k1.SkSecretKey(b)
|
||||||
proc `==`*(a, b: SkSignature): bool {.borrow.}
|
func `==`*(a, b: SkPublicKey): bool =
|
||||||
proc `==`*(a, b: SkKeyPair): bool {.borrow.}
|
secp256k1.SkPublicKey(a) == secp256k1.SkPublicKey(b)
|
||||||
|
func `==`*(a, b: SkSignature): bool =
|
||||||
|
secp256k1.SkSignature(a) == secp256k1.SkSignature(b)
|
||||||
|
func `==`*(a, b: SkKeyPair): bool =
|
||||||
|
secp256k1.SkKeyPair(a) == secp256k1.SkKeyPair(b)
|
Loading…
Reference in New Issue