summaryrefslogtreecommitdiff
path: root/md2.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-04-15 00:38:48 +0000
committerweidai <weidai11@users.noreply.github.com>2003-04-15 00:38:48 +0000
commitd52b49c51f5c87180cb561b666dd6085556f6c3b (patch)
tree2be608b49b99003d7d6f49ac33abd7bbe763d7d9 /md2.cpp
parentb4f6ef8e16db0be6ebc3e8aa01bf51ee52082aeb (diff)
downloadcryptopp-git-d52b49c51f5c87180cb561b666dd6085556f6c3b.tar.gz
fix bug in Grouper
add RIPEMD-???, Whirlpool, Shacal2, Camellia, Two-Track MAC (Kevin Springle) change ChannelSwitch to allow non-blocking input (denis bider) change Redirector to allow more options (denis bider) fix MaurerRandomnessTest optimize MD2 (Kevin Springle)
Diffstat (limited to 'md2.cpp')
-rw-r--r--md2.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/md2.cpp b/md2.cpp
index aa1a28cb..a010dc08 100644
--- a/md2.cpp
+++ b/md2.cpp
@@ -80,8 +80,17 @@ void MD2::Update(const byte *buf, unsigned int len)
t=0;
for(i=0; i<18; i++)
{
- for(j=0; j<48; j++)
- t=m_X[j]^=S[t];
+ for(j=0; j<48; j+=8)
+ {
+ t=m_X[j+0]^=S[t];
+ t=m_X[j+1]^=S[t];
+ t=m_X[j+2]^=S[t];
+ t=m_X[j+3]^=S[t];
+ t=m_X[j+4]^=S[t];
+ t=m_X[j+5]^=S[t];
+ t=m_X[j+6]^=S[t];
+ t=m_X[j+7]^=S[t];
+ }
t=(t+i) & 0xFF;
}
}