50 Commits

Author SHA1 Message Date
Michael Baentsch
18b3fe39b2
disable BIKE on all 32bitters except x86 (#1180) 2022-01-22 10:27:46 -05:00
Sebastian Ramacher
9227b2a233
Update to Picnic 3.0.9 (#1167)
* Update to Picnic 3.0.10 (fixes #1165)

* Disable Picnic SIMD optimizations on Cygwin (fixes #1163)

* Set WITH_OPT only if required

* Revert "remove picnic from cygwin build (#1171)"

This reverts commit 5608b465748281c8f84a97858dbd9887e77d6bd3.

* Update supported CPU extensions for Picnic
2022-01-09 11:28:56 -05:00
pkubaj
5ea49c2a44
Add support for powerpc64. (#1160)
This is 64-bit POWER big-endian. Since s390x (64-bit big-endian) and ppc64le
(64-bit POWER) are already supported, this shouldn't be an issue.
2021-12-23 18:03:25 -05:00
Sebastian Ramacher
4479f50da8
Update Picnic to 3.0.7 (#1158)
* Define PICNIC_EXPORT instead of PICNIC_STATIC

PICNIC_STATIC builds some internal functions only required for testing.

* Handle SSE2/AVX2/NEON in Picnic similar to other schemes

* Update to Picnic 3.0.8
2021-12-20 11:01:10 -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
188e6a38b2
enable ARM64 optimizations when using MINIMAL_BUILD option (#1139) 2021-12-01 07:08:07 +01: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
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
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
Basil Hess
5c2e13062c
Disable BIKE build on s390x (big endian) (#1115) 2021-10-21 20:57:07 -04:00
Vitaly Chikunov
9c2b485cd0
Support for x86 and ppc64le architectures (#1037)
* x86: Optimistic port to x86

No processor extensions support.
Tests are passed.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>

* ppc64le: Optimistic port to ppc64le

No (AltiVec/VSX) processor extensions support is detected.
Tests are passed.

Note that `secure_cmp32` may require additional treatment for this
architecture.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2021-07-09 10:30:20 -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
dkostic
17d3e0bab5
Import BIKE Round-3 Additional code (#1013)
* Import BIKE Round-3 Additional code

* astyle fix

* Fix for the shared build

* Added KATs sha256sum for BIKE-L1 and BIKE-L3

* Add check if the compiler supports VPCLMUL flag (some older ones don't)

* Disable BIKE build on 32-bit ARM

* Addressing comments on the PR

Co-authored-by: Dusan Kostic <dkostic@amazon.com>
2021-06-17 11:17:22 -04:00
Michael Baentsch
3a56677a93
fix for #865 (#1002) 2021-05-21 15:52:03 -04: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
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
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 Schanck
b5fd8aedfc
Resolve some McEliece AVX build issues (#932)
* Fix minimal build support for McEliece avx

* mceliece avx consts.S: use .hidden to avoid putting consts in GOT

* mceliece avx int32_sort.c: avoid gcc extension __m256i_u

* cmake: Use target_compile_option when setting -Wno-language-extension-token for mceliece avx
2021-03-11 21:28:07 -05:00
Michael Baentsch
6040f559ec
Update Falcon & McEliece (adding AVX) (#920)
* fixing copy_from_upstream issues (>2 optimized implementations)

* adding mceliece-avx & falcon

* alg doc added
2021-02-23 16:45:56 +01:00
Thom Wiggers
d9e025852e
Support OpenSSL on Windows (#915)
* Allow OpenSSL on Windows

See https://github.com/open-quantum-safe/liboqs-rust/issues/17
2021-02-23 06:12:06 +01:00
John Schanck
f4c1ef9ba5
Add OQS_MINIMAL_BUILD option and redefine CI workflow (#903)
* Add OQS_MINIMAL_BUILD option that builds only the default KEM/SIG

* CI: add buildcheck job, which uses minimal build

* Add buildcheck and testapproval to CI workflow

* CI: Only run address-sanitizer on audit branches

* CI: Disable centos-8 and debian-buster
2021-02-13 16:53:06 +01:00
Basil Hess
bd4d09da75
Sync upstream with copy_from_upstram / pqcrystals pull (#891)
* Point Kyber and Dilithium to pqcrystals-repo.

* Pulls Kyber and Dilithium from PQCrystals using copy_from_upstream

* Dilithium Round 3
* Kyber round 3
* Updates Dilithium Round 3 KAT

* Updates kyber.md and dilithium.md (manual changes after running copy_from_upstream)
2021-02-04 15:46:45 +01:00
Basil Hess
fc35e09a14
Update copy_from_pqclean / copy_from_upstream (#883)
* Update copy_from_pqclean / copy_from_upstream (#880)

* Renames copy_from_pqclean to copy_from_upstream.

* Adds 'upstreams' field to copy_from_upstream.yml, allowing to specify upstream repositories, branches and commits.

* Modifies "copy" command in copy_from_upstream: sources are pulled from specified git-repositories. Implementation folders in $LIBOQS_DIR/src will be prefixed with the upstream-name.

* Adds "verify" command in copy_from_upstream: Implementations in $LIBOQS_DIR/src are compared with expected upstream versions.

* Prepares for copying pqclean, pqcrystals-kyber and pqcrystals-dilithium from upstream.

* Updates copy_from_upstream to process common dependencies from an upstream.

* Adds reminder text to manually update algorithm docs .md files after copying
2021-02-03 18:43:02 +01:00
Douglas Stebila
85597bbc6c
Rainbow Round 3 (#867) 2021-01-04 09:25:35 -05:00
Douglas Stebila
65b3fb6e71
Sync with PQClean (Kyber Round 3) (#858)
* Delete Kyber Round 2

* Sync with PQClean

Major changes; Kyber Round 3
Minor changes: HQC and NTRU

PQClean commit 168e3625988defacdf10812642e4d412fb295dc0
2020-12-03 09:56:03 -05:00
Douglas Stebila
1ad950ac00
Sync with PQClean (#851)
* Remove HQC round 2

* Sync with PQClean

3c8be3cb1f8ca0953f2df44ea665f118efb468d6

* Add HQC from PQClean
2020-11-24 10:04:49 -05:00
Douglas Stebila
46693cf93a
Add NTRU-Prime from PQClean (#848) 2020-11-03 13:36:24 -05:00
Douglas Stebila
1a923c79e0
Sync with PQClean (#846)
* Change BMI1 and add PCLMUL

* Copy from PQClean

Commit b4078aae55f9efbc7b3ab7b3c702be376f7a7987, excluding HQC

* Update algorithm datasheets

* Prettyprint

* Update version to 0.5.0-dev
2020-10-29 19:46:39 -04:00
Douglas Stebila
1d08c9d6ab
Sync with PQClean (#817)
* Sync with PQClean

* NTRU update

* SPHINCS updates

* Update commit in documentation
2020-09-10 18:16:18 -04:00
Douglas Stebila
226b4637d9
Remove non-Round 3 algorithms (NewHope, ThreeBears, MQDSS, qTesla) (#810) 2020-08-17 13:25:08 -04:00
Douglas Stebila
adac989932
Added HQC from PQClean. (#805) 2020-08-04 13:22:45 -04:00
Douglas Stebila
aa7f1dfa3d
Cleanup PQClean implementations (#803)
* Sync with PQClean commit 90630db2ebada4bacceb5331b0a1a9a356ba65b9

* Delete duplicate implementations due to underscore bug; add MQDSS AVX2

* Delete more duplicate PQClean implementations
2020-08-04 11:54:25 -04:00
Michael Baentsch
2991696b4c
upstream dilithium (#794)
* added upstream dilithium

* switched to clang on Centos-8
2020-07-23 06:45:08 +02:00
Christian Paquin
f4d4d47c81 Integrated picnic v3.0. 2020-06-24 20:18:39 -04:00
Douglas Stebila
ffae460a71
Remove LEDAcrypt v2.1 temporarily (#756)
Due to attack in https://eprint.iacr.org/2020/455
2020-05-26 14:11:11 -04:00
Douglas Stebila
6e0b0d79a9
Add SPDX-License-Identifier headers (#749)
* Add SPDX-License-Identifier in src/common

* Add SPDX-License-Identifier in FrodoKEM

* Add SPDX-License-Identifier in SIKE

* Add SPDX-License-Identifier in BIKE

* Add SPDX-License-Identifier in OQS headers

* Add SPDX-License-Identifier in files generated during copy-from-pqclean

* Add SPDX-License-Identifier in Picnic

* Add SPDX-License-Identifier in qTesla

* Add SPDX-License-Identifier in CMake files

* Update license info in README

* Add SPDX-License-Identifier in scripts

* Add SPDX-License-Info to CMakeLists

* Add SPDX-License-Info in tests

* Add SPDX-License-Info to various files

* Prettyprint

* Add test for SPDX-License-Identifier headers

* Updated license identifiers for CPU extension detection code.

* Use conjunction for SPDX in file with two licenses

Co-authored-by: xvzcf <xvzcf@users.noreply.github.com>
2020-05-12 11:45:37 -04:00
Michael Baentsch
2bcc8ae038
Default alg setting brought in line with documentation (#744) 2020-05-04 09:43:36 -04:00
Douglas Stebila
3bad81851f
Add AVX2 and AESNI versions of SPHINCS+ (#736)
* Add AVX2 and AESNI versions of SPHINCS+

Also remove all of the dead code that was included (probably due to
a name format change sometime)

* Don't include empty operating_system matcher

* Rerun copy_from_pqclean

Co-authored-by: Thom Wiggers <thom@thomwiggers.nl>
2020-04-27 21:22:38 -04:00
xvzcf
8950275409
Removed non-standard CMake build types and fixed other bugs. (#726)
* Removed non-standard CMake build types and introduced new variables to customize the build.

* Added handling for new build variables to all KEMS and signatures and updated CI.

* Added clang-9 test to CI.
2020-04-16 13:53:04 -04:00
xvzcf
d6788819d8
Re-enabled Picnic and qTESLA. (#715) 2020-04-14 10:52:52 -04:00
xvzcf
722ca648a1
Overhauled compiler-time CPU-extension detection. (#713)
Refactored .CMake/alg_support.cmake, and kem/ and sig/ CMakeLists.txt files.

Refactored copy_from_pqclean/ templating.

Added custom x64 CPU extension detection code and removed cpu_features.

Removed duplicate Kyber source directories.
2020-04-14 07:58:41 +02:00
Michael Baentsch
29232021b7 copy-from-PQClean done - triggering full CI test 2020-04-07 08:30:43 +02:00
Douglas Stebila
4c3016f43e
Add Rainbow from PQClean (#662)
* Add Rainbow from PQClean

* Adapt CircleCI config to handle larger number of local files
2020-03-15 20:25:42 -04:00
Douglas Stebila
eaec7972ba
Add Classic McEliece from PQClean (#661)
* Add Classic McEliece from PQClean

* Enlarge stack size on Windows

* Enlarge stack size with Mingw/Cygwin
2020-03-15 08:54:55 -04:00
Douglas Stebila
795c1b7932
Add Falcon from PQClean (#660)
* More cleanup after replaced dashes in filenames

* Add Falcon from PQClean and sync with latest PQClean commits

* Try to fix type punning warning in Falcon

* Missed templating

* Formatting change
2020-03-14 10:56:42 -04:00
xvzcf
adcfe2744c Replaced dashes in filenames with underscores for consistency. 2020-03-11 15:06:26 -04:00