260 Commits

Author SHA1 Message Date
Goutam Tamvada
c50d38e5a8
Removed NTRU-Prime. (#1325) 2022-11-29 07:31:53 +01:00
Goutam Tamvada
fac5a818ed
Removed the Picnic signature scheme. (#1323) 2022-11-28 15:29:10 -05:00
Goutam Tamvada
203c9c269b
Removed the rainbow signature scheme (#1321). 2022-11-28 11:34:59 -05:00
Basil Hess
2e2ddb4e04
Update Kyber and Dilithium from upstream (#1316) 2022-11-23 15:15:27 -05:00
thb@sb
c5b8cfe478
Solve '-Wstrict-prototypes' for clang >= 15.0 (#1293)
* Solve '-Wstrict-prototypes'

Manual changes are applied to the following algorithms only:

 * Bike
 * Frodo
 * Picnic

* Add prototype for implementation of `OQS_SIG_alg_count`

* Add prototype for implementation of `OQS_KEM_alg_count`

* Run `copy_from_upstream.py`

Now, the constructors have a full prototype. It compiles with clang 16.0
2022-08-30 11:20:05 +02:00
thb@sb
ff09345f5f
Add missing requirements to the requirements.txt (#1295)
The script `scripts/update_docs_from_yaml.py` is using the python package
`tabulate`. It is missing from the `requirements.txt` file.

This PR adds it the the `requirements.txt` file.
2022-08-26 07:07:28 +02:00
Douglas Stebila
1e47e14556
Remove SIDH and SIKE (#1272)
Due to https://eprint.iacr.org/2022/975.

Fixes #1268.
2022-08-03 10:19:28 -04:00
Douglas Stebila
478ccba970
Remove Rainbow level 1 (#1263)
Fixes #1260
2022-07-27 15:12:16 -04:00
Basil Hess
e88cc366b5
Sync Kyber with upstream, enable Scan-Build with Kyber (#1252) 2022-07-11 11:53:20 +02:00
Basil Hess
d402280283
Updated Dilithium sign.c patch with AES context release (2) (#1242) 2022-06-30 06:48:55 +02:00
Basil Hess
a9629e0a48
Updated Dilithium sign.c patch with AES context release (#1238) 2022-06-28 09:57:57 -04:00
Basil Hess
719a84ecdd
Integrates pqcrystals with common-aes / extends common code AES CTR-API (#1221)
* Integrates pqcrystals (ref and avx2) with liboqs common AES code (for Kyber-90s and Dilithium-AES).
* Extends libOQS AES-CTR with Incremental API: OQS_AES256_CTR_inc_init, OQS_AES256_CTR_inc_iv, OQS_AES256_CTR_inc_ivu64, OQS_AES256_CTR_inc_stream_iv, OQS_AES256_CTR_inc_stream_blks.
* Adds some AES-CTR shim API.
* Faster AESNI CTR code (improved iv handling, 4x interleaved blocks for higher throughput).
* OpenSSL AES supporting CTR API.
* Updated pqcrystals patches (API, context releases).
* Removes redundant AES implementations from Kyber and Dilithium.
* Copy-from-upstream with updated patches.
* Uses internal AES on x86_64 (dist & AES) because of increased performance with the internal AESNI code.
* Adds AES-CTR benchmarks to speed_common
* Update CONFIGURE.md
2022-06-23 14:44:36 +02:00
Michael Baentsch
d9c2cd2136
doxygen update (#1228)
* upgrade script to support doxygen 1.9.3

* update CI script for doc generation

* add license identifiers
2022-06-21 10:53:16 -04:00
Jason Goertzen
55bc8cb38d
ARMv8 optimized Dilithium (#1194)
* Updated sig templates to add support for arch specific upstreams. Currently behaves as expected, but still need to test (and integrate) dilithium

* Fixed a couple of build errors, and started work on dilithium integration from pqclean. Currently failing kat tests

* Updated templating for both sig and kem to make them look a little better

* Renamed dilithium folders so they are consistent across pqclean and pqcrystals so that copy_from_upstream script will function correctly

* Added arm optimized version of dilithium[2|3|5]

* Updating other signature schemes CMakeLists.txt to be the output of the updated templates

* Arm optimized implementation of dilithium is added, with randomized signing patched into it. copy_from_upstream script is working properly. Still need to update the update_docs scripts before ready to merge

* Finished updating docs scripts and yml files. Builds pass, so should be ready for a merge

* Fixed template issue with multiple compile flags

* Updated doc generation scripts so that all '_' in scheme names are replaced with '\_'
2022-03-09 15:17:42 -05:00
Jason Goertzen
4ec538e3c8
Fixed build issue on arm based macs when using gcc11 (#1177)
* Fixed a build issue when trying to use gcc11 on an arm based mac. Also updated kem templates so that any pqclean scheme that has a similar problem in the future can be fixed by just patching the assembly files

* adding M1 CI for gcc-11

Co-authored-by: Michael <57787676+baentsch@users.noreply.github.com>
2022-01-20 10:27:46 -05:00
John Schanck
4d938b1d04
Update XKCP and avoid assembler .ifdef directives (#1173)
* copy_from_xkcp: Update to latest version and fix merge conflicts

* Add macOS gcc-11 CI job

Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
2022-01-03 07:25:23 +01:00
Jason Goertzen
abf1080ddd
Added spdx headers to noregress.[py|sh] (#1154) 2021-12-12 21:39:21 -05:00
Michael Baentsch
ca0cd60a1b
release performance regression test (#1152)
* performance regression test script [skip ci]

* parameterized no-regress testing [skip ci]
2021-12-11 13:51:15 -05:00
Michael Baentsch
3b7b8d7816
aarch64 dist build (#1148)
* aarch64 dist generator run

* removing undocumented OQS_DIST_ARM64_V8_BUILD

* re-activate ARMV8 specific dist build
2021-12-09 11:47:45 -05:00
Michael Baentsch
6888e9ea95
add downlevel compiler warning (#1137)
* add downlevel compiler warning

* correct warning message

* warning added to code generator script

* implement PR feedback
2021-11-30 09:25:37 -05:00
Jason Goertzen
71b570c59c
Adding arm64_v8 optimized versions of saber. (#1131)
* Added aarch64 optimized version of saber, lightsaber, and firesaber from pqclean

* Updated to latest commit of pqclean which fixes saber aarch64.

* Updated saber docs as per @dstebila's comment

* Removed duplicate lines from README.md

* Fixed local issue for duplicate lines in README.md. This is the output of the update docs script after fixing my local issue
2021-11-27 15:24:05 -05:00
Douglas Stebila
14d64d379d
Fix gcc 11 error for Kyber on arm64 (#1127)
* Set new version of Kyber ARM to use from PQClean

* Result of running copy_from_upstream

* Removed the need for pqclean aarch64 patches

* Updating doc generation to be a little more careful about when required flags is an empty list

Co-authored-by: Jason Goertzen <Martyrshot@gmail.com>
2021-11-19 16:40:04 -05:00
Michael Baentsch
2c98b97fa4
adding ntruhps40961229 ntruhrss1373
clean code only added (https://github.com/PQClean/PQClean/pull/427)
2021-11-19 06:43:43 +01:00
Jason Goertzen
769412623c
Adding multiple upstream support to doc generation (#1123)
* Fix an issue where run_tests tried to run tests from upstream. Fix by @DStebila

* No longer checking spdx on files copied from upstream

* Added compiler checking for gcc. Must be at least 9.4.0.

* Added pqclean's aarch64 optimized kyber implementation to liboqs

* stripping asimd flag for ARM64_V8 as it isn't needed and will cause errors when trying to specify it during compilation

* Updated kyber docs

* Updated kyber markdown so that no-secret-dependent-branching-checked-by-valgrind correctly says false for the new aarch64 implementation

* Added automated updating of legacy yaml format, and added some yaml files which don't get automatically updated

* Fixed a bug where optimized upstreams would use the primary upstream's supported platform

* Fixed a bug with copy_from_upstream.py's verify function where it would always use the default upstream location when comparing with diff

* Added reporting for implementations that are in upstream but aren't yet integrated into liboqs

* Added support to ignore implementations from upstream in copy_from_upstream.yml. This is to prevent implementations that haven't been integrated into LIBOQS yet from being pulled in by copy_from_upstream.py. It also silences the warning when verifying.

* Adding updated ymls and md files for docs

* copy_from_upstream.py now also calls update_docs_from_yaml.py
2021-11-18 06:56:19 +01:00
Jason Goertzen
0807ecf9af
Adding support for multiple upstream to copy_from_upstream, as well as pqclean's aarch64 kyber implementation (#1117)
* currently there is a bug where pytest doesn't work but the individual tests work... looking into it still.

* Fix an issue where run_tests tried to run tests from upstream. Fix by @DStebila

* No longer checking spdx on files copied from upstream

* pqclean's aarch64 kyber implementation is now being pulled from. Still need to clean things up.

* pqclean kyber fragment was left behind. It's now added

* Added compiler checking for gcc. Must be at least 9.4.0. Need to track down clang and appleclang

* Need to figure out how to handle commen dependencies from multiple upstreams

* Cleaned up copy_from_upstream.py a bit

* Added pqclean's aarch64 optimized kyber implementation to liboqs

* Added pqclean's aarch64 optimized kyber implementation to liboqs

* Fixed an isssue where 'empty' conditionals were added to kem_scheme.c files when there were no required flags

* reverting sabre to version prior to updated copy_from_upstream script

* stripping asimd flag for ARM64_V8 as it isn't needed and will cause errors when trying to specify it during compilation

* Fixed an issue where empty conditionals would appear when no required flags were specified

* Updated kyber docs

* Updated kyber docs with better formatting

* Adding updated kyber documentation

* Reverting documentation that was erroniously updated while updating kyber.

* Reverted ntruprime too far back by mistake

* Updated kyber doc's yml no-secret-dependent-branching-checked-by-valgrind to false

* Updated kyber markdown so that no-secret-dependent-branching-checked-by-valgrind correctly says false for the new aarch64 implementation
2021-11-10 14:22:49 -05:00
Michael Baentsch
6175da8246
Add S/NTRUP1277 (#1111)
* adds S/NTRUP1277

* disable McEliece for OSX shared CCI runs

* known sntrup constant_time issue suppressed
2021-10-22 09:31:47 -04:00
Douglas Stebila
36d8a49c88
Update to PQClean commit 5b8ef3baea3ffdfbf688a3a1bb8f02de44a67ec0 (#1097)
* Update to PQClean commit 5b8ef3baea3ffdfbf688a3a1bb8f02de44a67ec0

* executed python3 scripts/update_docs_from_yaml.py

Co-authored-by: Michael <57787676+baentsch@users.noreply.github.com>
2021-10-01 12:31:31 -04:00
Michael Baentsch
c0a550f736
do full upstream doc generation (#1066)
* do full upstream doc generation 

* added Common_META merge logic

* integrated src and doc upstream copy

* 'upstream' information auto-generated

* sort 'required_flags' for reproducability
2021-09-14 17:42:03 +02:00
Basil Hess
75b648e9f6
Kyber/Dilithium copy_from_upstream (#1088)
* Kyber/Dilithium copy_from_upstream

* Updated algorithm docs
2021-09-13 21:07:25 +02:00
Michael Baentsch
35155ce481
use doc YMLs to count non-copy-from-upstream algs [skip ci] (#1063)
* use doc YMLs to count non-upstream provided algs [skip ci]
2021-08-03 17:49:45 +02:00
Douglas Stebila
30fbfd826f
Sync with PQClean (#1061)
* Sync with PQClean 6c1ea921ee4a06a6b50c742ca540bb9b5e51aee2

* Update documentation YML from PQClean

* Update documentation from PQClean
2021-08-01 17:02:22 -04:00
Goutam Tamvada
4de651c723
Refactoring documentation generation. (#1057) 2021-07-30 13:26:44 -04:00
Goutam Tamvada
6315abe19e
Signature datasheets (#1053). 2021-07-23 14:35:24 -04:00
Goutam Tamvada
760b3886fa
New datasheets (#1030)
* Documentation YAML files and automatic markdown generation for KEMS.

* Escape underscores

Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
2021-07-15 13:50:46 -04:00
Michael Baentsch
f3caccff9e
Removing default algs (#1044)
* change to retain OQS_MINIMAL_BUILD logic

* remove default alg support
2021-07-01 11:42:12 +02:00
John Schanck
21dcba4eae
Remove old versions of BIKE (#1045)
* oqsconfig.h: CLMUL definitions

* BIKE: unhook old versions from OQS

* BIKE: improve cpu_features.h

* BIKE: update CMakeLists.txt

* BIKE: support dist build on compilers without -mvpclmulqdq

* BIKE: compile with -Wno-missing-braces -Wno-missing-field-initializers

* Manually update algorithm count
2021-07-01 07:05:49 +02:00
Michael Baentsch
a822f0e62d
PQClean / NTRU Prime update (#1039)
* updating upstream algorithms

* update Kyber upstream ref

* adding compat.h

* add SPDX

* move to PQClean shims

* alpine-breaking gcc feature check changed

* remove error case as per PR review comment
2021-06-29 15:05:34 -04:00
Douglas Stebila
8d7e8f5579
Consistent type in KEM decaps API (#1004) (#1005)
* Consistent type in KEM decaps API (#1004)

* uint8_t in non-PQClean KEM APIs

* uint8_t in PQCleam KEM APIs

* Additional uint8_t tweaks in PQClean KEM APIs

Co-authored-by: Sebastian <sebastianv89@users.noreply.github.com>
2021-06-01 17:49:32 -04:00
Michael Baentsch
3a56677a93
fix for #865 (#1002) 2021-05-21 15:52:03 -04:00
John Schanck
9e2044ff2d
Pull latest HQC-192 from PQClean (#992) 2021-05-06 10:18:02 -04:00
John Schanck
f1673911c3
KeccakP-1600times4/avx2: Switch a memmove to a memcpy for musl libc (#972) 2021-04-18 06:55:39 +02:00
John Schanck
f99556ddda
Add SHA3 call dispatching (#957)
* Move copy_from_xkcp/CMakeLists.txt out of copy_from_xkcp/package.sh

* Namespace xkcp_low implementations for dist builds

* Run-time dispatching of sha3 calls

* Disable sha3 avx2 on windows
2021-04-06 10:34:45 -04:00
John Schanck
211aa22f94
Fix shake context leak in Dilithium (#960)
* Reduce concurrency in CircleCI AddressSanitizer builds

* Fix shake context leak in Dilithium

Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
2021-04-06 08:42:20 -04:00
Douglas Stebila
b1e2b44888
Sync with PQClean (#954)
* Sync with PQClean commmit e463123b92a5b315531c883d0d6b7381731e9b1c

* Sync with PQClean commit ef4ad5da02283ec0dd58b57a0684c98a1e33a531

* Reduce concurrency in CircleCI AddressSanitizer builds
2021-04-05 15:40:07 -04:00
John Schanck
b36ff9f17c
Replace OQS_PORTABLE_BUILD and OQS_USE_CPU_EXTENSIONS (#951)
* Replace OQS_PORTABLE_BUILD with OQS_DIST_BUILD

Also introduces OQS_OPT_TARGET and removes OQS_USE_CPU_EXTENSIONS

* Only compile sha3 avx2 code on Linux|Darwin

* Use new ARCH_ARM[X] flags in SIKE CMakeLists

* Update test_portability and rename to test_distbuild

* Update documentation for building Windows AMD64 from Ubuntu Bionic

* Update scripts/build-android.sh

* More specific CMAKE_SYSTEM_PROCESSOR for rasppi toolchain

* CI: Use OQS_DIST_BUILD in some jobs

* Replace OQS_get_available_CPU_extensions by OQS_CPU_has_extension

* ARM64v8/ARM32v7 runtime cpu feature detection

* Compile-time detection of some ARM features

* Toolchain files to cross compile for ARM32v7 and ARM64v8

* Remove unnecessary references to CMAKE_BUILD_TYPE=Release

* Use OQS_DIST_BUILD=ON on Windows
2021-03-31 16:30:54 -04:00
John Schanck
e82b58aebf
Patch Kyber, Dilithium, and SPHINCS to use our SHA3 (#948)
* Prepare SHA3 shims for pqcrystals

* SHA3 patches for Kyber

* Apply Kyber patches

* SHA3 patches for Dilithium

* Apply Dilithium patches

* SHA3 patches for sphincs (file deletions)
2021-03-24 21:35:37 -04:00
John Schanck
eccb24f21e
Fix OQS_PORTABLE_BUILD logic for upstream imports (#941)
* Fix OQS_PORTABLE_BUILD logic for schemes imported with copy_from_upstream

* Correct interpretation of pclmulqdq required flag

* Only run detect_gcc_clang_intrinsics on X86_64
2021-03-24 21:31:20 -04:00
John Schanck
7dc4b378d6
Refactor SHA3 implementations and improve API (#922)
* sha3: remove old implementations

* sha3: new implementations

* picnic: use liboqs sha3 and sha3x4

* frodo: use new sha3x4 interface

* sphincs: use liboqs sha3x4

* fixup

* skip test_spdx on xkcp_low directory
* xkcp_sha3: explicit casts to avoid narrowing warnings
* xkcp_sha3x4: explicit casts to avoid narrowing warnings
* sha3: disable platform specific xkcp if OQS_PORTABLE_BUILD
* sha3: fix Wcast-qual warnings on clang-9
* fix 'reset' functions
* xkcp_sha3: skip fastloop call if input is not long enough
* xkcp_low: Enable lane complementing for plain-64bits
* xkcp_low: remove Kravatte definitions from times4/avx2

* Add common OQS_MEM_aligned_alloc and OQS_MEM_aligned_free

* Require both OQS_USE_OPENSSL and OQS_USE_SHA3_OPENSSL to enable OpenSSL's SHA3

* Fix some undefined behaviour in KeccakP-1600/plain-64bits

* Fix some undefined behaviour in KeccakP-1600times4/avx2

* Expand shake tests

* Add sha3x4.h include to oqs.h

* Add xkcp_low license info to readme [skip-ci]

* Add copy_from_xkcp scripts [skip-ci]

* SPDX License Info for new scripts [skip-ci]
2021-03-22 19:54:32 -04:00
John M. Schanck
352b5d3db9 Bump PQClean commit number in copy_from_upstream.yml 2021-03-19 09:03:22 -04:00
John M. Schanck
72dfa5a31c Add Wno-language-extension-token for McEliece/avx 2021-03-19 09:03:22 -04:00