CXI
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Util Class Reference

Utility Functions. More...

Static Public Member Functions

static void store_int2 (unsigned int val, unsigned char *buf)
 
static void store_int3 (unsigned int val, unsigned char *buf)
 
static void store_int4 (unsigned int val, unsigned char *buf)
 
static unsigned int load_int2 (const unsigned char *buf)
 
static unsigned int load_int3 (const unsigned char *buf)
 
static unsigned int load_int4 (const unsigned char *buf)
 
static void xtrace (FILE *fp, const char *prefix, const char *text, const void *data, int len)
 
static void xtrace (const char *text, const void *data, int len)
 
static void xtrace (const char *text, const ByteArray &ba)
 

Detailed Description

Utility Functions.

The Util class implements as set of utility functions. Some of the static methods may be useful for applications that work with the CryptoServer.

Member Function Documentation

◆ store_int2()

void store_int2 ( unsigned int  val,
unsigned char *  buf 
)
static

Stores a 2-byte integer in to a character buffer. The integer is stored in big endian order.

Parameters
valInteger value to be stored (unsigned).
bufByte array into which the integer is stored.

◆ store_int3()

void store_int3 ( unsigned int  val,
unsigned char *  buf 
)
static

Stores a 3-byte integer in to a character buffer. The integer is stored in big endian order.

Parameters
valInteger value to be stored (unsigned).
bufByte array into which the integer is stored.

◆ store_int4()

void store_int4 ( unsigned int  val,
unsigned char *  buf 
)
static

Stores a 4-byte integer in to a character buffer. The integer is stored in big endian order.

Parameters
valInteger value to be stored (unsigned).
bufByte array into which the integer is stored.

◆ load_int2()

unsigned int load_int2 ( const unsigned char *  buf)
static

Loads a 2-byte integer from a character buffer. The integer must be stored in big endian order.

Parameters
bufBuffer from which the integer is loaded.
Returns
Integer value loaded (unsigned).

◆ load_int3()

unsigned int load_int3 ( const unsigned char *  buf)
static

Loads a 3-byte integer from a character buffer. The integer must be stored in big endian order.

Parameters
bufBuffer from which the integer is loaded.
Returns
Integer value loaded (unsigned).

◆ load_int4()

unsigned int load_int4 ( const unsigned char *  buf)
static

Loads a 4-byte integer from a character buffer. The integer must be stored in big endian order.

Parameters
bufBuffer from which the integer is loaded.
Returns
Integer value loaded (unsigned).

◆ xtrace() [1/3]

void xtrace ( FILE *  fp,
const char *  prefix,
const char *  text,
const void *  data,
int  len 
)
static

Dumps binary data to a file stream. The binary data is converted to hexadecimal notation.

Parameters
fptarget file stream
prefixstring to print before each line
texttag (optional)
datapointer to binary data
lenlength of binary data

◆ xtrace() [2/3]

void xtrace ( const char *  text,
const void *  data,
int  len 
)
static

Dumps binary data to stdout. The binary data is converted to hexadecimal notation.

Parameters
texttag (optional)
datapointer to binary data
lenlength of binary data

◆ xtrace() [3/3]

void xtrace ( const char *  text,
const ByteArray ba 
)
static

Dumps binary data to stdout. The binary data is converted to hexadecimal notation.

Parameters
texttag (optional)
babyte arry to be dumped