projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates. New data types.
[silc.git]
/
lib
/
silccrypt
/
sha1.c
diff --git
a/lib/silccrypt/sha1.c
b/lib/silccrypt/sha1.c
index f22df0b8b6c4a60e779c376a6953310fa646229b..ef51330d3dea7088ed1d0a2267cd7ca49699976a 100644
(file)
--- a/
lib/silccrypt/sha1.c
+++ b/
lib/silccrypt/sha1.c
@@
-59,12
+59,12
@@
SILC_HASH_API_CONTEXT_LEN(sha1)
/* Hash a single 512-bit block. This is the core of the algorithm. */
/* Hash a single 512-bit block. This is the core of the algorithm. */
-void SHA1Transform(u
nsigned long
state[5], unsigned char buffer[64])
+void SHA1Transform(u
int32
state[5], unsigned char buffer[64])
{
{
-u
nsigned long
a, b, c, d, e;
+u
int32
a, b, c, d, e;
typedef union {
unsigned char c[64];
typedef union {
unsigned char c[64];
- u
nsigned long
l[16];
+ u
int32
l[16];
} CHAR64LONG16;
CHAR64LONG16* block;
static unsigned char workspace[64];
} CHAR64LONG16;
CHAR64LONG16* block;
static unsigned char workspace[64];
@@
-124,9
+124,9
@@
void SHA1Init(SHA1_CTX* context)
/* Run your data through this. */
/* Run your data through this. */
-void SHA1Update(SHA1_CTX* context, unsigned char* data, u
nsigned int
len)
+void SHA1Update(SHA1_CTX* context, unsigned char* data, u
int32
len)
{
{
-u
nsigned int
i, j;
+u
int32
i, j;
j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
@@
-148,7
+148,7
@@
unsigned int i, j;
void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
{
void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
{
-u
nsigned long
i, j;
+u
int32
i, j;
unsigned char finalcount[8];
for (i = 0; i < 8; i++) {
unsigned char finalcount[8];
for (i = 0; i < 8; i++) {