From 932a57e1e47e56d9fb99c8c47cc389328a65ea76 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 25 Aug 2021 22:31:31 +0300 Subject: [PATCH] keys: reuse coordLen where appropriate --- pkg/crypto/keys/publickey.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/crypto/keys/publickey.go b/pkg/crypto/keys/publickey.go index be3a799ce..f39a15b1d 100644 --- a/pkg/crypto/keys/publickey.go +++ b/pkg/crypto/keys/publickey.go @@ -249,7 +249,7 @@ func (p *PublicKey) DecodeBinary(r *io.BinReader) { return case 0x02, 0x03: // Compressed public keys - xbytes := make([]byte, 32) + xbytes := make([]byte, coordLen) r.ReadBytes(xbytes) if r.Err != nil { return @@ -262,8 +262,8 @@ func (p *PublicKey) DecodeBinary(r *io.BinReader) { return } case 0x04: - xbytes := make([]byte, 32) - ybytes := make([]byte, 32) + xbytes := make([]byte, coordLen) + ybytes := make([]byte, coordLen) r.ReadBytes(xbytes) r.ReadBytes(ybytes) if r.Err != nil {