Encapsulates the TinyXml library to retrieve easily information from the xml configuration file described in the verificatum verifier specification. More...
#include <xmlconfig.hpp>
Public Member Functions | |
const char * | retrieveText (std::string node, TiXmlHandle hdl) |
Returns the text at the node whose name is given as an argument. If there is no such node, stops everything by exiting with code 1. | |
int | toInteger (std::string node, TiXmlHandle hdl) |
Gets the content of the node specified and returns its value as an integer. | |
cryptoTools::SHAx * | string2hash (const char *hashRepresentation) |
Parses a c-string and returns a pointer to the corresponding child of SHAx. | |
arithm::Group * | unmarshalPGroup (const char *fieldRepresentation) |
Performs the "unmarshalling" of the pgroup used for the computations. | |
XmlConfig (std::string path2file) | |
Class contructor. | |
unsigned int | getNopart () |
unsigned int | getThres () |
unsigned int | getMaxciph () |
unsigned int | getVbitlenro () |
unsigned int | getStatdist () |
unsigned int | getCbitlenro () |
cryptoTools::SHAx * | getRohash () |
cryptoTools::SHAx * | getPrghash () |
arithm::Group * | getPgroup () |
Private Attributes | |
TiXmlDocument | doc |
A class from the tinyxml library used to store a xml document and access it. | |
unsigned int | nopart |
The number of parties involved. | |
unsigned int | thres |
The threshold number of mix-servers that must be corrupted to break the privacy of the senders (thres node). | |
unsigned int | maxciph |
The maximal number of ciphertext (maxciph node). | |
unsigned int | vbitlenro |
The number of bits in each component of random vectors used for batching in proofs of shuffles and proofs of correct decryption (vbitlenro node). | |
unsigned int | statdist |
The acceptable statistical error when sampling random values (statdist node). | |
unsigned int | cbitlenro |
The number of bits used in the challenge of the verifier in zero-knowledge proofs (cbitlenro node). | |
cryptoTools::SHAx * | rohash |
An implementation of the cryptoTools::SHAx class corresponding to the hash function specified in the rohash node. | |
cryptoTools::SHAx * | prghash |
An implementation of the cryptoTools::SHAx class corresponding to the hash function specified in the prg node. | |
arithm::Group * | pgroup |
A pointer to the arithm::Field instance corresponding to the one described in the pgroup node. |
Encapsulates the TinyXml library to retrieve easily information from the xml configuration file described in the verificatum verifier specification.
Retrieves the following (as they are defined in the spec):
Definition at line 50 of file xmlconfig.hpp.
XmlConfig::XmlConfig | ( | std::string | path2file | ) |
Class contructor.
path2file | The path to the file to parse. |
Definition at line 96 of file xmlconfig.cpp.
unsigned int XmlConfig::getCbitlenro | ( | ) |
Definition at line 164 of file xmlconfig.cpp.
unsigned int XmlConfig::getMaxciph | ( | ) |
Definition at line 146 of file xmlconfig.cpp.
unsigned int XmlConfig::getNopart | ( | ) |
Definition at line 134 of file xmlconfig.cpp.
arithm::Group * XmlConfig::getPgroup | ( | ) |
Definition at line 182 of file xmlconfig.cpp.
cryptoTools::SHAx * XmlConfig::getPrghash | ( | ) |
Definition at line 176 of file xmlconfig.cpp.
cryptoTools::SHAx * XmlConfig::getRohash | ( | ) |
Definition at line 170 of file xmlconfig.cpp.
unsigned int XmlConfig::getStatdist | ( | ) |
Definition at line 158 of file xmlconfig.cpp.
unsigned int XmlConfig::getThres | ( | ) |
Definition at line 140 of file xmlconfig.cpp.
unsigned int XmlConfig::getVbitlenro | ( | ) |
Definition at line 152 of file xmlconfig.cpp.
const char * XmlConfig::retrieveText | ( | std::string | node, |
TiXmlHandle | hdl | ||
) |
Returns the text at the node whose name is given as an argument. If there is no such node, stops everything by exiting with code 1.
node | The name of the node we are interested in. |
hdl | TinyXml stuff, it is a Handle to the XML documented we are using. |
Definition at line 19 of file xmlconfig.cpp.
cryptoTools::SHAx * XmlConfig::string2hash | ( | const char * | hashRepresentation | ) |
Parses a c-string and returns a pointer to the corresponding child of SHAx.
Can read "SHA-256", "SHA-384" and "SHA-512". If none of these is found, exits with exit code 1.
hashRepresentation | A string describing the hashfunction to use. |
Definition at line 43 of file xmlconfig.cpp.
int XmlConfig::toInteger | ( | std::string | node, |
TiXmlHandle | hdl | ||
) |
Gets the content of the node specified and returns its value as an integer.
node | The name of the node we want to read. |
hdl | TinyXml stuff, it is a Handle to the XML documented we are using. |
Definition at line 36 of file xmlconfig.cpp.
arithm::Group * XmlConfig::unmarshalPGroup | ( | const char * | fieldRepresentation | ) |
Performs the "unmarshalling" of the pgroup used for the computations.
Can currently read "ModPGrp" instances. Reads a string containing:
< class name>(...)::< bytetree representation of the group>
Depending on < class name>, the correct Field child is instanciated with its constructor taking a verifierUtils::ByteTree as its input.
fieldRepresentation | A string which must contain the name of the class, then parenthesis containing human readable data we are not interested in, then two ':' and then the bytetree representation of the field. |
Definition at line 61 of file xmlconfig.cpp.
|
private |
The number of bits used in the challenge of the verifier in zero-knowledge proofs (cbitlenro node).
Definition at line 92 of file xmlconfig.hpp.
|
private |
A class from the tinyxml library used to store a xml document and access it.
Definition at line 57 of file xmlconfig.hpp.
|
private |
The maximal number of ciphertext (maxciph node).
Definition at line 73 of file xmlconfig.hpp.
|
private |
The number of parties involved.
Definition at line 62 of file xmlconfig.hpp.
|
private |
A pointer to the arithm::Field instance corresponding to the one described in the pgroup node.
Definition at line 112 of file xmlconfig.hpp.
|
private |
An implementation of the cryptoTools::SHAx class corresponding to the hash function specified in the prg node.
Definition at line 106 of file xmlconfig.hpp.
|
private |
An implementation of the cryptoTools::SHAx class corresponding to the hash function specified in the rohash node.
Definition at line 99 of file xmlconfig.hpp.
|
private |
The acceptable statistical error when sampling random values (statdist node).
Definition at line 86 of file xmlconfig.hpp.
|
private |
The threshold number of mix-servers that must be corrupted to break the privacy of the senders (thres node).
Definition at line 68 of file xmlconfig.hpp.
|
private |
The number of bits in each component of random vectors used for batching in proofs of shuffles and proofs of correct decryption (vbitlenro node).
Definition at line 80 of file xmlconfig.hpp.