146 Commits

Author SHA1 Message Date
Douglas Stebila
0ab1d1d95b Switch to 0.5.1-dev [skip ci] 2021-03-10 13:33:25 -05:00
Douglas Stebila
af1b14e7b6 liboqs 0.5.0 release 2021-03-10 13:30:25 -05:00
Douglas Stebila
5b2ed97f08
liboqs 0.5.0 release candidate 1 (#926)
* liboqs 0.5.0 release candidate 1

* picnic: compile keccak with NO_MISALIGNED_ACCESSES (#924)

* liboqs 0.5.0 release candidate 1

Co-authored-by: John Schanck <jschanck@uwaterloo.ca>
2021-02-27 22:42:11 -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
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
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
fb5484cda6
FrodoKEM portable build with CPU feature detection (#878)
* Make `OQS_SHA3_shake128_4x` always available

* Simplify FrodoKEM SHA3

* Fix prettyprint

* Make SHAKE128 x4 always available and use CPU feature detection

Move contents of sha3x4.c into sha3x4_avx2.c

* CPU feature detection for FrodoKEM sa+e operation

Separate out the 4 versions (C, AVX2) x (AES, SHAKE) and then select 
appropriate one

* Missing braces for single-line for statement

* Reorganize FrodoKEM AVX2 code into separate compilation units

* Move as+e so compiler can apply AVX2 optimizations

There isn't an explicit separate AVX2 implementation since Patrick 
observed that the compiler can optimize this code well enough without 
hand-written usage of intrinsics.  This commit reorganizes the code so 
that the compiler can separately compile a version with -mavx2 options 
provided.
2021-01-18 10:13:11 -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
Goutam Tamvada
3f89b987c7
Refactored CI. (#829) 2020-09-24 11:16:23 -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
02fddd9353 0.4.0 release 2020-08-11 20:30:00 -04:00
Douglas Stebila
477ef3f60c 0.4.0-rc1 2020-08-04 20:25:59 -04:00
Douglas Stebila
adac989932
Added HQC from PQClean. (#805) 2020-08-04 13:22:45 -04:00
Douglas Stebila
ed1baf3d27 Change to 0.4.0-dev and some cleanup 2020-07-24 20:38:46 -04: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
cafb8667c4 Bump to 0.3.1-dev 2020-06-10 12:00:26 -04:00
Douglas Stebila
f6ca3dca5e liboqs 0.3.0 2020-06-10 11:57:51 -04:00
Douglas Stebila
44618b71f6 liboqs 0.3.0 release candidate 2 2020-06-05 19:16:22 -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
6516da6651 liboqs 0.3.0 release candidate 1 2020-05-14 17:38:28 -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
Michael Baentsch
9507608882
Optimized build refactoring. (#683) 2020-04-01 11:33:59 -04:00
Nikita Karpey
438fecf289
Use cpu_features instead of __builtin_cpu (#654). 2020-03-24 15:12:06 -04:00
xvzcf
57f2bcf91f
Replaced add_compile_options(-fPIC) with set(CMAKE_POSITION_INDEPENDENT_CODE ON) (#672)
* Use POSITION_INDEPENDENT_CODE property instead of add_compile_options(-fPIC).

* Fixing CircleCI.
2020-03-19 20:07:58 -04: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
xvzcf
9f4cffbfda Moved the contents of src/crypto into src/common. 2020-03-11 15:06:26 -04:00
xvzcf
0d39a601b1
CMake refactoring. (#652)
* Overhauled the propagation of compiler flags

* Added "Dependency" CMake build type

* Removed src/common/CMakeLists.txt and src/crypto/CMakeLists.txt

* Set default build type to exclude CPU extension-based optimizations
2020-03-11 10:48:28 -04:00
Nikita Karpey
cd24c784a3
Improved support for Mingw-w64 (#648)
* Build fixed through Mingw-w64

* Initial try to build using appveyor and MSYS2
2020-03-10 11:06:52 -04:00
Nir Drucker
fc1bd942a3
Fixing BIKE CMAKE compilation when using Clang-3.9 and on an AVX512 platform (#655) 2020-03-10 11:06:33 -04:00
Douglas Stebila
63b4c6552b
Clear compiler warnings (#633)
* Fix clang on macOS warnings

* Clear gcc-9 on macOS warnings

* Work around gcc-4.9 warnings

* Disable one Picnic compiler warning

* Fix compiler warning on WSL
2020-03-05 11:01:10 -05:00
Nick Fulton
24eb40f121
Enable cross-compilation for Android (#627)
* Update CMakeLists.txt

Prevent breaking options on Android compilation

* Create build-android.sh

Created build script for Android cross-compilation.
2020-02-29 16:05:57 -05:00
Michael Baentsch
8f78156dfa
Added generic optimized build type. (#631) 2020-02-27 15:03:41 -05:00
Nikita Karpey
785c9dc24e
Fixed detection processor architecture (#629) 2020-02-25 12:30:49 -05:00
xvzcf
9c01847b21
Refactored oqsconfig.h.cmake (#628)
* Added OQS_ prefix and assigned values to all #defines in oqsconfig.h.cmake

* Updated CI and templating scripts
2020-02-24 18:04:01 -05:00
xvzcf
56eece81d1
Improved CPU extension handling and updated README. (#622) 2020-02-20 11:17:25 -05:00
Douglas Stebila
410caa77a1
Make AddressSanitizer available (#617)
* Initial format with astyle

* Fix templating to match

* Remove old line

* Add address sanitizer to CI

* Undo merge commit screwup
2020-02-16 17:32:56 -05:00
xvzcf
1b99376625
CMake Bugfixes (#615)
* Python ctypes.cdll.LoadLibrary should be able to load liboqs now.

* Trying to address a TODO.
2020-02-16 13:58:34 -05:00
Douglas Stebila
ca66375f30
Switch from clang-format to astyle (#613)
* Initial format with astyle

* Fix templating to match

* Fix files with missing newline at EOF

* Remove old line

* Remove old .clang-format spec

* Add prettyprint target to CMake
2020-02-15 23:34:31 -05:00
xvzcf
889a03bd15
Switched build system to CMake. (#556)
* Removed cross-compilation scripts and associated Travis CI workflows.
2020-02-14 14:03:29 -05:00