20 void encrypt_n(
const uint8_t in[], uint8_t out[],
size_t blocks)
const override;
21 void decrypt_n(
const uint8_t in[], uint8_t out[],
size_t blocks)
const override;
23 void clear()
override;
25 std::string
name()
const override {
return "Twofish"; }
27 std::unique_ptr<BlockCipher>
new_object()
const override {
return std::make_unique<Twofish>(); }
32 void key_schedule(std::span<const uint8_t> key)
override;
34 static const uint32_t MDS0[256];
35 static const uint32_t MDS1[256];
36 static const uint32_t MDS2[256];
37 static const uint32_t MDS3[256];
38 static const uint8_t Q0[256];
39 static const uint8_t Q1[256];
40 static const uint8_t RS[32];
41 static const uint8_t EXP_TO_POLY[255];
42 static const uint8_t POLY_TO_EXP[255];