1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
11 uint8_t entropy
[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
12 uint8_t digest
[RMD160_DIGEST_LENGTH
];
15 RMD160Update(&ctx
, entropy
, __arraycount(entropy
));
16 RMD160Final(digest
, &ctx
);
19 for (size_t i
= 0; i
< __arraycount(digest
); i
++)
20 printf("%02x", digest
[i
]);
26 uint8_t entropy
[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
27 char digest
[RMD160_DIGEST_STRING_LENGTH
];
30 RMD160Update(&ctx
, entropy
, __arraycount(entropy
));
31 char *p
= RMD160End(&ctx
, digest
);
34 printf("test2: '%s'\n", digest
);
39 uint8_t entropy
[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
42 RMD160Update(&ctx
, entropy
, __arraycount(entropy
));
43 char *p
= RMD160End(&ctx
, NULL
);
44 assert(strlen(p
) == RMD160_DIGEST_STRING_LENGTH
- 1);
46 printf("test3: '%s'\n", p
);
52 char digest
[RMD160_DIGEST_STRING_LENGTH
];
54 char *p
= RMD160File("/etc/fstab", digest
);
57 printf("test4: '%s'\n", p
);
61 char *p
= RMD160File("/etc/fstab", NULL
);
62 assert(strlen(p
) == RMD160_DIGEST_STRING_LENGTH
- 1);
64 printf("test5: '%s'\n", p
);
70 char digest
[RMD160_DIGEST_STRING_LENGTH
];
72 char *p
= RMD160FileChunk("/etc/fstab", digest
, 10, 20);
75 printf("test6: '%s'\n", p
);
79 char *p
= RMD160FileChunk("/etc/fstab", NULL
, 10, 20);
80 assert(strlen(p
) == RMD160_DIGEST_STRING_LENGTH
- 1);
82 printf("test7: '%s'\n", p
);
88 uint8_t entropy
[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
89 char digest
[RMD160_DIGEST_STRING_LENGTH
];
91 char *p
= RMD160Data(entropy
, __arraycount(entropy
), digest
);
94 printf("test8: '%s'\n", p
);
98 uint8_t entropy
[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
100 char *p
= RMD160Data(entropy
, __arraycount(entropy
), NULL
);
101 assert(strlen(p
) == RMD160_DIGEST_STRING_LENGTH
- 1);
103 printf("test9: '%s'\n", p
);
122 // CHECK: test1: '2787e5a006365df6e8e799315b669dc34866783c'
123 // CHECK: test2: '2787e5a006365df6e8e799315b669dc34866783c'
124 // CHECK: test3: '2787e5a006365df6e8e799315b669dc34866783c'
125 // CHECK: test4: '{{.*}}'
126 // CHECK: test5: '{{.*}}'
127 // CHECK: test6: '{{.*}}'
128 // CHECK: test7: '{{.*}}'
129 // CHECK: test8: '2787e5a006365df6e8e799315b669dc34866783c'
130 // CHECK: test9: '2787e5a006365df6e8e799315b669dc34866783c'