aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/des/des.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/block/des/des.cpp')
-rw-r--r--src/lib/block/des/des.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/block/des/des.cpp b/src/lib/block/des/des.cpp
index 6d2bcfe1e..88671df8d 100644
--- a/src/lib/block/des/des.cpp
+++ b/src/lib/block/des/des.cpp
@@ -154,7 +154,7 @@ void DES::encrypt_n(const byte in[], byte out[], size_t blocks) const
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
- des_encrypt(L, R, round_key.data());
+ des_encrypt(L, R, m_round_key.data());
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) |
@@ -184,7 +184,7 @@ void DES::decrypt_n(const byte in[], byte out[], size_t blocks) const
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
- des_decrypt(L, R, round_key.data());
+ des_decrypt(L, R, m_round_key.data());
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) |
@@ -205,13 +205,13 @@ void DES::decrypt_n(const byte in[], byte out[], size_t blocks) const
*/
void DES::key_schedule(const byte key[], size_t)
{
- round_key.resize(32);
- des_key_schedule(round_key.data(), key);
+ m_round_key.resize(32);
+ des_key_schedule(m_round_key.data(), key);
}
void DES::clear()
{
- zap(round_key);
+ zap(m_round_key);
}
/*
@@ -229,9 +229,9 @@ void TripleDES::encrypt_n(const byte in[], byte out[], size_t blocks) const
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
- des_encrypt(L, R, &round_key[0]);
- des_decrypt(R, L, &round_key[32]);
- des_encrypt(L, R, &round_key[64]);
+ des_encrypt(L, R, &m_round_key[0]);
+ des_decrypt(R, L, &m_round_key[32]);
+ des_encrypt(L, R, &m_round_key[64]);
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) |
@@ -262,9 +262,9 @@ void TripleDES::decrypt_n(const byte in[], byte out[], size_t blocks) const
u32bit L = static_cast<u32bit>(T >> 32);
u32bit R = static_cast<u32bit>(T);
- des_decrypt(L, R, &round_key[64]);
- des_encrypt(R, L, &round_key[32]);
- des_decrypt(L, R, &round_key[0]);
+ des_decrypt(L, R, &m_round_key[64]);
+ des_encrypt(R, L, &m_round_key[32]);
+ des_decrypt(L, R, &m_round_key[0]);
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) |
@@ -285,19 +285,19 @@ void TripleDES::decrypt_n(const byte in[], byte out[], size_t blocks) const
*/
void TripleDES::key_schedule(const byte key[], size_t length)
{
- round_key.resize(3*32);
- des_key_schedule(&round_key[0], key);
- des_key_schedule(&round_key[32], key + 8);
+ m_round_key.resize(3*32);
+ des_key_schedule(&m_round_key[0], key);
+ des_key_schedule(&m_round_key[32], key + 8);
if(length == 24)
- des_key_schedule(&round_key[64], key + 16);
+ des_key_schedule(&m_round_key[64], key + 16);
else
- copy_mem(&round_key[64], &round_key[0], 32);
+ copy_mem(&m_round_key[64], &m_round_key[0], 32);
}
void TripleDES::clear()
{
- zap(round_key);
+ zap(m_round_key);
}
}