elGamal::CipherText Class Reference

Implements an El-Gamal ciphertext, i.e. a pair $(u,v)$ of group elements. More...

#include <ciphertext.hpp>

+ Collaboration diagram for elGamal::CipherText:

Public Member Functions

 CipherText (verifierUtils::ByteTree *bt, CipherGroup c)
 Reads the two children of bt to retrieve the bytetree representations of u and v as elements of c.
 CipherText (arithm::Elmt left, arithm::Elmt right)
 Assigns directly u to left and v to right.
verifierUtils::ByteTreetoByteTree ()
 Turns this ciphertext into a node containing the bytetree representations of u and v.
arithm::Elmt getU ()
 Returns the u attribute, i.e. the left side member.
arithm::Elmt getV ()
 Returns the v attribute, i.e. the right side member.

Private Attributes

arithm::Elmt u
 The left hand side of the pair.
arithm::Elmt v
 The right hand side of the pair.

Detailed Description

Implements an El-Gamal ciphertext, i.e. a pair $(u,v)$ of group elements.

Definition at line 30 of file ciphertext.hpp.

Constructor & Destructor Documentation

CipherText::CipherText ( verifierUtils::ByteTree bt,
CipherGroup  c 
)

Reads the two children of bt to retrieve the bytetree representations of u and v as elements of c.

Definition at line 19 of file ciphertext.cpp.

:
u(bt->getChild(0),c.getGrp()),
v(bt->getChild(1),c.getGrp())
{
if ( (!bt->isNode()) || (bt->size() != 2) )
{
std::cout<<"ERROR: in CipherText(bt,c), bt is not a "
<<"Node or is not of size 2.\nbt=";
bt->prettyPrint("");
std::cout<<std::endl;
exit(1);
}
}
CipherText::CipherText ( arithm::Elmt  left,
arithm::Elmt  right 
)

Assigns directly u to left and v to right.

Definition at line 34 of file ciphertext.cpp.

:
u(left), v(right)
{
}

Member Function Documentation

arithm::Elmt CipherText::getU ( )

Returns the u attribute, i.e. the left side member.

Definition at line 49 of file ciphertext.cpp.

{
return u;
}
arithm::Elmt CipherText::getV ( )

Returns the v attribute, i.e. the right side member.

Definition at line 55 of file ciphertext.cpp.

{
return v;
}
verifierUtils::ByteTree * CipherText::toByteTree ( )

Turns this ciphertext into a node containing the bytetree representations of u and v.

Definition at line 40 of file ciphertext.cpp.

{
result->addChild(u.toByteTree());
result->addChild(v.toByteTree());
return result;
}

Member Data Documentation

arithm::Elmt elGamal::CipherText::u
private

The left hand side of the pair.

Definition at line 36 of file ciphertext.hpp.

arithm::Elmt elGamal::CipherText::v
private

The right hand side of the pair.

Definition at line 41 of file ciphertext.hpp.


The documentation for this class was generated from the following files: