#41 randpool.h not conformed to the online doc

None
closed
None
5
2015-06-08
2012-08-23
L. Alebarde
No

In randpool.h (http://cryptopp.sourceforge.net/docs/ref/randpool_h-source.html) :

00013 class RandomPool : public RandomNumberGenerator,
00014 public Sink
00015 {
00016 public:
00018 RandomPool(unsigned int poolSize=384);
00019
00021 void Put(byte inByte);
00023 void Put(const byte *inString, unsigned int length);
00024
00025 byte GenerateByte();
00026 void GenerateBlock(byte *output, unsigned int size);
00027
00028 protected:
00029 void Stir();
00030
00031 private:
00032 SecByteBlock pool, key;
00033 unsigned int addPos, getPos;
00034 };

In the downloaded file cryptopp561.zip :

class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable
{
public:
RandomPool();

bool CanIncorporateEntropy() const {return true;}
void IncorporateEntropy(const byte *input, size_t length);
void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size);

// for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality
void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);}

private:
FixedSizeSecBlock<byte, 32> m_key;
FixedSizeSecBlock<byte, 16> m_seed;
member_ptr<BlockCipher> m_pCipher;
bool m_keySet;
};

In particular RandomPool constructor has one argument in the doc and none in the zip.

Is the online doc in advance of a forthcoming release, or late ?

Can someone post a valid RandomPool example please ?

Discussion


  • Anonymous
    2012-12-22

    > Can someone post a valid RandomPool example please ?
    You can find an example of RandomPool use in test.cpp, functions GenerateRSAKey, RSAEncryptString, and SecretShareFile.

     
    Last edit: Anonymous 2014-07-19
  • Jeffrey Walton
    Jeffrey Walton
    2015-06-08

    • status: open --> closed
    • assigned_to: Jeffrey Walton
    • Group: -->