MCPcopy Create free account
hub / github.com/LUX-Core/lux / ValidateThreeWay

Function ValidateThreeWay

src/cryptopp/validat1.cpp:2082–2102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2080}
2081
2082bool ValidateThreeWay()
2083{
2084 cout << "\n3-WAY validation suite running...\n\n";
2085 bool pass1 = true, pass2 = true;
2086
2087 ThreeWayEncryption enc; // 96-bit only
2088 pass1 = ThreeWayEncryption::KEYLENGTH == 12 && pass1;
2089 pass1 = enc.StaticGetValidKeyLength(8) == 12 && pass1;
2090 pass1 = enc.StaticGetValidKeyLength(12) == 12 && pass1;
2091 pass1 = enc.StaticGetValidKeyLength(16) == 12 && pass1;
2092
2093 ThreeWayDecryption dec; // 96-bit only
2094 pass2 = ThreeWayDecryption::KEYLENGTH == 12 && pass2;
2095 pass2 = dec.StaticGetValidKeyLength(8) == 12 && pass2;
2096 pass2 = dec.StaticGetValidKeyLength(12) == 12 && pass2;
2097 pass2 = dec.StaticGetValidKeyLength(16) == 12 && pass2;
2098 cout << (pass1 && pass2 ? "passed:" : "FAILED:") << " Algorithm key lengths\n";
2099
2100 FileSource valdata(CRYPTOPP_DATA_DIR "TestData/3wayval.dat", true, new HexDecoder);
2101 return BlockTransformationTest(FixedRoundsCipherFactory<ThreeWayEncryption, ThreeWayDecryption>(), valdata) && pass1 && pass2;
2102}
2103
2104bool ValidateGOST()
2105{

Callers 2

ValidateFunction · 0.85
ValidateAllFunction · 0.85

Calls 2

BlockTransformationTestFunction · 0.85

Tested by 1

ValidateFunction · 0.68