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

Clarified shared secret validation #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions draft-wahby-cfrg-hpke-kem-secp256k1.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ Conversion functions in this section are defined in {{SEC1v2}}.
- The SerializePublicKey() function uses the uncompressed Elliptic-Curve-Point-to-Octet-String conversion.

- The DeserializePublicKey() function uses the uncompressed Octet-String-to-Elliptic-Curve-Point conversion.
Deserialized public keys MUST be validated before they can be used in a
manner analogous to the one for NIST-P256 in {{RFC9180}}, Section 7.1.4.

- The SerializePrivateKey() function uses the Field-Element-to-Octet-String conversion.
If the private key is an integer outside the range [0, order-1], where 'order' is
Expand All @@ -95,6 +93,10 @@ Conversion functions in this section are defined in {{SEC1v2}}.

- The DeserializePrivateKey() function uses the Octet-String-to-Field-Element conversion.

## Validation of Inputs and Outputs

As with the NIST-P256 DHKEM, senders and recipients using the secp256k1 DHKEM MUST perform partial public key validation on all public key inputs, as defined in Section 5.6.2.3.4 of [keyagreement]. This includes checking that the coordinates are in the correct range, that the point is on the curve, and that the point is not the point at infinity. Additionally, senders and recipients MUST ensure the Diffie-Hellman shared secret is not the point at infinity.

## DeriveKeyPair

The DeriveKeyPair() function is as described in {{RFC9180}}, Section 7.1.3.
Expand Down