| 2080 | } |
| 2081 | |
| 2082 | bool 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 | |
| 2104 | bool ValidateGOST() |
| 2105 | { |