MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_vs_openssl

Function test_vs_openssl

tests/fuzz/fuzz-ripemd160.c:56–67  ·  view source on GitHub ↗

Test that the hash calculated by CCAN matches OpenSSL's hash. */

Source from the content-addressed store, hash-verified

54
55/* Test that the hash calculated by CCAN matches OpenSSL's hash. */
56static void test_vs_openssl(const struct ripemd160 *expected, const u8 *data,
57 size_t size)
58{
59 u8 openssl_hash[RIPEMD160_DIGEST_LENGTH];
60 unsigned hash_size;
61
62 assert(EVP_Digest(data, size, openssl_hash, &hash_size, ripemd160_algo,
63 NULL));
64 assert(hash_size == RIPEMD160_DIGEST_LENGTH);
65 assert(memeq(expected, sizeof(*expected), openssl_hash,
66 sizeof(openssl_hash)));
67}
68
69void run(const u8 *data, size_t size)
70{

Callers 1

runFunction · 0.70

Calls 1

memeqFunction · 0.85

Tested by

no test coverage detected