#include "config.h" #include #include /** * crypto/ripemd160 - implementation of RIPEMD 160 bit digest algorithm. * * This code is either a wrapper for openssl (if CCAN_CRYPTO_RIPEMD160_USE_OPENSSL * is defined) or an open-coded implementation based on Bitcoin's. * * License: BSD-MIT * Maintainer: Rusty Russell * * Example: * #include * #include * #include * #include * * // Simple demonstration: idential strings will have the same hash, but * // two different strings will not. * int main(int argc, char *argv[]) * { * struct ripemd160 hash1, hash2; * * if (argc != 3) * errx(1, "Usage: %s ", argv[0]); * * ripemd160(&hash1, argv[1], strlen(argv[1])); * ripemd160(&hash2, argv[2], strlen(argv[2])); * printf("Hash is %s\n", memcmp(&hash1, &hash2, sizeof(hash1)) * ? "different" : "same"); * return 0; * } */ int main(int argc, char *argv[]) { /* Expect exactly one argument */ if (argc != 2) return 1; if (strcmp(argv[1], "depends") == 0) { printf("ccan/compiler\n"); printf("ccan/endian\n"); return 0; } if (strcmp(argv[1], "libs") == 0) { #ifdef CCAN_CRYPTO_RIPEMD160_USE_OPENSSL printf("crypto\n"); #endif return 0; } return 1; }