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

Consider serializing compressed keys in ?pj= parameters #344

Open
DanGould opened this issue Aug 13, 2024 · 0 comments
Open

Consider serializing compressed keys in ?pj= parameters #344

DanGould opened this issue Aug 13, 2024 · 0 comments

Comments

@DanGould
Copy link
Contributor

DanGould commented Aug 13, 2024

Secp256k1 keys for HPKE (and OHTTP that depends on it) are 65 bytes according to the IANA DHKEM(secp256k1, HKDF-SHA256) spec. Since these need to be serialized in a sharable format often exchanged via QR, a better user experience would compress them

Compressed Public Key: A secp256k1 compressed public key consists of 33 bytes. The first byte indicates the parity (even or odd) of the y-coordinate (0x02 for even and 0x03 for odd), and the remaining 32 bytes represent the x-coordinate of the elliptic curve point. The y-coordinate is omitted in the compressed form because it can be derived from the x-coordinate and the parity.

We need to first determine whether this is a hard requirement since it adds complexity and then how we'd de/serialize them into an Ohttp Key config with default parameters that shouldn't change.

Depends on #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant