~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to rng.h

  • Committer: weidai
  • Date: 2009-03-02 02:39:17 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:433
changes for 5.6: 
    - added AuthenticatedSymmetricCipher interface class and Filter wrappers
    - added CCM, GCM (with SSE2 assembly), CMAC, and SEED
    - improved AES speed on x86 and x64
    - removed WORD64_AVAILABLE; compiler 64-bit int support is now required

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        LC_RNG(word32 init_seed)
17
17
                : seed(init_seed) {}
18
18
 
19
 
        byte GenerateByte();
 
19
        void GenerateBlock(byte *output, size_t size);
20
20
 
21
21
        word32 GetSeed() {return seed;}
22
22
 
37
37
        // cipher will be deleted by destructor, deterministicTimeVector = 0 means obtain time vector from system
38
38
        X917RNG(BlockTransformation *cipher, const byte *seed, const byte *deterministicTimeVector = 0);
39
39
 
40
 
        byte GenerateByte();
 
40
        void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size);
41
41
 
42
42
private:
43
43
        member_ptr<BlockTransformation> cipher;
44
 
        const int S;                    // blocksize of cipher
 
44
        unsigned int S;                 // blocksize of cipher
45
45
        SecByteBlock dtbuf;     // buffer for enciphered timestamp
46
 
        SecByteBlock randseed, randbuf, m_deterministicTimeVector;
47
 
        int randbuf_counter;    // # of unused bytes left in randbuf
 
46
        SecByteBlock randseed, m_lastBlock, m_deterministicTimeVector;
48
47
};
49
48
 
50
49
/** This class implements Maurer's Universal Statistical Test for Random Bit Generators