crypto-calcul
is a cryptographic library that provides various functionalities in C with a GUI.
- C compiler, e.g.
gcc
orclang
GMP
python3
cython
PyQt
It's recommended to install gcc
, GMP
, and python3
with MSYS2
, and pwsh
to follow the next steps.
# Run in MSYS2 terminal
pacman -S mingw-w64-x86_64-gcc \
mingw-w64-x86_64-gmp \
mingw-w64-x86_64-python \
mingw-w64-x86_64-python-pip
Clone the repository, ensure the prerequisites are installed, and build the library with follow these steps (in the cloned directory):
make setup
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 source .venv/bin/activate pip install -r requirements.txt
-
Wrap C modules into Python modules with Cython:
# Basic make wrap # Parallel make wrap_fast
-
Build the C library:
make all -f Makefile.win
-
Setup Python virtual environment and install dependencies:
python3 -m venv .venv .venv\\bin\\activate # or .venv\\Scripts\\Activate.ps1 pip install -r requirements.txt
-
Wrap C modules into Python modules with Cython:
# Basic make wrap -f Makefile.win # Parallel make wrap_fast -f Makefile.win
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 # -f Makefile.win # Run tests of a module make test_<module_name> # -f Makefile.win
- Test Python library for UI:
python3 src/frontend/test.py
make gui
or
make gui_<page_name>
To clean up the build artifacts, run:
make clean # -f Makefile.win