aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-29 14:48:11 +0000
committerlloyd <[email protected]>2010-10-29 14:48:11 +0000
commit82c677e2326a83fafcb89df3be2fe9719934d847 (patch)
tree8c5fb5270e64f6ee596be2048c33d36626992579 /src/stream
parent1f438bfa0ef0777cdee8585a1061c7b355cf5222 (diff)
Use u32bit here
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/ctr/ctr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stream/ctr/ctr.cpp b/src/stream/ctr/ctr.cpp
index e01f2432c..87d68f5c3 100644
--- a/src/stream/ctr/ctr.cpp
+++ b/src/stream/ctr/ctr.cpp
@@ -99,8 +99,8 @@ void CTR_BE::set_iv(const byte iv[], size_t iv_len)
&counter[(i-1)*BLOCK_SIZE],
BLOCK_SIZE);
- for(s32bit j = BLOCK_SIZE - 1; j >= 0; --j)
- if(++counter[i*BLOCK_SIZE+j])
+ for(u32bit j = 0; j != BLOCK_SIZE; ++j)
+ if(++counter[i*BLOCK_SIZE + (BLOCK_SIZE-1-j)])
break;
}
@@ -124,8 +124,8 @@ void CTR_BE::increment_counter()
last_byte += PARALLEL_BLOCKS;
if(this_ctr[BLOCK_SIZE-1] > last_byte)
- for(s32bit j = BLOCK_SIZE - 2; j >= 0; --j)
- if(++this_ctr[j])
+ for(u32bit j = 1; j != BLOCK_SIZE; ++j)
+ if(++counter[i*BLOCK_SIZE + (BLOCK_SIZE-1-j)])
break;
this_ctr[BLOCK_SIZE-1] = last_byte;