From 538de80a91da74598ba2449fbbec6de37376a4ce Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 20 Mar 2003 01:24:12 +0000 Subject: various changes for 5.1 --- luc.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'luc.h') diff --git a/luc.h b/luc.h index 34e76cec..e88d0251 100644 --- a/luc.h +++ b/luc.h @@ -13,7 +13,12 @@ NAMESPACE_BEGIN(CryptoPP) -//! . +//! The LUC function. +/*! This class is here for historical and pedagogical interest. It has no + practical advantages over other trapdoor functions and probably shouldn't + be used in production software. The discrete log based LUC schemes + defined later in this .h file may be of more practical interest. +*/ class LUCFunction : public TrapdoorFunction, public PublicKey { typedef LUCFunction ThisClass; @@ -57,7 +62,7 @@ public: void BERDecode(BufferedTransformation &bt); void DEREncode(BufferedTransformation &bt) const; - Integer CalculateInverse(const Integer &x) const; + Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const; bool Validate(RandomNumberGenerator &rng, unsigned int level) const; bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const; @@ -92,8 +97,8 @@ struct LUCES : public TF_ES }; //! LUC signature scheme with appendix -template -struct LUCSSA : public TF_SSA +template +struct LUCSS : public TF_SS { }; @@ -101,8 +106,8 @@ struct LUCSSA : public TF_SSA typedef LUCES >::Decryptor LUCES_OAEP_SHA_Decryptor; typedef LUCES >::Encryptor LUCES_OAEP_SHA_Encryptor; -typedef LUCSSA::Signer LUCSSA_PKCS1v15_SHA_Signer; -typedef LUCSSA::Verifier LUCSSA_PKCS1v15_SHA_Verifier; +typedef LUCSS::Signer LUCSSA_PKCS1v15_SHA_Signer; +typedef LUCSS::Verifier LUCSSA_PKCS1v15_SHA_Verifier; // ******************************************************** @@ -179,10 +184,7 @@ class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm public: static const char * StaticAlgorithmName() {return "LUC-HMP";} - Integer EncodeDigest(unsigned int modulusBits, const byte *digest, unsigned int digestLen) const - {return DSA_EncodeDigest(modulusBits, digest, digestLen);} - - bool Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const; + void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const; bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const; unsigned int RLen(const DL_GroupParameters ¶ms) const @@ -199,7 +201,7 @@ struct DL_SignatureKeys_LUC //! LUC-HMP, based on "Digital signature schemes based on Lucas functions" by Patrick Horster, Markus Michels, Holger Petersen template -struct LUC_HMP : public DL_SSA +struct LUC_HMP : public DL_SS { }; -- cgit v1.2.1