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

Function init

tests/fuzz/fuzz-ripemd160.c:17–33  ·  view source on GitHub ↗

Some versions of OpenSSL removed ripemd160 from the default provider. Check * and load the legacy provider if necessary. */

Source from the content-addressed store, hash-verified

15/* Some versions of OpenSSL removed ripemd160 from the default provider. Check
16 * and load the legacy provider if necessary. */
17void init(int *argc, char ***argv)
18{
19 const char data[] = "hash test data";
20 u8 openssl_hash[RIPEMD160_DIGEST_LENGTH];
21 unsigned hash_size;
22
23 ripemd160_algo = EVP_MD_fetch(NULL, "RIPEMD-160", NULL);
24 if (!ripemd160_algo) {
25 OSSL_PROVIDER_load(NULL, "legacy");
26 ripemd160_algo = EVP_MD_fetch(NULL, "RIPEMD-160", NULL);
27 assert(ripemd160_algo);
28 }
29
30 assert(EVP_Digest(data, sizeof(data), openssl_hash, &hash_size,
31 ripemd160_algo, NULL));
32 assert(hash_size == RIPEMD160_DIGEST_LENGTH);
33}
34
35/* Test that splitting the data and hashing via multiple updates yields the same
36 * result as not splitting the data. */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected