* Add script to format code in a CI container
* Update CONTRIBUTING.md to document script
---------
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
make server astyle happy
update xmss.yml
update algorithm list and README
clean up
[trigger downstream]
Signed-off-by: Duc Tri Nguyen <dnguye69@gmu.edu>
Add support for LMS and XMSS. Key generation and signing are disabled behind a feature flag labelled "hazardous experimental."
---------
Signed-off-by: Duc Tri Nguyen <dnguye69@gmu.edu>
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Signed-off-by: Norman Ashley <nashley@cisco.com>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Duc Tri Nguyen <dnguye69@gmu.edu>
Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Duc Nguyen <106774416+ducnguyen-sb@users.noreply.github.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Co-authored-by: Duc Nguyen <ductri.nguyen@sandboxquantum.com>
Co-authored-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
Co-authored-by: Jason Goertzen <133878263+jgoertzen-sb@users.noreply.github.com>
The kat_kem and kat_sig programs could not be linked when building natively on windows. This was caused by multiple definitions of symbols. By using the /FORCE:MULTIPLE compiler option, this is allowed, similar in spirit to what was already used for cross-compiling to Windows.
Fixes#1749
Signed-off-by: Mattias Lindblad <matlin@gmail.com>
* sha2: Use EVP_MD_CTX_free instead of EVP_MD_CTX_destroy
According to the manual page, EVP_MD_CTX_destroy has been renamed to
EVP_MD_CTX_free in OpenSSL 1.1.0 and only provided as a compatibility
macro in later OpenSSL releases:
https://www.openssl.org/docs/man1.1.1/man3/EVP_MD_CTX_free.html
Signed-off-by: Daiki Ueno <dueno@redhat.com>
* ossl_helpers: Use pthread_once instead of CRYPTO_THREAD_run_once
Throughout the code base, liboqs uses pthread_once for one-shot
initialization and falls back to thread-unsafe code if it is not
supported nor enabled on the system. For consistency and to remove
additional dependency on OpenSSL, this switches the use of
CRYPTO_THREAD_run_once with that.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Make common algorithms pluggable
This allows applications to replace the implementation of common
cryptographic algorithms at runtime, by setting callback functions for
each operations with OQS_AES_set_callbacks, OQS_SHA2_set_callbacks,
OQS_SHA3_set_callbacks, and OQS_SHA3_x4_callbacks. Those functions
may be called once before OQS_init; otherwise the default
implementation will be used.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Add option to dynamically load libcrypto.so.*
This adds OQS_DLOPEN_OPENSSL build option to use OpenSSL through
dynamically loaded libcrypto.so.* with dlopen, instead of linking to
the library at build time.
That way the applications could use their favorite implementation of
common cryptographic primitives without pulling in the OpenSSL as a
hard dependency.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Add tests for OQS_*_set_callbacks
This adds tests that exercise OQS_*_set_callbacks by overriding one of
the function of each and ensuring the wrapper function is called.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
---------
Signed-off-by: Daiki Ueno <dueno@redhat.com>
* Ensure aliases are activated with cmake
* Updates alg_support fragments: ensure that dependencies (aliases and platform-specific code) are activated after applying filter_algs
* Adds bike_l5 to NIST_R4 algorithms
* add CI test for aliases
* remove ml_kem ipds from STD filter_algs
* decouple name and alias
* fixing vector tests
Pulls ML-DSA-ipd and ML-KEM-ipd
Adds test cases with NIST supplied test vectors for ML-DSA/ML-KEM
Adds aliases (ML-<name> are aliases of ML-<name>-ipd)
[trigger downstream]
Run full KAT tests weekly. All should pass except Falcon-1024, which is pending upstream changes.
---------
Co-authored-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com>
* Separate public and internal headers
* Add necessary #include statements in FrodoKem code
* Build oqs-internal library
* Link test programs with oqs-internal
* Update header file documentation
* Refactor test Makefile
* Move rand_nist to internal API only
* Delete nistseedexpander shim
* Remove internal headers from Doxyfile
* Switch to new PQClean commit for SPHINCS+ and remove old patch file
* Improve "compilability" on Apple M1 (ARM) (#1421)
* correct ARM SHA3 extension addition
* correct compile option for ARM SHA
* correct SHA3 enablement
* Remove SPHINCS+ robust and Haraka variants
* Fix SHA2 block sizes in OpenSSL wrapper
* enable Keccak for Sphincs even if OpenSSL shall provide SHA3
* properly handle xkcp enablement if only specific algorithms are selected
* correct conditional setting
* re-enable XKCP for other platforms
* Windows support
* alternate pqcrystals-AES removal
---------
Co-authored-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com>
* disable OpenSSL if neither AES, SHA2, or SHA3 are OSSL-provided
* Fixes faulty OpenSSL incremental SHA2 API integration
* guard OpenSSL3 initialization
* initialize all OSSL3 statics if OQS_USE_OPENSSL=ON
* 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>