crypto tests: minor fixes
This commit is contained in:
parent
52f941c748
commit
196c08a15f
1 changed files with 6 additions and 6 deletions
|
|
@ -473,10 +473,10 @@ uint64_t hash_64(const void* data, size_t size)
|
|||
static bool test_name_a ## _ ## test_name_b(); \
|
||||
static test_keeper_t test_name_a ## _ ## test_name_b ## _ ## keeper(STR(COMBINE(test_name_a ## _, test_name_b)), & test_name_a ## _ ## test_name_b); \
|
||||
static bool test_name_a ## _ ## test_name_b()
|
||||
#define ASSERT_TRUE(expr) CHECK_AND_ASSERT_MES(expr, false, "This is not true: " #expr)
|
||||
#define ASSERT_FALSE(expr) CHECK_AND_ASSERT_MES((expr) == false, false, "This is not false: " #expr)
|
||||
#define ASSERT_EQ(a, b) CHECK_AND_ASSERT_MES(a == b, false, #a " != " #b "\n " << a << " != " << b)
|
||||
#define ASSERT_NEQ(a, b) CHECK_AND_ASSERT_MES(a != b, false, #a " == " #b "\n " << a)
|
||||
#define ASSERT_TRUE(expr) CHECK_AND_ASSERT_MES(expr, false, "This is not true: " #expr << " @ " << LOCATION_SS)
|
||||
#define ASSERT_FALSE(expr) CHECK_AND_ASSERT_MES((expr) == false, false, "This is not false: " #expr << " @ " << LOCATION_SS)
|
||||
#define ASSERT_EQ(a, b) CHECK_AND_ASSERT_MES(a == b, false, #a " != " #b "\n " << a << " != " << b << " @ " << LOCATION_SS)
|
||||
#define ASSERT_NEQ(a, b) CHECK_AND_ASSERT_MES(a != b, false, #a " == " #b "\n " << a << " @ " << LOCATION_SS)
|
||||
|
||||
typedef bool(*bool_func_ptr_t)();
|
||||
static std::vector<std::pair<std::string, bool_func_ptr_t>> g_tests;
|
||||
|
|
@ -1537,14 +1537,14 @@ TEST(crypto, schnorr_sig)
|
|||
scalar_t a = scalar_t::random();
|
||||
point_t A_pt = a * c_point_G;
|
||||
public_key A = A_pt.to_public_key();
|
||||
ASSERT_FALSE(generate_schnorr_sig<gt_X>(m, A_pt, a, ss));
|
||||
// (different behaviour in debug and release) ASSERT_FALSE(generate_schnorr_sig<gt_X>(m, A_pt, a, ss));
|
||||
ASSERT_TRUE(generate_schnorr_sig<gt_G>(m, A_pt, a, ss));
|
||||
ASSERT_FALSE(verify_schnorr_sig<gt_X>(m, A, ss));
|
||||
ASSERT_TRUE(verify_schnorr_sig<gt_G>(m, A, ss));
|
||||
|
||||
A_pt = a * c_point_X;
|
||||
A = A_pt.to_public_key();
|
||||
ASSERT_FALSE(generate_schnorr_sig<gt_G>(m, A_pt, a, ss));
|
||||
// (different behaviour in debug and release) ASSERT_FALSE(generate_schnorr_sig<gt_G>(m, A_pt, a, ss));
|
||||
ASSERT_TRUE(generate_schnorr_sig<gt_X>(m, A_pt, a, ss));
|
||||
ASSERT_FALSE(verify_schnorr_sig<gt_G>(m, A, ss));
|
||||
ASSERT_TRUE(verify_schnorr_sig<gt_X>(m, A, ss));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue