blob: 4ccdddf9a6441e34d9afdf5d2a5d73961d0123db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#include "config.h"
#include <stdio.h>
#include <string.h>
/**
* md4 - MD4 Message Digest Algorithm (RFC1320).
*
* Message Digest #4 is a 128-bit hashing algorithm; it is quick but
* not sufficiently strong for cryptographic use (duplicates can be
* found very efficiently). It provides sufficient mixing to have an
* avalanche effect: any change in input changes the output completely.
*
* Example:
* #include <stdio.h>
* #include <ccan/md4/md4.h>
*
* // Provide MD4 sums of the input strings.
* int main(int argc, char *argv[])
* {
* unsigned int i, j;
* struct md4_ctx ctx;
*
* for (i = 1; i < argc; i++) {
* md4_init(&ctx);
* md4_hash(&ctx, argv[i], strlen(argv[i]));
* md4_finish(&ctx);
* for (j = 0; j < 16; j++)
* printf("%02x", ctx.hash.bytes[j]);
* printf("\n");
* }
* return 0;
* }
*
* License: GPL (v2 or any later version)
*/
int main(int argc, char *argv[])
{
if (argc != 2)
return 1;
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/endian\n");
printf("ccan/array_size\n");
return 0;
}
return 1;
}
|