diff options
author | Jack Lloyd <[email protected]> | 2018-02-18 12:01:43 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-18 13:37:42 -0500 |
commit | 9772e10e3112f9b14669d372574bcc01981028f2 (patch) | |
tree | db1a4c6aa745ff73dd52da6dcc57a812901d3e8a /src/tests/unit_ecc.cpp | |
parent | 292c32bd73b3c114621ac2e4a668f6aca02c0cea (diff) |
Add functions to reduce integers mod the order to EC_Group
This allows calculating the Barett reduction params just once,
when the group is initialized, then sharing them across all
operations which use that group.
Diffstat (limited to 'src/tests/unit_ecc.cpp')
-rw-r--r-- | src/tests/unit_ecc.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tests/unit_ecc.cpp b/src/tests/unit_ecc.cpp index 96e2438b3..bd8295033 100644 --- a/src/tests/unit_ecc.cpp +++ b/src/tests/unit_ecc.cpp @@ -889,9 +889,15 @@ class ECC_Invalid_Key_Tests final : public Text_Based_Test const std::string encoded = get_req_str(vars, "SubjectPublicKey"); Botan::DataSource_Memory key_data(Botan::hex_decode(encoded)); - std::unique_ptr<Botan::Public_Key> key(Botan::X509::load_key(key_data)); - result.test_eq("public key fails check", key->check_key(Test::rng(), false), false); - + try + { + std::unique_ptr<Botan::Public_Key> key(Botan::X509::load_key(key_data)); + result.test_eq("public key fails check", key->check_key(Test::rng(), false), false); + } + catch(Botan::Decoding_Error&) + { + result.test_success("Decoding invalid ECC key results in decoding error exception"); + } return result; } |