13 #if CRYPTOPP_MSC_VERSION
14 # pragma warning(push)
15 # pragma warning(disable: 4127 4189)
25 NAMESPACE_BEGIN(CryptoPP)
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
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)
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Trapdoor Function (TF) encryption scheme.
bool NotZero() const
Determines if the Integer is non-0.
Converts a typename to an enumerated value.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
Discrete Log (DL) encryption scheme.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Classes for performing mathematics over different fields.
Interface for private keys.
bool IsIdentity(const Integer &element) const
Determines if an element is an identity.
Interface for Discrete Log (DL) public keys.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Discrete Log (DL) signature scheme.
Classes and functions for secure memory allocations.
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
Applies the inverse of the trapdoor function.
LUC signature scheme with appendix.
Classes for PKCS padding schemes.
A method was called which was not implemented.
Interface for Elgamal-like signature algorithms.
Classes for Diffie-Hellman key exchange.
Multiple precision integer with arithmetic operations.
static const Integer & Two()
Integer representing 2.
Applies the trapdoor function.
Implementation of schemes based on DL over GF(p)
#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.
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
LUC-HMP, based on "Digital signature schemes based on Lucas functions" by Patrick Horster...
DL private key (in GF(p) groups)
void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const
Exponentiates a base to multiple exponents.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
Multiple precision integer with arithmetic operations.
Interface for public keys.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
DH_Domain< DL_GroupParameters_LUC_DefaultSafePrime > LUC_DH
LUC-DH.
unsigned int ByteCount() const
Determines the number of bytes required to represent the Integer.
virtual Integer GetGroupOrder() const
Retrieves the order of the group.
Interface for retrieving values given their names.
Template implementing constructors for public key algorithm classes.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Trapdoor Function (TF) Signature Scheme.