Skip to content

CryptoLib: Environment & Building

Donovan Ice edited this page Mar 15, 2024 · 22 revisions

Environment

Environment and dependency details may be found within ./support/Dockerfile. If running via docker, dependencies will be installed automatically.

If the user decides to build locally, ensure all dependencies below are met.



Note: Theses dependencies are for the default internal build, other builds may vary.

Running requires:

Apt:
autoconf automake
ca-certificates cmake
curl g++-multilib
gcc-multilib gettext
git gdb
lcov libcurl4-openssl-dev
libmariadb-dev libmariadb-dev-compat
libgcrypt20-dev libtool
make python3-dev
python3-pip unzip


Testing requires:

Pip3:
pycryptodome


Building

There are numerous configurations when building CryptoLib. References to necessary build flags can be found within ./support/scripts/. For example to build the current internal build:

Clone the CryptoLib repo. Switch to the desired branch. Currently, integration efforts are occurring in the main branch.

  • cd Cryptolib
  • cmake -DCODECOV=1 -DDEBUG=1 -DTEST=1 -DTEST_ENC=1 .
  • make
  • make test

This will build the internal debug environment, with code coverage, testing, and encryption testing.

Other Build Configurations:

  • KMC, Minimal, WolfSSL, and other configurations have convenience scripts which can be referenced within the ./support/scripts/ directory.

Code Coverage: With the DCODECOV Flag set, users may produce code coverage results similarly to the code below:

  • cmake -DMYSQL=1 -DENCTEST=1 -DDEBUG=1 -DCODECOV=1 ../
  • make
  • make gcov

This will produce local coverage reports in /build/coverage, with the HTML results within /build/coverage/results/index.html

Cleanup:

  • make clean -- Cleans Build
  • make scrub -- Cleans Code Coverage

The two flags (DEBUG and TEST_ENC) can be used simultaneously, or separately.

All Build Flags:

  • DDEBUG -- Enables Debug output
  • DMYSQL -- Enables use of mysql DB
  • DCRYPTO_LIBGCRYPT -- Enables LibGCrypt Library
  • DCRYPTO_KMC -- Enables KMC Cryptography Module
  • DCRYPTO_WOLFSSL -- Enables WolfSSL Cryptography Module
  • DKEY_CUSTOM -- Enables Custom Key Modules
  • DKEY_INTERNAL -- Enables Internal Key module
  • DKEY_KMC -- Enables the KMC Key Module
  • DSA_CUSTOM -- Enables Custom Security Association
  • DMC_CUSTOM -- Enables Custom Monitoring and Control
  • DMC_INTERNAL -- Enables Internal Monitoring and Control
  • DSA_INTERNAL -- Enables Internal Security Association
  • DSA_MARIADB -- Enables MariaDB Security Association
  • DSUPPORT -- Enables Standalone Support
  • DSYSTEM_INSTALL -- Copies generated library files to /usr/local
  • DTEST -- Enables Unit Testing
  • DTEST_ENC -- Enables Encryption Testing (Requires pycryptodome)
  • DCODECOV -- Used for code coverage results