diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index da29dd70..ce2bb1d8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,7 +2,7 @@ - + #### Manually checked properties diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9595c44..8bd87d1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,9 +26,8 @@ See the section [API](#API) below. type: claimed-nist-level: length-public-key: # KEM and signature - length-secret-key: # KEM and signature length-ciphertext: # KEM only - length-shared-secret: # KEM only + length-shared-secret: # KEM only length-signature: # Signature only testvectors-sha256: sha256sum of output of testvectors principal-submitter: Eve @@ -38,6 +37,7 @@ See the section [API](#API) below. - ... implementations: - name: clean + length-secret-key: # KEM and signature version: ``` diff --git a/crypto_kem/ntruhps2048509/clean/api.h b/crypto_kem/ntruhps2048509/clean/api.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/crypto_sort.c b/crypto_kem/ntruhps2048509/clean/crypto_sort.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/crypto_sort.h b/crypto_kem/ntruhps2048509/clean/crypto_sort.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/kem.c b/crypto_kem/ntruhps2048509/clean/kem.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/owcpa.c b/crypto_kem/ntruhps2048509/clean/owcpa.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/owcpa.h b/crypto_kem/ntruhps2048509/clean/owcpa.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/pack3.c b/crypto_kem/ntruhps2048509/clean/pack3.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/packq.c b/crypto_kem/ntruhps2048509/clean/packq.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/params.h b/crypto_kem/ntruhps2048509/clean/params.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/poly.c b/crypto_kem/ntruhps2048509/clean/poly.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/poly.h b/crypto_kem/ntruhps2048509/clean/poly.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/sample.c b/crypto_kem/ntruhps2048509/clean/sample.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/sample.h b/crypto_kem/ntruhps2048509/clean/sample.h old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/verify.c b/crypto_kem/ntruhps2048509/clean/verify.c old mode 100755 new mode 100644 diff --git a/crypto_kem/ntruhps2048509/clean/verify.h b/crypto_kem/ntruhps2048509/clean/verify.h old mode 100755 new mode 100644 diff --git a/crypto_sign/sphincs-shake256-128f-simple/clean/wots.c b/crypto_sign/sphincs-shake256-128f-simple/clean/wots.c index 4431986d..ac8b54d1 100644 --- a/crypto_sign/sphincs-shake256-128f-simple/clean/wots.c +++ b/crypto_sign/sphincs-shake256-128f-simple/clean/wots.c @@ -68,7 +68,7 @@ static void base_w(unsigned int *output, const size_t out_len, bits += 8; } bits -= SPX_WOTS_LOGW; - output[out] = (total >> bits) & (SPX_WOTS_W - 1); + output[out] = (unsigned int)((total >> bits) & (SPX_WOTS_W - 1)); out++; } } diff --git a/test/Makefile b/test/Makefile index daab4f01..a6fa459a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -73,3 +73,7 @@ clean: $(RM) $(DEST_DIR)/test_aes $(RM) $(DEST_DIR)/test_fips202 $(RM) $(DEST_DIR)/test_sha2 + +.PHONY: distclean +distclean: + $(RM) -r $(DEST_DIR) diff --git a/test/test_functest.py b/test/test_functest.py index d4517947..d7696881 100644 --- a/test/test_functest.py +++ b/test/test_functest.py @@ -14,14 +14,14 @@ import helpers def test_functest(): for scheme in pqclean.Scheme.all_schemes(): for implementation in scheme.implementations: - if helpers.permit_test('functest', implementation): + if helpers.permit_test('functest', implementation): yield check_functest, implementation def test_functest_sanitizers(): for scheme in pqclean.Scheme.all_schemes(): for implementation in scheme.implementations: - if helpers.permit_test('functest_sanitizers', implementation): + if helpers.permit_test('functest_sanitizers', implementation): yield check_functest_sanitizers, implementation @@ -41,39 +41,44 @@ def check_functest(implementation): ) -@helpers.skip_windows +@helpers.skip_windows() def check_functest_sanitizers(implementation): env = None if platform.machine() == 'ppc' and os.environ.get('CC', 'gcc') == 'clang': raise unittest.SkipTest("Clang does not support ASAN on ppc") elif platform.machine() in ['armv7l', 'aarch64']: env = {'ASAN_OPTIONS': 'detect_leaks=0'} + elif platform.system() == 'Darwin': + raise unittest.SkipTest('valgrind is not reliable on OSX') else: print("Supported platform: {}".format(platform.machine())) - helpers.ensure_available('valgrind') helpers.make('clean-scheme', 'functest', TYPE=implementation.scheme.type, SCHEME=implementation.scheme.name, IMPLEMENTATION=implementation.name, - EXTRAFLAGS='-fsanitize=address,undefined', + EXTRAFLAGS='-g -fsanitize=address,undefined', working_dir=os.path.join('..', 'test'), env=env) - helpers.run_subprocess( - [os.path.join('..', 'bin', 'functest_{}_{}{}'.format( - implementation.scheme.name, - implementation.name, - '.exe' if os.name == 'nt' else '' - ))], - os.path.join('..', 'bin'), - env=env, - ) - # Remove files with ASAN library compiled in - helpers.make('clean-scheme', - TYPE=implementation.scheme.type, - SCHEME=implementation.scheme.name, - IMPLEMENTATION=implementation.name, - working_dir=os.path.join('..', 'test')) + try: + helpers.run_subprocess( + [os.path.join('..', 'bin', 'functest_{}_{}{}'.format( + implementation.scheme.name, + implementation.name, + '.exe' if os.name == 'nt' else '' + ))], + os.path.join('..', 'bin'), + env=env, + ) + except AssertionError as e: + raise e + finally: + # Remove files with ASAN library compiled in + helpers.make('clean-scheme', + TYPE=implementation.scheme.type, + SCHEME=implementation.scheme.name, + IMPLEMENTATION=implementation.name, + working_dir=os.path.join('..', 'test')) if __name__ == '__main__':