16 Commits

Author SHA1 Message Date
Sadiq Hussain M
a47d8926c9
tests: Check OQS_STATUS of RNG and fstore functions (#2153) 2025-06-06 13:26:31 -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
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
20fadb89ef
Add full-cycle speed test (#1391)
* adding true repetitive full-cycle testing

* fix mem leak in speed testing
2023-02-17 10:06:51 +01:00
Michael Baentsch
e9cd9a5c55
automatically activate USE_RASPBERRY_PI define (#1313)
* automatically activate USE_RASPERRY_PI define

* prefix RASPBERRY_PI define with OQS_
2022-11-18 08:12:19 +01:00
Basil Hess
719a84ecdd
Integrates pqcrystals with common-aes / extends common code AES CTR-API (#1221)
* Integrates pqcrystals (ref and avx2) with liboqs common AES code (for Kyber-90s and Dilithium-AES).
* Extends libOQS AES-CTR with Incremental API: OQS_AES256_CTR_inc_init, OQS_AES256_CTR_inc_iv, OQS_AES256_CTR_inc_ivu64, OQS_AES256_CTR_inc_stream_iv, OQS_AES256_CTR_inc_stream_blks.
* Adds some AES-CTR shim API.
* Faster AESNI CTR code (improved iv handling, 4x interleaved blocks for higher throughput).
* OpenSSL AES supporting CTR API.
* Updated pqcrystals patches (API, context releases).
* Removes redundant AES implementations from Kyber and Dilithium.
* Copy-from-upstream with updated patches.
* Uses internal AES on x86_64 (dist & AES) because of increased performance with the internal AESNI code.
* Adds AES-CTR benchmarks to speed_common
* Update CONFIGURE.md
2022-06-23 14:44:36 +02:00
Douglas Stebila
c97706c6b3
Option to use PMU for benchmarking on ARM (#1147)
* Add CMake option and compiler flag for using ARM PMU in speed

* Enabling use of ARM PMU for benchmarking when compiler flag is enabled (#1141)

* Enabling use of ARM PMU for benchmarking when compiler flag is enabled

* Adding documentation in code on how to enable PMU

Co-authored-by: Ted Eaton <ted@eeaton.ca>
2021-12-08 12:28:14 -05: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
xvzcf
7c083329f3
Enabled more Clang warning flags. (#663) 2020-03-16 15:33:14 -04:00
Douglas Stebila
d4cd8d44a1
Don't use cycle count register on Raspberry Pi (#583)
* Don't use cycle count register on Raspberry Pi

* Prettyprint
2020-01-27 19:50:23 -05:00
xvzcf
4e6b694507 Issue 557: Miscellaneous fixes (#562)
* Added -Wstrict-prototypes flag and fixed resulting errors.

* Removed double underscores from header guards.

* Changed EVP_MD_CTX_create to EVP_MD_CTX_new and EVP_MD_CTX_destroy to EVP_MD_CTX_free.

* Fixed comments.

* Changed Kyber function signatures.

* Revert "Changed EVP_MD_CTX_create to EVP_MD_CTX_new and EVP_MD_CTX_destroy to EVP_MD_CTX_free."

This reverts commit f09b5e49d73b16b56d332fbcfc3b671966032fd4.
2019-10-23 22:01:37 -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
453516248b
Move tests to a common directory (#335) 2018-08-14 17:00:29 -04:00