Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
98371cb
Refactor pqcrypto-templates build.rs.j2 and ffi.rs.j2
Nov 24, 2021
362bbbd
Merge pull request #30 from RW-sec/refactor-pqcrypto-templates
thomwiggers Nov 25, 2021
e1a156c
Update from PQClean
thomwiggers Nov 25, 2021
4bc2ea4
Added support PQC in the browser with the target wasm32-wasi now supp…
john-sharratt Dec 1, 2021
dedb29e
Add AArch64 support for selected schemes (#32)
RW-sec Dec 16, 2021
e1a527e
fixed canonicalisation of include path in windows (#35)
l3utterfly Apr 13, 2022
f799b0d
Update schemes (#36)
thomwiggers Apr 14, 2022
d8373e5
Fix target vs host confusion (#37)
sebastinas Apr 25, 2022
31773a2
Fix version numbers
thomwiggers Apr 14, 2022
ee40657
Kyber-90s has no Aarch64 code (#39)
thomwiggers May 31, 2022
478b17c
Bump kyber version
thomwiggers May 31, 2022
fd59ad3
Don't run cryptographically insecure tests without cryptographically …
JustinWoodring Sep 2, 2022
37eccd1
Delete schemes no longer supported by PQClean
thomwiggers Oct 21, 2022
4d60de4
update HQC
thomwiggers Oct 21, 2022
681ec03
Update release script
thomwiggers Oct 21, 2022
7af22bb
Update HQC version number
thomwiggers Oct 21, 2022
4529ad1
add support for dilithium2aes, dilithium3aes and dilithium5aes (#46)
carl-wallace Nov 16, 2022
de36961
Fix version numbers
thomwiggers Nov 16, 2022
c5cd38a
Get rid of clippy warning (#55)
thomwiggers Apr 21, 2023
1c28cf2
Fix positions of arguments in error message (#54)
RW-sec Apr 21, 2023
82479d0
Update implementations and Rust dependencies
thomwiggers Apr 26, 2023
e2f4d80
Clippy fixes
thomwiggers Apr 26, 2023
319ba23
Update rust edition for pqcrypto-internals (#52)
thomwiggers Apr 26, 2023
7da3cf1
Update Rust edition
thomwiggers Apr 26, 2023
a1ce41b
update version number for PQCrypto internals (#57)
thomwiggers Aug 14, 2023
2c2469d
Update package
thomwiggers Aug 14, 2023
8bbf10d
Update schemes (#58)
thomwiggers Oct 16, 2023
2ba2d2a
Bump kyber version number
thomwiggers Oct 16, 2023
150f0b5
Get rid of actions-rs (#59)
thomwiggers Oct 16, 2023
6ee29f7
Fix workflow
thomwiggers Oct 16, 2023
f921490
Update Kyber
thomwiggers Jan 25, 2024
e9d654e
Add python environment
thomwiggers Oct 24, 2024
5770dde
Add support for CTX in signature schemes
thomwiggers Oct 24, 2024
0ae709c
delete Kyber,MLDSA
thomwiggers Oct 24, 2024
145c36d
Add fips202x2 support
thomwiggers Oct 24, 2024
2404814
Add mlkem, mldsa
thomwiggers Oct 24, 2024
a70c48b
Update Falcon
thomwiggers Oct 24, 2024
9c7253d
update release.sh
thomwiggers Oct 24, 2024
95ffa1b
Inform Cargo about build flags
thomwiggers Oct 24, 2024
e11234a
Fix paste version
thomwiggers Nov 4, 2024
7e6a110
Specify build flag that hopefully works
thomwiggers Nov 11, 2024
96a0178
Bump version for internals
thomwiggers Nov 28, 2024
0c07fa8
fix security flaw in hqc
thomwiggers Dec 11, 2024
1b41b2b
disable wasi tests
thomwiggers Jan 19, 2025
b399374
Add +sha3 (#72)
gridbox Jan 28, 2025
8ecb93e
[ci] Add Android build workflow (#75)
charlag Feb 4, 2025
17d1ece
Fix comment character (#76)
thomwiggers Feb 4, 2025
50b6e6e
Bump version
thomwiggers Feb 4, 2025
1144807
Use 'older fashioned' assembly syntax (#78)
thomwiggers Feb 26, 2025
9860ea6
bump version
thomwiggers Feb 26, 2025
a371514
Update Pipfile.lock
thomwiggers Feb 27, 2025
fba5d80
Fix shebang for generate-implementations.py
thomwiggers Feb 27, 2025
d822f97
Update PQClean upstream
thomwiggers Feb 27, 2025
ee77b60
Set gcc architecture to armv8.2-a when building for aarch64 (#81)
gioelece Mar 3, 2025
0222f5f
Fix build flag again
thomwiggers Mar 3, 2025
c83c48b
Add repository field to -internals
thomwiggers Mar 3, 2025
1799a32
Fix specification of components (#85)
thomwiggers Mar 17, 2025
1e45876
Bump dependencies for testing (#86)
thomwiggers Mar 17, 2025
ea05906
Implement Debug
thomwiggers Jul 23, 2025
64e064e
Add CI job to verify generated code is up-to-date
biryukovmaxim Dec 2, 2025
7e08d58
Add support for OpenBSD's wasm32 libc and improve WASM compatibility
biryukovmaxim Nov 25, 2025
06dc67c
Extend WASM compatibility by integrating OpenBSD's wasm32 libc
biryukovmaxim Nov 26, 2025
f36f6d2
Fix typos in feature keys: correct `getrandom_wasm_jd` to `getrandom_…
biryukovmaxim Dec 2, 2025
4d95901
Add CI workflow for wasm32-unknown-unknown target
biryukovmaxim Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 177 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on: push
on:
push:
pull_request:

name: Continuous integration

Expand All @@ -12,42 +14,196 @@ jobs:
- beta
- nightly
env:
CARGO_TERM_COLOR: always
# 20 MiB stack
RUST_MIN_STACK: 20971520

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Install Rust
run: |
rustup set auto-self-update disable
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy
rustup default ${{ matrix.rust }}
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
echo RUST_BACKTRACE=1 >> $GITHUB_ENV

- name: build with cryptographically-insecure turned on (if available)
run: cargo build --features cryptographically-insecure

- name: Run tests with cryptographically-insecure turned on
run: cargo test --features cryptographically-insecure

- name: Run cargo check with all features
run: cargo check --all-features

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: run Cargo clippy
run: cargo clippy -- -D warnings -A deprecated

android:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
env:
CARGO_TERM_COLOR: always
# 20 MiB stack
RUST_MIN_STACK: 20971520

- uses: actions-rs/cargo@v1
steps:
- uses: actions/checkout@v4
with:
command: build
submodules: true

- name: Install Rust
run: |
rustup set auto-self-update disable
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy
rustup target add aarch64-linux-android
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
echo RUST_BACKTRACE=1 >> $GITHUB_ENV

- name: Setup Android SDK
uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f #3.2.0

- name: Setup Android NDK
run: sdkmanager "ndk;26.1.10909125"

- uses: actions-rs/cargo@v1
- name: Compile for Android
run: |
cargo install cargo-ndk
cargo ndk -t aarch64-linux-android build

wasm32-unknown-unknown:
name: wasm32-unknown-unknown
runs-on: ubuntu-latest
strategy:
matrix:
rust: [ stable, beta, nightly ]
steps:
- uses: actions/checkout@v4
with:
command: test
submodules: true

- name: Install Rust
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component clippy
rustup default ${{ matrix.rust }}
rustup target add wasm32-unknown-unknown

- name: Check workspace (all crates except classicmceliece & umbrella)
run: |
cargo check --workspace --target wasm32-unknown-unknown --features getrandom_wasm_js \
--exclude pqcrypto-classicmceliece \
--exclude pqcrypto

- name: Check umbrella crate (explicitly enable only supported wasm crates)
run: |
cargo check --target wasm32-unknown-unknown \
-p pqcrypto --no-default-features -F pqcrypto-mlkem,pqcrypto-hqc,pqcrypto-mldsa,pqcrypto-falcon,pqcrypto-sphincsplus,serialization,getrandom_wasm_js
# wasi:
# name: wasi
# runs-on: ubuntu-latest
# strategy:
# matrix:
# rust:
# - stable
# - beta
# - nightly
# env:
# # 20 MiB stack
# RUST_MIN_STACK: 20971520
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true

# - name: Install Rust
# run: |
# rustup set auto-self-update disable
# rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt clippy
# rustup default ${{ matrix.rust }}
# echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
# echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
# echo RUST_BACKTRACE=1 >> $GITHUB_ENV

# - name: Install WASI
# run: cargo install cargo-wasi
# - name: Install wasmtime
# run: curl https://wasmtime.dev/install.sh -sSf | bash
# - name: Install WASI SDK
# run: |
# wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sysroot-12.0.tar.gz
# tar -xvzf wasi-sysroot-12.0.tar.gz
# rm wasi-sysroot-12.0.tar.gz
# - name: Run tests
# run: |
# export WASI_SDK_DIR="$(pwd)/wasi-sysroot"
# export WASMTIME_HOME="$(pwd)/.wasmtime"
# export PATH="$WASMTIME_HOME/bin:$PATH"
# cargo wasi build --features cryptographically-insecure
# #cargo wasi test -- --nocapture

- uses: actions-rs/cargo@v1
generated-code-is-up-to-date:
runs-on: ubuntu-latest

env:
PIPENV_VENV_IN_PROJECT: 1

steps:
- uses: actions/checkout@v4
with:
command: check
args: --features serialization
submodules: true

- uses: actions-rs/cargo@v1
- name: Install Python
uses: actions/setup-python@v5
with:
command: fmt
args: --all -- --check
python-version: '3.13'
cache: 'pip'

- uses: actions-rs/cargo@v1
- name: Restore Pipenv virtualenv cache
uses: actions/cache@v4
with:
command: clippy
args: -- -D warnings
path: .venv
key: pipenv-venv-${{ runner.os }}-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
pipenv-venv-${{ runner.os }}-

- name: Install Pipenv
run: pip install --upgrade pipenv

- name: Install dependencies (Pipfile.lock)
run: pipenv sync --dev

- name: Regenerate all crates
run: pipenv run python generate-implementations.py

- name: Check for uncommitted changes
run: |
if ! git diff --exit-code --quiet; then
echo "❌ ERROR: Generated files are out of date!"
git diff --name-only
git diff --color
exit 1
fi

if ! git diff --cached --exit-code --quiet; then
echo "❌ ERROR: Staged changes detected!"
git diff --cached --name-only
git diff --cached --color
exit 1
fi

echo "✅ All generated files are up-to-date!"
# vim: set ft=yaml ts=2 sw=2 tw=0 et :
112 changes: 106 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,96 @@
# Changelog

## 2025-03-17

* Bump dependencies for testing

## 2025-02-27
* Update PQClean to today's version
* Update SPHINCS+ for some minor improvements. This is not yet SLH-DSA.
* Update ML-DSA for some minor improvements.

## 2024-12-11
* `pqcrypto-hqc` was updated to addresss a security flaw in decapsulation.

## 2024-10-24
* `pqcrypto-kyber` and `pqcrypto-dilithium` are retired and replaced by `pqcrypto-mlkem` and `pqcrypto-mldsa`, respectively.
* `pqcrypto-falcon` now separates Falcon into the "compressed" mode and the "padded" variants. The "compressed" variant likely produces shorter signatures than the max size.

## 2024-01-25

* Update Kyber `clean` implementation to avoid potential Kyber side-channel vulnerabilities.
Note that the `aarch64` implementation is still vulnerable, but it is waiting for other updates.
This library is for experimental purposes, so security vulnerabilties are addressed on a best-effort basis.

## 2023-10-16

* Update Kyber to draft FIPS standard
* Remove 90s variants
* Update Dilithium to draft FIPS standard
* Remove 90s variants
* Update McEliece implementation
* Remove Vec variants
* Bring SPHINCS+ to closer to FIPS variants by removing -robust and Haraka variants
* Small fix in Falcon
* Add Falcon NEON implementation
* Update Rust edition to 2021

## 2023-04-26

* Update Rust dependencies
* Update SPHINCS+ implementation
* Update Falcon implementation

## 2022-11-16

* Add support for Dilithium*AES instances

## 2022-10-21

* Remove schemes eliminated from the NIST competition as they are no longer
tracked by PQClean
* Frodo
* NTRU
* NTRU Prime
* Rainbow
* SABER
* Update HQC implementation from PQClean
* Fixes aliasing violation

## 2022-04-13

* Update schemes
* NTRU small fixes
* Dilithium fixes
* McEliece small fix
* SPHINCS+ small fixes
* SABER NEON implementation
* Kyber neon
* Many build system fixes

## 2021-12-07

* Add AArch64 compilation option for supported schemes
* NTT operations can now compute with NEON support

## 2021-12-01

* Add WebAssembly (WASM) support

## 2021-11-24

* Add a general implementation list for each scheme in implementations.yaml which is used by build.rs.j2
* Each scheme now has a list of supported implementation variants
* Refactor build.rs.js2 to use macro calls
* Update the other template files to adapt to this change
* Slight modifications to README.md
* Update PQClean
* Larger-size NTRU parametersets

## 2021-10-26

* Make `pqcrypto-internals` cross-compilable

## 2021-10-18

* Fix small issue in randombytes implementation: should return 0
Expand All @@ -9,9 +100,9 @@
* `no_std` support thanks to @rozbb (PR#25)
* Extract randombytes from PQClean-provided APIs (avoids symbol conflict) (PR #24)
* Update PQClean:
* NTRUPrime new parametersets
* Small Falcon fixes
* Small NTRU fix
* NTRUPrime new parametersets
* Small Falcon fixes
* Small NTRU fix

## 2021-07-28

Expand All @@ -20,6 +111,10 @@
* NTRU Prime updates
* Move common files into `pqcrypto-internals` and out of individual libs

## 2021-06-28

* Refactor the wrapper methods in scheme.rs.js2 file to macro calls

## 2021-06-10

* Add optional `serde` support
Expand Down Expand Up @@ -120,10 +215,10 @@
* Update FALCON from PQClean
* Update SPHINCS+ from PQClean
* Package LEDAcryptKEM
* **Warning:** The LEDAcryptKEM implementations currently packaged are known to have timing side-channel vulnerabilities.
* **Warning:** The LEDAcryptKEM implementations currently packaged are known to have timing side-channel vulnerabilities.
* Package Rainbow
* The ``clean`` implementations are currently known to have undefined behaviour.
See https://github.com/PQClean/PQClean/issues/220
* The ``clean`` implementations are currently known to have undefined behaviour.
See [pqclean/issues/220](https://github.com/PQClean/PQClean/issues/220)
* Hide a internal enum variable from ``pqcrypto_traits::sign::VerificationError``

## 2019-07-24
Expand All @@ -138,23 +233,28 @@
* Update `rand` crate to `0.7.0`

## 2019-07-18

* Update PQClean implementations
* SPHINCS+ is now thread-safe.
* Frodo now uses ``opt`` implementation by default.
* Allow for multiple implementations in the ``ffi`` interface.

## 2019-07-09

* Make ``encapsulate`` and ``decapsulate`` take references.
* Add Dilithium
* Add SABER

## 2019-07-08

* Remove ``pqcrypto-internals``

## 2019-05-22

* Added ``pqcrypto_traits::{Error,Result}`` to ``from_bytes`` signature.
* Added ``pqcrypto::prelude`` to allow importing all traits in one easy go.
* Removed all uses of ``mem::uninitialized()``

## 2019-05-21

* Added MQDSS
Loading