diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-12-03 14:46:52 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-12-03 14:46:52 -0500 |
commit | 7cc8ad1a1d6b9fdfea6ac3695ac50f45150ce05e (patch) | |
tree | abcaf68b02b5ad548f8ebf2fd23a41d8e3fccda7 /gfpcrypt.h | |
parent | d45763a7ae1756b937708f31d2c3ca1de020ddff (diff) | |
download | cryptopp-git-7cc8ad1a1d6b9fdfea6ac3695ac50f45150ce05e.tar.gz |
Updated documentation (Issue 328)
Diffstat (limited to 'gfpcrypt.h')
-rw-r--r-- | gfpcrypt.h | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -39,6 +39,12 @@ public: void Initialize(const DL_GroupParameters_IntegerBased ¶ms)
{Initialize(params.GetModulus(), params.GetSubgroupOrder(), params.GetSubgroupGenerator());}
+ //! \brief Create a trapdoor function keypair
+ //! \param rng a RandomNumberGenerator derived class
+ //! \param pbits the size of p, in bits
+ //! \details This function overload of Initialize() creates a new keypair because it
+ //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ //! then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int pbits)
{GenerateRandom(rng, MakeParameters("ModulusSize", (int)pbits));}
void Initialize(const Integer &p, const Integer &g)
@@ -271,14 +277,39 @@ class DL_PrivateKey_GFP : public DL_PrivateKeyImpl<GP> public:
virtual ~DL_PrivateKey_GFP() {}
+ //! \brief Create a private key
+ //! \param rng a RandomNumberGenerator derived class
+ //! \param modulusBits the size of the modulus, in bits
+ //! \details This function overload of Initialize() creates a new keypair because it
+ //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ //! then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
{this->GenerateRandomWithKeySize(rng, modulusBits);}
+
+ //! \brief Create a private key
+ //! \param rng a RandomNumberGenerator derived class
+ //! \param p TODO
+ //! \param g TODO
+ //! \details This function overload of Initialize() creates a new keypair because it
+ //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ //! then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &g)
{this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupGenerator", g));}
+
+ //! \brief Create a private key
+ //! \param rng a RandomNumberGenerator derived class
+ //! \param p TODO
+ //! \param q TODO
+ //! \param g TODO
+ //! \details This function overload of Initialize() creates a new keypair because it
+ //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ //! then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g)
{this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupOrder", q)("SubgroupGenerator", g));}
+
void Initialize(const DL_GroupParameters_IntegerBased ¶ms, const Integer &x)
{this->AccessGroupParameters().Initialize(params); this->SetPrivateExponent(x);}
+
void Initialize(const Integer &p, const Integer &g, const Integer &x)
{this->AccessGroupParameters().Initialize(p, g); this->SetPrivateExponent(x);}
void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &x)
|