aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2010-05-20 09:57:51 +0000
committerVincent Richard <[email protected]>2010-05-20 09:57:51 +0000
commitac1da379ebef71dd66f7685c5ed6dfa3b5396895 (patch)
treee61024f03c616c94432295684e9a9dc0690de528
parentAdded helper function to construct parsed message from net message. Splitted ... (diff)
downloadvmime-ac1da379ebef71dd66f7685c5ed6dfa3b5396895.tar.gz
vmime-ac1da379ebef71dd66f7685c5ed6dfa3b5396895.zip
Fixed type size.
-rw-r--r--src/security/digest/sha1/sha1MessageDigest.cpp14
-rw-r--r--vmime/security/digest/sha1/sha1MessageDigest.hpp6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/security/digest/sha1/sha1MessageDigest.cpp b/src/security/digest/sha1/sha1MessageDigest.cpp
index 6d99e3fb..e4bcea41 100644
--- a/src/security/digest/sha1/sha1MessageDigest.cpp
+++ b/src/security/digest/sha1/sha1MessageDigest.cpp
@@ -135,7 +135,7 @@ void sha1MessageDigest::update(const byte_t* buffer, const unsigned long len)
void sha1MessageDigest::finalize()
{
- unsigned long i, j;
+ unsigned int i, j;
unsigned char finalcount[8];
for (i = 0 ; i < 8 ; i++)
@@ -162,8 +162,8 @@ void sha1MessageDigest::finalize()
i = j = 0;
std::memset(m_buffer, 0, 64);
- std::memset(m_state, 0, 5 * sizeof(unsigned long));
- std::memset(m_count, 0, 2 * sizeof(unsigned long));
+ std::memset(m_state, 0, 5 * sizeof(unsigned int));
+ std::memset(m_count, 0, 2 * sizeof(unsigned int));
std::memset(&finalcount, 0, 8);
}
@@ -192,17 +192,17 @@ void sha1MessageDigest::finalize(const byte_t* buffer,
* This is the core of the algorithm.
*/
void sha1MessageDigest::transform
- (unsigned long state[5], const unsigned char buffer[64])
+ (unsigned int state[5], const unsigned char buffer[64])
{
- unsigned long a, b, c, d, e;
+ unsigned int a, b, c, d, e;
typedef union
{
unsigned char c[64];
- unsigned long l[16];
+ unsigned int l[16];
} CHAR64LONG16;
- assert(sizeof(unsigned long) == 4);
+ assert(sizeof(unsigned int) == 4);
CHAR64LONG16* block;
static unsigned char workspace[64];
diff --git a/vmime/security/digest/sha1/sha1MessageDigest.hpp b/vmime/security/digest/sha1/sha1MessageDigest.hpp
index 906009a4..c8da349f 100644
--- a/vmime/security/digest/sha1/sha1MessageDigest.hpp
+++ b/vmime/security/digest/sha1/sha1MessageDigest.hpp
@@ -59,10 +59,10 @@ protected:
void init();
- static void transform(unsigned long state[5], const byte_t buffer[64]);
+ static void transform(unsigned int state[5], const byte_t buffer[64]);
- unsigned long m_state[5];
- unsigned long m_count[2];
+ unsigned int m_state[5];
+ unsigned int m_count[2];
byte_t m_buffer[64];
byte_t m_digest[20];