-
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
Bignum: Add Montgomery conversion and high level I/O #6017
Comments
PR 6083 and PR 6095 have been succeffully test-merged with conflicts resovles on 6017_add_Montgomery_conversion_high_lv_IO branch. Currently the code compiles, and all implemented tests are passing |
That's great! Note that with the merging of #6070 remove radix from test data I will be rebasing my PR on top of development, so you'll need to re-do the rebase (sorry) |
That is as expected (Also the reason this is for now a branch and not a PR). This step was neccessary to have a common starting point for implemting the |
Testing DesignFollowing the sync design meeting the following items have been agreed with regards to testing for this pr: For testing we need to test the following methods:
The following methods may need new tests to warranty the succesfull allocation/deallocation/zeorisation of memory: For testing we need to test for:
Because of the high level nature of this PR, most of the math are testing during the Multiplication depedency, and is assumed to be trustworthy. |
Reopening as the PR that automatically closed this is only the first in a series of PRs implementing this. |
Still not done, one more PR to go. |
Prerequisites: #6015, #6016
Add Montgomery conversion and high level I/O.
Add missing fields to the
mbedtls_mpi_mont_struct
and update setup and free to initialise and free these fields:https://github.com/hanno-arm/mbedtls/blob/ecp_prototype/library/bignum_core.h#L86-L87
Extract functions required to do this from the prototype.
Extract low level conversion functions from the prototype:
https://github.com/hanno-arm/mbedtls/blob/ecp_prototype/library/bignum_core.c#L963-L978
Adapt naming conventions and add them to
bignum_mod_raw.h
.Add I/O functions for
mbedtls_mod_residue
that take a modulus as a parameter and automatically converts to internal representation as needed based onint_rep
field of the modulus.The task includes making the legacy Bignum functions call the extracted functions where the functionality is duplicated. This is necessary to minimise cost in code size.
Whenever extracting functions from the prototype, there should be separate commits containing the code from the prototype, with the absolute minimum of modifications that make the library compile. (It is Ok if these functions are not called at all at this point.) These commits should have Hanno as the author (git commit --author="Hanno Becker [email protected]")
The prototype is too macro heavy. Most new macros should be expanded/removed or replaced with static functions if possible. (Pre-existing macros should not be touched.) The macro
MPI_CORE
should expand tombedtls_mpi_core_ ## func ##
instead ofmbedtls_mpi_core_ ## func ## _minimal
.All new function implementations should go into bignum_new.c.
This task is done when the following changes are merged on development:
mbedtls_mpi_mont_struct
bignum.c
are calling the new functions inlibrary/bignum_core.h
wherever possibleThe text was updated successfully, but these errors were encountered: