Commit 1b564f17 authored by Niels Möller's avatar Niels Möller
Browse files

(print_hex): New function (moved from

yarrow-test.c).

Rev: src/nettle/testsuite/testutils.c:1.10
Rev: src/nettle/testsuite/testutils.h:1.8
Rev: src/nettle/testsuite/yarrow-test.c:1.13
parent 8560129c
...@@ -108,6 +108,19 @@ decode_hex_dup(const char *hex) ...@@ -108,6 +108,19 @@ decode_hex_dup(const char *hex)
} }
} }
void
print_hex(unsigned length, uint8_t *data)
{
unsigned i;
for (i = 0; i < length; i++)
{
if (! (i % 8))
printf(" ");
printf("%02x", data[i]);
}
}
int verbose = 0; int verbose = 0;
int int
......
...@@ -29,6 +29,9 @@ decode_hex(uint8_t *dst, const char *hex); ...@@ -29,6 +29,9 @@ decode_hex(uint8_t *dst, const char *hex);
const uint8_t * const uint8_t *
decode_hex_dup(const char *hex); decode_hex_dup(const char *hex);
void
print_hex(unsigned length, uint8_t *data);
/* The main program */ /* The main program */
int int
test_main(void); test_main(void);
......
...@@ -36,19 +36,6 @@ get_event(FILE *f, struct sha256_ctx *hash, ...@@ -36,19 +36,6 @@ get_event(FILE *f, struct sha256_ctx *hash,
return 1; return 1;
} }
static void
print_hex(unsigned length, uint8_t *digest)
{
unsigned i;
for (i = 0; i < length; i++)
{
if (! (i % 8))
printf(" ");
printf("%02x", digest[i]);
}
}
static FILE * static FILE *
open_file(const char *name) open_file(const char *name)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment