From d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 12 Jul 2005 04:23:32 +0000 Subject: port to MSVC .NET 2005 beta 2 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- modes.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modes.cpp') diff --git a/modes.cpp b/modes.cpp index 2033dd9..a4df7b0 100644 --- a/modes.cpp +++ b/modes.cpp @@ -24,9 +24,9 @@ void Modes_TestInstantiations() } #endif -void CipherModeBase::SetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) +void CipherModeBase::SetKey(const byte *key, size_t length, const NameValuePairs ¶ms) { - UncheckedSetKey(params, key, length, GetIVAndThrowIfInvalid(params)); // the underlying cipher will check the key length + UncheckedSetKey(params, key, (unsigned int)length, GetIVAndThrowIfInvalid(params)); // the underlying cipher will check the key length } void CipherModeBase::GetNextIV(byte *IV) @@ -55,7 +55,7 @@ void CTR_ModePolicy::GetNextIV(byte *IV) IncrementCounterByOne(IV, m_counterArray, BlockSize()); } -inline void CTR_ModePolicy::ProcessMultipleBlocks(byte *output, const byte *input, unsigned int n) +inline void CTR_ModePolicy::ProcessMultipleBlocks(byte *output, const byte *input, size_t n) { unsigned int s = BlockSize(), j = 0; for (unsigned int i=1; iOptimalNumberOfParallelBlocks(); if (maxBlocks == 1) @@ -110,7 +110,7 @@ void BlockOrientedCipherModeBase::UncheckedSetKey(const NameValuePairs ¶ms, Resynchronize(iv); } -void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inString, unsigned int length) +void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inString, size_t length) { unsigned int s = BlockSize(); assert(length % s == 0); @@ -146,7 +146,7 @@ void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inStr } } -void CBC_Encryption::ProcessBlocks(byte *outString, const byte *inString, unsigned int numberOfBlocks) +void CBC_Encryption::ProcessBlocks(byte *outString, const byte *inString, size_t numberOfBlocks) { unsigned int blockSize = BlockSize(); while (numberOfBlocks--) @@ -159,7 +159,7 @@ void CBC_Encryption::ProcessBlocks(byte *outString, const byte *inString, unsign } } -void CBC_CTS_Encryption::ProcessLastBlock(byte *outString, const byte *inString, unsigned int length) +void CBC_CTS_Encryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) { if (length <= BlockSize()) { @@ -186,7 +186,7 @@ void CBC_CTS_Encryption::ProcessLastBlock(byte *outString, const byte *inString, memcpy(outString, m_register, BlockSize()); } -void CBC_Decryption::ProcessBlocks(byte *outString, const byte *inString, unsigned int numberOfBlocks) +void CBC_Decryption::ProcessBlocks(byte *outString, const byte *inString, size_t numberOfBlocks) { unsigned int blockSize = BlockSize(); while (numberOfBlocks--) @@ -200,7 +200,7 @@ void CBC_Decryption::ProcessBlocks(byte *outString, const byte *inString, unsign } } -void CBC_CTS_Decryption::ProcessLastBlock(byte *outString, const byte *inString, unsigned int length) +void CBC_CTS_Decryption::ProcessLastBlock(byte *outString, const byte *inString, size_t length) { const byte *pn, *pn1; bool stealIV = length <= BlockSize(); -- cgit v1.2.1