Commit Graph

298 Commits

Author SHA1 Message Date
John M. Schanck
a96df80f89 HQC: update from upstream 2021-03-24 21:02:48 +00:00
Thom Wiggers
351d17ae70 Implement testing via Github actions
* Fix a bunch of issues in SPHINCS+ on Windows
* Fix testing makefile dependencies by fixing times of common files
  (affected Windows testing mainly)
2021-03-24 21:02:48 +00:00
Thom Wiggers
7bc63d020b Fix test_symbol_namespace 2021-03-24 21:02:48 +00:00
John M. Schanck
fdd73d893c inspect initializations 2021-03-24 21:02:48 +00:00
John M. Schanck
331733e9e0 Add test/test_boolean.py 2021-03-24 21:02:48 +00:00
John M. Schanck
629b89ba73 readability changes 2021-03-24 21:02:48 +00:00
John M. Schanck
d1a4fa5e68 uint8_t api for encode/decode in optimized rmrs 2021-03-24 21:02:47 +00:00
John M. Schanck
26e0aea3e2 more endianness fixes 2021-03-24 21:02:47 +00:00
John M. Schanck
646f9f4a05 satisfy MS compiler 2021-03-24 21:02:47 +00:00
John M. Schanck
eb120a6b24 narrowing warnings 2021-03-24 21:02:47 +00:00
John M. Schanck
bf7bd3650b Rename log and exp to gf_log and gf_exp 2021-03-24 21:02:47 +00:00
John M. Schanck
a3c627fe6b Some MS compiler fixes 2021-03-24 21:02:47 +00:00
John M. Schanck
9d35c7bb57 typo and more endianness fixes 2021-03-24 21:02:47 +00:00
John M. Schanck
d73a713fd4 Fix endianness issues 2021-03-24 21:02:47 +00:00
John M. Schanck
63d033cf02 Initialize arrays in fft.c and fix a few compiler warnings 2021-03-24 21:02:47 +00:00
John M. Schanck
ae30e1f432 Avoid ==, !=, etc in arithmetic expressions. Some compilers will produce non-constant time code. 2021-03-24 21:02:47 +00:00
John M. Schanck
cb7675a9b6 Replace avx2 'reduce' in gf2x 2021-03-24 21:02:47 +00:00
John M. Schanck
b0afb62c0e New HQC and HQC-RMRS from upstream 2021-03-24 21:02:47 +00:00
John M. Schanck
162751e2e5 NTRU Prime: jump directly to crypto_sort_smallindices 2021-03-24 21:02:47 +00:00
John M. Schanck
b568d01ac6 NTRU Prime: Simplified patch set 2021-03-24 21:02:47 +00:00
John M. Schanck
431dbada45 Add sntrup{653,761,857} and ntrulpr{653,761,857}
Exported from SUPERCOP-20200826 using the scripts at:
https://github.com/jschanck/pqclean-package-ntruprime
2021-03-24 21:02:46 +00:00
John M. Schanck
722b510358 NTRU: duplicate consistency 2021-03-24 21:02:46 +00:00
Matthias J. Kannwischer
22babfef8a remove threebears, ledakem, newhope, mqdss, qtesla
NIST announced the Round 3 finalists and alternate candidates today:
https://groups.google.com/a/list.nist.gov/d/msg/pqc-forum/0ieuPB-b8eg/Cl7Ji8TpCwAJ

