#include <rabin.h>
Inheritance diagram for InvertibleRabinFunction:
Definition at line 46 of file rabin.h.
Public Member Functions | |
void | Initialize (const Integer &n, const Integer &r, const Integer &s, const Integer &p, const Integer &q, const Integer &u) |
void | Initialize (RandomNumberGenerator &rng, unsigned int keybits) |
void | BERDecode (BufferedTransformation &bt) |
void | DEREncode (BufferedTransformation &bt) const |
Integer | CalculateInverse (RandomNumberGenerator &rng, const Integer &x) const |
bool | Validate (RandomNumberGenerator &rng, unsigned int level) const |
check this object for errors | |
bool | GetVoidValue (const char *name, const std::type_info &valueType, void *pValue) const |
to be implemented by derived classes, users should use one of the above functions instead | |
void | AssignFrom (const NameValuePairs &source) |
assign values from source to this object | |
void | GenerateRandom (RandomNumberGenerator &rng, const NameValuePairs &alg) |
const Integer & | GetPrime1 () const |
const Integer & | GetPrime2 () const |
const Integer & | GetMultiplicativeInverseOfPrime2ModPrime1 () const |
void | SetPrime1 (const Integer &p) |
void | SetPrime2 (const Integer &q) |
void | SetMultiplicativeInverseOfPrime2ModPrime1 (const Integer &u) |
void | Initialize (const Integer &n, const Integer &r, const Integer &s) |
Integer | ApplyFunction (const Integer &x) const |
Integer | PreimageBound () const |
Integer | ImageBound () const |
const Integer & | GetModulus () const |
const Integer & | GetQuadraticResidueModPrime1 () const |
const Integer & | GetQuadraticResidueModPrime2 () const |
void | SetModulus (const Integer &n) |
void | SetQuadraticResidueModPrime1 (const Integer &r) |
void | SetQuadraticResidueModPrime2 (const Integer &s) |
Integer | ApplyRandomizedFunction (RandomNumberGenerator &rng, const Integer &x) const |
bool | IsRandomized () const |
virtual Integer | MaxPreimage () const |
virtual Integer | MaxImage () const |
Integer | CalculateRandomizedInverse (RandomNumberGenerator &rng, const Integer &x) const |
bool | IsRandomized () const |
Protected Attributes | |
Integer | m_p |
Integer | m_q |
Integer | m_u |
Integer | m_n |
Integer | m_r |
Integer | m_s |
bool InvertibleRabinFunction::Validate | ( | RandomNumberGenerator & | rng, | |
unsigned int | level | |||
) | const [virtual] |
check this object for errors
level | denotes the level of thoroughness: 0 - using this object won't cause a crash or exception (rng is ignored) 1 - this object will probably function (encrypt, sign, etc.) correctly (but may not check for weak keys and such) 2 - make sure this object will function correctly, and do reasonable security checks 3 - do checks that may take a long time |
Reimplemented from RabinFunction.
Definition at line 183 of file rabin.cpp.
References Integer::IsPositive(), RabinFunction::m_n, m_p, m_q, RabinFunction::m_r, RabinFunction::m_s, m_u, Integer::One(), and RabinFunction::Validate().
void InvertibleRabinFunction::AssignFrom | ( | const NameValuePairs & | source | ) | [virtual] |
assign values from source to this object
Reimplemented from RabinFunction.
void InvertibleRabinFunction::GenerateRandom | ( | RandomNumberGenerator & | rng, | |
const NameValuePairs & | alg | |||
) | [virtual] |
parameters: (ModulusSize)
Reimplemented from GeneratableCryptoMaterial.
Definition at line 75 of file rabin.cpp.
References Integer::GenerateRandom(), NameValuePairs::GetIntValue(), Integer::InverseMod(), RabinFunction::m_n, m_p, m_q, RabinFunction::m_r, RabinFunction::m_s, and m_u.