* 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>
* 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>
* 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>
* 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>
* 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>
* [#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>
* 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>
* 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
* 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
* 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
* 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>
* 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
* 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