Cipher Class
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
anonymous_namespace{cipher.cc} Namespace Reference

Functions

void bdump (const string &fn, uint ln, const string &prefix, unsigned char *a, unsigned int len)
 
template<typename T >
void tdump (const string &fn, uint ln, const string &prefix, const T &d)
 
template<typename T >
void vdump (const string &fn, uint ln, const string &prefix, const T &d)
 
template<>
void vdump< string > (const string &fn, uint ln, const string &prefix, const string &d)
 

Function Documentation

void anonymous_namespace{cipher.cc}::bdump ( const string &  fn,
uint  ln,
const string &  prefix,
unsigned char *  a,
unsigned int  len 
)

Definition at line 120 of file cipher.cc.

125  {
126  cout << fn << ":" << ln << ": " << prefix;
127  for(uint i=0;i<len;++i) {
128  if ((i%16)==0) {
129  if (i) {
130  cout << endl;
131  cout << "\t\t\t";
132  }
133  else {
134  cout << "\t\t";
135  }
136  }
137  else if (i) {
138  cout << ", ";
139  }
140  cout << setw(2) << hex << right << uint(a[i]) << dec;
141  }
142  cout << " (" << len << ")" << endl;
143  }
template<typename T >
void anonymous_namespace{cipher.cc}::tdump ( const string &  fn,
uint  ln,
const string &  prefix,
const T &  d 
)

Definition at line 86 of file cipher.cc.

90  {
91  cout << fn << ":" << ln << ": " << prefix << "\t";
92  for(uint i=0;i<sizeof(T);++i) {
93 #if 0
94  // Prettified output.
95  // I turned it off so that the format would match openssl.
96  if ((i%16)==0) {
97  if (i) {
98  cout << endl;
99  cout << "\t\t\t";
100  }
101  else {
102  if (prefix.size()<4) {
103  cout << "\t";
104  }
105  cout << "\t";
106  }
107  }
108  else if (i) {
109  cout << ", ";
110  }
111 #endif
112  cout << setw(2) << setfill('0') << hex << right << uint(d[i]) << dec << setfill(' ');
113  }
114  cout << " (" << sizeof(T) << ")" << endl;
115  }
template<typename T >
void anonymous_namespace{cipher.cc}::vdump ( const string &  fn,
uint  ln,
const string &  prefix,
const T &  d 
)

Definition at line 59 of file cipher.cc.

63  {
64  cout << fn << ":" << ln << ": " << prefix << "\t" << d << endl;
65  }
template<>
void anonymous_namespace{cipher.cc}::vdump< string > ( const string &  fn,
uint  ln,
const string &  prefix,
const string &  d 
)

Definition at line 71 of file cipher.cc.

75  {
76  cout << fn << ":" << ln << ": "
77  << prefix << "\t"
78  << left << setw(64) << d
79  << " (" << d.size() << ")"
80  << endl;
81  }