aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash')
-rw-r--r--src/hash/bmw_512/bmw_512.h2
-rw-r--r--src/hash/comb4p/comb4p.cpp10
-rw-r--r--src/hash/gost_3411/gost_3411.cpp4
-rw-r--r--src/hash/gost_3411/gost_3411.h2
-rw-r--r--src/hash/has160/has160.h2
-rw-r--r--src/hash/keccak/keccak.cpp4
-rw-r--r--src/hash/keccak/keccak.h2
-rw-r--r--src/hash/md2/md2.h2
-rw-r--r--src/hash/md4/md4.h4
-rw-r--r--src/hash/md5/md5.h4
-rw-r--r--src/hash/mdx_hash/mdx_hash.h2
-rw-r--r--src/hash/rmd128/rmd128.h2
-rw-r--r--src/hash/rmd160/rmd160.h2
-rw-r--r--src/hash/sha1/sha160.h4
-rw-r--r--src/hash/sha2_32/sha2_32.cpp2
-rw-r--r--src/hash/sha2_32/sha2_32.h4
-rw-r--r--src/hash/sha2_64/sha2_64.cpp2
-rw-r--r--src/hash/sha2_64/sha2_64.h4
-rw-r--r--src/hash/skein/skein_512.cpp12
-rw-r--r--src/hash/skein/skein_512.h6
-rw-r--r--src/hash/tiger/tiger.cpp4
-rw-r--r--src/hash/tiger/tiger.h4
-rw-r--r--src/hash/whirlpool/whrlpool.h2
23 files changed, 43 insertions, 43 deletions
diff --git a/src/hash/bmw_512/bmw_512.h b/src/hash/bmw_512/bmw_512.h
index 474b607bb..b9ea63578 100644
--- a/src/hash/bmw_512/bmw_512.h
+++ b/src/hash/bmw_512/bmw_512.h
@@ -30,7 +30,7 @@ class BOTAN_DLL BMW_512 : public MDx_HashFunction
void compress_n(const byte input[], size_t blocks);
void copy_out(byte output[]);
- SecureVector<u64bit> H, M, Q;
+ secure_vector<u64bit> H, M, Q;
};
}
diff --git a/src/hash/comb4p/comb4p.cpp b/src/hash/comb4p/comb4p.cpp
index 1ea64a5cb..7aec5972e 100644
--- a/src/hash/comb4p/comb4p.cpp
+++ b/src/hash/comb4p/comb4p.cpp
@@ -13,8 +13,8 @@ namespace Botan {
namespace {
-void comb4p_round(MemoryRegion<byte>& out,
- const MemoryRegion<byte>& in,
+void comb4p_round(secure_vector<byte>& out,
+ const secure_vector<byte>& in,
byte round_no,
HashFunction* h1,
HashFunction* h2)
@@ -25,7 +25,7 @@ void comb4p_round(MemoryRegion<byte>& out,
h1->update(&in[0], in.size());
h2->update(&in[0], in.size());
- SecureVector<byte> h_buf = h1->final();
+ secure_vector<byte> h_buf = h1->final();
xor_buf(&out[0], &h_buf[0], std::min(out.size(), h_buf.size()));
h_buf = h2->final();
@@ -78,8 +78,8 @@ void Comb4P::add_data(const byte input[], size_t length)
void Comb4P::final_result(byte out[])
{
- SecureVector<byte> h1 = hash1->final();
- SecureVector<byte> h2 = hash2->final();
+ secure_vector<byte> h1 = hash1->final();
+ secure_vector<byte> h2 = hash2->final();
// First round
xor_buf(&h1[0], &h2[0], std::min(h1.size(), h2.size()));
diff --git a/src/hash/gost_3411/gost_3411.cpp b/src/hash/gost_3411/gost_3411.cpp
index 6e56c2b97..eb889c0a5 100644
--- a/src/hash/gost_3411/gost_3411.cpp
+++ b/src/hash/gost_3411/gost_3411.cpp
@@ -225,11 +225,11 @@ void GOST_34_11::final_result(byte out[])
compress_n(&buffer[0], 1);
}
- SecureVector<byte> length_buf(32);
+ secure_vector<byte> length_buf(32);
const u64bit bit_count = count * 8;
store_le(bit_count, &length_buf[0]);
- SecureVector<byte> sum_buf = sum;
+ secure_vector<byte> sum_buf = sum;
compress_n(&length_buf[0], 1);
compress_n(&sum_buf[0], 1);
diff --git a/src/hash/gost_3411/gost_3411.h b/src/hash/gost_3411/gost_3411.h
index fbbcb7a89..5437ca4d8 100644
--- a/src/hash/gost_3411/gost_3411.h
+++ b/src/hash/gost_3411/gost_3411.h
@@ -34,7 +34,7 @@ class BOTAN_DLL GOST_34_11 : public HashFunction
void final_result(byte[]);
GOST_28147_89 cipher;
- SecureVector<byte> buffer, sum, hash;
+ secure_vector<byte> buffer, sum, hash;
size_t position;
u64bit count;
};
diff --git a/src/hash/has160/has160.h b/src/hash/has160/has160.h
index d32361601..9947d9580 100644
--- a/src/hash/has160/has160.h
+++ b/src/hash/has160/has160.h
@@ -31,7 +31,7 @@ class BOTAN_DLL HAS_160 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u32bit> X, digest;
+ secure_vector<u32bit> X, digest;
};
}
diff --git a/src/hash/keccak/keccak.cpp b/src/hash/keccak/keccak.cpp
index 107055509..e34c0fd43 100644
--- a/src/hash/keccak/keccak.cpp
+++ b/src/hash/keccak/keccak.cpp
@@ -178,12 +178,12 @@ void Keccak_1600::add_data(const byte input[], size_t length)
void Keccak_1600::final_result(byte output[])
{
- MemoryVector<byte> padding(bitrate / 8 - S_pos);
+ std::vector<byte> padding(bitrate / 8 - S_pos);
padding[0] = 0x01;
padding[padding.size()-1] |= 0x80;
- add_data(padding, padding.size());
+ add_data(&padding[0], padding.size());
/*
* We never have to run the permutation again because we only support
diff --git a/src/hash/keccak/keccak.h b/src/hash/keccak/keccak.h
index 17ae632ba..e91a04d32 100644
--- a/src/hash/keccak/keccak.h
+++ b/src/hash/keccak/keccak.h
@@ -38,7 +38,7 @@ class BOTAN_DLL Keccak_1600 : public HashFunction
void final_result(byte out[]);
size_t output_bits, bitrate;
- SecureVector<u64bit> S;
+ secure_vector<u64bit> S;
size_t S_pos;
};
diff --git a/src/hash/md2/md2.h b/src/hash/md2/md2.h
index 84e0323f7..032d8a8e0 100644
--- a/src/hash/md2/md2.h
+++ b/src/hash/md2/md2.h
@@ -32,7 +32,7 @@ class BOTAN_DLL MD2 : public HashFunction
void hash(const byte[]);
void final_result(byte[]);
- SecureVector<byte> X, checksum, buffer;
+ secure_vector<byte> X, checksum, buffer;
size_t position;
};
diff --git a/src/hash/md4/md4.h b/src/hash/md4/md4.h
index d37dbe3b2..750be0fe7 100644
--- a/src/hash/md4/md4.h
+++ b/src/hash/md4/md4.h
@@ -33,12 +33,12 @@ class BOTAN_DLL MD4 : public MDx_HashFunction
/**
* The message buffer, exposed for use by subclasses (x86 asm)
*/
- SecureVector<u32bit> M;
+ secure_vector<u32bit> M;
/**
* The digest value, exposed for use by subclasses (x86 asm)
*/
- SecureVector<u32bit> digest;
+ secure_vector<u32bit> digest;
};
}
diff --git a/src/hash/md5/md5.h b/src/hash/md5/md5.h
index 92c023c92..bc90df0af 100644
--- a/src/hash/md5/md5.h
+++ b/src/hash/md5/md5.h
@@ -33,12 +33,12 @@ class BOTAN_DLL MD5 : public MDx_HashFunction
/**
* The message buffer, exposed for use by subclasses (x86 asm)
*/
- SecureVector<u32bit> M;
+ secure_vector<u32bit> M;
/**
* The digest value, exposed for use by subclasses (x86 asm)
*/
- SecureVector<u32bit> digest;
+ secure_vector<u32bit> digest;
};
}
diff --git a/src/hash/mdx_hash/mdx_hash.h b/src/hash/mdx_hash/mdx_hash.h
index ed3381605..14d3c27a0 100644
--- a/src/hash/mdx_hash/mdx_hash.h
+++ b/src/hash/mdx_hash/mdx_hash.h
@@ -55,7 +55,7 @@ class BOTAN_DLL MDx_HashFunction : public HashFunction
*/
virtual void write_count(byte out[]);
private:
- SecureVector<byte> buffer;
+ secure_vector<byte> buffer;
u64bit count;
size_t position;
diff --git a/src/hash/rmd128/rmd128.h b/src/hash/rmd128/rmd128.h
index d64cf3c84..e37666a27 100644
--- a/src/hash/rmd128/rmd128.h
+++ b/src/hash/rmd128/rmd128.h
@@ -30,7 +30,7 @@ class BOTAN_DLL RIPEMD_128 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u32bit> M, digest;
+ secure_vector<u32bit> M, digest;
};
}
diff --git a/src/hash/rmd160/rmd160.h b/src/hash/rmd160/rmd160.h
index 5df4ad490..0e43fed9a 100644
--- a/src/hash/rmd160/rmd160.h
+++ b/src/hash/rmd160/rmd160.h
@@ -30,7 +30,7 @@ class BOTAN_DLL RIPEMD_160 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u32bit> M, digest;
+ secure_vector<u32bit> M, digest;
};
}
diff --git a/src/hash/sha1/sha160.h b/src/hash/sha1/sha160.h
index c3b264861..e2a81808d 100644
--- a/src/hash/sha1/sha160.h
+++ b/src/hash/sha1/sha160.h
@@ -47,12 +47,12 @@ class BOTAN_DLL SHA_160 : public MDx_HashFunction
/**
* The digest value, exposed for use by subclasses (asm, SSE2)
*/
- SecureVector<u32bit> digest;
+ secure_vector<u32bit> digest;
/**
* The message buffer, exposed for use by subclasses (asm, SSE2)
*/
- SecureVector<u32bit> W;
+ secure_vector<u32bit> W;
};
}
diff --git a/src/hash/sha2_32/sha2_32.cpp b/src/hash/sha2_32/sha2_32.cpp
index 6dd780e64..cffc8bd2a 100644
--- a/src/hash/sha2_32/sha2_32.cpp
+++ b/src/hash/sha2_32/sha2_32.cpp
@@ -50,7 +50,7 @@ inline u32bit sigma(u32bit X, u32bit rot1, u32bit rot2, u32bit shift)
/*
* SHA-224 / SHA-256 compression function
*/
-void compress(MemoryRegion<u32bit>& digest,
+void compress(secure_vector<u32bit>& digest,
const byte input[], size_t blocks)
{
u32bit A = digest[0], B = digest[1], C = digest[2],
diff --git a/src/hash/sha2_32/sha2_32.h b/src/hash/sha2_32/sha2_32.h
index 807b979d1..ccb8e07f2 100644
--- a/src/hash/sha2_32/sha2_32.h
+++ b/src/hash/sha2_32/sha2_32.h
@@ -31,7 +31,7 @@ class BOTAN_DLL SHA_224 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u32bit> digest;
+ secure_vector<u32bit> digest;
};
/**
@@ -52,7 +52,7 @@ class BOTAN_DLL SHA_256 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u32bit> digest;
+ secure_vector<u32bit> digest;
};
}
diff --git a/src/hash/sha2_64/sha2_64.cpp b/src/hash/sha2_64/sha2_64.cpp
index 3026c3a39..8dcb4684e 100644
--- a/src/hash/sha2_64/sha2_64.cpp
+++ b/src/hash/sha2_64/sha2_64.cpp
@@ -49,7 +49,7 @@ inline u64bit sigma(u64bit X, u32bit rot1, u32bit rot2, u32bit shift)
/*
* SHA-{384,512} Compression Function
*/
-void compress(MemoryRegion<u64bit>& digest,
+void compress(secure_vector<u64bit>& digest,
const byte input[], size_t blocks)
{
u64bit A = digest[0], B = digest[1], C = digest[2],
diff --git a/src/hash/sha2_64/sha2_64.h b/src/hash/sha2_64/sha2_64.h
index 124d4bbfb..58b154170 100644
--- a/src/hash/sha2_64/sha2_64.h
+++ b/src/hash/sha2_64/sha2_64.h
@@ -30,7 +30,7 @@ class BOTAN_DLL SHA_384 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u64bit> digest;
+ secure_vector<u64bit> digest;
};
/**
@@ -51,7 +51,7 @@ class BOTAN_DLL SHA_512 : public MDx_HashFunction
void compress_n(const byte[], size_t blocks);
void copy_out(byte[]);
- SecureVector<u64bit> digest;
+ secure_vector<u64bit> digest;
};
}
diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp
index 2458bf5f0..28c2aa38b 100644
--- a/src/hash/skein/skein_512.cpp
+++ b/src/hash/skein/skein_512.cpp
@@ -27,8 +27,8 @@ enum type_code {
SKEIN_OUTPUT = 63
};
-void ubi_512(MemoryRegion<u64bit>& H,
- MemoryRegion<u64bit>& T,
+void ubi_512(secure_vector<u64bit>& H,
+ secure_vector<u64bit>& T,
const byte msg[], size_t msg_len)
{
do
@@ -125,7 +125,7 @@ void ubi_512(MemoryRegion<u64bit>& H,
} while(msg_len);
}
-void reset_tweak(MemoryRegion<u64bit>& T,
+void reset_tweak(secure_vector<u64bit>& T,
type_code type, bool final)
{
T[0] = 0;
@@ -135,8 +135,8 @@ void reset_tweak(MemoryRegion<u64bit>& T,
(static_cast<u64bit>(final) << 63);
}
-void initial_block(MemoryRegion<u64bit>& H,
- MemoryRegion<u64bit>& T,
+void initial_block(secure_vector<u64bit>& H,
+ secure_vector<u64bit>& T,
size_t output_bits,
const std::string& personalization)
{
@@ -245,7 +245,7 @@ void Skein_512::final_result(byte out[])
size_t out_bytes = output_bits / 8;
- SecureVector<u64bit> H_out(9);
+ secure_vector<u64bit> H_out(9);
while(out_bytes)
{
diff --git a/src/hash/skein/skein_512.h b/src/hash/skein/skein_512.h
index 8605e5991..e0abc06ae 100644
--- a/src/hash/skein/skein_512.h
+++ b/src/hash/skein/skein_512.h
@@ -41,9 +41,9 @@ class BOTAN_DLL Skein_512 : public HashFunction
std::string personalization;
size_t output_bits;
- SecureVector<u64bit> H;
- SecureVector<u64bit> T;
- SecureVector<byte> buffer;
+ secure_vector<u64bit> H;
+ secure_vector<u64bit> T;
+ secure_vector<byte> buffer;
size_t buf_pos;
};
diff --git a/src/hash/tiger/tiger.cpp b/src/hash/tiger/tiger.cpp
index daa0939b9..57250d6f5 100644
--- a/src/hash/tiger/tiger.cpp
+++ b/src/hash/tiger/tiger.cpp
@@ -17,7 +17,7 @@ namespace {
/*
* Tiger Mixing Function
*/
-inline void mix(MemoryRegion<u64bit>& X)
+inline void mix(secure_vector<u64bit>& X)
{
X[0] -= X[7] ^ 0xA5A5A5A5A5A5A5A5;
X[1] ^= X[0];
@@ -83,7 +83,7 @@ void Tiger::copy_out(byte output[])
* Tiger Pass
*/
void Tiger::pass(u64bit& A, u64bit& B, u64bit& C,
- const MemoryRegion<u64bit>& X,
+ const secure_vector<u64bit>& X,
byte mul)
{
C ^= X[0];
diff --git a/src/hash/tiger/tiger.h b/src/hash/tiger/tiger.h
index 09c9947fb..70c70958b 100644
--- a/src/hash/tiger/tiger.h
+++ b/src/hash/tiger/tiger.h
@@ -38,7 +38,7 @@ class BOTAN_DLL Tiger : public MDx_HashFunction
void copy_out(byte[]);
static void pass(u64bit& A, u64bit& B, u64bit& C,
- const MemoryRegion<u64bit>& M,
+ const secure_vector<u64bit>& M,
byte mul);
static const u64bit SBOX1[256];
@@ -46,7 +46,7 @@ class BOTAN_DLL Tiger : public MDx_HashFunction
static const u64bit SBOX3[256];
static const u64bit SBOX4[256];
- SecureVector<u64bit> X, digest;
+ secure_vector<u64bit> X, digest;
const size_t hash_len, passes;
};
diff --git a/src/hash/whirlpool/whrlpool.h b/src/hash/whirlpool/whrlpool.h
index ab7a78bc8..d4ad805e1 100644
--- a/src/hash/whirlpool/whrlpool.h
+++ b/src/hash/whirlpool/whrlpool.h
@@ -39,7 +39,7 @@ class BOTAN_DLL Whirlpool : public MDx_HashFunction
static const u64bit C6[256];
static const u64bit C7[256];
- SecureVector<u64bit> M, digest;
+ secure_vector<u64bit> M, digest;
};
}