14 NAMESPACE_BEGIN(CryptoPP)
34 Integer PreimageBound()
const {
return m_n;}
35 Integer ImageBound()
const {
return m_n;}
38 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
42 const Integer & GetModulus()
const {
return m_n;}
43 const Integer & GetPublicExponent()
const {
return m_e;}
45 void SetModulus(
const Integer &n) {m_n = n;}
46 void SetPublicExponent(
const Integer &e) {m_e = e;}
60 {m_n = n; m_e = e; m_p = p; m_q = q; m_u = u;}
68 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
74 const Integer& GetPrime1()
const {
return m_p;}
75 const Integer& GetPrime2()
const {
return m_q;}
76 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
78 void SetPrime1(
const Integer &p) {m_p = p;}
79 void SetPrime2(
const Integer &q) {m_q = q;}
80 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
88 static std::string StaticAlgorithmName() {
return "LUC";}
94 template <
class STANDARD>
100 template <
class STANDARD,
class H>
123 void SetModulus(
const Integer &v) {m_p = v;}
124 const Integer & GetModulus()
const {
return m_p;}
135 bool IsInitialized()
const {
return m_g.NotZero();}
143 {
throw NotImplemented(
"DL_BasePrecomputation_LUC: CascadeExponentiate not implemented");}
155 void SimultaneousExponentiate(
Element *results,
const Element &base,
const Integer *exponents,
unsigned int exponentsCount)
const;
157 {
throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");}
159 {
throw NotImplemented(
"LUC_GroupParameters: MultiplyElements can not be implemented");}
162 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const
164 return GetValueHelper<DL_GroupParameters_IntegerBased>(
this, name, valueType, pValue).Assignable();
168 int GetFieldType()
const {
return 2;}
178 unsigned int GetDefaultSubgroupOrderSize(
unsigned int modulusSize)
const {
return modulusSize-1;}
185 static const char * StaticAlgorithmName() {
return "LUC-HMP";}
191 {
return params.GetGroupOrder().
ByteCount();}
204 struct LUC_HMP :
public DL_SS<DL_SignatureKeys_LUC, DL_Algorithm_LUC_HMP, DL_SignatureMessageEncodingMethod_DSA, H>
217 template <
class COFACTOR_OPTION = NoCofactorMultiplication,
bool DHAES_MODE = true>
221 DL_KeyAgreementAlgorithm_DH<Integer, COFACTOR_OPTION>,
222 DL_KeyDerivationAlgorithm_P1363<Integer, DHAES_MODE, P1363_KDF2<SHA1> >,
223 DL_EncryptionAlgorithm_Xor<HMAC<SHA1>, DHAES_MODE>,
226 static std::string StaticAlgorithmName() {
return "LUC-IES";}
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Discrete Log Based Signature Scheme.
interface for random number generators
static const Integer & Two()
avoid calling constructors for these frequently used integers
Discrete Log Based Encryption Scheme.
interface for private keys
interface for DL public keys
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 ...
LUC signature scheme with appendix.
exception thrown by a class if a non-implemented method is called
interface for Elgamal-like signature algorithms
multiple precision integer and basic arithmetics
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 DEREncode(BufferedTransformation &bt) const
encode using Distinguished Encoding Rules, put result into a BufferedTransformation object ...
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 from source to this object
Trapdoor Function Based Signature Scheme.
interface for public keys
Trapdoor Function Based Encryption Scheme.
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