summaryrefslogtreecommitdiff
path: root/blumshub.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
commit48809d4e85c125814425c621d8d0d89f95405924 (patch)
tree1010fd16c4b1199f3d27dd726dda241a2bd29f83 /blumshub.h
parent025337a94aceb75d188149db70c2094673772816 (diff)
downloadcryptopp-git-48809d4e85c125814425c621d8d0d89f95405924.tar.gz
CRYPTOPP 5.6.3 RC6 checkin
Diffstat (limited to 'blumshub.h')
-rw-r--r--blumshub.h101
1 files changed, 52 insertions, 49 deletions
diff --git a/blumshub.h b/blumshub.h
index 5955f69c..cd194965 100644
--- a/blumshub.h
+++ b/blumshub.h
@@ -1,49 +1,52 @@
-#ifndef CRYPTOPP_BLUMSHUB_H
-#define CRYPTOPP_BLUMSHUB_H
-
-#include "config.h"
-#include "integer.h"
-#include "modarith.h"
-
-NAMESPACE_BEGIN(CryptoPP)
-
-//! BlumBlumShub without factorization of the modulus
-class PublicBlumBlumShub : public RandomNumberGenerator,
- public StreamTransformation
-{
-public:
- PublicBlumBlumShub(const Integer &n, const Integer &seed);
-
- unsigned int GenerateBit();
- byte GenerateByte();
- void GenerateBlock(byte *output, size_t size);
- void ProcessData(byte *outString, const byte *inString, size_t length);
-
- bool IsSelfInverting() const {return true;}
- bool IsForwardTransformation() const {return true;}
-
-protected:
- ModularArithmetic modn;
- word maxBits, bitsLeft;
- Integer current;
-};
-
-//! BlumBlumShub with factorization of the modulus
-class BlumBlumShub : public PublicBlumBlumShub
-{
-public:
- // 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
- BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
-
- bool IsRandomAccess() const {return true;}
- void Seek(lword index);
-
-protected:
- const Integer p, q;
- const Integer x0;
-};
-
-NAMESPACE_END
-
-#endif
+#ifndef CRYPTOPP_BLUMSHUB_H
+#define CRYPTOPP_BLUMSHUB_H
+
+#include "cryptlib.h"
+#include "modarith.h"
+#include "integer.h"
+
+NAMESPACE_BEGIN(CryptoPP)
+
+//! BlumBlumShub without factorization of the modulus
+class PublicBlumBlumShub : public RandomNumberGenerator,
+ public StreamTransformation
+{
+public:
+ PublicBlumBlumShub(const Integer &n, const Integer &seed);
+
+ unsigned int GenerateBit();
+ byte GenerateByte();
+ void GenerateBlock(byte *output, size_t size);
+ void ProcessData(byte *outString, const byte *inString, size_t length);
+
+ bool IsSelfInverting() const {return true;}
+ bool IsForwardTransformation() const {return true;}
+
+protected:
+ ModularArithmetic modn;
+ word maxBits, bitsLeft;
+ Integer current;
+
+ friend class BlumGoldwasserPublicKey;
+ friend class BlumGoldwasserPrivateKey;
+};
+
+//! BlumBlumShub with factorization of the modulus
+class BlumBlumShub : public PublicBlumBlumShub
+{
+public:
+ // 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
+ BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
+
+ bool IsRandomAccess() const {return true;}
+ void Seek(lword index);
+
+protected:
+ const Integer p, q;
+ const Integer x0;
+};
+
+NAMESPACE_END
+
+#endif