Crypto++
5.6.5
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
13 #if CRYPTOPP_MSC_VERSION
14 # pragma warning(push)
15 # pragma warning(disable: 4127 4189)
49 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
53 const Integer & GetModulus()
const {
return m_n;}
54 const Integer & GetPublicExponent()
const {
return m_e;}
56 void SetModulus(
const Integer &n) {m_n = n;}
57 void SetPublicExponent(
const Integer &e) {m_e = e;}
59 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
75 {m_n = n; m_e = e; m_p = p; m_q = q; m_u = u;}
83 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
89 const Integer& GetPrime1()
const {
return m_p;}
90 const Integer& GetPrime2()
const {
return m_q;}
91 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
93 void SetPrime1(
const Integer &p) {m_p = p;}
94 void SetPrime2(
const Integer &q) {m_q = q;}
95 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
97 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
107 static std::string StaticAlgorithmName() {
return "LUC";}
113 template <
class STANDARD>
119 template <
class STANDARD,
class H>
142 void SetModulus(
const Integer &v) {m_p = v;}
143 const Integer & GetModulus()
const {
return m_p;}
145 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
158 bool IsInitialized()
const {
return m_g.
NotZero();}
160 {CRYPTOPP_UNUSED(group); m_g = base;}
162 {CRYPTOPP_UNUSED(group);
return m_g;}
164 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(maxExpBits); CRYPTOPP_UNUSED(storage);}
166 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);}
168 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);}
172 CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(exponent); CRYPTOPP_UNUSED(pc2); CRYPTOPP_UNUSED(exponent2);
174 throw NotImplemented(
"DL_BasePrecomputation_LUC: CascadeExponentiate not implemented");
177 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
191 void SimultaneousExponentiate(Element *results,
const Element &base,
const Integer *exponents,
unsigned int exponentsCount)
const;
192 Element MultiplyElements(
const Element &a,
const Element &b)
const
194 CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b);
195 throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");
197 Element CascadeExponentiate(
const Element &element1,
const Integer &exponent1,
const Element &element2,
const Integer &exponent2)
const
199 CRYPTOPP_UNUSED(element1); CRYPTOPP_UNUSED(exponent1); CRYPTOPP_UNUSED(element2); CRYPTOPP_UNUSED(exponent2);
200 throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");
204 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const
206 return GetValueHelper<DL_GroupParameters_IntegerBased>(
this, name, valueType, pValue).Assignable();
209 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
214 int GetFieldType()
const {
return 2;}
223 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
228 unsigned int GetDefaultSubgroupOrderSize(
unsigned int modulusSize)
const {
return modulusSize-1;}
235 CRYPTOPP_CONSTEXPR
static const char *StaticAlgorithmName() {
return "LUC-HMP";}
243 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
255 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
262 struct LUC_HMP :
public DL_SS<DL_SignatureKeys_LUC, DL_Algorithm_LUC_HMP, DL_SignatureMessageEncodingMethod_DSA, H>
273 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
279 template <
class COFACTOR_OPTION = NoCofactorMultiplication,
bool DHAES_MODE = true>
283 DL_KeyAgreementAlgorithm_DH<Integer, COFACTOR_OPTION>,
284 DL_KeyDerivationAlgorithm_P1363<Integer, DHAES_MODE, P1363_KDF2<SHA1> >,
285 DL_EncryptionAlgorithm_Xor<HMAC<SHA1>, DHAES_MODE>,
288 static std::string StaticAlgorithmName() {
return "LUC-IES";}
290 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
302 #if CRYPTOPP_MSC_VERSION
303 # pragma warning(pop)
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
Interface for private keys.
Converts a typename to an enumerated value.
A method was called which was not implemented.
virtual Integer GetGroupOrder() const
Retrieves the order of the group.
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
bool NotZero() const
Determines if the Integer is non-0.
Discrete Log (DL) encryption scheme.
Applies the trapdoor function.
Discrete Log (DL) signature scheme.
Classes and functions for secure memory allocations.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Classes for Diffie-Hellman key exchange.
Classes for PKCS padding schemes.
Interface for random number generators.
DL private key (in GF(p) groups)
unsigned int ByteCount() const
Determines the number of bytes required to represent the Integer.
bool IsIdentity(const Integer &element) const
Determines if an element is an identity.
DH_Domain< DL_GroupParameters_LUC_DefaultSafePrime > LUC_DH
LUC-DH.
Interface for Elgamal-like signature algorithms.
Interface for public keys.
Applies the inverse of the trapdoor function.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
LUC signature scheme with appendix.
LUC-HMP, based on "Digital signature schemes based on Lucas functions" by Patrick Horster,...
Classes for performing mathematics over different fields.
Crypto++ library namespace.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Interface for Discrete Log (DL) public keys.
static const Integer & Two()
Integer representing 2.
Trapdoor Function (TF) Signature Scheme.
Trapdoor Function (TF) encryption scheme.
Template implementing constructors for public key algorithm classes.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
Multiple precision integer with arithmetic operations.
Multiple precision integer with arithmetic operations.