diff options
author | Jack Lloyd <[email protected]> | 2018-01-31 14:03:05 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-31 14:03:05 -0500 |
commit | e5b9ee2345affb56307070298ded9c2d5e1914be (patch) | |
tree | 7311fb0a10a99ccaf8cb82eecdea26d9fbe3d458 /src/cli | |
parent | 439d2ead033142365f092c7882bad31e4257ed09 (diff) |
Use shared representation of EC_Group
Hide CurveGFp with an eye for eventual removal
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/pubkey.cpp | 6 | ||||
-rw-r--r-- | src/cli/speed.cpp | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/cli/pubkey.cpp b/src/cli/pubkey.cpp index ffe1470dc..0e515d2ea 100644 --- a/src/cli/pubkey.cpp +++ b/src/cli/pubkey.cpp @@ -340,9 +340,9 @@ class EC_Group_Info final : public Command } else { - output() << "P = " << std::hex << group.get_curve().get_p() << "\n" - << "A = " << std::hex << group.get_curve().get_a() << "\n" - << "B = " << std::hex << group.get_curve().get_b() << "\n" + output() << "P = " << std::hex << group.get_p() << "\n" + << "A = " << std::hex << group.get_a() << "\n" + << "B = " << std::hex << group.get_b() << "\n" << "G = " << group.get_base_point().get_affine_x() << "," << group.get_base_point().get_affine_y() << "\n"; } diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp index 04b8cc3ff..7dbc7922c 100644 --- a/src/cli/speed.cpp +++ b/src/cli/speed.cpp @@ -1215,7 +1215,7 @@ class Speed final : public Command Timer mult_timer(group_name + " scalar mult"); Timer blinded_mult_timer(group_name + " blinded scalar mult"); - const Botan::BigInt scalar(rng(), group.get_curve().get_p().bits()); + const Botan::BigInt scalar(rng(), group.get_p_bits()); const Botan::PointGFp& base_point = group.get_base_point(); Botan::Blinded_Point_Multiply scalar_mult(base_point, group.get_order(), 4); @@ -1242,7 +1242,6 @@ class Speed final : public Command for(std::string group_name : groups) { const Botan::EC_Group group(group_name); - const Botan::CurveGFp& curve = group.get_curve(); while(uncmp_timer.under(runtime) && cmp_timer.under(runtime)) { @@ -1251,8 +1250,8 @@ class Speed final : public Command const Botan::secure_vector<uint8_t> os_cmp = Botan::EC2OSP(p, Botan::PointGFp::COMPRESSED); const Botan::secure_vector<uint8_t> os_uncmp = Botan::EC2OSP(p, Botan::PointGFp::UNCOMPRESSED); - uncmp_timer.run([&]() { OS2ECP(os_uncmp, curve); }); - cmp_timer.run([&]() { OS2ECP(os_cmp, curve); }); + uncmp_timer.run([&]() { group.OS2ECP(os_uncmp); }); + cmp_timer.run([&]() { group.OS2ECP(os_cmp); }); } record_result(uncmp_timer); |