Skip to content

Commit

Permalink
fix bug in deserializing ed25519 public key
Browse files Browse the repository at this point in the history
  • Loading branch information
AlverLyu committed Dec 13, 2018
1 parent 9e0c9ff commit eac296b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keypair/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func DeserializePublicKey(data []byte) (PublicKey, error) {
if len(data[2:]) < ed25519.PublicKeySize {
return nil, errors.New("deserializing public key failed: not enough length for Ed25519 key")
}
pk := make([]byte, len(data)-2)
pk := make([]byte, ed25519.PublicKeySize)
copy(pk, data[2:])
return ed25519.PublicKey(pk), nil
} else {
Expand Down

0 comments on commit eac296b

Please sign in to comment.