aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream/ctr/ctr.cpp
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/ctr.cpp
parent2e42b5aaaf8d817f612518afa91a5bc9d1465eb7 (diff)
s/u32bit/size_t/ in stream
Diffstat (limited to 'src/stream/ctr/ctr.cpp')
-rw-r--r--src/stream/ctr/ctr.cpp14
1 files changed, 7 insertions, 7 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];