aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/des
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-09-21 16:44:01 +0000
committerlloyd <[email protected]>2009-09-21 16:44:01 +0000
commit57849f8f9a9de40abbf29a2fdb453dfe7d726974 (patch)
treec66acd9b314b1dc4a21c4bad434901239eeb472d /src/block/des
parentb086b54c16383da44eebfa8f14d55e6e50dc87b8 (diff)
Indentation fix
Diffstat (limited to 'src/block/des')
-rw-r--r--src/block/des/des.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/block/des/des.cpp b/src/block/des/des.cpp
index 1c9d37e6b..05287304f 100644
--- a/src/block/des/des.cpp
+++ b/src/block/des/des.cpp
@@ -144,9 +144,9 @@ void DES::encrypt_n(const byte in[], byte out[], u32bit blocks) const
for(u32bit i = 0; i != blocks; ++i)
{
u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) |
- (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) |
- (DES_IPTAB1[in[4]] << 4) | (DES_IPTAB1[in[5]] << 5) |
- (DES_IPTAB1[in[6]] << 6) | (DES_IPTAB2[in[7]] );
+ (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) |
+ (DES_IPTAB1[in[4]] << 4) | (DES_IPTAB1[in[5]] << 5) |
+ (DES_IPTAB1[in[6]] << 6) | (DES_IPTAB2[in[7]] );
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
@@ -154,10 +154,9 @@ void DES::encrypt_n(const byte in[], byte out[], u32bit blocks) const
des_encrypt(L, R, round_key);
T = (DES_FPTAB1[get_byte(0, L)] << 5) | (DES_FPTAB1[get_byte(1, L)] << 3) |
- (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) |
- (DES_FPTAB1[get_byte(0, R)] << 4) | (DES_FPTAB1[get_byte(1, R)] << 2) |
- (DES_FPTAB1[get_byte(2, R)] ) | (DES_FPTAB2[get_byte(3, R)] );
-
+ (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) |
+ (DES_FPTAB1[get_byte(0, R)] << 4) | (DES_FPTAB1[get_byte(1, R)] << 2) |
+ (DES_FPTAB1[get_byte(2, R)] ) | (DES_FPTAB2[get_byte(3, R)] );
T = rotate_left(T, 32);
store_be(T, out);
@@ -175,9 +174,9 @@ void DES::decrypt_n(const byte in[], byte out[], u32bit blocks) const
for(u32bit i = 0; i != blocks; ++i)
{
u64bit T = (DES_IPTAB1[in[0]] ) | (DES_IPTAB1[in[1]] << 1) |
- (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) |
- (DES_IPTAB1[in[4]] << 4) | (DES_IPTAB1[in[5]] << 5) |
- (DES_IPTAB1[in[6]] << 6) | (DES_IPTAB2[in[7]] );
+ (DES_IPTAB1[in[2]] << 2) | (DES_IPTAB1[in[3]] << 3) |
+ (DES_IPTAB1[in[4]] << 4) | (DES_IPTAB1[in[5]] << 5) |
+ (DES_IPTAB1[in[6]] << 6) | (DES_IPTAB2[in[7]] );
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
@@ -185,9 +184,9 @@ void DES::decrypt_n(const byte in[], byte out[], u32bit blocks) const
des_decrypt(L, R, round_key);
T = (DES_FPTAB1[get_byte(0, L)] << 5) | (DES_FPTAB1[get_byte(1, L)] << 3) |
- (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) |
- (DES_FPTAB1[get_byte(0, R)] << 4) | (DES_FPTAB1[get_byte(1, R)] << 2) |
- (DES_FPTAB1[get_byte(2, R)] ) | (DES_FPTAB2[get_byte(3, R)] );
+ (DES_FPTAB1[get_byte(2, L)] << 1) | (DES_FPTAB2[get_byte(3, L)] << 1) |
+ (DES_FPTAB1[get_byte(0, R)] << 4) | (DES_FPTAB1[get_byte(1, R)] << 2) |
+ (DES_FPTAB1[get_byte(2, R)] ) | (DES_FPTAB2[get_byte(3, R)] );
T = rotate_left(T, 32);