Skip to content

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

@wernerd

Description

@wernerd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions