12 #if CRYPTOPP_MSC_VERSION 13 # pragma warning(push) 14 # pragma warning(disable: 4127 4189) 48 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
52 const Integer & GetModulus()
const {
return m_n;}
53 const Integer & GetPublicExponent()
const {
return m_e;}
55 void SetModulus(
const Integer &n) {m_n = n;}
56 void SetPublicExponent(
const Integer &e) {m_e = e;}
58 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 74 {m_n = n; m_e = e; m_p = p; m_q = q; m_u = u;}
82 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
88 const Integer& GetPrime1()
const {
return m_p;}
89 const Integer& GetPrime2()
const {
return m_q;}
90 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
92 void SetPrime1(
const Integer &p) {m_p = p;}
93 void SetPrime2(
const Integer &q) {m_q = q;}
94 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
96 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 106 static std::string StaticAlgorithmName() {
return "LUC";}
112 template <
class STANDARD>
118 template <
class STANDARD,
class H>
141 void SetModulus(
const Integer &v) {m_p = v;}
142 const Integer & GetModulus()
const {
return m_p;}
144 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 157 bool IsInitialized()
const {
return m_g.NotZero();}
159 {CRYPTOPP_UNUSED(group); m_g = base;}
161 {CRYPTOPP_UNUSED(group);
return m_g;}
163 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(maxExpBits); CRYPTOPP_UNUSED(storage);}
165 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);}
167 {CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(storedPrecomputation);}
171 CRYPTOPP_UNUSED(group); CRYPTOPP_UNUSED(exponent); CRYPTOPP_UNUSED(pc2); CRYPTOPP_UNUSED(exponent2);
173 throw NotImplemented(
"DL_BasePrecomputation_LUC: CascadeExponentiate not implemented");
176 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 190 void SimultaneousExponentiate(
Element *results,
const Element &base,
const Integer *exponents,
unsigned int exponentsCount)
const;
193 CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b);
194 throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");
198 CRYPTOPP_UNUSED(element1); CRYPTOPP_UNUSED(exponent1); CRYPTOPP_UNUSED(element2); CRYPTOPP_UNUSED(exponent2);
199 throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");
203 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const 205 return GetValueHelper<DL_GroupParameters_IntegerBased>(
this, name, valueType, pValue).Assignable();
208 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 213 int GetFieldType()
const {
return 2;}
222 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 227 unsigned int GetDefaultSubgroupOrderSize(
unsigned int modulusSize)
const {
return modulusSize-1;}
234 static const char * StaticAlgorithmName() {
return "LUC-HMP";}
240 {
return params.GetGroupOrder().
ByteCount();}
242 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 254 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 261 struct LUC_HMP :
public DL_SS<DL_SignatureKeys_LUC, DL_Algorithm_LUC_HMP, DL_SignatureMessageEncodingMethod_DSA, H>
272 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 278 template <
class COFACTOR_OPTION = NoCofactorMultiplication,
bool DHAES_MODE = true>
282 DL_KeyAgreementAlgorithm_DH<Integer, COFACTOR_OPTION>,
283 DL_KeyDerivationAlgorithm_P1363<Integer, DHAES_MODE, P1363_KDF2<SHA1> >,
284 DL_EncryptionAlgorithm_Xor<HMAC<SHA1>, DHAES_MODE>,
287 static std::string StaticAlgorithmName() {
return "LUC-IES";}
289 #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 301 #if CRYPTOPP_MSC_VERSION 302 # pragma warning(pop) virtual void Precompute(unsigned int precomputationStorage)
Perform precomputation.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Trapdoor Function Based Encryption Scheme.
virtual void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
Converts a typename to an enumerated value.
virtual void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
Discrete Log Based Encryption Scheme.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Interface for private keys.
interface for DL public keys
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Discrete Log Based Signature Scheme.
Classes and functions for secure memory allocations.
Applies the inverse of the trapdoor function.
LUC signature scheme with appendix.
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)
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 AssignFrom(const NameValuePairs &source)
Assign values to this object.
Interface for public keys.
Crypto++ library namespace.
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
number of significant bytes = ceiling(BitCount()/8)
Interface for retrieving values given their names.
A template implementing constructors for public key algorithm classes.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Trapdoor Function Based Signature Scheme.