summaryrefslogtreecommitdiff
path: root/modes.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-06 03:58:13 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-06 03:58:13 +0000
commita2f7dfe3afb5c056fdbb2a7e3f2e20753771fa95 (patch)
tree0c0531b9afb27bb170a0ec1f6ec4d56e35368e90 /modes.h
parent54aac9c52276331c818cebd420354c5e281d363a (diff)
downloadcryptopp-a2f7dfe3afb5c056fdbb2a7e3f2e20753771fa95.tar.gz
bug fix and optimization
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@8 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'modes.h')
-rw-r--r--modes.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/modes.h b/modes.h
index f498400..671f212 100644
--- a/modes.h
+++ b/modes.h
@@ -142,19 +142,7 @@ class CTR_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPol
void SeekToIteration(dword iterationCount);
IV_Requirement IVRequirement() const {return STRUCTURED_IV;}
- static inline void IncrementCounterByOne(byte *output, const byte *input, unsigned int s)
- {
- for (int i=s-1, carry=1; i>=0; i--)
- carry = !(output[i] = input[i]+1);
- }
- inline void ProcessMultipleBlocks(byte *output, const byte *input, unsigned int n)
- {
- unsigned int s = BlockSize(), j = 0;
- for (unsigned int i=1; i<n; i++, j+=s)
- IncrementCounterByOne(m_counterArray + j + s, m_counterArray + j, s);
- m_cipher->ProcessAndXorMultipleBlocks(m_counterArray, input, output, n);
- IncrementCounterByOne(m_counterArray, m_counterArray + s*(n-1), s);
- }
+ inline void ProcessMultipleBlocks(byte *output, const byte *input, unsigned int n);
SecByteBlock m_counterArray;
};