diff options
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/pk_algs.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp index 34d659c8f..ab10f0ab9 100644 --- a/src/lib/pubkey/pk_algs.cpp +++ b/src/lib/pubkey/pk_algs.cpp @@ -62,6 +62,7 @@ #if defined(BOTAN_HAS_SM2) #include <botan/sm2.h> + #include <botan/sm2_enc.h> #endif #if defined(BOTAN_HAS_OPENSSL) @@ -141,6 +142,8 @@ load_public_key(const AlgorithmIdentifier& alg_id, #if defined(BOTAN_HAS_SM2) if(alg_name == "SM2_Sig") return std::unique_ptr<Public_Key>(new SM2_Signature_PublicKey(alg_id, key_bits)); + if(alg_name == "SM2_Enc") + return std::unique_ptr<Public_Key>(new SM2_Encryption_PublicKey(alg_id, key_bits)); #endif #if defined(BOTAN_HAS_XMSS) @@ -217,6 +220,8 @@ load_private_key(const AlgorithmIdentifier& alg_id, #if defined(BOTAN_HAS_SM2) if(alg_name == "SM2_Sig") return std::unique_ptr<Private_Key>(new SM2_Signature_PrivateKey(alg_id, key_bits)); + if(alg_name == "SM2_Enc") + return std::unique_ptr<Private_Key>(new SM2_Encryption_PrivateKey(alg_id, key_bits)); #endif #if defined(BOTAN_HAS_ELGAMAL) @@ -305,6 +310,7 @@ create_private_key(const std::string& alg_name, alg_name == "ECKCDSA" || alg_name == "ECGDSA" || alg_name == "SM2_Sig" || + alg_name == "SM2_Enc" || alg_name == "GOST-34.10") { const EC_Group ec_group(params.empty() ? "secp256r1" : params); @@ -332,6 +338,8 @@ create_private_key(const std::string& alg_name, #if defined(BOTAN_HAS_SM2) if(alg_name == "SM2_Sig") return std::unique_ptr<Private_Key>(new SM2_Signature_PrivateKey(rng, ec_group)); + if(alg_name == "SM2_Enc") + return std::unique_ptr<Private_Key>(new SM2_Encryption_PrivateKey(rng, ec_group)); #endif #if defined(BOTAN_HAS_ECGDSA) |