diff options
author | Jeffrey Walton <noloader@gmail.com> | 2020-04-02 08:29:45 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2020-04-02 08:29:45 -0400 |
commit | 3b3525558d7725eed59b8ebea37e12db475ff339 (patch) | |
tree | bfe2d9bd46912ea5bb30e21c8ef2975a050aaa8d /blumshub.h | |
parent | bbb23a0177fc49bd0e4e901fefd3d2a4088254d7 (diff) | |
download | cryptopp-git-3b3525558d7725eed59b8ebea37e12db475ff339.tar.gz |
Update documentation
Diffstat (limited to 'blumshub.h')
-rw-r--r-- | blumshub.h | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -12,13 +12,19 @@ NAMESPACE_BEGIN(CryptoPP)
-/// BlumBlumShub without factorization of the modulus
+/// \brief BlumBlumShub without factorization of the modulus
+/// \details You should reseed the generator after a fork() to avoid multiple generators
+/// with the same internal state.
class PublicBlumBlumShub : public RandomNumberGenerator,
public StreamTransformation
{
public:
virtual ~PublicBlumBlumShub() {}
+ /// \brief Construct a PublicBlumBlumShub
+ /// \param n the modulus
+ /// \param seed the seed for the generator
+ /// \detials seed is the secret key and should be about as large as n.
PublicBlumBlumShub(const Integer &n, const Integer &seed);
unsigned int GenerateBit();
@@ -35,14 +41,20 @@ protected: word maxBits, bitsLeft;
};
-/// BlumBlumShub with factorization of the modulus
+/// \brief BlumBlumShub with factorization of the modulus
+/// \details You should reseed the generator after a fork() to avoid multiple generators
+/// with the same internal state.
class BlumBlumShub : public PublicBlumBlumShub
{
public:
virtual ~BlumBlumShub() {}
- // Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long,
- // seed is the secret key and should be about as big as p*q
+ /// \brief Construct a BlumBlumShub
+ /// \param p the first prime factor
+ /// \param q the second prime factor
+ /// \param seed the seed for the generator
+ /// \details Esure p and q are both primes congruent to 3 mod 4 and at least 512 bits long.
+ /// seed is the secret key and should be about as large as p*q.
BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
bool IsRandomAccess() const {return true;}
|