Fix MARS VariableKeyLength information (Issue 252)

This commit is contained in:
Jeffrey Walton 2016-09-05 13:06:26 -04:00
parent 0d14a52790
commit 9767221125
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ void MARS::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by
unsigned int i;
word32 a, b, c, d, l, m, r, t;
const word32 *k = m_k;
Block::Get(inBlock)(a)(b)(c)(d);
a += k[0]; b += k[1]; c += k[2]; d += k[3];
@ -109,7 +109,7 @@ void MARS::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by
const word32 *k = m_k;
Block::Get(inBlock)(d)(c)(b)(a);
d += k[36]; c += k[37]; b += k[38]; a += k[39];
for (i=0; i<8; i++)

2
mars.h
View File

@ -13,7 +13,7 @@ NAMESPACE_BEGIN(CryptoPP)
//! \class MARS_Info
//! \brief MARS block cipher information
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
{
static const char *StaticAlgorithmName() {return "MARS";}
};