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

Use of wrong group constant for calculating e in ECDSA_SIG_recover_key_GFp #7

Open
smlu opened this issue Dec 29, 2023 · 0 comments
Open

Comments

@smlu
Copy link

smlu commented Dec 29, 2023

There is a bug in public_key_impl::ECDSA_SIG_recover_key_GFp where the bit size of the group prime p is retrieved via call to EC_GROUP_get_degree. However, according to SEC1-v2 "4.1.4 Verifying Operation", part 3.2 , the bit size of the prime order n of the base point G should be used to compute e from M.
While this issue is pedantic, and in practice, the bit size of prime p and group order n for EC secp256r1 (P-256) is the same, it would be advisable to use EC_GROUP_order_bits instead. This becomes especially important for future cases if other ECs are supported where bitsize(n) != bitsize(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