summaryrefslogtreecommitdiff
path: root/blumshub.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-04-02 08:29:45 -0400
committerJeffrey Walton <noloader@gmail.com>2020-04-02 08:29:45 -0400
commit3b3525558d7725eed59b8ebea37e12db475ff339 (patch)
treebfe2d9bd46912ea5bb30e21c8ef2975a050aaa8d /blumshub.h
parentbbb23a0177fc49bd0e4e901fefd3d2a4088254d7 (diff)
downloadcryptopp-git-3b3525558d7725eed59b8ebea37e12db475ff339.tar.gz
Update documentation
Diffstat (limited to 'blumshub.h')
-rw-r--r--blumshub.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/blumshub.h b/blumshub.h
index 9297c942..f59ddefc 100644
--- a/blumshub.h
+++ b/blumshub.h
@@ -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;}