aboutsummaryrefslogtreecommitdiffstats
path: root/src/cipher
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-10-01 15:36:02 +0000
committerlloyd <[email protected]>2008-10-01 15:36:02 +0000
commit9b8d9c877ffdf544e180112bfb7dede6da5aa5c6 (patch)
tree3757e5647262f11cd1aa5220c82504daed46967e /src/cipher
parent909389b209d97ac3d7f83d76abef9cf943e7e9c7 (diff)
Wrap 80 columns
Diffstat (limited to 'src/cipher')
-rw-r--r--src/cipher/salsa20/salsa20.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cipher/salsa20/salsa20.cpp b/src/cipher/salsa20/salsa20.cpp
index d11ba8799..1ca45e48f 100644
--- a/src/cipher/salsa20/salsa20.cpp
+++ b/src/cipher/salsa20/salsa20.cpp
@@ -121,12 +121,16 @@ void Salsa20::cipher(const byte in[], byte out[], u32bit length)
*************************************************/
void Salsa20::key(const byte key[], u32bit length)
{
+ static const u32bit TAU[] =
+ { 0x61707865, 0x3120646e, 0x79622d36, 0x6b206574 };
+
+ static const u32bit SIGMA[] =
+ { 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574 };
+
clear();
if(length == 16)
{
- const u32bit TAU[] = { 0x61707865, 0x3120646e, 0x79622d36, 0x6b206574 };
-
state[0] = TAU[0];
state[1] = load_le<u32bit>(key, 0);
state[2] = load_le<u32bit>(key, 1);
@@ -142,8 +146,6 @@ void Salsa20::key(const byte key[], u32bit length)
}
else if(length == 32)
{
- const u32bit SIGMA[] = { 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574 };
-
state[0] = SIGMA[0];
state[1] = load_le<u32bit>(key, 0);
state[2] = load_le<u32bit>(key, 1);