47 Commits

Author SHA1 Message Date
Douglas Stebila
bb60b41f56
Fix typo in test_kem (#2281)
Fixes #2280

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
2025-09-23 08:40:55 -04:00
Bruce
1ae1b92302
initialize length_encaps_seed for NTRU implementations (#2266)
* initialize length_encaps_seed for NTRU implementations

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* Only allocate for keypair seed and encaps seed when derandomized

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* format test_kem.c according to astyle

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

* only call memcmp on keypair_seed and encaps_seed if derand

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>

---------

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>
2025-09-15 15:53:48 -04:00
Rodrigo Martín
c62031ee75
Include DeriveEncapsulation functionality (Issue #2135) (#2221)
* Include 'encaps_derand' functionality

Signed-off-by: RodriM11 <62776780+RodriM11@users.noreply.github.com>

* Add changes pertaining to upstream copy

Signed-off-by: RodriM11 <62776780+RodriM11@users.noreply.github.com>

* Add co-author

Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Signed-off-by: RodriM11 <62776780+RodriM11@users.noreply.github.com>

* Fix formatting

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

* Modify 'vectors_kem.c' to employ '_derand' API

Signed-off-by: Rodrigo Martin Sánchez-Ledesma <rmsanchezledesma@indra.es>

---------

Signed-off-by: RodriM11 <62776780+RodriM11@users.noreply.github.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Signed-off-by: Rodrigo Martin Sánchez-Ledesma <rmsanchezledesma@indra.es>
Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Rodrigo Martin Sánchez-Ledesma <rmsanchezledesma@indra.es>
2025-08-27 10:05:41 -04:00
Sadiq Hussain M
a47d8926c9
tests: Check OQS_STATUS of RNG and fstore functions (#2153) 2025-06-06 13:26:31 -04:00
Sadiq Hussain M
894547b15c
Check for NULL dereference before using secure free (#2151)
* Check for NULL dereference before using secure free

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>

* Skip failing CI test (#2157)

* Skip failing CI test

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

* Fix typo

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
2025-06-04 16:18:45 -04:00
Sadiq Hussain M
65ed00c2f1
Use OQS_MEM_cleanse() instead of memset() (#2158)
* Use OQS_MEM_cleanse() instead of memset()

This is needed for secret objects as memset
maybe optimized out by the compiler.

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>

* Skip failing CI test (#2157)

* Skip failing CI test

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

* Fix typo

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

---------

Signed-off-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Hussain1811 <Sadiq.Hussain.M@ibm.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
2025-06-04 16:18:36 -04:00
Spencer Wilson
3ca1a36909
Add DeriveKeyPair API (#2070)
* Initial derive keypair commit

Signed-off-by: Eddy Kim <Eddy.M.Kim@outlook.com>
Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Add pqcrystals-ml_kem_ipd.patch

Signed-off-by: Eddy Kim <Eddy.M.Kim@outlook.com>
Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Fix encaps key in scheme and revert whitespace changes

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Hopefully corrected patch file

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Corrected missing derand in kem_scheme

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Fix indentation

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Run copy_from_upstream

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

derand testing tentative changes

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Add missing function declarations

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Add template for avx2 derand functions

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Run copy_from_upstream

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

WIP: Add changes for coin length

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>

Update patch to include coin lengths

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Bootstrap

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Conditional copy

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Run copy_from_upstream

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Separate coins variable into two distinct variables

Signed-off-by: Eddy Kim <Eddy.M.Kim@outlook.com>
Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Add derand fixes

- Add support for BIKE, FrodoKEM, sntrup
- Add hooks for testing
- Add missing kem comment to documentation
- Don't run decaps() in test_kem_derand if encaps_derand() fails
- Add markdown documentation changes

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

WIP trying to fix build errors

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Fix remaining build issues

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Resolve unused parameter issues for BIKE

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Resolve unused paramter issues for FrodoKEM

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Fix whitespace inconsistency

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Fix whitepace issue

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Insert unused attributes

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Void all unused parameters

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Use tab instead of spaces in kem_scheme

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Run copy_from_upstream

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Fix kem_derand python tests

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

Initialize coins in test_kem_derand

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Update patch to work with mlkem-native

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Update docs generation and templating

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Run copy_from_upstream [full tests] [extended tests]

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Don't call randombytes on zero-length arrays

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Run format script

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Remove encaps_derand support

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Run copy_from_upstream

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Skip encaps/decaps in test_kem_derand

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Refactor test code

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* s/coins/seed/g

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Improve output

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

* Improve formatting [full tests] [extended tests]

Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>

---------

Signed-off-by: Eddy Kim <e84kim@uwaterloo.ca>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Co-authored-by: Eddy Kim <Eddy.M.Kim@outlook.com>
2025-03-18 14:40:07 -04:00
Marco Gianvecchio
8ee6039c74
Add bitflip test for trivial SUF-CMA forgeries (#2090)
* add bitflip test to test_sig.c
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* format code
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* - add sig->suf_cma
- add command-line argument to test_sig.c (the number of bitflips)
- update CROSS upstream to SUF-CMA
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* %d to %ld for size_t bitflips

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* cast argument bitflips to size_t
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* replace atoi() with strtol()
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* cast bit_index to %llu

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* update bitflip tests:
- revert CROSS to EUF-CMA
- add test_bitflip_message
- exclude stateful signatures for now
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* remove bitflips_as_str in printf
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* test_bitflip as a single function, add support for stateful signatures
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* add OQS_TEST_CT_DECLASSIFY after test_bitflip_stfl
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* [extended tests]
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* more OQS_TEST_CT_DECLASSIFY [extended tests]
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* patch dilithium to add suf-cma
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* run copy_from_upstream.py
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* SUF-CMA in dilithium docs, run copy_from_upstream.py
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* correct sizeof in OQS_randombytes call (thank you @SWilson4!)
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* factor bitflip testing functions out into test_helpers.c
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* --allow-multiple-definition for Windows .dll in test_kem_mem
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

* --allow-multiple-definition for Windows .dll in test_sig and test_sig_stfl
Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>

---------

Signed-off-by: rtjk <47841774+rtjk@users.noreply.github.com>
2025-03-14 11:53:05 -04:00
Pablo Gutiérrez
c2a6559c22
Added alg_version details to test output (#2080)
* Added alg_version details as test output

Signed-off-by: Pablo Gutiérrez <pablogf@uma.es>
2025-02-25 17:21:11 +01:00
Abhinav Saxena
507d03009c
Test Improvements for ML-KEM (#1947)
* test improvements for ML-KEM

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* update length type from int to size_t

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* fix windows dll + compilation issues

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* fix windows tests for ACVP vectors

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* fix build failure in vector_kem

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* remove const qualifier from prng_op_stream

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* add macros instead of hardcoding & declasify values before use

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* add ML-KEM rejection tests in seperate function

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* add ciphertext corruption test for kem rejection

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

* add conditional compilation for ML-KEM tests

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>

---------

Signed-off-by: Abhinav Saxena <abhinav.saxena@thalesgroup.com>
2024-11-13 13:30:57 +01:00
Norman Ashley
3c8bde1b08
Add new API to cleanup OpenSSL threads. (#1959)
* Add new API to clean up OpenSSL threads.

Signed-off-by: Norman Ashley <nashley@cisco.com>

* Updates per review comments.

Signed-off-by: Norman Ashley <nashley@cisco.com>

* Update format

Signed-off-by: Norman Ashley <nashley@cisco.com>

* Apply suggestions from code review

Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Signed-off-by: Norman Ashley <nashley@cisco.com>

---------

Signed-off-by: Norman Ashley <nashley@cisco.com>
Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
2024-10-30 12:20:05 -04:00
songlingatpan
1d92135e80
[#1823] replace malloc/calloc/strdup/free with openssl allocator (#1926)
* [#1823] replace malloc/calloc/strdup/free with openssl allocator

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* [#1823] update memory allocator for copy_from_upstream

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* [#1823] Use OpenSSL Memory Allocator for BIKE, FrodoKEM, and NTRUPrime

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* [#1823] Add Comments for Doxygen

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* include openssl/crypto.h and resolve conflict varible for ntru

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add openssl version check to fix build error

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Fix build for OQS_DLOPEN_OPENSSL

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* remove OQS_MEM_free

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add allocator check in tests/test_code_conventions.py

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add IGNORE memory-check

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Delect checked allocation functions

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Revert back p_param to p for sntrup

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add allocator check for '.c', '.h', '.fragment'

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add NULL for previous checked allocation

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* Add fprintf error for abort cases

Signed-off-by: Songling Han <shan@paloaltonetworks.com>

* use OQS_EXIT_IF_NULLPTR for checked malloc cases

Signed-off-by: Songling Han <shan@paloaltonetworks.com>


---------

Signed-off-by: Songling Han <shan@paloaltonetworks.com>
2024-10-19 07:21:51 +02:00
Jolene Tan
688bdb431f
find_package(Threads) regardless of BUILD_ONLY_LIB (#1653)
* find_package(Threads) regardless of BUILD_ONLY_LIB

* New macro OQS_USE_PTHREADS conditioned on embedded
2024-01-31 09:17:56 +01:00
Jolene Tan
b7f35d76c5
Use CMAKE_USE_PTHREADS_INIT (#1576) 2023-10-18 14:17:53 -04:00
Dmitry Belyavskiy
871f9e26d1
Initial fetching of MD and Cipher objects from OpenSSL(3) (#1431)
* Strawman version of one-time fetching MD objects from OpenSSL

We need init them and free them in one place to avoid threading
issues.

* Moving initialization of OpenSSL objects to a separate file

* Call OQS_init to ensure OpenSSL methods are cached

* Fix typo

* Use prefetch OpenSSL cipher object in rand_nist

---------

Co-authored-by: Douglas Stebila <beldmit@users.noreply.github.com>
Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
2023-04-25 12:19:42 -04:00
Michael Baentsch
1f62f66a47
correct free in test_kem/sig (#1399)
* correct free in test_kem/sig

* code simplification
2023-02-23 17:24:40 +01:00
Michael Baentsch
91bfca9bdd
Add library version retrieval function (#1273) 2022-08-03 13:32:11 -04:00
John Schanck
83af71078b
Add canaries around malloc'd regions in test_sig (#993)
* test_sig: Add canaries around malloc'd regions

* test_sig/kem: disable canary checks in test_constant_time

* test_kem: test canaries after testing malformed ciphertext
2021-05-06 19:50:53 -04:00
Thom Wiggers
1923b82a3b
Test without alignment (#986)
* Fix potential NULL dereference in fix_test_kem

* Test without aligned pk, sk

This changes the test_kem.c functions like those in PQClean:
* also prefix magic bytes for checking for out-of-bounds access
* use odd numbers for breaking alignment

Includes #985

* Fix style
2021-05-04 20:27:07 -04:00
John Schanck
fa9c2671ec
Use valgrind to check for secret-dependent branching on 'audit' branches (#904)
* Constant time checks using Valgrind and suppression files

* Suppression file for Kyber (ref+avx), HQC, SIKE, NTRUPrime, McEliece, SIDH, Falcon (ref+avx), SPHINCS, Dilithium r2+r3, picnic

* mark all BIKE implementations as vartime

* Set OQS_DEBUG_BUILD in oqsconfig.h if CMAKE_BUILD_TYPE=Debug

* Add OQS_ENABLE_TEST_CONSTANT_TIME to oqsconfig.h

* Check build options before running

* test_{kem,sig}: avoid direct call to OQS_randombytes_system

* Remove picnic3 issue based on review #889

* fix Kyber namespacing

* Missing BIKE error type, skip BIKE

* Resolve SIDH/SIKE bingcd issue as per #888

* Mark Falcon hash_to_point_vartime issue as resolved

* Disable CI tests
2021-02-25 06:51:01 +01:00
Douglas Stebila
adac989932
Added HQC from PQClean. (#805) 2020-08-04 13:22:45 -04:00
Douglas Stebila
ed1baf3d27 Change to 0.4.0-dev and some cleanup 2020-07-24 20:38:46 -04:00
Christian Paquin
a34fd7062f formatted 2020-07-13 12:03:17 -04:00
Christian Paquin
0cba778097 Added invalid ciphertext test in test_kem, and replaced invalid signature with random array vs modified first byte (code from PR787). 2020-07-13 11:57:36 -04:00
Douglas Stebila
6e0b0d79a9
Add SPDX-License-Identifier headers (#749)
* Add SPDX-License-Identifier in src/common

* Add SPDX-License-Identifier in FrodoKEM

* Add SPDX-License-Identifier in SIKE

* Add SPDX-License-Identifier in BIKE

* Add SPDX-License-Identifier in OQS headers

* Add SPDX-License-Identifier in files generated during copy-from-pqclean

* Add SPDX-License-Identifier in Picnic

* Add SPDX-License-Identifier in qTesla

* Add SPDX-License-Identifier in CMake files

* Update license info in README

* Add SPDX-License-Identifier in scripts

* Add SPDX-License-Info to CMakeLists

* Add SPDX-License-Info in tests

* Add SPDX-License-Info to various files

* Prettyprint

* Add test for SPDX-License-Identifier headers

* Updated license identifiers for CPU extension detection code.

* Use conjunction for SPDX in file with two licenses

Co-authored-by: xvzcf <xvzcf@users.noreply.github.com>
2020-05-12 11:45:37 -04:00
Michael Baentsch
c847efab8f addresses issue #691 2020-04-06 14:51:54 +02:00
Michael Baentsch
768c4aefea formatting corrected 2020-03-30 17:15:44 +02:00
Michael Baentsch
5d690b8746 CPU feature runtime flags support via OQS 2020-03-30 16:28:04 +02:00
Douglas Stebila
1ff2323752 Properly pass data to/from threads 2020-03-26 20:08:56 -04:00
Vlad Gheorghiu
532d0cb36b minor cosmetic change 2020-03-26 11:48:02 -04:00
Vlad Gheorghiu
306d5f9747 put no-thread kems/sigs in array 2020-03-26 10:21:37 -04:00
Douglas Stebila
efdbed4d67 Use strstr instead of strnstr 2020-03-26 09:44:17 -04:00
Douglas Stebila
f437663bd0 Run big stack usage tests on main thread 2020-03-25 17:23:31 -04:00
Douglas Stebila
2a2393d097 Fix compilation warnings under gcc 2020-03-19 15:23:20 -04:00
Douglas Stebila
4cc03987b1 Run the test_kem and test_sig tests on a thread when possible 2020-03-19 14:57:18 -04:00
xvzcf
7c083329f3
Enabled more Clang warning flags. (#663) 2020-03-16 15:33:14 -04:00
Douglas Stebila
ca66375f30
Switch from clang-format to astyle (#613)
* Initial format with astyle

* Fix templating to match

* Fix files with missing newline at EOF

* Remove old line

* Remove old .clang-format spec

* Add prettyprint target to CMake
2020-02-15 23:34:31 -05:00
Douglas Stebila
54cc101a3d Skip disabled algorithms 2019-08-12 09:30:51 -04:00
Douglas Stebila
8a0af5bc12 Prettyprint 2019-08-03 07:31:01 -04:00
Douglas Stebila
4d492b9270 Add macros containing compilation information and print in test programs
Fixes #331
2019-08-02 22:03:13 -04:00
Douglas Stebila
3ab9044f51 Prettyprint 2019-08-01 14:32:20 -04:00
Douglas Stebila
91614924b6 Make test_kem and test_sig run one algorithm at a time 2019-08-01 13:36:41 -04:00
Douglas Stebila
85b1cbb5ec
Sync master with nist-branch, including sorting algorithms (#418)
* Sync master with nist-branch, including sorting algorithms

* Forgot to declare function before use
2018-10-14 15:31:22 -04:00
Douglas Stebila
84e8dcb119
Remove old OQS_RAND object and API (#403)
* Remove old RAND API, AES-CTR and ChaCha20-based RNGs, and test_rand.

* Fix build and API for shared libraries

* Fix problems from merge with master
2018-10-09 20:36:57 -04:00
Douglas Stebila
79d77d3617 Sync common signature files on master with nist-branch 2018-10-03 11:56:54 -04:00
Christian Paquin
dc9617f81f Refactored sig api following nist-branch (issue380) (#391)
* Fixed a typo in a comment

* Refactored sig API following nist-branch (also fixes issue 380)

* Fixed Windows compilation error in sig.c.

* Added Picnic to Windows' config, and changed defaul alg to Picnic (since qTesla is not yet supported on Windows)

* Moved sig_picnic and sig_qtesla under sig directory, to harmonize with kem api

* Use different default sig alg on Windows to fix Travis back-compat tests and platform gap.

* Further changes required for OQS to be properly used by applications

* Compare OQS functions's return values to OQS error codes in sig.c.

* Fixed typos in comments.

* Replaced minimal_oqs_sig with example_sig.

* Ensure travis tests fail on error

* Add try-catch block in all-tests.sh

* Ignore example_sig

* Point global-namespace-check to .libs/liboqs.a

* More precise error handling in global-namespace-check

* Warning colours in travis tests and error handling in free-check

* Error handling in style-check

* Clean up style-check

* Removed leftover minimal_sig_oqs ref and VS projects.

* Prettyprint

* Revert clang-format version check

* Re-revert clang-format style check

* Prettyprint

* Added speed_sig to master.

* Removed superfluous extern from sig schemes .h
2018-09-26 10:01:53 -04:00
Douglas Stebila
453516248b
Move tests to a common directory (#335) 2018-08-14 17:00:29 -04:00