Some of the schemes in PQClean did not make it to Round 3 and this commit
removes them.
2021-03-24 21:02:46 +00:00
Thom Wiggers
8e27bd0915 Add MQDSS AVX2 implementations (#288)
* Add AVX2 version of mqdss

* Fix duplicate consistency
2021-03-24 21:02:46 +00:00
Thom Wiggers
1f8b852e8f Speed up test collection (#298)
* don't do filesystem operations during collection

* Greatly speed up test collection

* fixup! Greatly speed up test collection

* Silence junit warning

* fixup! Greatly speed up test collection
2021-03-24 21:02:46 +00:00
Thom Wiggers
1edad0d3cc Filter out clang-tidy on alternate platforms 2021-03-24 21:02:46 +00:00
Thom Wiggers
a66d24971f Speed up circleci tests 2021-03-24 21:02:46 +00:00
Douglas Stebila
cf5107b69f Split aes*_keyexp up into ecb and ctr variants 2021-03-24 21:02:46 +00:00
Sebastian
4054af0c42 HQC submission (#202)
* Sebastian's HQC merge request

* Clean up changes to common infrastructure

* Fix Bitmask macro

It assumed that ``unsigned long`` was 64 bit

* Remove maxlen from nistseedexpander

It's a complicated thing to handle because the value is larger than size_t supports on 32-bit platforms

* Initialize buffers to help linter

* Add Nistseedexpander test

* Resolve UB in gf2x.c

Some of the shifts could be larger than WORD_SIZE_BITS, ie. larger than
the width of uint64_t. This apparently on Intel gets interpreted as the
shift mod 64, but on ARM something else happened.

* Fix Windows complaints

* rename log, exp which appear to be existing functions on MS

* Solve endianness problems

* remove all spaces before ';'

* Fix duplicate consistency

* Fix duplicate consistency

* Fix complaints by MSVC about narrowing int

* Add nistseedexpander.obj to COMMON_OBJECTS_NOPATH

* astyle format util.[ch]

* add util.h to makefile

* Sort includes in util.h

* Fix more Windows MSVC complaints

Co-authored-by: Sebastian Verschoor <sebastian@zeroknowledge.me>
Co-authored-by: Thom Wiggers <thom@thomwiggers.nl>
2021-03-24 21:02:46 +00:00
Thom Wiggers
ea5ede6e80 Make sure tests respond to undefined behaviour 2021-03-24 21:02:46 +00:00
Thom Wiggers
698738c263 Enable leak check in Valgrind 2021-03-24 21:02:46 +00:00
Thom Wiggers
5bad0df0b6 Fix detecting of to-be-tested changes on Windows 2021-03-24 21:02:46 +00:00
Thom Wiggers
07db9c1e60 Put all common primitives on the heap (#266)
* Put AES ctx on the heap

This forces people to use the ``ctx_release`` functions, because otherwise there will be leaks

* Put fips202 on the heap

* Add much more docs for fips202.h

* fixup! Put fips202 on the heap

* Put SHA2 on the heap-supporting API

* Fix clang-tidy warnings

* Fix unreachable free() in falcon

* Fix McEliece8192128f-sse GNU Makefile
2021-03-24 21:02:45 +00:00
Thom Wiggers
ac2c20045c Classic McEliece (#259)
* Add McEliece reference implementations

* Add Vec implementations of McEliece

* Add sse implementations

* Add AVX2 implementations

* Get rid of stuff not supported by Mac ABI

* restrict to two cores

* Ditch .data files

* Remove .hidden from all .S files

* speed up duplicate consistency tests by batching

* make cpuinfo more robust

* Hope to stabilize macos cpuinfo without ccache

* Revert "Hope to stabilize macos cpuinfo without ccache"

This reverts commit 6129c3cabe1abbc8b956bc87e902a698e32bf322.

* Just hardcode what's available at travis

* Fixed-size types in api.h

* namespace all header files in mceliece

* Ditch operations.h

* Get rid of static inline functions

* fixup! Ditch operations.h
2021-03-24 21:02:45 +00:00
Thom Wiggers
22e2551c95 Also run duplicate consistency checks on windows (#261) 2021-03-24 21:02:45 +00:00
Leon Botros
13c0317e25 Add ephemeral versions of ThreeBears 2021-03-24 21:02:45 +00:00
Thom Wiggers
77e9a23431 Move keys to heap for KEMs as well 2021-03-24 21:02:45 +00:00
Thom Wiggers
303a741192 Move keys in crypto_sign/functest.c to the heap
Having the keys on the stack increases the stack space consumption by
quite a bit, and this in turn results in the sanitizer tests failing
for Rainbow.

Moving the keys to the heap in the test seems like a harmless change.
2021-03-24 21:02:45 +00:00
Thom Wiggers
facb527c7c SPHINCS+ optimized implementations (#253)
* Add state destroy to SHA2 API

* Include optimized SPHINCS+ implementations

I've generated new implementations from the sphincsplus repository.

* Don't destroy sha256ctx after finalize

* Attempt to shut up MSVC

* Make sure to drop errors in rmtree
2021-03-24 21:02:45 +00:00
Thom Wiggers
a4e31f16a2 Fix isolation in test_metadata_sizes (#258) 2021-03-24 21:02:45 +00:00
Thom Wiggers
9c35647461 MacOS ABI versions of Keccak 2021-03-24 21:02:45 +00:00
Thom Wiggers
cb729b6a03 Fix duplicate consistency files
Every .s file is now handled through CC
2021-03-24 21:02:45 +00:00
Thom Wiggers
6cd265f5b9 fixup! Add Dilithium's AVX2 implementations 2021-03-24 21:02:45 +00:00
Thom Wiggers
377d0cbf1a Support unaligned vectors in pycparser 2021-03-24 21:02:45 +00:00
Thom Wiggers
6682216791 Add Dilithium's AVX2 implementations 2021-03-24 21:02:45 +00:00
Leon Botros
36b6142794 remove empty lines at end of file 2021-03-24 21:02:45 +00:00
Leon Botros
2d9e259608 add duplicate consistency checks 2021-03-24 21:02:44 +00:00
Sebastian
56a0fcb135 qTESLA (#239)
* Copied qTESLA-p-I round2 (2019-08-19) code

* Code compiles, NIST-KAT works

* Included detached signature API

* Generated testvectors

* Fixed name in api.h

* code style

* Fixed error in Makefile

* Passing pytest

* Fixing types (uint8_t bytes and size_t indices)

* Replaced SHAKE with SHAKE128 where necessary

* Fixed bug: (signed) integer overflow

* Added qTESLA-p-III

* Code is now independent of machine endianness

* repaired Microsoft makefile
2019-10-21 14:26:27 +02:00
Thom Wiggers
f792b925b4 Enable optimizers on Windows (#244) 2019-10-21 14:23:59 +02:00
Matthias J. Kannwischer
1e04996465 re-add duplicate consistency checks 2019-09-24 14:43:23 +02:00