ciphertext.cpp
Go to the documentation of this file.
1 
12 #include "ciphertext.hpp"
13 #include "ciphergroup.hpp"
14 
15 using namespace elGamal;
16 
17 
18 
20  u(bt->getChild(0),c.getGrp()),
21  v(bt->getChild(1),c.getGrp())
22 {
23  if ( (!bt->isNode()) || (bt->size() != 2) )
24  {
25  std::cout<<"ERROR: in CipherText(bt,c), bt is not a "
26  <<"Node or is not of size 2.\nbt=";
27  bt->prettyPrint("");
28  std::cout<<std::endl;
29  exit(1);
30  }
31 }
32 
33 
35  u(left), v(right)
36 {
37 }
38 
39 
41 {
43  result->addChild(u.toByteTree());
44  result->addChild(v.toByteTree());
45  return result;
46 }
47 
48 
50 {
51  return u;
52 }
53 
54 
56 {
57  return v;
58 }