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

Missing zero checks in DH operation in X448, P-256, and P-521 #43

Open
rozbb opened this issue Sep 11, 2020 · 0 comments
Open

Missing zero checks in DH operation in X448, P-256, and P-521 #43

rozbb opened this issue Sep 11, 2020 · 0 comments

Comments

@rozbb
Copy link
Contributor

rozbb commented Sep 11, 2020

Section 7.1.3 states that DH results MUST be rejected if they are the point at infinity. Currently (including the current PR), this check is only implemented for X25519. There should be a similar check for X448 and the NIST curves.

A suggestion for the P-curves: I actually don't explicitly check for the point at infinity in rust-hpke. Instead, I mandate that all private keys be in the range (0,p-1] (a pretty standard requirement), and that received pubkeys not be the point at infinity (already mandated by the spec). The combination of these two requirements means that sk * pk cannot be the point at infinity, since pk has order p and sk is not 0 mod p.

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

No branches or pull requests

1 participant