1111 Commits

Author SHA1 Message Date
Douglas Stebila
2e7f65752b Add astyle to Ubuntu install instructions [skip ci] 2021-06-04 17:45:35 +00:00
Douglas Stebila
f8e339dcae liboqs 0.6.0 RC2 0.6.0-rc2 2021-06-02 21:04:37 -04:00
John Schanck
bd23977818
tests/constant_time: update SIKE suppression files [skip ci] (#1009) 2021-06-01 17:50:17 -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
Christian Paquin
63ffa9854a
Integrated sike compressed elligator fix. (#1008)
* Integrated sike compressed elligator fix.

* Updated SIKE's github commit ref
2021-06-01 14:30:13 -04:00
Michael Baentsch
35489ee823
ARM64 via CCI machine (#1010)
* activating ARM64 machine use for CCI
2021-06-01 07:21:37 +02:00
Michael Baentsch
3a56677a93
fix for #865 (#1002) 2021-05-21 15:52:03 -04:00
Michael Baentsch
92e6418b35
BIKE and Picnic enablement for cygwin (#1001)
* BIKE and Picnic enablement for cygwin

* no doxygen support for cygwin
2021-05-18 08:17:05 +02:00
John Schanck
530d7059b2
sha3: respect OQS_ENABLE_SHA3_xkcp_low_avx2=OFF in CMakeLists.txt (#999) 2021-05-11 21:09:34 -04:00
Michael Baentsch
f42b8b0033
change MSVC compile opts to openssl integration (#996) 2021-05-11 10:38:51 -04:00
Michael Baentsch
e4568033cc
documentation consolidation (#998) 2021-05-11 10:30:31 -04:00
John Schanck
1b25f45f35
tests/constant_time: update passes file for AVX2 impl of HQC [skip ci] (#994) 2021-05-06 19:51:20 -04:00
John Schanck
83af71078b
Add canaries around malloc'd regions in test_sig (#993)
* test_sig: Add canaries around malloc'd regions

* test_sig/kem: disable canary checks in test_constant_time

* test_kem: test canaries after testing malformed ciphertext
2021-05-06 19:50:53 -04:00
John Schanck
8981b7f337
tests/constant_time: SIKE issues are resolved (#987) 2021-05-06 10:52:35 -04:00
John Schanck
9e2044ff2d
Pull latest HQC-192 from PQClean (#992) 2021-05-06 10:18:02 -04:00
Sofía Celi
8ae15e6a88
astyle is needed to be installed on MacOS for run_tests to succeed (#991) 2021-05-05 10:25:17 -04:00
Thom Wiggers
1923b82a3b
Test without alignment (#986)
* Fix potential NULL dereference in fix_test_kem

* Test without aligned pk, sk

This changes the test_kem.c functions like those in PQClean:
* also prefix magic bytes for checking for out-of-bounds access
* use odd numbers for breaking alignment

Includes #985

* Fix style
2021-05-04 20:27:07 -04:00
Michael Baentsch
8f8bb44c2f
output CPU feature CT/RT distinction (#984) 2021-05-03 15:03:23 +02:00
Christian Paquin
b1d07278d1
SIKE March 2021 bug fix (#981)
* SIKE March 2021 bug fix

* Reverted typo.
2021-04-29 14:35:57 -04:00
Douglas Stebila
5f28a2af5d liboqs 0.6.0-rc1 0.6.0-rc1 2021-04-25 16:43:56 -04:00
John Schanck
a89e3ac581
Improve random sources when not using OpenSSL (#976)
* rand.c: request at most 256 bytes per getentropy call

* CMake: Set OQS_HAVE_GETENTROPY

* rand.c: fopen/fread error handling

* rand.c: redundant test to silence warn_unused_result

* CMake: include CheckSymbolExists
2021-04-20 19:48:24 -04:00
jyao1
e48bc41c4f
Enable liboqs build in UEFI/EDKII. (#975)
UEFI/EDKII used openssl as crypto lib with OPENSSL_SYS_UEFI.

This patch adds OQS_SYS_UEFI macro in liboqs to indicate special build in UEFI/EDKII.
With this patch, we can start building liboqs in UEFI/EDKII.

For algorithm specific patches, we will submit one by one later.

Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
2021-04-20 08:55:31 -04:00
Douglas Stebila
a04ef8d3ca
Switch AES C implementation to PQClean's (#971)
* Switch AES C implementation to PQClean's

* Tweaks to AES C implementation
2021-04-19 15:55:25 -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
Douglas Stebila
7b56fa83f8
Remove AES decryption functions (#970)
* added OQS_NO_AESDEC define

* disable _dec only subroutines

* further non-openssl _dec subroutines disabled

* Remove decryption subroutines

* Remove further AES decryption code

* Forgot one function

Co-authored-by: Michael <57787676+baentsch@users.noreply.github.com>
2021-04-15 09:50:28 -04:00
Douglas Stebila
008ba89dc4
Don't do feature detection inside a tight loop (#969)
* Don't do feature detection inside a tight loop

* Prettyprint
2021-04-14 16:57:28 -04:00
John Schanck
aa076bb192
oqsconfig.h.cmake: add missing OQS_ENABLE_SHA3_xkcp_low_avx2 line (#968) 2021-04-12 20:16:09 -04:00
John Schanck
44fe8fd82c
SIKE/CMake: recognize both x64+BMI2 and x64+BMI2+ADX (#965)
* SIKE/CMake: recognize both x64+BMI2 and x64+BMI2+ADX

* CI: re-enable alpine
2021-04-12 15:31:38 -04:00
John Schanck
efd7b1926a
Speed up ARM jobs in CI (#964)
* CMake: ARM toolchain files

* CI: Cross compile for ARM instead of emulating the entire build

* CMake: do not use mcpu=native when cross compiling

* CI: Disable testapproval [skip ci]

* CI: Disable armel tests

* CI: Disable test_mem on ARM
2021-04-08 14:49:56 -04:00
John Schanck
7efdb91322
Detect ADX instructions (#963)
* Detect x86_64 ADX extension

* Check for ADX instructions SIKE CMakeLists

* system_info.c: better instruction reporting
2021-04-06 19:15:51 -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
Michael Baentsch
8036fc616b
Update RELEASE notes with new build flags (#962)
As per discussion in #951
2021-04-06 10:33:31 -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
336488085c
Update windows cross-compiling toolchain and documentation [skip ci] (#959) 2021-04-02 13:09:24 -04:00
John Schanck
7f3088232a
Manually remove fips202 files left by copy_from_upstream (#958) 2021-04-02 13:08:30 -04:00
John M. Schanck
7a5001fe12 Fix compilation of KeccakP-1600-AVX2.s on macOS 2021-04-01 10:13:56 -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
3f2da47b36
Pull latest SPHINCS from PQClean; bump liboqs version to 0.6.0-dev (#950) 2021-03-27 14:11:00 -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
ac2b828193 Pull latest verison of McEliece from PQClean 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
John M. Schanck
5572f76b26 Upstream patch to remove __m256i_u* casts from McEliece/avx 2021-03-19 09:03:22 -04:00
John M. Schanck
d682661514 Remove unused McEliece implementations 2021-03-19 09:03:22 -04:00
John M. Schanck
9b77b33ece Revert local McEliece changes 2021-03-19 09:03:22 -04:00
John Schanck
3a4ef5437a
copy_from_upstream: patch mechanism (#944) 2021-03-18 09:37:35 -04:00
John Schanck
4b1a9e23ee
Make OQS_USE_CPU_EXTENSIONS imply OQS_PORTABLE_BUILD=OFF; alternative to #939 (#942) 2021-03-14 15:32:52 -04:00