mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Fix MARS VariableKeyLength information (Issue 252)
This commit is contained in:
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;
|
||||
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
2
mars.h
@ -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";}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user