PALISADE Lattice Crypto Library
1.11.9
A lattice crypto library for software engineers by software engineers.
|
The class for representing vectors of ubint with associated modulo math. More...
#include <mubintvecntl.h>
Public Member Functions | |
myVecP (const size_t length) | |
myVecP (INIT_SIZE_TYPE, const long length) | |
myVecP (const myVecP< myT > &a) | |
myVecP (myVecP< myT > &&a) | |
myVecP (const long n, const myT &q) | |
myVecP (const long n, const myT &q, std::initializer_list< std::string > rhs) | |
myVecP (const long n, const myT &q, std::initializer_list< uint64_t > rhs) | |
myVecP (const myVecP< myT > &a, const myT &q) | |
myVecP (size_t n, const std::string &sq) | |
myVecP (const myVecP< myT > &a, const std::string &sq) | |
myVecP (size_t n, uint64_t q) | |
myVecP (const myVecP< myT > &a, const uint64_t q) | |
myVecP (std::vector< std::string > &s) | |
myVecP (std::vector< std::string > &s, const myT &q) | |
myVecP (std::vector< std::string > &s, const char *sq) | |
myVecP (std::vector< std::string > &s, const uint64_t q) | |
void | clear (myVecP &x) |
const myVecP & | operator= (const myVecP &a) |
const myVecP & | operator= (myVecP &&a) |
const myVecP & | operator= (std::initializer_list< uint64_t > rhs) |
const myVecP & | operator= (std::initializer_list< int32_t > rhs) |
const myVecP & | operator= (std::initializer_list< std::string > rhs) |
const myVecP & | operator= (uint64_t rhs) |
myT & | at (size_t i) |
const myT & | at (size_t i) const |
myT & | operator[] (size_t idx) |
const myT & | operator[] (size_t idx) const |
void | push_back (const myT &a) |
void | SwitchModulus (const myT &newModulus) |
bool | isModulusSet (void) const |
bool | SameModulus (const myVecP &a) const |
void | SetModulus (const uint64_t &value) |
void | SetModulus (const myT &value) |
void | SetModulus (const std::string &value) |
void | SetModulus (const myVecP &value) |
const myT & | GetModulus () const |
int | CopyModulus (const myVecP &rhs) |
size_t | GetLength (void) const |
void | resize (size_t n) |
myVecP | Mod (const myT &b) const |
const myVecP & | ModEq (const myT &b) |
myVecP | ModAdd (const myT &b) const |
const myVecP & | ModAddEq (const myT &b) |
myVecP | ModAddAtIndex (size_t i, const myT &b) const |
const myVecP & | ModAddAtIndexEq (size_t i, const myT &b) |
myVecP | ModAdd (const myVecP &b) const |
const myVecP & | ModAddEq (const myVecP &b) |
void | modadd_p (myVecP &x, const myVecP &a, const myVecP &b) const |
myVecP | ModSub (const myT &b) const |
const myVecP & | ModSubEq (const myT &b) |
myVecP | ModSub (const myVecP &b) const |
const myVecP & | ModSubEq (const myVecP &b) |
void | modsub_p (myVecP &x, const myVecP &a, const myVecP &b) const |
myVecP | ModMul (const myT &b) const |
const myVecP & | ModMulEq (const myT &b) |
myVecP | ModMul (const myVecP &b) const |
const myVecP & | ModMulEq (const myVecP &b) |
void | modmul_p (myVecP &x, const myVecP &a, const myVecP &b) const |
myVecP | ModExp (const myT &b) const |
const myVecP & | ModExpEq (const myT &b) |
myVecP | ModInverse () const |
const myVecP & | ModInverseEq () |
myVecP | ModByTwo () const |
const myVecP & | ModByTwoEq () |
myVecP | MultiplyAndRound (const myT &p, const myT &q) const |
const myVecP & | MultiplyAndRoundEq (const myT &p, const myT &q) |
myVecP | DivideAndRound (const myT &q) const |
const myVecP & | DivideAndRoundEq (const myT &q) |
myVecP | GetDigitAtIndexForBase (size_t index, usint base) const |
template<class Archive > | |
std::enable_if<!cereal::traits::is_text_archive< Archive >::value, void >::type | save (Archive &ar, std::uint32_t const version) const |
template<class Archive > | |
std::enable_if< cereal::traits::is_text_archive< Archive >::value, void >::type | save (Archive &ar, std::uint32_t const version) const |
template<class Archive > | |
std::enable_if<!cereal::traits::is_text_archive< Archive >::value, void >::type | load (Archive &ar, std::uint32_t const version) |
template<class Archive > | |
std::enable_if< cereal::traits::is_text_archive< Archive >::value, void >::type | load (Archive &ar, std::uint32_t const version) |
std::string | SerializedObjectName () const |
Public Member Functions inherited from lbcrypto::BigVectorInterface< myVecP< myT >, myT > | |
const myVecP< myT > & | operator= (const myVecP< myT > &vec) |
const myVecP< myT > & | operator= (myVecP< myT > &&vec) |
const myVecP< myT > & | operator= (std::initializer_list< std::string > strvec) |
const myVecP< myT > & | operator= (std::initializer_list< uint64_t > vec) |
const myVecP< myT > & | operator= (uint64_t val) |
myT & | at (size_t idx) |
const myT & | at (size_t idx) const |
myT & | operator[] (size_t idx) |
const myT & | operator[] (size_t idx) const |
void | SetModulus (const myT &value) |
void | SwitchModulus (const myT &value) |
const myT & | GetModulus () const |
size_t | GetLength () const |
myVecP< myT > | Mod (const myT &modulus) const |
const myVecP< myT > & | ModEq (const myT &modulus) |
myVecP< myT > | ModAdd (const myT &b) const |
myVecP< myT > | ModAdd (const myVecP< myT > &b) const |
const myVecP< myT > & | ModAddEq (const myT &b) |
const myVecP< myT > & | ModAddEq (const myVecP< myT > &b) |
myVecP< myT > | ModAddAtIndex (usint i, const myT &b) const |
const myVecP< myT > & | ModAddAtIndexEq (usint i, const myT &b) |
myVecP< myT > | ModSub (const myT &b) const |
myVecP< myT > | ModSub (const myVecP< myT > &b) const |
const myVecP< myT > & | ModSubEq (const myT &b) |
const myVecP< myT > & | ModSubEq (const myVecP< myT > &b) |
myVecP< myT > | ModMul (const myT &b) const |
myVecP< myT > | ModMul (const myVecP< myT > &b) const |
const myVecP< myT > & | ModMulEq (const myT &b) |
const myVecP< myT > & | ModMulEq (const myVecP< myT > &b) |
myVecP< myT > | ModExp (const myT &b) const |
const myVecP< myT > & | ModExpEq (const myT &b) |
myVecP< myT > | ModInverse () const |
const myVecP< myT > & | ModInverseEq () |
myVecP< myT > | ModByTwo () const |
const myVecP< myT > & | ModByTwoEq () |
myVecP< myT > | MultiplyAndRound (const myT &p, const myT &q) const |
const myVecP< myT > & | MultiplyAndRoundEq (const myT &p, const myT &q) |
myVecP< myT > | DivideAndRound (const myT &q) const |
const myVecP< myT > & | DivideAndRoundEq (const myT &q) |
myVecP< myT > | GetDigitAtIndexForBase (usint index, usint base) const |
Static Public Member Functions | |
static myVecP | Single (const myT &val, const myT &modulus) |
static uint32_t | SerializedVersion () |
Protected Member Functions | |
bool | IndexCheck (size_t index) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const myVecP< myT > &ptr_obj) |
Additional Inherited Members | |
Public Types inherited from lbcrypto::BigVectorInterface< myVecP< myT >, myT > | |
typedef myT | Integer |
The class for representing vectors of ubint with associated modulo math.
myVecP< myT > NTL::myVecP< myT >::DivideAndRound | ( | const myT & | q | ) | const |
Divide and Rounding operation. Returns [x/q] where [] is the rounding operation.
&q | is the denominator to be divided. |
const myVecP< myT > & NTL::myVecP< myT >::DivideAndRoundEq | ( | const myT & | q | ) |
Divide and Rounding operation. Returns [x/q] where [] is the rounding operation. In-place variant.
&q | is the denominator to be divided. |
myVecP< myT > NTL::myVecP< myT >::GetDigitAtIndexForBase | ( | size_t | index, |
usint | base | ||
) | const |
Digit vector at a specific index for all entries for a given number base. Warning: only power-of-2 bases are currently supported. Example: for vector (83, 1, 45), index 2 and base 4 we have:
index:0,1,2,3
|83| |3,0,1,1| |1| |1 | –base 4 decomposition–> |1,0,0,0| –at index 2–> |0| |45| |1,3,2,0| |2|
The return vector is (1,0,2)
index | is the index to return the digit from in all entries. |
base | is the base to use for the operation. |
myVecP< myT > NTL::myVecP< myT >::Mod | ( | const myT & | b | ) | const |
Vector modulus operator.
&modulus | is the modulus to perform on the current vector entries. |
|
inline |
Scalar-to-vector modulus addition operation.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus addition.
&b | is the vector to perform operation with. |
|
inline |
procedural version for the vector component wise modulus addition operation.
myVecP< myT > NTL::myVecP< myT >::ModAddAtIndex | ( | size_t | i, |
const myT & | b | ||
) | const |
Scalar modulus addition at a particular index.
i | is the index of the entry to add. |
&b | is the scalar to add. |
const myVecP< myT > & NTL::myVecP< myT >::ModAddAtIndexEq | ( | size_t | i, |
const myT & | b | ||
) |
Scalar modulus addition at a particular index. In-place variant.
i | is the index of the entry to add. |
&b | is the scalar to add. |
|
inline |
Scalar-to-vector modulus addition operation. In-place variant.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus addition. In-place variant.
&b | is the vector to perform operation with. |
myVecP< myT > NTL::myVecP< myT >::ModByTwo | ( | ) | const |
Modulus 2 operation, also a least significant bit.
const myVecP< myT > & NTL::myVecP< myT >::ModByTwoEq | ( | ) |
Modulus 2 operation, also a least significant bit. In-place variant.
const myVecP< myT > & NTL::myVecP< myT >::ModEq | ( | const myT & | b | ) |
Vector modulus operator. In-place variant.
&modulus | is the modulus to perform on the current vector entries. |
myVecP< myT > NTL::myVecP< myT >::ModExp | ( | const myT & | b | ) | const |
Scalar modulus exponentiation operation.
&b | is the scalar to perform operation with. |
const myVecP< myT > & NTL::myVecP< myT >::ModExpEq | ( | const myT & | b | ) |
Scalar modulus exponentiation operation. In-place variant.
&b | is the scalar to perform operation with. |
myVecP< myT > NTL::myVecP< myT >::ModInverse | ( | void | ) | const |
Modulus inverse operation.
const myVecP< myT > & NTL::myVecP< myT >::ModInverseEq | ( | void | ) |
Modulus inverse operation. In-place variant.
|
inline |
Scalar-to-vector modulus multiplication operation.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus multiplication.
&b | is the vector to perform operation with. |
|
inline |
procedural version for the vector component wise modulus multiplication operation.
|
inline |
Scalar-to-vector modulus multiplication operation. In-place variant.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus multiplication. In-place variant.
&b | is the vector to perform operation with. |
|
inline |
Scalar-from-vector modulus subtraction operation.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus subtraction.
&b | is the vector to perform operation with. |
void NTL::myVecP< myT >::modsub_p | ( | myVecP< myT > & | x, |
const myVecP< myT > & | a, | ||
const myVecP< myT > & | b | ||
) | const |
procedural version for the vector component wise modulus subtraction operation.
|
inline |
Scalar-from-vector modulus subtraction operation. In-place variant.
&b | is the scalar to perform operation with. |
|
inline |
Vector component wise modulus subtraction. In-place variant.
&b | is the vector to perform operation with. |
myVecP< myT > NTL::myVecP< myT >::MultiplyAndRound | ( | const myT & | p, |
const myT & | q | ||
) | const |
Multiply and Rounding operation. Returns [x*p/q] where [] is the rounding operation.
&p | is the numerator to be multiplied. |
&q | is the denominator to be divided. |
const myVecP< myT > & NTL::myVecP< myT >::MultiplyAndRoundEq | ( | const myT & | p, |
const myT & | q | ||
) |
Multiply and Rounding operation. Returns [x*p/q] where [] is the rounding operation. In-place variant.
&p | is the numerator to be multiplied. |
&q | is the denominator to be divided. |
|
friend |
ostream operator to output vector values to console
os | is the std ostream object. |
&ptr_obj | is the BigVectorImpl object to be printed. |