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

Hardware MPI loses sign when multiplying by -1 #1181

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

pieceofsummer
Copy link
Contributor

Test case:

mbedtls_mpi x, y, z;
mbedtls_mpi_init(&x); mbedtls_mpi_init(&y); mbedtls_mpi_init(&z);

mbedtls_mpi_lset(&x, 12345);
mbedtls_mpi_lset(&y, -1);
mbedtls_mpi_mul_mpi(&z, &x, &y);

mbedtls_mpi_write_file(NULL, &z, 10, NULL);

Expected: -12345
Actual: 12345

@CLAassistant
Copy link

CLAassistant commented Oct 28, 2017

CLA assistant check
All committers have signed the CLA.

@projectgus projectgus self-requested a review October 30, 2017 19:12
@projectgus
Copy link
Contributor

Good catch @pieceofsummer , thank you. I've pushed this into our internal review & merge queue.

@projectgus projectgus added the Status: Pending blocked by some other factor label Oct 30, 2017
@igrr igrr merged commit 5405255 into espressif:master Nov 7, 2017
igrr added a commit that referenced this pull request Nov 7, 2017
hwcrypto mpi: Fix losing sign when multiplying by -1 (github PR)

Contribution from github: #1181

See merge request !1471
@igrr igrr removed the Status: Pending blocked by some other factor label Nov 14, 2017
turmary pushed a commit to Seeed-Studio/Seeed_Arduino_mbedtls that referenced this pull request Jan 22, 2020
hwcrypto mpi: Fix losing sign when multiplying by -1 (github PR)

Contribution from github: espressif/esp-idf#1181

See merge request !1471
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.

None yet

4 participants