Skip to content

Fix P-521 coordinate length calculation#29

Merged
leelynne merged 2 commits into
remitly-oss:mainfrom
getvictor:patch-2
Jul 28, 2025
Merged

Fix P-521 coordinate length calculation#29
leelynne merged 2 commits into
remitly-oss:mainfrom
getvictor:patch-2

Conversation

@getvictor

Copy link
Copy Markdown
Contributor

The P-521 curve has 521 bits (65.125 bytes), but JWK EC coordinates must be zero-padded to 66 bytes. Using crv.Params().BitSize/8 truncates to 65 bytes. Updating the calculation to round up. We need 66 bytes to store 521 bits.

The P-521 curve has 521 bits (65.125 bytes), but JWK EC coordinates must be zero-padded to 66 bytes. Using `crv.Params().BitSize/8` truncates to 65 bytes. Updating the calculation to round up

@leelynne leelynne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! One request for a comment.

Comment thread keyutil/jwk.go
@leelynne
leelynne merged commit 5099cfa into remitly-oss:main Jul 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants