All Projects → pq-crystals → dilithium

pq-crystals / dilithium

Licence: other
No description or website provided.

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
Makefile
30231 projects
CMake
9771 projects
Gnuplot
187 projects
shell
77523 projects
Pawn
127 projects

Projects that are alternatives of or similar to dilithium

kyber
No description or website provided.
Stars: ✭ 170 (+2.41%)
Mutual labels:  post-quantum-cryptography, lattice-based-crypto, post-quantum, module-lattices
frodo
practical quantum-secure key encapsulation from generic lattices
Stars: ✭ 17 (-89.76%)
Mutual labels:  post-quantum-cryptography, lattice-based-crypto, module-lattices
Packettracer
The SIMD-accelereted ray tracing in C# powered by Intel hardware intrinsic of .NET Core.
Stars: ✭ 109 (-34.34%)
Mutual labels:  avx
WeIdentity
基于区块链的符合W3C DID和Verifiable Credential规范的分布式身份解决方案
Stars: ✭ 1,063 (+540.36%)
Mutual labels:  digital-signature
Mipp
MIPP is a portable wrapper for SIMD instructions written in C++11. It supports NEON, SSE, AVX and AVX-512.
Stars: ✭ 253 (+52.41%)
Mutual labels:  avx
Nsimd
Agenium Scale vectorization library for CPUs and GPUs
Stars: ✭ 138 (-16.87%)
Mutual labels:  avx
Guided Missile Simulation
Guided Missile, Radar and Infrared EOS Simulation Framework written in Fortran.
Stars: ✭ 33 (-80.12%)
Mutual labels:  avx
Simd
C++ image processing and machine learning library with using of SIMD: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX-512, VMX(Altivec) and VSX(Power7), NEON for ARM.
Stars: ✭ 1,263 (+660.84%)
Mutual labels:  avx
hpc
Learning and practice of high performance computing (CUDA, Vulkan, OpenCL, OpenMP, TBB, SSE/AVX, NEON, MPI, coroutines, etc. )
Stars: ✭ 39 (-76.51%)
Mutual labels:  avx
Boost.simd
Boost SIMD
Stars: ✭ 238 (+43.37%)
Mutual labels:  avx
awesome-authentication
Resources to learn and implement authentication in your application
Stars: ✭ 116 (-30.12%)
Mutual labels:  digital-signature
Hybridizer Basic Samples
Examples of C# code compiled to GPU by hybridizer
Stars: ✭ 186 (+12.05%)
Mutual labels:  avx
Ctranslate2
Fast inference engine for OpenNMT models
Stars: ✭ 140 (-15.66%)
Mutual labels:  avx
Corrfunc
⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
Stars: ✭ 114 (-31.33%)
Mutual labels:  avx
leptin
🔗 Leptin is a PoW blockchain completely built in Nodejs.
Stars: ✭ 57 (-65.66%)
Mutual labels:  digital-signature
Despacer
C library to remove white space from strings as fast as possible
Stars: ✭ 90 (-45.78%)
Mutual labels:  avx
Osaca
Open Source Architecture Code Analyzer
Stars: ✭ 162 (-2.41%)
Mutual labels:  avx
ternary-logic
Support for ternary logic in SSE, XOP, AVX2 and x86 programs
Stars: ✭ 21 (-87.35%)
Mutual labels:  avx
penguinV
Simple and fast C++ image processing library with focus on heterogeneous systems
Stars: ✭ 110 (-33.73%)
Mutual labels:  avx
pqcrypto
Rust Post-Quantum cryptography
Stars: ✭ 124 (-25.3%)
Mutual labels:  post-quantum

Dilithium

Build Status Coverage Status

This repository contains the official reference implementation of the Dilithium signature scheme, and an optimized implementation for x86 CPUs supporting the AVX2 instruction set. Dilithium is a finalist in the NIST PQC standardization project.

Build instructions

The implementations contain several test and benchmarking programs and a Makefile to facilitate compilation.

Prerequisites

Some of the test programs require OpenSSL. If the OpenSSL header files and/or shared libraries do not lie in one of the standard locations on your system, it is necessary to specify their location via compiler and linker flags in the environment variables CFLAGS, NISTFLAGS, and LDFLAGS.

For example, on macOS you can install OpenSSL via Homebrew by running

brew install openssl

Then, run

export CFLAGS="-I/usr/local/opt/[email protected]/include"
export NISTFLAGS="-I/usr/local/opt/[email protected]/include"
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"

before compilation to add the OpenSSL header and library locations to the respective search paths.

Test programs

To compile the test programs on Linux or macOS, go to the ref/ or avx2/ directory and run

make

This produces the executables

test/test_dilithium$ALG
test/test_vectors$ALG
PQCgenKAT_sign$ALG

where $ALG ranges over the parameter sets 2, 3, 5, 2aes, 3aes, and 5aes.

  • test_dilithium$ALG tests 10000 times to generate keys, sign a random message of 59 bytes and verify the produced signature. Also, the program will try to verify wrong signatures where a single random byte of a valid signature was randomly distorted. The program will abort with an error message and return -1 if there was an error. Otherwise it will output the key and signature sizes and return 0.
  • test_vectors$ALG performs further tests of internal functions and prints deterministically generated test vectors for several intermediate values that occur in the Dilithium algorithms. Namely, a 48 byte seed, the matrix A corresponding to the first 32 bytes of seed, a short secret vector s corresponding to the first 32 bytes of seed and nonce 0, a masking vector y corresponding to the seed and nonce 0, the high bits w1 and the low bits w0 of the vector w = Ay, the power-of-two rounding t1 of w and the corresponding low part t0, and the challenge c for the seed and w1. This program is meant to help to ensure compatibility of independent implementations.
  • PQCgenKAT_sign$ALG is the Known Answer Test (KAT) generation program provided by NIST. It computes the official KATs and writes them to the files PQCsignKAT_$(CRYPTO_ALGNAME).{req,rsp}.

Benchmarking programs

For benchmarking the implementations, we provide speed test programs for x86 CPUs that use the Time Step Counter (TSC) or the actual cycle counter provided by the Performance Measurement Counters (PMC) to measure performance. To compile the programs run

make speed

This produces the executables

test/test_speed$ALG

for all parameter sets $ALG as above. The programs report the median and average cycle counts of 10000 executions of various internal functions and the API functions for key generation, signing and verification. By default the Time Step Counter is used. If instead you want to obtain the actual cycle counts from the Performance Measurement Counters export CFLAGS="-DUSE_RDPMC" before compilation.

Please note that the reference implementation in ref/ is not optimized for any platform, and, since it prioritises clean code, is significantly slower than a trivially optimized but still platform-independent implementation. Hence benchmarking the reference code does not provide representative results.

Our Dilithium implementations are contained in the SUPERCOP benchmarking framework. See here for current cycle counts on an Intel KabyLake CPU.

Randomized signing

By default our code implements Dilithium's deterministic signing mode. To change this to the randomized signing mode, define the DILITHIUM_RANDOMIZED_SIGNING preprocessor macro at compilation by either uncommenting the line

//#define DILITHIUM_RANDOMIZED_SIGNING

in config.h, or adding -DDILITHIUM_RANDOMIZED_SIGNING to the compiler flags in the environment variable CFLAGS.

Shared libraries

All implementations can be compiled into shared libraries by running

make shared

For example in the directory ref/ of the reference implementation, this produces the libraries

libpqcrystals_dilithium$ALG_ref.so

for all parameter sets $ALG, and the required symmetric crypto libraries

libpqcrystals_aes256ctr_ref.so
libpqcrystals_fips202_ref.so

All global symbols in the libraries lie in the namespaces pqcrystals_dilithium$ALG_ref, libpqcrystals_aes256ctr_ref and libpqcrystals_fips202_ref. Hence it is possible to link a program against all libraries simultaneously and obtain access to all implementations for all parameter sets. The corresponding API header file is ref/api.h, which contains prototypes for all API functions and preprocessor defines for the key and signature lengths.

CMake

Also available is a portable cmake based build system that permits building the reference implementation.

By calling

mkdir build && cd build && cmake .. && cmake --build . && ctest

the Dilithium reference implementation gets built and tested.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].