aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/pubkey/ec_group/ec_named.cpp12
-rw-r--r--src/tests/unit_ecc.cpp25
2 files changed, 26 insertions, 11 deletions
diff --git a/src/lib/pubkey/ec_group/ec_named.cpp b/src/lib/pubkey/ec_group/ec_named.cpp
index 3687fabdf..7fe1517e4 100644
--- a/src/lib/pubkey/ec_group/ec_named.cpp
+++ b/src/lib/pubkey/ec_group/ec_named.cpp
@@ -121,7 +121,18 @@ std::shared_ptr<EC_Group_Data> EC_Group::EC_group_info(const OID& oid)
"0x1",
"0x8D91E471E0989CDA27DF505A453F2B7635294F2DDF23E3B122ACC99C9E9F1E14",
"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C611070995AD10045841B09B761B893",
+ OID{1,2,643,7,1,2,1,1,1});
+
+ // gost_512A
+ if(oid == OID{1,2,643,7,1,2,1,2,1})
+ return load_EC_group_info("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",
+ "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4",
+ "0xE8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760",
+ "3",
+ "0x7503CFE87A836AE3A61B8816E25450E6CE5E1C93ACF1ABC1778064FDCBEFA921DF1626BE4FD036E93D75E6A50E3A41E98028FE5FC235F5B889A589CB5215F2A4",
+ "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27E69532F48D89116FF22B8D4E0560609B4B38ABFAD2B85DCACDB1411F10B275",
oid);
+
// secp160k1
if(oid == OID{1,3,132,0,9})
return load_EC_group_info("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
@@ -281,6 +292,7 @@ const std::set<std::string>& EC_Group::known_named_groups()
"x962_p239v2",
"x962_p239v3",
"gost_256A",
+ "gost_512A",
"frp256v1",
"sm2p256v1"
};
diff --git a/src/tests/unit_ecc.cpp b/src/tests/unit_ecc.cpp
index 28b2fadd1..08d08b516 100644
--- a/src/tests/unit_ecc.cpp
+++ b/src/tests/unit_ecc.cpp
@@ -9,16 +9,17 @@
#include "tests.h"
#if defined(BOTAN_HAS_ECC_GROUP)
-#include <botan/bigint.h>
-#include <botan/numthry.h>
-#include <botan/curve_nistp.h>
-#include <botan/pk_keys.h>
-#include <botan/point_gfp.h>
-#include <botan/ec_group.h>
-#include <botan/reducer.h>
-#include <botan/hex.h>
-#include <botan/data_src.h>
-#include <botan/x509_key.h>
+ #include <botan/bigint.h>
+ #include <botan/numthry.h>
+ #include <botan/curve_nistp.h>
+ #include <botan/pk_keys.h>
+ #include <botan/point_gfp.h>
+ #include <botan/ec_group.h>
+ #include <botan/reducer.h>
+ #include <botan/hex.h>
+ #include <botan/data_src.h>
+ #include <botan/x509_key.h>
+ #include <botan/oids.h>
#endif
namespace Botan_Tests {
@@ -273,7 +274,9 @@ class EC_Group_Tests : public Test
{
Test::Result result("EC_Group " + group_name);
- const Botan::EC_Group group(group_name);
+ const Botan::OID oid = Botan::OIDS::lookup(group_name);
+
+ const Botan::EC_Group group(oid);
result.confirm("EC_Group is known", !group.get_curve_oid().empty());
result.confirm("EC_Group is considered valid", group.verify_group(Test::rng(), true));