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

Bug calculation carry/borrow when right=0xFFFFFFFF and carry/borrow=1 #227

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

Conversation

valencif
Copy link

@valencif valencif commented Jun 7, 2024

Bug in uECC_vli_add and uECC_vli_sub

Error appear when oper2 = 0xFFFFFFFF and previous carry=1

i.e with 8 bits:

oper1:       83 +
oper2:       FF
           ------
   F+3=      12
 1+8+F=     18   // carry = (sum < left[i])  -->  carry = (8<8)  --> carry = 0 (Incorrect)
           ------
            182  //  Correct result

Equivalent error appears in the calculation of borrow in uECC_vli_sub

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.

2 participants