Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Macros
Pages
xmlconfig
xmltest.cpp
Go to the documentation of this file.
1
13
#include "
xmlconfig.hpp
"
14
15
22
void
printHash
(
cryptoTools::SHAx
* hash)
23
{
24
std::vector<unsigned char> hashTest;
25
hash->
hash
(hashTest);
26
std::cout<<hash->
getType
()<<
", "
<<std::hex;
27
for
(
unsigned
int
i=0; i<hash->
getHashLength
()/8; i++)
28
std::cout<<(
int
)hash->
getHash
()[i];
29
}
30
31
43
void
parseAndPrint
(std::string path)
44
{
45
XmlConfig
conf(path);
46
std::cout<<
"nopart: "
<<std::dec<<conf.
getNopart
()
47
<<std::endl;
48
std::cout<<
"thres: "
<<conf.
getThres
() <<std::endl;
49
std::cout<<
"maxciph: "
<<conf.
getMaxciph
() <<std::endl;
50
std::cout<<
"vbitlenro: "
<<conf.
getVbitlenro
()<<std::endl;
51
std::cout<<
"statdist: "
<<conf.
getStatdist
()<<std::endl;
52
std::cout<<
"cbitlenro: "
<<conf.
getCbitlenro
()<<std::endl;
53
std::cout<<
"rohash: "
;
54
printHash
(conf.
getRohash
());
55
std::cout<<std::endl;
56
std::cout<<
"prghash: "
;
57
printHash
(conf.
getPrghash
());
58
std::cout<<std::endl;
59
std::cout<<conf.
getPgroup
()->
toByteTree
()->
toString
()<<std::endl;
60
}
61
62
71
int
main
(
void
)
72
{
73
std::string path1(
"sample1.xml"
);
74
parseAndPrint
(path1);
75
std::string path2(
"sample2.xml"
);
76
parseAndPrint
(path2);
77
std::string path3(
"sample3.xml"
);
78
parseAndPrint
(path3);
79
return
0;
80
}