aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/ctr
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-13 00:38:07 +0000
committerlloyd <[email protected]>2010-10-13 00:38:07 +0000
commitc59d960db6d69bd9c479ec674768b7ec371830b5 (patch)
tree250385bd1c9c5b4a2afac27cc47d10031965f84b /src/stream/ctr
parent2e42b5aaaf8d817f612518afa91a5bc9d1465eb7 (diff)
s/u32bit/size_t/ in stream
Diffstat (limited to 'src/stream/ctr')
-rw-r--r--src/stream/ctr/ctr.cpp14
-rw-r--r--src/stream/ctr/ctr.h8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/stream/ctr/ctr.cpp b/src/stream/ctr/ctr.cpp
index bf546da9a..f1b73a8c3 100644
--- a/src/stream/ctr/ctr.cpp
+++ b/src/stream/ctr/ctr.cpp
@@ -67,7 +67,7 @@ std::string CTR_BE::name() const
/*
* CTR-BE Encryption/Decryption
*/
-void CTR_BE::cipher(const byte in[], byte out[], u32bit length)
+void CTR_BE::cipher(const byte in[], byte out[], size_t length)
{
while(length >= buffer.size() - position)
{
@@ -84,20 +84,20 @@ void CTR_BE::cipher(const byte in[], byte out[], u32bit length)
/*
* Set CTR-BE IV
*/
-void CTR_BE::set_iv(const byte iv[], u32bit iv_len)
+void CTR_BE::set_iv(const byte iv[], size_t iv_len)
{
if(!valid_iv_length(iv_len))
throw Invalid_IV_Length(name(), iv_len);
- const u32bit BLOCK_SIZE = permutation->BLOCK_SIZE;
+ const size_t BLOCK_SIZE = permutation->BLOCK_SIZE;
zeroise(counter);
counter.copy(0, iv, iv_len);
- const u32bit PARALLEL_BLOCKS = counter.size() / BLOCK_SIZE;
+ const size_t PARALLEL_BLOCKS = counter.size() / BLOCK_SIZE;
- for(u32bit i = 1; i != PARALLEL_BLOCKS; ++i)
+ for(size_t i = 1; i != PARALLEL_BLOCKS; ++i)
{
counter.copy(i*BLOCK_SIZE,
&counter[(i-1)*BLOCK_SIZE],
@@ -117,9 +117,9 @@ void CTR_BE::set_iv(const byte iv[], u32bit iv_len)
*/
void CTR_BE::increment_counter()
{
- const u32bit PARALLEL_BLOCKS = counter.size() / permutation->BLOCK_SIZE;
+ const size_t PARALLEL_BLOCKS = counter.size() / permutation->BLOCK_SIZE;
- for(u32bit i = 0; i != PARALLEL_BLOCKS; ++i)
+ for(size_t i = 0; i != PARALLEL_BLOCKS; ++i)
{
byte* this_ctr = &counter[i * permutation->BLOCK_SIZE];
diff --git a/src/stream/ctr/ctr.h b/src/stream/ctr/ctr.h
index fc7ba522f..45a3e29e2 100644
--- a/src/stream/ctr/ctr.h
+++ b/src/stream/ctr/ctr.h
@@ -19,11 +19,11 @@ namespace Botan {
class BOTAN_DLL CTR_BE : public StreamCipher
{
public:
- void cipher(const byte in[], byte out[], u32bit length);
+ void cipher(const byte in[], byte out[], size_t length);
- void set_iv(const byte iv[], u32bit iv_len);
+ void set_iv(const byte iv[], size_t iv_len);
- bool valid_iv_length(u32bit iv_len) const
+ bool valid_iv_length(size_t iv_len) const
{ return (iv_len <= permutation->BLOCK_SIZE); }
std::string name() const;
@@ -44,7 +44,7 @@ class BOTAN_DLL CTR_BE : public StreamCipher
BlockCipher* permutation;
SecureVector<byte> counter, buffer;
- u32bit position;
+ size_t position;
};
}