From 1b564f171755ef1655a6b8d2aef181dfb044984d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Thu, 14 Feb 2002 11:48:36 +0100 Subject: [PATCH] (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 --- testsuite/testutils.c | 13 +++++++++++++ testsuite/testutils.h | 3 +++ testsuite/yarrow-test.c | 13 ------------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/testsuite/testutils.c b/testsuite/testutils.c index e18d025c..8f296b08 100644 --- a/testsuite/testutils.c +++ b/testsuite/testutils.c @@ -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 diff --git a/testsuite/testutils.h b/testsuite/testutils.h index 28f66014..89d2de74 100644 --- a/testsuite/testutils.h +++ b/testsuite/testutils.h @@ -29,6 +29,9 @@ decode_hex(uint8_t *dst, const char *hex); const uint8_t * decode_hex_dup(const char *hex); +void +print_hex(unsigned length, uint8_t *data); + /* The main program */ int test_main(void); diff --git a/testsuite/yarrow-test.c b/testsuite/yarrow-test.c index 54a176f0..ae97a255 100644 --- a/testsuite/yarrow-test.c +++ b/testsuite/yarrow-test.c @@ -36,19 +36,6 @@ get_event(FILE *f, struct sha256_ctx *hash, 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 * open_file(const char *name) { -- GitLab