mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-27 11:50:29 +00:00
Restore MARS capability to use 448-bit keys
This commit is contained in:
parent
69f3d9483e
commit
58c33810e7
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, 32, 8>
|
||||
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 58, 8>
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "MARS";}
|
||||
};
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user