International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems, Volume 2022

Improved Plantard Arithmetic for Lattice-based Cryptography


README

Improved Plantard Arithmetic for Lattice-based Cryptography

This repository provides code for our implementations of Kyber and NTTRU using the improved Plantard arithmetic on the Arm Cortex-M4.
Authors:
- Junhao Huang <huangjunhao@uic.edu.cn>
- Jipeng Zhang <jp-zhang@outlook.com>
- Haosong Zhao <zhaohaosonguic@gmail.com>
- Zhe Liu <zhe.liu@nuaa.edu.cn>
- Ray C. C. Cheung <r.cheung@cityu.edu.hk>
- Çetin Kaya Koç <cetinkoc@ucsb.edu>
- Donglong Chen <donglongchen@uic.edu.cn> (Corresponding Author)

The setup for testing and evaluating of our code is based on the framework provided in the pqm4 project.

Prerequisites

Files in this archive

Usage

Detailed instructions on interacting with the hardware and on installing required software can be found in pqm4's readme.

The scripts benchmarks.py, f_benchmarks.py, stack.py and test.py cover most of the frequent use cases.
In case separate, manual testing is required, the binaries for a scheme can be build using

make IMPLEMENTATION_PATH=crypto_{kem,sign}/{scheme}/{variant} bin/crypto_{kem,sign}_{scheme}_{variant}_{firmware}.bin

, where firmware is one of {test, testvectors, speed, f_speed, stack} and variant is one of old, newstack (testvectors only available for Kyber).

It can then be flashed using:

st-flash --reset write bin/crypto_{kem,sign}_{scheme}_{variant}_{firmware}.bin 0x8000000

Example

For building the test firmware for our newstack version of kyber768 the following command can be used:

make IMPLEMENTATION_PATH=crypto_kem/kyber768/newstack bin/crypto_kem_kyber768_newstack_test.bin

It can the be flashed using:

st-flash --reset write bin/crypto_kem_kyber768_newstack_test.bin 0x8000000

reference

[AHKS22] Amin Abdulrahman, Vincent Hwang, Matthias J Kannwischer, and Daan Sprenkels. Faster Kyber and Dilithium on the Cortex-M4. Cryptology ePrint Archive, 2022.
[LS19] Lyubashevsky V, Seiler G. NTTRU: Truly Fast NTRU Using NTT[J]. IACR Transactions on Cryptographic Hardware and Embedded Systems, 2019: 180-201.
[ABCG20] Erdem Alkim, Yusuf Alper Bilgin, Murat Cenk, and François Gérard. Cortex-M4 optimizations for {R, M}-LWE schemes. IACR Transactions on Cryptographic Hardware and Embedded Systems, pages 336–357, 2020.

License

Each subdirectory containing implementations contains a LICENSE or COPYING file stating under what license that specific implementation is released. The files in common contain licensing information at the top of the file (and are currently either public domain or MIT). All other code in this repository is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.