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

Too many global variables, functions etc in SIDH source modules #26

Open
wernerd opened this issue Feb 20, 2020 · 1 comment
Open

Too many global variables, functions etc in SIDH source modules #26

wernerd opened this issue Feb 20, 2020 · 1 comment

Comments

@wernerd
Copy link

wernerd commented Feb 20, 2020

In my fork of SIDH to add Cmake, C++ wrapper, Android, Java support I build a shared library which includes the SIDH modules. To support Android applications a shared library is a pre-requisite.

When combining all SIDH modules (P434, P503, P610, P751) into one shared library there are a lot of multiple definitions due to global variables and functions. To solve the problems I did some small refactoring of the sources:

  • move some functions to a common/common_funcs.c file. The common functions do not
    depend on fields or parameters which are specific to a SIDH type

  • define several fields/arrays/functions as static inside their sources files. Due to
    the sources' structure this was possible without affecting functionality. This also reduces
    the number of global definitions which is a 'good thing (tm)' :-) in general.

  • add some #defines to map generic names to SIDH type specific names. This follows the
    technique already in use inside the Pnnn.c files. These #defines were put into the
    Pnnn_internal.h files and thus are accessible to the arithmetic tests.

No changes to the actual implementation of the math-functions.

If this is of interest to the SIDH dev team please have a look at the fork mentioned above, branch develop.

@christianpaquin
Copy link
Contributor

You might consider using the open quantum safe library, which contains an integration of all the SIDH/SIKE variants in one library.

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

No branches or pull requests

2 participants