Commit Graph

277 Commits

Author SHA1 Message Date
John M. Schanck
06ff242344 Revert "NTRU Prime: change prototype for clean/crypto_sort_int32"
This reverts commit 8a372ad2e8.
2020-09-02 17:27:14 -04:00
John M. Schanck
8a372ad2e8 NTRU Prime: change prototype for clean/crypto_sort_int32 2020-09-02 16:41:51 -04:00
John M. Schanck
4f6e00ed69 NTRU Prime: jump directly to crypto_sort_smallindices 2020-09-02 13:37:23 -04:00
John M. Schanck
75710108fb NTRU Prime: satisfy linter 2020-09-02 13:01:19 -04:00
John M. Schanck
55c6d04df6 NTRU Prime: Simplified patch set 2020-09-02 12:48:28 -04:00
John M. Schanck
8bb37ad134 NTRU Prime: Disable -Wconversion for gcc 2020-09-01 17:34:55 -04:00
John M. Schanck
7f3228a9b3 NTRU Prime: more unary negations 2020-09-01 17:15:01 -04:00
John M. Schanck
a5b5633534 NTRU Prime: more explicit casts 2020-09-01 17:00:55 -04:00
John M. Schanck
22c4feb174 NTRU Prime: avoid unsigned unary negation 2020-09-01 16:18:21 -04:00
John M. Schanck
2b54c6570d NTRU Prime: more compiler warnings 2020-09-01 15:56:45 -04:00
John M. Schanck
4c5a8326ef NTRU Prime: More changes for MS compiler 2020-09-01 15:16:45 -04:00
John M. Schanck
bfd9e1e8fd NTRU Prime: Explicit casts to avoid conversion warnings 2020-09-01 07:55:46 -04:00
John M. Schanck
5982bdffcc NTRU Prime: Match the NIST submission's sequence of calls to randombytes 2020-08-31 10:22:31 -04:00
John M. Schanck
70543bba37 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
2020-08-28 20:22:56 -04:00
John M. Schanck
268b62f3ce NTRU: Move crypto_sort_int32.h include to top of sample.c 2020-08-25 07:57:26 -04:00
John M. Schanck
146a3195e9 NTRU: more explicit casts for MS compiler 2020-08-24 10:56:18 -04:00
John M. Schanck
f49d18a75b NTRU: add explicit cast for MS compiler 2020-08-24 10:43:44 -04:00
John M. Schanck
1d26f6a582 Update NTRU and add AVX2 NTRU implementations 2020-08-24 09:47:30 -04:00
John Schanck
4ea4b478ba
Update NTRU (#311)
* Update NTRU

version: https://github.com/jschanck/ntru/tree/485dde03

* Fixed ntruhrss701/clean/Makefile.Microsoft_nmake
2020-08-15 14:26:25 -04:00
Sofía Celi
534e7a1277
Fix overflow in multiplication in Saber 2020-08-11 10:47:55 -05:00
Matthias J. Kannwischer
9fbfb230a9 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.
2020-07-23 14:08:09 +08:00
Douglas Stebila
ae1530d192 Fix timing leak in decapsulation.
As identified in: Qian Guo, Thomas Johansson, Alexander Nilsson. A 
key-recovery timing attack on post-quantum primitives using the 
Fujisaki-Okamoto transformation and its application on FrodoKEM. In 
CRYPTO 2020.

Based on 
155c24c3df
2020-06-19 13:15:13 -04:00
Thom Wiggers
f7c7af5155
Merge pull request #297 from PQClean/fix-kyber-meta
Kyber768 and Kyber1024 don't need -maes (see #296)
2020-06-02 09:41:14 +02:00
Ko-
25b15e5791 Fix whitespace to satisfy test_duplicate_consistency 2020-05-29 18:54:15 +02:00
Ko-
bca4250d1f Update KAT values 2020-05-29 18:50:37 +02:00
Ko-
4883f2ce89 Add domain separation to NewHope
NewHope announced a new version of their specification that adds
explicit domain separation. This is a port of
https://github.com/newhopecrypto/newhope/commit/607a9d3
2020-05-29 16:41:41 +02:00
Thom Wiggers
75416c93f0
Kyber768 and Kyber1024 don't need -maes (see #296) 2020-05-29 10:01:44 +02:00
Thom Wiggers
db0d5800c5
Merge pull request #279 from PQClean/ds-aes-keyexp
Split aes*_keyexp up into ecb and ctr variants
2020-04-03 10:00:50 +02:00
Sebastian
33232a0343
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>
2020-04-01 13:57:21 +08:00
mergify[bot]
da46a96aca
Merge branch 'master' into fix_ub 2020-03-27 23:13:26 +00:00
Douglas Stebila
ce4bd09860 Use the right AES CTX 2020-03-26 21:11:07 -04:00
Douglas Stebila
585a001fda Split aes*_keyexp up into ecb and ctr variants 2020-03-26 20:18:02 -04:00
Thom Wiggers
35e4b0faa1
fixup! Fix uint8_t to uint16_t upcast in Frodo 2020-03-13 16:30:01 -04:00
Thom Wiggers
5436ec0476
Fix uint8_t to uint16_t upcast in Frodo 2020-03-13 15:58:15 -04:00
Thom Wiggers
85de23bdfe
Fix too-large shift in mceliece*f 2020-03-13 13:27:02 -04:00
Thom Wiggers
ef38541c6e
Clean up SABER 2020-03-13 13:00:57 -04:00
Thom Wiggers
bc86182b93
Fix overflowing mults in NTRUHRSS701 2020-03-09 18:02:44 -04:00
Thom Wiggers
39fa1ccfc7
Fix reduce.c's overflowing multiplication 2020-03-09 17:57:43 -04:00
Matthias J. Kannwischer
85c6605bbf
fix MSVS warning 2020-03-09 15:45:20 -04:00
Matthias J. Kannwischer
de5cda4d7b
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.
2020-03-09 15:45:19 -04:00
Thom Wiggers
8c2f5994b9
Fix duplicate consistency 2020-03-03 10:15:57 -05:00
Thom Wiggers
fe4e12308b
Fix memory leaks in LEDAkem 2020-03-03 10:15:56 -05:00
Thom Wiggers
81caa58b57
Fix memory leaks in NewHope 2020-03-03 10:15:56 -05:00
Douglas Stebila
b4de294f68 Fix memory leak in Kyber 2020-02-16 14:55:19 -05:00
Thom Wiggers
65a6a63e08
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
2020-02-11 11:15:14 +01:00
Thom Wiggers
7862f7faae
Fix McEliece8192128f makefile 2020-02-11 09:17:55 +01:00
Thom Wiggers
53d50fd751
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
2020-02-07 11:13:59 +01:00
Thom Wiggers
b3f9d4f8d6
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
2020-02-05 13:09:56 +01:00
Leon Botros
f9d192036e
Add ephemeral versions of ThreeBears 2020-01-15 10:43:50 +01:00
Thom Wiggers
e762163478
Don't advertise MacOS support for Kyber-AVX2
In light of #251
2019-11-13 13:27:26 +01:00