From: Niels Möller Date: Sun, 29 Sep 2002 21:11:43 +0000 (+0200) Subject: (MEMEQH): New macro. X-Git-Tag: nettle_1.6_release_20021003~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f6b2ce6d5b6713b88339aed442112534de9d105;p=thirdparty%2Fnettle.git (MEMEQH): New macro. Rev: src/nettle/testsuite/testutils.h:1.10 --- diff --git a/testsuite/testutils.h b/testsuite/testutils.h index 6dcef287..d82aa51a 100644 --- a/testsuite/testutils.h +++ b/testsuite/testutils.h @@ -77,6 +77,11 @@ void test_rsa_sha1(struct rsa_public_key *pub, struct rsa_private_key *key, mpz_t expected); + +void +test_rsa_key(struct rsa_public_key *pub, + struct rsa_private_key *key); + #endif /* HAVE_LIBGMP */ #define H2(d, s) decode_hex((d), (s)) @@ -86,6 +91,9 @@ test_rsa_sha1(struct rsa_public_key *pub, #define LDATA(x) strlen(x), x #define MEMEQ(length, a, b) (!memcmp((a), (b), (length))) +#define MEMEQH(length, a, b) \ +((length) == decode_hex_length((b)) \ + && !memcmp((a), decode_hex_dup((b)), (length))) #define FAIL() abort() #define SKIP() exit(77)