From 96033661c46807b94b35419a8520d43445cabee2 Mon Sep 17 00:00:00 2001 From: René Korthaus Date: Sun, 12 Feb 2017 13:54:21 +0100 Subject: Add ECDSA key tests from Google's project Wycheproof --- src/tests/test_ecdsa.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/tests/test_ecdsa.cpp') diff --git a/src/tests/test_ecdsa.cpp b/src/tests/test_ecdsa.cpp index 41d81a576..148abaacc 100644 --- a/src/tests/test_ecdsa.cpp +++ b/src/tests/test_ecdsa.cpp @@ -89,17 +89,17 @@ class ECDSA_Invalid_Key_Tests : public Text_Based_Test std::unique_ptr public_point; try - { - public_point.reset(new Botan::PointGFp(group.get_curve(), x, y)); - } + { + public_point.reset(new Botan::PointGFp(group.get_curve(), x, y)); + } catch(Botan::Invalid_Argument&) - { - // PointGFp() performs a range check on x, y in [0, p−1], - // which is also part of the EC public key checks, e.g., - // in NIST SP800-56A rev2, sec. 5.6.2.3.2 - result.test_success("public key fails check"); - return result; - } + { + // PointGFp() performs a range check on x, y in [0, p−1], + // which is also part of the EC public key checks, e.g., + // in NIST SP800-56A rev2, sec. 5.6.2.3.2 + result.test_success("public key fails check"); + return result; + } std::unique_ptr key(new Botan::ECDSA_PublicKey(group, *public_point)); result.test_eq("public key fails check", key->check_key(Test::rng(), false), false); -- cgit v1.2.3