diff options
author | Werner Koch <wk@gnupg.org> | 2008-08-21 18:34:24 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-08-21 18:34:24 +0000 |
commit | 393d3b3b0cb80223cde9be75a6a10169e37c5778 (patch) | |
tree | c0b11bfebc8687f8fe888d6502fe1eede1857ade /src/misc.c | |
parent | 2f818ed3f919a9f8f565b67007b194fa953e7d9b (diff) | |
download | libgcrypt-393d3b3b0cb80223cde9be75a6a10169e37c5778.tar.gz |
Finished the X9.31 RNG implementations.
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -250,6 +250,7 @@ _gcry_log_debug( const char *fmt, ... ) va_end(arg_ptr); } + void _gcry_log_printf (const char *fmt, ...) { @@ -263,6 +264,26 @@ _gcry_log_printf (const char *fmt, ...) } } +/* Print a hexdump of BUFFER. With TEXT of NULL print just the raw + dump, with TEXT an empty string, print a trailing linefeed, + otherwise print an entire debug line. */ +void +_gcry_log_printhex (const char *text, const void *buffer, size_t length) +{ + if (text && *text) + log_debug ("%s ", text); + if (length) + { + const unsigned char *p = buffer; + log_printf ("%02X", *p); + for (length--, p++; length--; p++) + log_printf (" %02X", *p); + } + if (text) + log_printf ("\n"); +} + + void _gcry_burn_stack (int bytes) { |