git clone https://github.com/TeumessianFox/pmpq.git
cd pmpq
On Linux systems:
sudo apt install arm-none-eabi-gcc
git submodule update --init
make -C libopencm3
- Install st-link
python3 -m pip3 install pyserial
The main objective of this library is to provide different implementations of polynomial multiplication for post-quantum crypto algorithms.
The STM32F407G-DISCOVERY is used for the pqm4 contest and also the main target for this library.
Flashable .hex files can also be generated for the Chipwhisperer.
Python >= 3.7 needed
Run host/main.py
to try every supported polynomial multiplication on the STM32F407G-DISCOVERY once and gather results & cycle count.
Access pm_algo.POLYMUL_ALGOS
to gather all viable algo_names
PolymulAlgo class
Function | Parameter | Description |
---|---|---|
init(...) |
self, name: str, chain_size: int, chain: str array, degree: int, opt: char | Flashing PolymulAlgo code to the M4 and setting up serial communication |
build(...) |
self | Make and flashing PolymulAlgo code to the M4 |
log_to_file(...) |
self, key, text, result, cycles | Log results to file |
run_polymul(...) |
self, key, text, log: boolean | Run specific PolymulAlgo for specific testset |
Recommended: Use python PolymulAlgo.build()
to make & flash
For manual use in m4/
Command | Description |
---|---|
make |
Compile and create .elf & .bin |
make flash |
Flash .bin on the board |
make dump |
Using OBJDUMP to create dump |
make clean |
Remove created files |
To generate .hex file for cw use in cw/
Command | Description |
---|---|
make |
Compile and create .elf & .hex |
make clean |
Remove created files |
C language: coding style
Based on https://github.com/libopencm3/libopencm3-template.git