VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/Serpent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto/Serpent.c')
-rw-r--r--src/Crypto/Serpent.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Crypto/Serpent.c b/src/Crypto/Serpent.c
index ac77b397..91a4eadf 100644
--- a/src/Crypto/Serpent.c
+++ b/src/Crypto/Serpent.c
@@ -630,19 +630,16 @@ static void KXf (const unsigned __int32 *k, unsigned int r, unsigned __int32 *a,
#ifndef TC_MINIMIZE_CODE_SIZE
-void serpent_set_key(const unsigned __int8 userKey[], int keylen, unsigned __int8 *ks)
+void serpent_set_key(const unsigned __int8 userKey[],unsigned __int8 *ks)
{
unsigned __int32 a,b,c,d,e;
unsigned __int32 *k = (unsigned __int32 *)ks;
unsigned __int32 t;
int i;
- for (i = 0; i < keylen / (int)sizeof(__int32); i++)
+ for (i = 0; i < 8; i++)
k[i] = LE32(((unsigned __int32*)userKey)[i]);
- if (keylen < 32)
- k[keylen/4] |= (unsigned __int32)1 << ((keylen%4)*8);
-
k += 8;
t = k[-1];
for (i = 0; i < 132; ++i)
@@ -694,19 +691,16 @@ static void SKf (unsigned __int32 *k, unsigned int r, unsigned __int32 *a, unsig
k[r + 7] = *d;
}
-void serpent_set_key(const unsigned __int8 userKey[], int keylen, unsigned __int8 *ks)
+void serpent_set_key(const unsigned __int8 userKey[], unsigned __int8 *ks)
{
unsigned __int32 a,b,c,d,e;
unsigned __int32 *k = (unsigned __int32 *)ks;
unsigned __int32 t;
int i;
- for (i = 0; i < keylen / (int)sizeof(__int32); i++)
+ for (i = 0; i < 8; i++)
k[i] = LE32(((unsigned __int32*)userKey)[i]);
- if (keylen < 32)
- k[keylen/4] |= (unsigned __int32)1 << ((keylen%4)*8);
-
k += 8;
t = k[-1];
for (i = 0; i < 132; ++i)