SIDH Library is a fast and portable software library that implements state-of-the-art supersingular isogeny cryptographic schemes. The chosen parameters aim to provide security against attackers running a large-scale quantum computer, and security against classical algorithms.
MIT License
318
stars
101
forks
source link
Too many global variables, functions etc in SIDH source modules #26
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.
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 typedefine 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 thePnnn.c
files. These#defines
were put into thePnnn_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
.