Skip to content

Change logic of choosing early key shares #2052

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

linukaratnayake
Copy link

In the current implementation, if either the x25519 or secp256r1 algorithms are present in the list of named groups, one of them is used for early key shares—regardless of the presence of other algorithms. However, with the growing adoption of post-quantum cryptography, it is increasingly important to include post-quantum secure algorithms (i.e., KEM-based algorithms) in the early key shares.

Section 4.2.8 in the RFC 8446 mentions the following:

Clients can offer as many KeyShareEntry values as the number of supported groups it is offering, each representing a single set of key exchange parameters.

This means it is valid for clients to include multiple KeyShareEntry values corresponding to different named groups.

Updated Logic

The updated implementation modifies the selection logic for early key shares as follows:

  • If no KEM-type algorithms are present in the list of named groups:

    • If x25519 or secp256r1 is present, it is selected (in that order of preference).
    • Otherwise, the first algorithm in the list is used.
  • If one or more KEM-type algorithms are present:

    • The first KEM-type algorithm from the list is selected.
    • Additionally, the non-KEM algorithm is chosen using the logic above (can be omitted if none qualify).
    • Both selected algorithms are included in the early key share groups, preserving the order in which they appear in list of named groups.

This change ensures early key share negotiation includes support for post-quantum algorithms while maintaining backward compatibility with existing logic.

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.

1 participant