Security Scol plugin
blumshub.h
Go to the documentation of this file.
1// blumshub.h - originally written and placed in the public domain by Wei Dai
2
5
6#ifndef CRYPTOPP_BLUMSHUB_H
7#define CRYPTOPP_BLUMSHUB_H
8
9#include "cryptlib.h"
10#include "modarith.h"
11#include "integer.h"
12
13NAMESPACE_BEGIN(CryptoPP)
14
15
20{
21public:
22 virtual ~PublicBlumBlumShub() {}
23
28 PublicBlumBlumShub(const Integer &n, const Integer &seed);
29
30 unsigned int GenerateBit();
31 byte GenerateByte();
32 void GenerateBlock(byte *output, size_t size);
33 void ProcessData(byte *outString, const byte *inString, size_t length);
34
35 bool IsSelfInverting() const {return true;}
36 bool IsForwardTransformation() const {return true;}
37
38protected:
40 Integer current;
41 word maxBits, bitsLeft;
42};
43
48{
49public:
50 virtual ~BlumBlumShub() {}
51
58 BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
59
60 bool IsRandomAccess() const {return true;}
61 void Seek(lword index);
62
63protected:
64 const Integer p, q;
65 const Integer x0;
66};
67
68NAMESPACE_END
69
70#endif
BlumBlumShub with factorization of the modulus.
Definition blumshub.h:48
bool IsRandomAccess() const
Determines whether the cipher supports random access.
Definition blumshub.h:60
void Seek(lword index)
Seek to an absolute position.
Definition blumshub.cpp:55
Multiple precision integer with arithmetic operations.
Definition integer.h:50
Ring of congruence classes modulo n.
Definition modarith.h:44
BlumBlumShub without factorization of the modulus.
Definition blumshub.h:20
bool IsForwardTransformation() const
Determines if the cipher is being operated in its forward direction.
Definition blumshub.h:36
bool IsSelfInverting() const
Determines whether the cipher is self-inverting.
Definition blumshub.h:35
Interface for random number generators.
Definition cryptlib.h:1435
Interface for the data processing portion of stream ciphers.
Definition cryptlib.h:946
word64 lword
Large word type.
Definition config_int.h:158
Abstract base classes that provide a uniform interface to this library.
Multiple precision integer with arithmetic operations.
Class file for performing modular arithmetic.