Fix MARS VariableKeyLength information (Issue 252)
parent
0d14a52790
commit
9767221125
4
mars.cpp
4
mars.cpp
|
|
@ -58,7 +58,7 @@ void MARS::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
word32 a, b, c, d, l, m, r, t;
|
word32 a, b, c, d, l, m, r, t;
|
||||||
const word32 *k = m_k;
|
const word32 *k = m_k;
|
||||||
|
|
||||||
Block::Get(inBlock)(a)(b)(c)(d);
|
Block::Get(inBlock)(a)(b)(c)(d);
|
||||||
|
|
||||||
a += k[0]; b += k[1]; c += k[2]; d += k[3];
|
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;
|
const word32 *k = m_k;
|
||||||
|
|
||||||
Block::Get(inBlock)(d)(c)(b)(a);
|
Block::Get(inBlock)(d)(c)(b)(a);
|
||||||
|
|
||||||
d += k[36]; c += k[37]; b += k[38]; a += k[39];
|
d += k[36]; c += k[37]; b += k[38]; a += k[39];
|
||||||
|
|
||||||
for (i=0; i<8; i++)
|
for (i=0; i<8; i++)
|
||||||
|
|
|
||||||
2
mars.h
2
mars.h
|
|
@ -13,7 +13,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! \class MARS_Info
|
//! \class MARS_Info
|
||||||
//! \brief MARS block cipher information
|
//! \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";}
|
static const char *StaticAlgorithmName() {return "MARS";}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue