crypto-calcul
is a cryptographic library that provides various functionalities in C with a GUI.
- C compiler
GMP
library- Python3
- Cython
To build the library, follow these steps:
-
Clone the repository.
-
Ensure you have a C compiler and
GMP
library installed. -
Single-command setup:
make
This will compile all the C source files, create the executables for testing, and wrap C library into Python library.
If you want to build the library step-by-step, follow the next instructions.
Note. This command runs in parallel by default, you might want to adjust the NUM_CORES variable to match your system.
-
Build the C library:
# Basic make all # Parallel make build_fast
-
Setup Python virtual environment and install dependencies:
python3 -m venv .venv if [ -z "$PYTHONPATH" ]; then echo "export PYTHONPATH=$(pwd)/build" >> .venv/bin/activate; fi source .venv/bin/activate pip install -r requirements.txt
-
Wrap C modules into Python modules with Cython:
# Basic make wrap # Parallel make wrap_fast
To run the tests, follow these steps:
-
Ensure you have built the libraries as described above.
-
Run the tests for C library:
# Run all tests make test # Run tests of a module make test_<module_name>
-
Test Python library for UI:
python3 src/frontend/test.py
To clean up the build artifacts, run:
make clean