aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/debug.h
blob: 11de7010eaefd3b25b1a3b02e1101de84531ccf9 (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
/*
* Internal-use debugging functions for Botan
* (C) 2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_DEBUG_H__
#define BOTAN_DEBUG_H__

#include <botan/secmem.h>
#include <cstdio>

namespace Botan {

namespace Debug {

inline void print_vec(const std::string& name,
                      const byte array[], size_t array_len)
   {
   std::printf("%s = ", name.c_str());
   for(size_t i = 0; i != array_len; ++i)
      std::printf("%02X", array[i]);
   std::printf("\n");
   }

inline void print_vec(const std::string& name,
                      const MemoryRegion<byte>& vec)
   {
   print_vec(name, &vec[0], vec.size());
   }

}

}

#endif