9 Commits

Author SHA1 Message Date
Bruce
f629296e28
Remove Dilithium (#2275)
* Removed upstream `name: pqcrystals-dilithium` and signature `name: dilithium` from `copy_from_upstream.yml`.
Removed everything under `src/sig/dilithium`
Re-run `copy_from_upstream.py -d copy`, which produced downstream changes to various build files.

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* remove Dilithium entries from kats.json

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* remove Dilithium entries from constant_time tests

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Removed dilithium.yml and dilithium.md. Re-run copy_from_upstream.py, which also updated README.md and cbom.json

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Removed Dilithium from FUZZING.md

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* removed license information about pqclean Dilithium and pqcrystals-dilithium from README.md. README.md still mentions Dilithium but only to say that it has been excluded

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Upgraded CONFIGURE.md minimal build example to ML-KEM-768 and ML-DSA-44

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Upgraded C++ sig linking test to ML-DSA-44; also added option to make the test fail hard if the algorithm is not enabled

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* remove Dilithium from GitHub action workflows

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* removed Dilithium from zephyr configuration and examples

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Removed scripts/copy_from_upstream/patches/pqclean-dilithium-arm-randomized-signing.patch

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Removed dilithium from upstream.name==pqclean.ignore

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Removed orphaned patches

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

---------

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>
2025-09-22 20:52:14 -04:00
h2parson
9e964cad5b
Integrate SLH-DSA-C Library (#2175)
* copy from slhdsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* integrate with copy from upstream

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* explicitly list slhdsa files to include and push generated code

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* format code script

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add to requirements.in

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix code conventions

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* copy from upstream changes

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add chdir to copy from slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modify template

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* generate requirements.txt

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modify requirments in workflows

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* format

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* a

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* sort filenames in cmake file generation for slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add newline at end of header file

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add whitespace and fix alg info tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* update docs with copy from upstream

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add whitespace to src files

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* initialize ctx in slh

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* explicitly set little endian for windows x86

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* temporarily disable ctx signing for slh tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* disable kats until hashes available for slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix issues in test sig mem

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* temporarily add namespaces so that slh dsa will not break test namespace

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* updates

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* formatted file

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* align jinja template to astyle

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* change addrnd size

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* copy from slhdsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* integrate with copy from upstream

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* explicitly list slhdsa files to include and push generated code

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* format code script

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add to requirements.in

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix code conventions

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* copy from upstream changes

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add chdir to copy from slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modify template

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* generate requirements.txt

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modify requirments in workflows

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* format

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* a

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* sort filenames in cmake file generation for slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add newline at end of header file

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add whitespace and fix alg info tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* update docs with copy from upstream

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* add whitespace to src files

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* initialize ctx in slh

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* explicitly set little endian for windows x86

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* temporarily disable ctx signing for slh tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* disable kats until hashes available for slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix issues in test sig mem

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* temporarily add namespaces so that slh dsa will not break test namespace

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* updates

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* formatted file

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* align jinja template to astyle

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* change addrnd size

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix std algs filtering issue

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modifying windows amd toolchain file to fix endianness issue

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* disable leak testing on slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* disable slh dsa for arm emulated linux and zephyr tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix zephyr test skip logic

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix upstream issue with prehash naming and add variant specific nist levels

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* automatically update slh dsa yml file

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* get slh dsa md file generation working

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix naming in slh wrapper files

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* minor changes from review

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* separate slh dsa jobs from stfl sigs

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* separate slhdsa from sig stfl tests on mac and windows

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* fix macos yml format

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* modify zephyr timeout

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* re-enable some tests for slh dsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* separate leak tests

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* allow algorithm family level enablement and reconfigure slhdsa CI jobs

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* move slh dsa address sanitizer to extended tests and extend time limit to 90 minutes

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

* remove package deb from CI job, remove auto gen kat sig for slhdsa, add prime ctx step for sig testing slhdsa

Signed-off-by: h2parson <h2parson@uwaterloo.ca>

---------

Signed-off-by: h2parson <h2parson@uwaterloo.ca>
2025-08-13 15:41:47 -04:00
Sadiq Hussain M
894547b15c
Check for NULL dereference before using secure free (#2151)
* Check for NULL dereference before using secure free

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>

* Skip failing CI test (#2157)

* Skip failing CI test

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

* Fix typo

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
2025-06-04 16:18:45 -04:00
Tobias Frauenschläger
81b4452b9a
Fix for Zephyr CI (#1953)
* Revert to latest Zephyr SDK container
* Fix for Zephyr build (missing include for ptrdiff_t)
* Zephyr CI tests are now using Zepyhr V3.4 (minimal supported version)
  and Zephyr V3.7 (current LTS release)

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-10-17 11:16:22 -04:00
Basil Hess
4cc88845e8
Add MAYO signature scheme from NIST onramp (#1707)
Add MAYO signature scheme from NIST onramp, C and AVX2 versions
Add AES128CTR to common code

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
2024-07-13 21:38:01 +02:00
Tobias Frauenschläger
d183ed3266 Minor update for the Zephyr port
* Make ML-KEM and ML-DSA user configurable using Kconfig
* Enable ML-KEM and ML-DA by default
* Disable Kyber and Dilithium Round 3 by default

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-03-15 11:26:37 -04:00
Tobias Frauenschläger
5690baebe4
Fix for the Zephyr CI tests (#1714)
Create only a minimal Zephyr installation to run CI tests and increase timeout of the Signature test.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-03-01 09:40:08 -05:00
trigpolynom
bb23b3f61b
Riscv zephyr support (#1641)
* added riscv32 to zephyr (qemu)

* added to PLATFORMS.md
2024-01-14 08:37:50 +01:00
Tobias Frauenschläger
4906c3fc88
Add support for embedded Zephyr RTOS (#1621)
* Zephyr RTOS support

This commit adds initial support for the zephyr operating system. Some
minor changes to the library build system have been made for it to be
compilable with zephyr. Furthermore, we added support for an embedded
build option to disable standard library methods for random number
generation.

* Zephyr: added algorithm selection

The algorithms can now be selected with Kconfig. Per default, we only
enable the algorithms selected by NIST to be standardized. However, all
supported algorithms can be enabled or disabled individually on a per
project basis.

* Zephyr: added testable samples

Added two sample applications within the zephyr directory for KEMs and
Signatures. These are also intended for CI testing.

* Zephyr: added CI tests

* Zephyr: Add documentation

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-20 08:20:56 +01:00