Commit Graph

154 Commits

Author SHA1 Message Date
Douglas Stebila
cf5107b69f Split aes*_keyexp up into ecb and ctr variants 2021-03-24 21:02:46 +00:00
Michael Baentsch
9248977595 Wshadow at Dilithium/avx2 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
d257525360 Fix UB in qTESLA
Lots of shifts left of signed integers
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
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
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
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
08f96e8c71 fixup! Add MacOS support for Dilithium 2021-03-24 21:02:45 +00:00
Thom Wiggers
44b0522070 Add MacOS support for Dilithium 2021-03-24 21:02:45 +00:00
Thom Wiggers
ebb416a2ba Use more robust macro syntax 2021-03-24 21:02:45 +00:00
Thom Wiggers
a037d6ccf6 Don't use const integer arguments 2021-03-24 21:02:45 +00:00
Thom Wiggers
862d0d3094 Use PQClean int guidelines 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
6682216791 Add Dilithium's AVX2 implementations 2021-03-24 21:02:45 +00:00
Matthias J. Kannwischer
963e87af64 rainbow: memcpy -> memmove since buffers may overlap 2021-03-24 21:02:45 +00:00
Matthias J. Kannwischer
d1f2d16f46 remove ternary operator in rainbow to compute max
clang-tidy9.0.0 added a new check: bugprone-branch-clone
(https://releases.llvm.org/9.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html)
This doesn't like both branches of an if are the same.
This lead to a warning in rainbow, as where the maximum of two values (which
are always the same) is computed in a macro.
I don't always agree with this warning, but here I think it's worth to
remove the macro.
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
Sebastian
298dd2cf22 fix clang-tidy complaint about falcon (#242)
See https://circleci.com/gh/PQClean/PQClean/7991
2019-10-16 08:23:33 +02:00
Matthias J. Kannwischer
db7200dc54 fix algorithm names in META.yml 2019-09-24 14:38:18 +02:00
Matthias J. Kannwischer
f08f65c8b6 remove unsupported -Wcast-align=strict 2019-09-24 13:50:38 +02:00
Matthias J. Kannwischer
3a4673bfd6 refactor gf16+gf256 arithmetic of rainbow to fix undefined behaviour 2019-09-24 13:48:51 +02:00
Matthias J. Kannwischer
0523cd693b fix and re-add rainbow 2019-09-24 13:48:51 +02:00
Thomas Pornin
2515f13378 Updated version number, and added an explicit cast to appease some versions of clang-tidy. 2019-09-20 09:01:32 -04:00
Thomas Pornin
44a050106a Fixed sampler bug (update to new upstream Falcon code 2019-09-18). 2019-09-19 15:55:28 -04:00
Matthias J. Kannwischer
7d10484030 fix algo names for schemes that are inconsistent with the api.h 2019-09-19 12:44:26 +02:00
Thom Wiggers
aa46b5239d Enable valgrind exit errorcode and remove Rainbow (#223)
* Enable valgrind exit errorcode

It seems we were not doing anything with the valgrind results... D:

* Use --exit-on-first-error if available

* Revert "Merge pull request #182 from PQClean/rainbow"

This reverts commit 8a008417fe, reversing
changes made to d4b612fe9a.
2019-09-05 10:08:42 +02:00
Thom Wiggers
210937a66f
Fix SPHINCS+ clang-tidy warnings 2019-08-01 09:13:05 +02:00
Thomas Pornin
bad9956869 Fixed some buffer handling bugs that should never happen in practice (but may occur if reusing the internal functions with different parameters). 2019-07-31 16:17:23 -04:00
Douglas Stebila
83c974e45b
Merge pull request #207 from PQClean/sphincs-abstract-state-dupe
Add abstract state duplication for SHA256 incremental hashing API
2019-07-30 21:48:30 -04:00
Douglas Stebila
4d7e5886c9 Rename dupe to clone 2019-07-30 13:23:22 -04:00
Matthias J. Kannwischer
7e4c4c5112
Merge pull request #211 from PQClean/fix-205
Fix documentation for Dilithium `crypto_sign_open`
2019-07-25 12:51:24 +02:00
Thom Wiggers
e00c556699
Merge pull request #213 from kste/fix_haraka_msghash
Only absorb root part of pk in haraka message hashing.
2019-07-25 09:04:28 +02:00
Thom Wiggers
575d2d688b
Update hashes in META files 2019-07-24 16:35:10 +02:00
Thom Wiggers
8a008417fe
Merge pull request #182 from PQClean/rainbow
Add Rainbow
2019-07-24 15:56:14 +02:00
Matthias J. Kannwischer
1fca5ec068 unsigned -> unsigned int 2019-07-24 10:42:15 +02:00
Matthias J. Kannwischer
2bf9d8b3e9 ran clang-format 2019-07-24 10:42:15 +02:00
kste
1a27f40937 Only absorb root part of pk in haraka message hashing. 2019-07-24 08:24:33 +02:00
Thomas Pornin
65e6514be0 Set the version for "round two". 2019-07-22 08:59:08 -04:00
Thom Wiggers
3c2967b5a1
Fix documentation for Dilithium crypto_sign_open
It mentioned `sk` instead of `pk` as specified in the arguments.

Closes #205.
2019-07-22 09:20:54 +02:00
Thomas Pornin
7175413a5c Renamed local variable to avoid a warning about a redefinition; also disabled the MSVC warning C4146 (it is raised whenever negation is applied on an unsigned type, but this has a portable and standard behaviour, and there are good reasons to do that). 2019-07-20 22:21:11 -04:00
Thomas Pornin
dba40c7d43 Removed 'restrict' keyword (it's C99, but MSVC 2017 does not support it...). This does not seem to impact performance. 2019-07-20 21:27:27 -04:00
Thomas Pornin
87bc13c761 Some cosmetic changes to appease clang-tidy. 2019-07-20 20:35:30 -04:00
Thomas Pornin
192e72144b Falcon implementations (integer-only code, constant-time). 2019-07-20 19:44:25 -04:00
Thom Wiggers
debc9f8fd8
Document what exactly hash_state.h defines 2019-07-18 09:16:50 +02:00