-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ecp.c: Refactored a minor check in ecp check privkey #9494
ecp.c: Refactored a minor check in ecp check privkey #9494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment isn't right.
/* Zero limb mpis are invalid, but even if | ||
one is provided for d, the grp->nbits | ||
can not be equal to UINT64_MAX. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this comment is wrong.
Zero limb mpis are invalid
- Zero-limb
mbedtls_mpi
are perfectly valid to represent the value 0. - Zero-limb MPIs are not relevant here.
mbedtls_mpi_bitlen(d)
is 0 when the value ofd
is 0, regardless of how many limbs are used to represent it.
can not be equal to
UINT64_MAX
UINT64_MAX
is irrelevant here, you meant SIZE_MAX
. This computation doesn't involve uint64_t
values. Both mbedtls_mpi_bitlen(d)
and grp->nbits
are size_t
values.
Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: minosgalanakis <[email protected]>
0708460
to
991c658
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR has been migrated to the TF-PSA-Framework PR166 |
Description
Added a comment based on an investigation we did at the functional behaviour of a check.
PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.
Notes for the submitter
Please refer to the contributing guidelines, especially the
checklist for PR contributors.
Help make review efficient: