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;
191 Element MultiplyElements(
const Element &a,
const Element &b)
const 193 CRYPTOPP_UNUSED(a); CRYPTOPP_UNUSED(b);
194 throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");
196 Element CascadeExponentiate(
const Element &element1,
const Integer &exponent1,
const Element &element2,
const Integer &exponent2)
const 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.
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
virtual void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
Converts a typename to an enumerated value.
Abstract base classes that provide a uniform interface to this library.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Interface for random number generators.
Discrete Log Based Encryption Scheme.
Interface for private keys.
interface for DL public keys
Discrete Log Based Signature Scheme.
unsigned int ByteCount() const
number of significant bytes = ceiling(BitCount()/8)
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 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-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.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
virtual void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
DH_Domain< DL_GroupParameters_LUC_DefaultSafePrime > LUC_DH
LUC-DH.
Interface for retrieving values given their names.
A template implementing constructors for public key algorithm classes.
Trapdoor Function Based Signature Scheme.