Commit Graph

837 Commits

Author SHA1 Message Date
Thom Wiggers
a66d24971f Speed up circleci tests 2021-03-24 21:02:46 +00:00
Douglas Stebila
33ac64d922 Use the right AES CTX 2021-03-24 21:02:46 +00:00
Douglas Stebila
b6ecd70ac7 Don't return void 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
Michael Baentsch
9248977595 Wshadow at Dilithium/avx2 2021-03-24 21:02:46 +00:00
Matthias J. Kannwischer
999b76cb90 fix MSVS warning 2021-03-24 21:02:46 +00:00
Matthias J. Kannwischer
e93a6bef1f Fix NewHope verify
https://github.com/mupq/pqm4/issues/132 repoorted that the NewHope verify function does not actually return 0 or 1, but 0 or -1, which consequenctly breaks the cmov in the FO transform.
This bug was introduced when I integrated this into PQClean.
2021-03-24 21:02:46 +00:00
Douglas Stebila
5a4b5f7358 Trigger build 2021-03-24 21:02:46 +00:00
Douglas Stebila
ca0e28bc43 Change formatting
[skip ci]
2021-03-24 21:02:46 +00:00
Douglas Stebila
f4f51db4eb Avoid type-punning error when strict-aliasing turned on 2021-03-24 21:02:46 +00:00
Thom Wiggers
e39dbecb6a Clean up README and CONTRIBUTING (#273)
* Clean up the docs a bit

* Document that qemu-user-static needs Linux
2021-03-24 21:02:46 +00:00
Thom Wiggers
5b5956c2ef fixup! Fix uint8_t to uint16_t upcast in Frodo 2021-03-24 21:02:46 +00:00
Thom Wiggers
3b655f3f72 Fix uint8_t to uint16_t upcast in Frodo 2021-03-24 21:02:46 +00:00
Thom Wiggers
d257525360 Fix UB in qTESLA
Lots of shifts left of signed integers
2021-03-24 21:02:46 +00:00
Thom Wiggers
507617f30f fixup! Run sanitizers after running AMD64 tests 2021-03-24 21:02:46 +00:00
Thom Wiggers
fcd81030d6 Fix too-large shift in mceliece*f 2021-03-24 21:02:46 +00:00
Thom Wiggers
c5f8131c8b fixup! Run sanitizers after running AMD64 tests 2021-03-24 21:02:46 +00:00
Thom Wiggers
73704e2224 Run sanitizers after running AMD64 tests 2021-03-24 21:02:46 +00:00
Thom Wiggers
3307f05c49 Clean up SABER 2021-03-24 21:02:46 +00:00
Thom Wiggers
5f02a4e80c Fix overflowing mults in NTRUHRSS701 2021-03-24 21:02:46 +00:00
Thom Wiggers
3ef983c459 Fix reduce.c's overflowing multiplication 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
83750a2fb2 Fix duplicate consistency 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
d8c9c431cf Fix memory leaks in LEDAkem 2021-03-24 21:02:46 +00:00
Thom Wiggers
0912b1821c Fix memory leaks in NewHope 2021-03-24 21:02:46 +00:00
Thom Wiggers
160030400d Fix FIPS202 API memory leaks in Dilithium 2021-03-24 21:02:46 +00:00
Thom Wiggers
a804c623de Force running brew update
This will add ~5m to the build time, but Travis CI SUCK at keeping their tools up to date...
2021-03-24 21:02:46 +00:00
Thom Wiggers
1b69c78763 Update Travis CI to XCode 11.3 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
Douglas Stebila
833a9d5129 Fix memory leak in Kyber 2021-03-24 21:02:46 +00:00
Thom Wiggers
b6b4c7d8ed Fix SHAKE256 memory leak in Dilithium (#271) 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
f20c77f718 Fix McEliece8192128f makefile 2021-03-24 21:02:45 +00:00
Thom Wiggers
6bfec2978e Fix alignment problems with vectors in McEliece AVX2 and fix McEliece 8192128f (#267)
* Fix alignment problems with vectors

* Fix required CPU flags for McEliece

* Fix McElice8192128f that was missed in #259

* fixup! Fix McElice8192128f that was missed in #259

* Fix initialization
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
f971718ef7 Fix clang builds to actually use clang 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
784973a8fb Update PR template along practice (#254)
* remove automatically checked property

* Allow PR-submitters to self-document.

We don't ever use these, so allow submitters of PRs to self-document.
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
e4e6ef930e Add ccache to speed up builds (#257)
* Add ccache to speed up builds

* Fix circleci config

* fixup! Fix circleci config

* Try again with environment variables

* Set up ccache on MacOS
2021-03-24 21:02:45 +00:00
Thom Wiggers
7dc03bfc44 Specify arrays with sizes again 2021-03-24 21:02:45 +00:00
Thom Wiggers
2b9759912d Matthias' feedback 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
08f96e8c71 fixup! Add MacOS support for Dilithium 2021-03-24 21:02:45 +00:00