From 689c7d630a552b6e7e3a19f7e4173de0ac0ad7cc Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 7 Dec 2017 13:15:01 +0100 Subject: [PATCH] crypto/secp256k1: rename output variables in DecompressPubkey --- crypto/secp256k1/secp256.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/secp256k1/secp256.go b/crypto/secp256k1/secp256.go index 71005b1a09..1650601149 100644 --- a/crypto/secp256k1/secp256.go +++ b/crypto/secp256k1/secp256.go @@ -135,17 +135,17 @@ func VerifySignature(pubkey, msg, signature []byte) bool { // DecompressPubkey parses a public key in the 33-byte compressed format. // It returns non-nil coordinates if the public key is valid. -func DecompressPubkey(pubkey []byte) (X, Y *big.Int) { +func DecompressPubkey(pubkey []byte) (x, y *big.Int) { if len(pubkey) != 33 { return nil, nil } - buf := make([]byte, 65) - bufdata := (*C.uchar)(unsafe.Pointer(&buf[0])) + out := make([]byte, 65) + outdata := (*C.uchar)(unsafe.Pointer(&out[0])) pubkeydata := (*C.uchar)(unsafe.Pointer(&pubkey[0])) if C.secp256k1_ext_decompress_pubkey(context, outdata, pubkeydata) == 0 { return nil, nil } - return new(big.Int).SetBytes(buf[1:33]), new(big.Int).SetBytes(buf[33:]) + return new(big.Int).SetBytes(out[1:33]), new(big.Int).SetBytes(out[33:]) } func checkSignature(sig []byte) error {