forked from TrueCloudLab/neoneo-go
keys: reuse coordLen where appropriate
This commit is contained in:
parent
2585713f31
commit
932a57e1e4
1 changed files with 3 additions and 3 deletions
|
@ -249,7 +249,7 @@ func (p *PublicKey) DecodeBinary(r *io.BinReader) {
|
||||||
return
|
return
|
||||||
case 0x02, 0x03:
|
case 0x02, 0x03:
|
||||||
// Compressed public keys
|
// Compressed public keys
|
||||||
xbytes := make([]byte, 32)
|
xbytes := make([]byte, coordLen)
|
||||||
r.ReadBytes(xbytes)
|
r.ReadBytes(xbytes)
|
||||||
if r.Err != nil {
|
if r.Err != nil {
|
||||||
return
|
return
|
||||||
|
@ -262,8 +262,8 @@ func (p *PublicKey) DecodeBinary(r *io.BinReader) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case 0x04:
|
case 0x04:
|
||||||
xbytes := make([]byte, 32)
|
xbytes := make([]byte, coordLen)
|
||||||
ybytes := make([]byte, 32)
|
ybytes := make([]byte, coordLen)
|
||||||
r.ReadBytes(xbytes)
|
r.ReadBytes(xbytes)
|
||||||
r.ReadBytes(ybytes)
|
r.ReadBytes(ybytes)
|
||||||
if r.Err != nil {
|
if r.Err != nil {
|
||||||
|
|
Loading…
Reference in a new issue