Implements a CipherGroup, i.e. the cartesian product of two Groups. El-Gamal operations are implemented here. More...
#include <ciphergroup.hpp>
Public Member Functions | |
CipherGroup (arithm::Group *group) | |
Builds a CipherGroup from a group in which computations will be made. | |
arithm::Group * | getGrp () |
Returns the group in which the computations are made. | |
CipherText | getCipherText (verifierUtils::ByteTree *bt) |
Returns a CipherText from this group built from a bytetree. | |
ArrayOfCiphers | getArrayOfCiphers (verifierUtils::ByteTree *bt) |
Returns an ArrayOfCiphers from this group built from a bytetree. | |
Encryption/decryption | |
CipherText | enc (arithm::Elmt y, arithm::Elmt m, arithm::Elmt s) |
Let grp->getGenerator() be g then returns ![]() | |
arithm::Elmt | dec (arithm::Elmt x, CipherText uv) |
Let uv be ![]() ![]() | |
arithm::Elmt | pdec (arithm::Elmt xl, CipherText uv) |
Let uv be ![]() ![]() | |
arithm::ArrayOfElmts | pdec (arithm::Elmt xl, ArrayOfCiphers uv) |
Applies pdec component-wise on an array of cipher text using a fixed public key. | |
arithm::Elmt | tdec (CipherText uv, arithm::Elmt f) |
Let uv be ![]() ![]() | |
arithm::ArrayOfElmts | tdec (ArrayOfCiphers uv, arithm::ArrayOfElmts f) |
Applies tdec component-wise on an array of cipher texts and an array of decryption factors (i.e. group elements). | |
Group operations | |
CipherText | exponentiation (CipherText c, arithm::Elmt s) |
Componentwise exponentiation of a ciphertext. | |
CipherText | multiplication (CipherText c1, CipherText c2) |
Componentwise multiplication of a ciphertext. | |
ArrayOfCiphers | exponentiation (ArrayOfCiphers c, arithm::ArrayOfElmts s) |
Componentwise exponentiation of an array of ciphertext. | |
CipherText | expProduct (ArrayOfCiphers c, arithm::ArrayOfElmts s) |
Componentwise call to Group::expProduct(). | |
bool | compare (CipherText c1, CipherText c2) |
Returns true if c1 and c2 are identical, false otherwise. | |
bool | compare (ArrayOfCiphers c1, ArrayOfCiphers c2) |
Returns true if c1 and c2 contain strictly identical ciphertexts, false otherwise. |
Private Attributes | |
arithm::Group * | grp |
The group in which computations are made. |
Implements a CipherGroup, i.e. the cartesian product of two Groups. El-Gamal operations are implemented here.
Definition at line 28 of file ciphergroup.hpp.
CipherGroup::CipherGroup | ( | arithm::Group * | group | ) |
Builds a CipherGroup from a group in which computations will be made.
Definition at line 20 of file ciphergroup.cpp.
bool CipherGroup::compare | ( | CipherText | c1, |
CipherText | c2 | ||
) |
bool CipherGroup::compare | ( | ArrayOfCiphers | c1, |
ArrayOfCiphers | c2 | ||
) |
Returns true if c1 and c2 contain strictly identical ciphertexts, false otherwise.
Definition at line 138 of file ciphergroup.cpp.
arithm::Elmt CipherGroup::dec | ( | arithm::Elmt | x, |
CipherText | uv | ||
) |
Let uv be . Then returns
.
Definition at line 58 of file ciphergroup.cpp.
CipherText CipherGroup::enc | ( | arithm::Elmt | y, |
arithm::Elmt | m, | ||
arithm::Elmt | s | ||
) |
Let grp->getGenerator() be g then returns .
Definition at line 49 of file ciphergroup.cpp.
CipherText CipherGroup::exponentiation | ( | CipherText | c, |
arithm::Elmt | s | ||
) |
Componentwise exponentiation of a ciphertext.
Definition at line 100 of file ciphergroup.cpp.
ArrayOfCiphers CipherGroup::exponentiation | ( | ArrayOfCiphers | c, |
arithm::ArrayOfElmts | s | ||
) |
Componentwise exponentiation of an array of ciphertext.
Definition at line 115 of file ciphergroup.cpp.
CipherText CipherGroup::expProduct | ( | ArrayOfCiphers | c, |
arithm::ArrayOfElmts | s | ||
) |
Componentwise call to Group::expProduct().
Definition at line 123 of file ciphergroup.cpp.
ArrayOfCiphers CipherGroup::getArrayOfCiphers | ( | verifierUtils::ByteTree * | bt | ) |
Returns an ArrayOfCiphers from this group built from a bytetree.
Definition at line 38 of file ciphergroup.cpp.
CipherText CipherGroup::getCipherText | ( | verifierUtils::ByteTree * | bt | ) |
Returns a CipherText from this group built from a bytetree.
Definition at line 32 of file ciphergroup.cpp.
arithm::Group * CipherGroup::getGrp | ( | ) |
Returns the group in which the computations are made.
Definition at line 26 of file ciphergroup.cpp.
CipherText CipherGroup::multiplication | ( | CipherText | c1, |
CipherText | c2 | ||
) |
arithm::Elmt CipherGroup::pdec | ( | arithm::Elmt | xl, |
CipherText | uv | ||
) |
Let uv be . Then returns
.
Definition at line 66 of file ciphergroup.cpp.
arithm::ArrayOfElmts CipherGroup::pdec | ( | arithm::Elmt | xl, |
ArrayOfCiphers | uv | ||
) |
Applies pdec component-wise on an array of cipher text using a fixed public key.
Definition at line 72 of file ciphergroup.cpp.
arithm::Elmt CipherGroup::tdec | ( | CipherText | uv, |
arithm::Elmt | f | ||
) |
Let uv be . The returns
.
Definition at line 81 of file ciphergroup.cpp.
arithm::ArrayOfElmts CipherGroup::tdec | ( | ArrayOfCiphers | uv, |
arithm::ArrayOfElmts | f | ||
) |
Applies tdec component-wise on an array of cipher texts and an array of decryption factors (i.e. group elements).
Definition at line 87 of file ciphergroup.cpp.
|
private |
The group in which computations are made.
Definition at line 34 of file ciphergroup.hpp.