aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/buf_comp/buf_comp.h10
-rw-r--r--src/utils/xor_buf.h13
2 files changed, 12 insertions, 11 deletions
diff --git a/src/utils/buf_comp/buf_comp.h b/src/utils/buf_comp/buf_comp.h
index 784a3285d..0904941d6 100644
--- a/src/utils/buf_comp/buf_comp.h
+++ b/src/utils/buf_comp/buf_comp.h
@@ -25,14 +25,14 @@ class BOTAN_DLL BufferedComputation
/**
* The length of the output of this function in bytes.
*/
- const u32bit OUTPUT_LENGTH;
+ const size_t OUTPUT_LENGTH;
/**
* Add new input to process.
* @param in the input to process as a byte array
* @param length of param in in bytes
*/
- void update(const byte in[], u32bit length) { add_data(in, length); }
+ void update(const byte in[], size_t length) { add_data(in, length); }
/**
* Add new input to process.
@@ -96,7 +96,7 @@ class BOTAN_DLL BufferedComputation
* @param length the length of the byte array
* @result the result of the call to final()
*/
- SecureVector<byte> process(const byte in[], u32bit length)
+ SecureVector<byte> process(const byte in[], size_t length)
{
add_data(in, length);
return final();
@@ -129,7 +129,7 @@ class BOTAN_DLL BufferedComputation
/**
* @param out_len the output length of this computation
*/
- BufferedComputation(u32bit out_len) : OUTPUT_LENGTH(out_len) {}
+ BufferedComputation(size_t out_len) : OUTPUT_LENGTH(out_len) {}
virtual ~BufferedComputation() {}
private:
@@ -140,7 +140,7 @@ class BOTAN_DLL BufferedComputation
* @param input is an input buffer
* @param length is the length of input in bytes
*/
- virtual void add_data(const byte input[], u32bit length) = 0;
+ virtual void add_data(const byte input[], size_t length) = 0;
/**
* Write the final output to out
diff --git a/src/utils/xor_buf.h b/src/utils/xor_buf.h
index 34abb48d3..3c96dea70 100644
--- a/src/utils/xor_buf.h
+++ b/src/utils/xor_buf.h
@@ -18,7 +18,7 @@ namespace Botan {
* @param in the read-only input buffer
* @param length the length of the buffers
*/
-inline void xor_buf(byte out[], const byte in[], u32bit length)
+inline void xor_buf(byte out[], const byte in[], size_t length)
{
while(length >= 8)
{
@@ -33,8 +33,9 @@ inline void xor_buf(byte out[], const byte in[], u32bit length)
out += 8; in += 8; length -= 8;
}
- for(u32bit j = 0; j != length; ++j)
- out[j] ^= in[j];
+
+ for(size_t i = 0; i != length; ++i)
+ out[i] ^= in[i];
}
/**
@@ -47,7 +48,7 @@ inline void xor_buf(byte out[], const byte in[], u32bit length)
inline void xor_buf(byte out[],
const byte in[],
const byte in2[],
- u32bit length)
+ size_t length)
{
while(length >= 8)
{
@@ -65,8 +66,8 @@ inline void xor_buf(byte out[],
in += 8; in2 += 8; out += 8; length -= 8;
}
- for(u32bit j = 0; j != length; ++j)
- out[j] = in[j] ^ in2[j];
+ for(size_t i = 0; i != length; ++i)
+ out[i] = in[i] ^ in2[i];
}
}