Restore MARS capability to use 448-bit keys

This commit is contained in:
Uri Blumenthal 2016-09-16 12:19:12 -04:00
parent 69f3d9483e
commit 58c33810e7
2 changed files with 5 additions and 5 deletions

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, 32, 8>
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 58, 8>
{
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "MARS";}
};

View File

@ -2500,8 +2500,8 @@ bool ValidateMARS()
pass1 = enc.StaticGetValidKeyLength(16) == 16 && pass1;
pass1 = enc.StaticGetValidKeyLength(24) == 24 && pass1;
pass1 = enc.StaticGetValidKeyLength(32) == 32 && pass1;
pass1 = enc.StaticGetValidKeyLength(64) == 32 && pass1;
pass1 = enc.StaticGetValidKeyLength(128) == 32 && pass1;
pass1 = enc.StaticGetValidKeyLength(64) == 58 && pass1;
pass1 = enc.StaticGetValidKeyLength(128) == 58 && pass1;
pass1 = enc.StaticGetValidKeyLength(0) == enc.MinKeyLength() && pass1;
pass1 = enc.StaticGetValidKeyLength(SIZE_MAX) == enc.MaxKeyLength() && pass1;
@ -2510,8 +2510,8 @@ bool ValidateMARS()
pass2 = dec.StaticGetValidKeyLength(16) == 16 && pass2;
pass2 = dec.StaticGetValidKeyLength(24) == 24 && pass2;
pass2 = dec.StaticGetValidKeyLength(32) == 32 && pass2;
pass2 = dec.StaticGetValidKeyLength(64) == 32 && pass2;
pass2 = dec.StaticGetValidKeyLength(128) == 32 && pass2;
pass2 = dec.StaticGetValidKeyLength(64) == 58 && pass2;
pass2 = dec.StaticGetValidKeyLength(128) == 58 && pass2;
pass2 = dec.StaticGetValidKeyLength(0) == dec.MinKeyLength() && pass2;
pass2 = dec.StaticGetValidKeyLength(SIZE_MAX) == dec.MaxKeyLength() && pass2;
cout << (pass1 && pass2 ? "passed:" : "FAILED:") << " Algorithm key lengths\n";