feat: add sm2 encrypted test case from GM/T0003.5-2012.#16511
feat: add sm2 encrypted test case from GM/T0003.5-2012.#16511ymj-uos wants to merge 2 commits intoopenssl:masterfrom ymj-uos:master
Conversation
|
this PR is the same to this one! |
|
@ymj-uos you have 2 commits in this PR and one of them is a Merge commit, which we do not allow. |
|
Also, as background, I did look previously into backporting this KAT to OpenSSL, but preferred not to, for 2 reasons:
|
|
I thought a long time, the two reason which you mentioned seem to be misunderstood. about C1 (PC ∥ x1 ∥ y1), this is a data-format problem. In the GM/T0003.1-2012 (at section 4.1 and 4.2/page 6), |
|
about your 2nd reason: SM2Cipher ::= SEQENCE{ at the serialize/unserialize SM2 ciphertexts, section 6.1 (page 4-5) Encryption algorithm its process compared to the original version as below: |
|
finally, In the GM/T 0009-2012 only asn.1 data format (C1,C2,C3) is defined. not say that the SM2 cipher must use asn.1 data format. |
|
GMT 0003.4-2012 SM2椭圆曲线公钥密码算法第4部分:公钥加密算法.pdf This is the original version standard. If you want to check some detail,you can use it. |
|
Thanks for your comments @ymj-uos , but even considering that the problem might be related to the English version of the standard (which is a problem, because that is the one we can use for our reviews), I still have some doubts:
|
|
@ymj-uos I apologize, I finally managed to understand why I was seeing discrepancies, I will update my review shortly |
romen
left a comment
There was a problem hiding this comment.
Thanks for your patience @ymj-uos .
Here is my updated review, I'd like to apply some changes to make this test readable for future readers, especially considering that the expected answer technically differs from the one published in the document from which this tests originates.
|
Note for whoever will merge this, remember to squash the commits! |
@paulidale I plan to take care of merging this tomorrow morning (European timezones) once the 24h grace period is over. |
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
Reviewed-by: Nicola Tuveri <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from #16511)
Reviewed-by: Nicola Tuveri <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from #16511) (cherry picked from commit 8ba65c3)
|
@paulidale This could be cherry-picked cleanly to 1.1.1, and I would propose to do so. |
|
(removed the ready to merge label, so we can restart the 24h grace period for 1.1.1 if @paulidale agrees) |
|
This pull request is ready to merge |
Reviewed-by: Nicola Tuveri <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from #16511) (cherry picked from commit 8ba65c3)




Checklist