aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/sha1
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-14 01:16:32 +0000
committerlloyd <[email protected]>2010-09-14 01:16:32 +0000
commitae59295ea945fdcc482df2233409a5f878fa20c7 (patch)
tree768c30635a17847dccb6db6f36fa3b033adc37bf /src/hash/sha1
parent548f48611760346fa2e47efd5c0865eff831946a (diff)
Completely remove the second parameter to SecureVector which specifies
the initial/default length of the array, update all users to instead pass the value to the constructor. This is a old vestigal thing from a class (SecureBuffer) that used this compile-time constant in order to store the values in an array. However this was changed way back in 2002 to use the same allocator hooks as the rest of the containers, so the only advantage to using the length field was that the initial length was set and didn't have to be set in the constructor which was midly convenient. However this directly conflicts with the desire to be able to (eventually) use std::vector with a custom allocator, since of course vector doesn't support this. Fortunately almost all of the uses are in classes which have only a single constructor, so there is little to no duplication by instead initializing the size in the constructor.
Diffstat (limited to 'src/hash/sha1')
-rw-r--r--src/hash/sha1/sha160.cpp4
-rw-r--r--src/hash/sha1/sha160.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hash/sha1/sha160.cpp b/src/hash/sha1/sha160.cpp
index 0b3d7c346..79348a371 100644
--- a/src/hash/sha1/sha160.cpp
+++ b/src/hash/sha1/sha160.cpp
@@ -156,7 +156,7 @@ void SHA_160::clear()
* SHA_160 Constructor
*/
SHA_160::SHA_160() :
- MDx_HashFunction(20, 64, true, true), W(80)
+ MDx_HashFunction(20, 64, true, true), digest(5), W(80)
{
clear();
}
@@ -165,7 +165,7 @@ SHA_160::SHA_160() :
* SHA_160 Constructor
*/
SHA_160::SHA_160(u32bit W_size) :
- MDx_HashFunction(20, 64, true, true), W(W_size)
+ MDx_HashFunction(20, 64, true, true), digest(5), W(W_size)
{
clear();
}
diff --git a/src/hash/sha1/sha160.h b/src/hash/sha1/sha160.h
index c66831a1e..690aea1d5 100644
--- a/src/hash/sha1/sha160.h
+++ b/src/hash/sha1/sha160.h
@@ -35,7 +35,7 @@ class BOTAN_DLL SHA_160 : public MDx_HashFunction
void compress_n(const byte[], u32bit blocks);
void copy_out(byte[]);
- SecureVector<u32bit, 5> digest;
+ SecureVector<u32bit> digest;
SecureVector<u32bit> W;
};