Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed public key DID for NIST ECDSA curves #80

Closed
dholms opened this issue Jun 14, 2022 · 3 comments · Fixed by #81
Closed

Compressed public key DID for NIST ECDSA curves #80

dholms opened this issue Jun 14, 2022 · 3 comments · Fixed by #81

Comments

@dholms
Copy link
Collaborator

dholms commented Jun 14, 2022

The multicodec spec says that the public key DID for NIST ECDSA should be the compressed public key (33 bytes) instead of the full (64 byte) public key.

https://github.com/multiformats/multicodec/blob/e9ecf587558964715054a0afcc01f7ace220952c/table.csv#L141

@dholms
Copy link
Collaborator Author

dholms commented Jun 14, 2022

I'm planning to implement this btw 👍

Couple links:

@dholms
Copy link
Collaborator Author

dholms commented Jun 16, 2022

Implemented internally here: https://github.com/bluesky-social/adx/pull/139/files#diff-c4ab40937a57e2f51e45e0e65f47c9a6d94a9e75b1f86ddf4f563f1c09028587R47

I ended up using big-integer.js because native BigInts don't have fully support & they don't support the necessary modular arithmetic & would require an extension anyway: bigint-mod-arith

Happy to pull this over & make a PR, just wanna know that we def want it here 👍

This also only implements it for NIST P-256 atm & not for the other NIST curves. Same logic though, just different curve params.

Thoughts? @matheus23

@matheus23
Copy link
Member

Happy to pull this over & make a PR, just wanna know that we def want it here +1

This also only implements it for NIST P-256 atm & not for the other NIST curves. Same logic though, just different curve params.

Thoughts? @matheus23

Looks good! Would love to approve such a PR 👍

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 a pull request may close this issue.

2 participants