aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-06-20 18:12:33 -0400
committerJack Lloyd <[email protected]>2018-06-20 18:12:33 -0400
commit9fe8f70e8f028b20788d79ccabf943818d6339f0 (patch)
tree735a07f105cde52508d116e6a5943dc7af6feed2 /src
parent7bb65c2d9e3abba2fda12c8d70b872e6cf4a6c3a (diff)
Fix SM2 encryption tests
Broken in 5f26125d
Diffstat (limited to 'src')
-rw-r--r--src/tests/test_sm2.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tests/test_sm2.cpp b/src/tests/test_sm2.cpp
index 333e198b7..0c5a62c46 100644
--- a/src/tests/test_sm2.cpp
+++ b/src/tests/test_sm2.cpp
@@ -19,6 +19,7 @@ namespace Botan_Tests {
namespace {
+template<typename T>
std::unique_ptr<Botan::Private_Key> load_sm2_private_key(const VarMap& vars)
{
// group params
@@ -34,7 +35,7 @@ std::unique_ptr<Botan::Private_Key> load_sm2_private_key(const VarMap& vars)
Botan::EC_Group domain(p, a, b, xG, yG, order, cofactor);
Botan::Null_RNG null_rng;
- return std::unique_ptr<Botan::Private_Key>(new Botan::SM2_Signature_PrivateKey(null_rng, domain, x));
+ return std::unique_ptr<Botan::Private_Key>(new T(null_rng, domain, x));
}
class SM2_Signature_KAT_Tests final : public PK_Signature_Generation_Test
@@ -59,7 +60,7 @@ class SM2_Signature_KAT_Tests final : public PK_Signature_Generation_Test
std::unique_ptr<Botan::Private_Key> load_private_key(const VarMap& vars) override
{
- return load_sm2_private_key(vars);
+ return load_sm2_private_key<Botan::SM2_Signature_PrivateKey>(vars);
}
};
@@ -89,7 +90,7 @@ class SM2_Encryption_KAT_Tests final : public PK_Encryption_Decryption_Test
std::unique_ptr<Botan::Private_Key> load_private_key(const VarMap& vars) override
{
- return load_sm2_private_key(vars);
+ return load_sm2_private_key<Botan::SM2_Encryption_PrivateKey>(vars);
}
};