Skip to content

Commit

Permalink
set EC2 key x/y capacity when marshaling
Browse files Browse the repository at this point in the history
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
  • Loading branch information
qmuntal committed Jul 18, 2023
1 parent f02809a commit fae3330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ func (k *Key) MarshalCBOR() ([]byte, error) {
crv, x, y, _ := k.EC2()
if size := curveSize(crv); size > 0 {
if 0 < len(x) && len(x) < size {
tmp[KeyLabelEC2X] = append(make([]byte, size-len(x)), x...)
tmp[KeyLabelEC2X] = append(make([]byte, size-len(x), size), x...)
}
if 0 < len(y) && len(y) < size {
tmp[KeyLabelEC2Y] = append(make([]byte, size-len(y)), y...)
tmp[KeyLabelEC2Y] = append(make([]byte, size-len(y), size), y...)
}
}
}
Expand Down

0 comments on commit fae3330

Please sign in to comment.