diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:37:46 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:37:46 +0000 |
commit | 48e0b8231e112953680cacd9fa2bb6157184a657 (patch) | |
tree | 5c790bf6c465f48e0dca552dfff508cda8f7235f /modes.h | |
parent | d37d0425edebab09ec1ff767e9b89b68db52533d (diff) | |
download | cryptopp-48e0b8231e112953680cacd9fa2bb6157184a657.tar.gz |
reduce risk of reusing random numbers after VM state rollback
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@340 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'modes.h')
-rw-r--r-- | modes.h | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -40,7 +40,6 @@ public: unsigned int OptimalDataAlignment() const {return BlockSize();} unsigned int IVSize() const {return BlockSize();} - void GetNextIV(byte *IV); virtual IV_Requirement IVRequirement() const =0; protected: @@ -64,7 +63,6 @@ class CRYPTOPP_NO_VTABLE ModePolicyCommonTemplate : public CipherModeBase, publi { unsigned int GetAlignment() const {return m_cipher->BlockAlignment();} void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); - void CipherGetNextIV(byte *IV) {CipherModeBase::GetNextIV(IV);} }; template <class POLICY_INTERFACE> @@ -137,7 +135,6 @@ private: assert(iterationCount == 1); assert(m_cipher->IsForwardTransformation()); // OFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt m_cipher->ProcessBlock(keystreamBuffer); - memcpy_s(m_register, m_register.size(), keystreamBuffer, BlockSize()); } void CipherResynchronize(byte *keystreamBuffer, const byte *iv) { @@ -150,10 +147,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTe public: bool IsRandomAccess() const {return true;} IV_Requirement IVRequirement() const {return UNIQUE_IV;} - void CipherGetNextIV(byte *IV); static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";} private: + unsigned int GetAlignment() const {return m_cipher->BlockAlignment();} unsigned int GetBytesPerIteration() const {return BlockSize();} unsigned int GetIterationsToBuffer() const {return m_cipher->OptimalNumberOfParallelBlocks();} void WriteKeystream(byte *buffer, size_t iterationCount) |