Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ECC cofactor: fix check scalar bits #5737

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

SparkiDev
Copy link
Contributor

Description

For shared secrets, when a curve has a cofactor, the private key (in range of order) is multiplied by the cofactor before use.

If there is a cofactor involved, check bit size of scalar against modulus instead of order.

Fixes zd#15017

Testing

Modified test.c to use SECP112R2 instead of SECP112R1.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev assigned dgarske and SparkiDev and unassigned SparkiDev Oct 26, 2022
@dgarske dgarske assigned haydenroche5 and unassigned dgarske Nov 3, 2022
wolfcrypt/src/ecc.c Outdated Show resolved Hide resolved
SparkiDev and others added 2 commits November 3, 2022 10:00
For shared secrets, when a curve has a cofactor, the private key (in
range of order) is multiplied by the cofactor before use.

If there is a cofactor involved, check bit size of scalar against
modulus instead of order.
@dgarske dgarske requested a review from haydenroche5 November 3, 2022 17:13
@haydenroche5 haydenroche5 merged commit 7cc2336 into wolfSSL:master Nov 4, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants