Implements a modular field
(i.e. where
is prime).
More...
#include <modfield.hpp>
Inheritance diagram for arithm::ModField:
Collaboration diagram for arithm::ModField:Public Member Functions | |
| ModField (mpz_class order) | |
| Assumes assigns addOrder to order; assumes it is prime and thus assigns multOrder to addOrder-1. Generator gets assigned to 2. | |
| Elmt | multiplication (Elmt e1, Elmt e2) |
| Returns the product of the two elements as an element of this group. | |
| Elmt | multInverse (Elmt e) |
Returns as an element of this group. | |
| Elmt | exponentiation (Elmt e, Elmt s) |
Returns the as an element of this group. | |
| Elmt | addition (Elmt e1, Elmt e2) |
Returns as an element of this field. | |
| Elmt | addInverse (Elmt e) |
Returns as an element of the field. | |
| std::string | getType () |
| Returns a string containing the name of this Group. | |
Public Member Functions inherited from arithm::Field | |
| Field (mpz_class aOrder) | |
| Constructs a Field instance by setting only the value of addOrder, generator and multOrder being set to 1 and 0. | |
| Field (mpz_class aOrder, mpz_class mOrder, mpz_class gen) | |
| Constructs a Field instance by setting the values of addOrder, multOrder and generator. | |
| ArrayOfElmts | addition (ArrayOfElmts e1, ArrayOfElmts e2) |
Returns . If the sizes mismatch, exits with exitcode 1. | |
| ArrayOfElmts | addInverse (ArrayOfElmts a) |
Returns as an array of elements of this field. | |
| Elmt | sum (ArrayOfElmts a) |
Returns as an element of this field. | |
| Elmt | getZero () |
| Returns the neutral element for addition. | |
| ArrayOfElmts | getZero (unsigned int n) |
| Returns an array of field elements containging n copies of the neutral element for addition. | |
| mpz_class | getAddOrder () |
| unsigned int | getLeafSize () |
| Returns the byte size the leaves representing element of this group must have. | |
Public Member Functions inherited from arithm::Group | |
| Group (mpz_class order, mpz_class gen) | |
| Sets the attributes of a new group instance. | |
| virtual verifierUtils::ByteTree * | toByteTree () |
| Returns the bytetree representation of this group. | |
| bool | compare (Elmt e1, Elmt e2) |
| Returns true if e1 and e2 have identical values, false otherwise. | |
| ArrayOfElmts | multiplication (ArrayOfElmts e1, ArrayOfElmts e2) |
Returns as an array of elements of this group. | |
| ArrayOfElmts | multInverse (ArrayOfElmts e) |
Returns as an array of elements of this group. | |
| ArrayOfElmts | exponentiation (ArrayOfElmts e, ArrayOfElmts s) |
Returns as an array of elements of this group. | |
| Elmt | product (ArrayOfElmts e) |
Returns as an element of this group. | |
| Elmt | expProduct (ArrayOfElmts e, ArrayOfElmts s) |
Returns as an element of this group. | |
| bool | compare (ArrayOfElmts e1, ArrayOfElmts e2) |
| Returns true if e1 and e2 have identical values component-wise, false if at least one of the component is different. | |
| virtual Elmt | encode (std::vector< uint8_t > message) |
| Encodes the message into a element of this group. | |
| virtual std::vector< uint8_t > | decode (Elmt e) |
| Returns the element encoded in the element given as a paramater. | |
| Elmt | getOne () |
| Returns an element containing the unit of this group. | |
| ArrayOfElmts | getOne (unsigned int n) |
| Returns an array containing n copies of the unit of this group. | |
| Elmt | getElmt (mpz_class repr) |
| Returns the element of this group which has repr as a representative. | |
| Elmt | getElmt (verifierUtils::ByteTree *bt) |
| Returns the element of this group which bt as a bytetree representation. | |
| ArrayOfElmts | getArray (verifierUtils::ByteTree *bt) |
| Returns the array of elements of this group which has bt as a bytetree representation. | |
| virtual ArrayOfElmts | getRandArray (cryptoTools::PRG *prg, unsigned int nr, unsigned int n0) |
| Returns an array of elements of size n0 derived using a prg. | |
| mpz_class | getMultOrder () |
| Returns the multiplicative generator of this group. | |
| Elmt | getGenerator () |
| Returns the multiplicative generator of this group as an element of this group. | |
| ArrayOfElmts | getGenerator (unsigned int n) |
| Returns an array containing n copies of the multiplicative order of this group. | |
| virtual bool | isIn (mpz_class repr) |
| Returns true if the element of representative repr is in this group. | |
Additional Inherited Members | |
Protected Attributes inherited from arithm::Field | |
| mpz_class | addOrder |
| The additive order (characteristic) of the field. | |
Implements a modular field
(i.e. where
is prime).
Definition at line 25 of file modfield.hpp.
| ModField::ModField | ( | mpz_class | order | ) |
Assumes assigns addOrder to order; assumes it is prime and thus assigns multOrder to addOrder-1. Generator gets assigned to 2.
Definition at line 18 of file modfield.cpp.
Returns
as an element of the field.
Reimplemented from arithm::Field.
Definition at line 59 of file modfield.cpp.
Returns
as an element of this field.
Reimplemented from arithm::Field.
Definition at line 53 of file modfield.cpp.
Returns the
as an element of this group.
Reimplemented from arithm::Group.
Definition at line 42 of file modfield.cpp.
|
virtual |
Returns a string containing the name of this Group.
Reimplemented from arithm::Field.
Definition at line 65 of file modfield.cpp.
Returns
as an element of this group.
Reimplemented from arithm::Group.
Definition at line 32 of file modfield.cpp.
Returns the product of the two elements as an element of this group.
Reimplemented from arithm::Group.
Definition at line 26 of file modfield.cpp.