Implement SM2 & ML-DSA-65 Hybrid Signature Algorithm - #756
Closed
HOCOOH wants to merge 620 commits into
Closed
Conversation
通过独立的provider提供商用密码算法和协议,后续用于申请商用密码产品认证。 SMTC provider包括软件完整性验证,身份认证,kats自测试,测试随机数、杂凑、 对称加密、签名等基础密码学算法,随机数自检,熵源健康测试; 增加mod app, 包括生成SMTC配置、自测试功能。 目前SMTC provider以builtin module方式实现。
The AES-SIV mode allows for multiple associated data items authenticated separately with any of these being 0 length. The provided implementation ignores such empty associated data which is incorrect in regards to the RFC 5297 and is also a security issue because such empty associated data then become unauthenticated if an application expects to authenticate them. Fixes CVE-2023-2975 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from openssl/openssl#21384)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from openssl/openssl#21384)
The DH_check() function checks numerous aspects of the key or parameters that have been supplied. Some of those checks use the supplied modulus value even if it is excessively large. There is already a maximum DH modulus size (10,000 bits) over which OpenSSL will not generate or derive keys. DH_check() will however still perform various tests for validity on such a large modulus. We introduce a new maximum (32,768) over which DH_check() will just fail. An application that calls DH_check() and supplies a key or parameters obtained from an untrusted source could be vulnerable to a Denial of Service attack. The function DH_check() is itself called by a number of other OpenSSL functions. An application calling any of those other functions may similarly be affected. The other functions affected by this are DH_check_ex() and EVP_PKEY_param_check(). CVE-2023-3446 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21451) (cherry picked from commit 9e0094e2aa1b3428a12d5095132f133c078d3c3d)
Confirm that the only errors DH_check() finds with DH parameters with an excessively long modulus is that the modulus is too large. We should not be performing time consuming checks using that modulus. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from openssl/openssl#21451)
If the public key type is EVP_PKEY_KEYMGMT, errors may occur in some cases. It is necessary to obtain the exact type of the public key from keymgmt. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
If |q| >= |p| then the q value is obviously wrong as q is supposed to be a prime divisor of p-1. We check if p is overly large so this added test implies that q is not large either when performing subsequent tests using that q value. Otherwise if it is too large these additional checks of the q value such as the primality test can then trigger DoS by doing overly long computations. Fixes CVE-2023-3817 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from openssl/openssl#21550)
This must fail with DH_CHECK_INVALID_Q_VALUE and with DH_CHECK_Q_NOT_PRIME unset. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from openssl/openssl#21550)
pkcs7: support sm2 public algorithm
Absolute symlink path will cause unexpected error in rpmbuild. use relative path can solve this issue. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
use relative path for tongsuo symlink
Implement the NIZKPoK algorithm and zkp_range_proof gadget.
增加商用密码检测和认证Provider
Move the EC_POINT_from_string to ec_lib.c to make it more generic.
[docs] Add English version of README
Add ML-DSA post-quantum cryptography algorithm
Update the certificate
…tensions This PR adds support for the subjectDirectoryAttributes and associatedInformation X.509v3 extensions. These extensions allow an X.509 public key certificate to include arbitrary directory attributes: the former associated with the subject, and the latter containing arbitrary information that does not necessarily describe the subject.
Remove unnecessary items
Use command 'make update' to refresh .num file
…o-3.0.4 Optimize the method mechanism. 1. Refactor the method store mechanism to remove unnecessary operations of clearing all operation_bits for all providers. 2. Improve the mapping of methods with new pre-checking functions which support "no_store" parameter, so as to bypass the checking of stores when the method should not exist in any store.
This PR supports parsing SubjectDirectoryAttributes and AssociatedInformation X.509v3 extensions, which fixes issue Tongsuo-Project#685.
HOCOOH
force-pushed
the
sm2_mldsa65_hybrid
branch
from
September 18, 2025 08:52
4d73867 to
4e86b97
Compare
Contributor
Author
|
rebase to master |
Collaborator
|
@HOCOOH Please rebase this PR to current master (8.5.0) or 8.4.1-dev. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements an experimental SM2 and ML-DSA-65 hybrid signature algorithm.
The hybrid signature scheme is based on the IETF draft. The OID for this algorithm is temporarily assigned to an unused field under the
CompSigdomain proposed in the draft, namely<CompSig>.21(2.16.840.1.114027.80.9.1.21). All other signature details follow the draft specification.For easier review, the implementation is split into multiple commits, each corresponding to a specific functional change.
The corresponding documentation can be found in PR.