Contains several classes and functions used throughout the whole verifier, in particular the ByteTree. More...
Classes | |
class | ByteTree |
A virtual class providing a partial common interface for Node and Leaf. More... | |
class | Leaf |
Implements the ByteTree virtual class in the case when the data stored is not other bytetrees but actual bytes. More... | |
class | Node |
Inherits from the ByteTree and implements the case where the ByteTree has children. More... |
Functions | |
std::string | num2str (unsigned int number) |
Turns a number into a string of length 8 containing its hexdecimal representation. It is filled on the left with '0'. | |
std::string | byte2str (uint8_t b) |
Turns a byte into a two characters string. | |
uint8_t | doublon2byte (char b1, char b2) |
Turns two char representing a byte into the corresponding unsigned byte. | |
uint32_t | octuple2num (std::string s) |
Turns a string of length 8 into a number of bitlength 32. | |
std::vector< uint8_t > | largeNum2byteVector (mpz_class number) |
Turns an arbitrary large number into a vector containing bytes representing it. For instance, returns [0x1,0x0] if given 256. | |
std::vector< uint8_t > | file2bytes (std::string path) |
Returns the content of a file as a vector of bytes. |
Contains several classes and functions used throughout the whole verifier, in particular the ByteTree.
Classes in this module are of general utility but do not have much in common apart from that. See their respective documentation for more information.
std::string verifierUtils::byte2str | ( | uint8_t | b | ) |
Turns a byte into a two characters string.
b | The byte to transform. |
Definition at line 33 of file verifierutils.cpp.
uint8_t verifierUtils::doublon2byte | ( | char | b1, |
char | b2 | ||
) |
Turns two char representing a byte into the corresponding unsigned byte.
For instance:
b1 | The first char two read. |
b2 | The second to read. |
Definition at line 78 of file verifierutils.cpp.
std::vector< uint8_t > verifierUtils::file2bytes | ( | std::string | path | ) |
Returns the content of a file as a vector of bytes.
path | The path to the file to read. |
Definition at line 182 of file verifierutils.cpp.
std::vector< uint8_t > verifierUtils::largeNum2byteVector | ( | mpz_class | number | ) |
Turns an arbitrary large number into a vector containing bytes representing it. For instance, returns [0x1,0x0] if given 256.
number | The number to turn into bytes. |
Definition at line 167 of file verifierutils.cpp.
std::string verifierUtils::num2str | ( | unsigned int | number | ) |
Turns a number into a string of length 8 containing its hexdecimal representation. It is filled on the left with '0'.
number | The number to turn into a string. |
Definition at line 21 of file verifierutils.cpp.
uint32_t verifierUtils::octuple2num | ( | std::string | s | ) |
Turns a string of length 8 into a number of bitlength 32.
s | An hexadecimal representation of a number of length 8. |
Definition at line 149 of file verifierutils.cpp.