linbox
|
extend Wrapper of ZZ_p from NTL. More...
#include <PIR-ntl-ZZ_p.h>
Public Member Functions | |
Element & | init (Element &x, const NTL::ZZ &y) const |
Specialization for NTL::ZZ. More... | |
NTL::ZZ & | convert (NTL::ZZ &x, const Element &y) const |
Specialization for NTL::ZZ. More... | |
integer & | convert (integer &x, const Element &y) const |
Conversion of field element to an integer. More... | |
integer & | cardinality (integer &c) const |
Cardinality. More... | |
integer & | characteristic (integer &c) const |
Characteristic. More... | |
Element & | inv (Element &x, const Element &y) const |
Multiplicative Inverse. More... | |
bool | isZero (const Element &x) const |
Zero equality. More... | |
bool | isOne (const Element &x) const |
One equality. More... | |
Element & | invin (Element &x) const |
Inplace Multiplicative Inverse. More... | |
std::ostream & | write (std::ostream &os) const |
Print field. More... | |
std::ostream & | write (std::ostream &os, const Element &x) const |
Print field. More... | |
Static Public Member Functions | |
template<class Element2 > | |
static Element & | init (Element &x, const Element2 &y) |
Init x from y. | |
static Element & | init (Element &x, const Element &y) |
Init from a NTL::ZZ_p. | |
static Element & | init (Element &x, const integer &y) |
I don't know how to init from integer. | |
static integer & | convert (integer &x, const Element &y) |
Convert y to an Element. | |
static Element & | assign (Element &x, const Element &y) |
x = y. | |
static bool | areEqual (const Element &x, const Element &y) |
Test if x == y. | |
static bool | isZero (const Element &x) |
Test if x == 0. | |
static bool | isOne (const Element &x) |
Test if x == 1. | |
static Element & | add (Element &x, const Element &y, const Element &z) |
return x = y + z | |
static Element & | sub (Element &x, const Element &y, const Element &z) |
return x = y - z | |
template<class Int > | |
static Element & | mul (Element &x, const Element &y, const Int &z) |
return x = y * z | |
static Element & | div (Element &x, const Element &y, const Element &z) |
If exists a, such that a * z =y, return x = one of them. More... | |
static Element & | inv (Element &x, const Element &y) |
If y is a unit, return x = 1 / y, otherwsie, throw an exception. | |
static Element & | neg (Element &x, const Element &y) |
return x = -y; | |
template<class Int > | |
static Element & | axpy (Element &r, const Element &a, const Int &x, const Element &y) |
return r = a x + y | |
static Element & | addin (Element &x, const Element &y) |
return x += y; | |
static Element & | subin (Element &x, const Element &y) |
return x -= y; | |
template<class Int > | |
static Element & | mulin (Element &x, const Int &y) |
return x *= y; | |
static Element & | divin (Element &x, const Element &y) |
If y divides x, return x /= y, otherwise throw an exception. | |
static Element & | invin (Element &x) |
If x is a unit, x = 1 / x, otherwise, throw an exception. | |
static Element & | negin (Element &x) |
return x = -x; | |
template<class Int > | |
static Element & | axpyin (Element &r, const Element &a, const Int &x) |
return r += a x | |
static std::ostream & | write (std::ostream &out, const Element &y) |
out << y; | |
static std::istream & | read (std::istream &in, Element &x) |
read x from istream in | |
static bool | isUnit (const Element &x) |
some PIR function More... | |
static Element & | gcd (Element &g, const Element &a, const Element &b) |
return g = gcd (a, b) | |
static Element & | gcdin (Element &g, const Element &b) |
return g = gcd (g, b) | |
static Element & | xgcd (Element &g, Element &s, Element &t, const Element &a, const Element &b) |
g = gcd(a, b) = a*s + b*t. More... | |
static Element & | dxgcd (Element &g, Element &s, Element &t, Element &a1, Element &b1, const Element &a, const Element &b) |
g = gcd(a, b) = a*s + b*t. More... | |
static bool | isDivisor (const Element &a, const Element &b) |
Test if a | b. | |
static Element & | normal (Element &a, const Element &b) |
a = normalization of b. | |
extend Wrapper of ZZ_p from NTL.
Add PIR functions
|
inlinestatic |
If exists a, such that a * z =y, return x = one of them.
Otherwise, throw an exception
|
inlinestatic |
some PIR function
Test if x is a unit.
|
inlinestatic |
g = gcd(a, b) = a*s + b*t.
and gcd (s, t) is a unit.
|
inlinestatic |
g = gcd(a, b) = a*s + b*t.
and gcd (s, t) is a unit. s * a1 + t * b1 = a unit.
|
inlineinherited |
Specialization for NTL::ZZ.
x | field element to contain output (reference returned) |
y | NTL::ZZ. |
|
inlineinherited |
Specialization for NTL::ZZ.
x | NTL::ZZ to contain output (reference returned). |
y | constant reference to field element. |
Conversion of field element to an integer.
This function assumes the output field element x has already been constructed, but that it is not already initialized. This done by converting to a std::string : inefficient but correct.
x | reference to integer to contain output (reference returned). |
y | constant reference to field element. |
Cardinality.
Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.
Characteristic.
Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.
|
inlineinherited |
Multiplicative Inverse.
x = 1 / y This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
y | field element. |
|
inlineinherited |
Zero equality.
Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.
x | field element. |
|
inlineinherited |
One equality.
Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.
x | field element. |
|
inlineinherited |
Inplace Multiplicative Inverse.
x = 1 / x This function assumes both field elements have already been constructed and initialized.
x | field element (reference returned). |
|
inlineinherited |
Print field.
os | output stream to which field is written. |
|
inlineinherited |
Print field.
os | output stream to which field is written. |
x |