3 ms·
It looks like its inclusion is guarded by a compiler flag: https://github.com/openssl/openssl/blob/b93f6c2db94f736b497ff31a793c1e6766eaf209/crypto/sm2/sm2_err.c
by some_furry 5y ago
It looks like its inclusion is guarded by a compiler flag: https://github.com/openssl/openssl/blob/b93f6c2db94f736b497ff31a793c1e6766eaf209/crypto/sm2/sm2_err.c#L14 https://github.com/openssl/openssl/blob/b93f6c2db94f736b497f...
If anyone needs to know if SM2 is enabled quickly on any system, `openssl list --public-key-methods` is guaranteed to include "sm2" in the output if it's compiled. Therefore, if this returns 1, you have SM2 compiled in:
openssl list --public-key-methods | grep sm2 | wc -l
(There's probably better commands, but that'll get the job done. Compiled doesn't mean "enabled by TLS", of course.)
That said, assuming I'm reading the right docs, SM2 is interesting:
https://crypto.stackexchange.com/a/67481/87778 https://crypto.stackexchange.com/a/67481/87778
https://en.wikipedia.org/wiki/SM9_(cryptography_standard)#Chinese_Cryptographic_Standards https://en.wikipedia.org/wiki/SM9_(cryptography_standard)#Ch...
It prefixes the hash of the message with the public key, presumably to ensure exclusive ownership. https://www.bolet.org/~pornin/2005-acns-pornin+stern.pdf https://www.bolet.org/~pornin/2005-acns-pornin+stern.pdf
Additionally, SM2 signature verification requires no modular inversion.
This is neat stuff. I've never really bothered to look deeply at Chinese cryptography before.
- loeg 5y agoProbably you meant "grep sm2"?