21 Commits

Author SHA1 Message Date
Michael Baentsch
489aa7eb59
ARM32 gcc12 build workaround (#1297)
* add ARM32 gcc compile option workaround

* add no-ipa-modref only in gcc11 and higher
2022-09-07 19:21:27 +02:00
Sebastian Ramacher
9ee96d803e
Ensure build without an executable stack (fixes #1285) (#1294)
* Ensure build without an executable stack (fixes #1285)

Until it is clear why the shared library on mips64el and hppa is built
with the executable bit set for the stack, build with both
`-Wa,--noexecstack` (for the assembler) and `-Wl,-z,--noexecstack` (for
the linker).

* Check if compiler/linker support flags for noexecstack before using them

* Add a warning if unable to check for support
2022-08-31 06:41:28 +02:00
Douglas Stebila
a34cabb4bf
Mark stack non-executable when compiling with clang or gcc (#1161)
* Mark stack non-executable when compiling with clang or gcc

Fixes #1159

* Change noexecstack option on gcc

* Use gcc noexecstack only on non-Darwin

* Check for non-executable stack in shared object builds on Linux
2022-01-09 11:30:10 -05:00
Basil Hess
016404076d
S390x support (#1103)
* s390x support

* - Fix for FrodoKEM-SHAKE for big endian support
- Fix unused variable in Keccak code on big endian
2021-10-12 14:39:56 -04:00
Douglas Stebila
9b4d4bb683
Change CMake files to support macos on Apple Silicon (#1034) 2021-07-05 11:55:39 -04:00
John Schanck
dc0a14445e
CMake: Do not set march or mcpu when OQS_OPT_TARGET=generic (#1017) 2021-06-14 12:39:12 -04:00
Michael Baentsch
3a56677a93
fix for #865 (#1002) 2021-05-21 15:52:03 -04:00
Michael Baentsch
f42b8b0033
change MSVC compile opts to openssl integration (#996) 2021-05-11 10:38:51 -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
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
707750e034
Fix OQS_PORTABLE_BUILD logic for Frodo (#927)
* Fix OQS_PORTABLE_BUILD logic for Frodo

* Refine 'OQS_PORTABLE_BUILD' by general architecture, e.g. x86_64

* Use CMake to define ARCH_X86_64 and ARCH_ARM_ANY used in common.{c,h}

* Avoid triggering portable build on ARM

* Set OQS_USE_CPU_EXTENSIONS even on MSVC

* Compile AES-NI code in portable x86_64 builds
2021-03-11 21:31:26 -05: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
John Schanck
fa9c2671ec
Use valgrind to check for secret-dependent branching on 'audit' branches (#904)
* Constant time checks using Valgrind and suppression files

* Suppression file for Kyber (ref+avx), HQC, SIKE, NTRUPrime, McEliece, SIDH, Falcon (ref+avx), SPHINCS, Dilithium r2+r3, picnic

* mark all BIKE implementations as vartime

* Set OQS_DEBUG_BUILD in oqsconfig.h if CMAKE_BUILD_TYPE=Debug

* Add OQS_ENABLE_TEST_CONSTANT_TIME to oqsconfig.h

* Check build options before running

* test_{kem,sig}: avoid direct call to OQS_randombytes_system

* Remove picnic3 issue based on review #889

* fix Kyber namespacing

* Missing BIKE error type, skip BIKE

* Resolve SIDH/SIKE bingcd issue as per #888

* Mark Falcon hash_to_point_vartime issue as resolved

* Disable CI tests
2021-02-25 06:51:01 +01: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
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
Douglas Stebila
34ec4b83a7
Re-add AES-NI with CPU feature detection (#770)
* Start re-adding AES-NI with CPU feature detection

* Follow Goutam's feedback on CPU feature detection

* Macrify CPU feature detection logic in AES

* AES128 and AES256 using NI based on Romain Dolbeau's public domain code

* Fewer calls to C_OR_NI

* Restricting setting of OQS_USE_CPU_EXTENSIONS.

* Unroll AES loops

Co-authored-by: xvzcf <xvzcf@users.noreply.github.com>
2020-07-24 13:53:14 -04:00
Douglas Stebila
a55b12eb25
Fix non-Dilithium-related execute failures on Alpine (#796)
* Increase stack size when using musl libc on Alpine

This is probably not the best way to do it in long run, but I'm not sure 
how to detect libc version at compile time.

* Fix free-check bug on Alpine

* Extra symbols in shared library on Alpine

* Activate Alpine builds

* Only increase stack size if musl is present on Alpine

This is not the most generic way to do it but hopefully will suffice

* Temporarily enable Alpine builds

* Simplify link option on Alpine
2020-07-24 09:18:19 -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
xvzcf
e69bdcbd32
Broadened OQS_BUILD_TESTS to OQS_BUILD_ONLY_LIB and removed side-effecting asserts. (#741) 2020-04-28 15:05:00 -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
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