diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index ce12cfe99..9ea83461d 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -71,7 +71,7 @@ jobs: - name: Run C++ curve Tests working-directory: ./icicle/build/tests if: needs.check-changed-files.outputs.cpp == 'true' - run: ctest + run: ctest --output-on-failure test-linux-field: name: Test on Linux @@ -107,4 +107,4 @@ jobs: - name: Run C++ field Tests working-directory: ./icicle/build/tests if: needs.check-changed-files.outputs.cpp == 'true' - run: ctest --output-on-failure \ No newline at end of file + run: ctest --output-on-failure diff --git a/icicle/backend/cpu/src/field/cpu_vec_ops.cpp b/icicle/backend/cpu/src/field/cpu_vec_ops.cpp index 09e3d8095..a673286f4 100644 --- a/icicle/backend/cpu/src/field/cpu_vec_ops.cpp +++ b/icicle/backend/cpu/src/field/cpu_vec_ops.cpp @@ -10,6 +10,9 @@ #include #include +#include "icicle/program/program.h" +#include "cpu_program_executor.h" + using namespace field_config; using namespace icicle; @@ -32,7 +35,7 @@ enum VecOperation { REPLACE_ELEMENTS, OUT_OF_PLACE_MATRIX_TRANSPOSE, - NOF_OPERATIONS + NOF_VECTOR_OPERATIONS }; /** @@ -329,7 +332,7 @@ class VectorOpTask : public TaskBase // An array of available function pointers arranged according to the VecOperation enum using FunctionPtr = void (VectorOpTask::*)(); - static constexpr std::array(NOF_OPERATIONS)> functionPtrs = { + static constexpr std::array(NOF_VECTOR_OPERATIONS)> functionPtrs = { &VectorOpTask::vector_add, // VECTOR_ADD, &VectorOpTask::vector_sub, // VECTOR_SUB, &VectorOpTask::vector_mul, // VECTOR_MUL, @@ -838,6 +841,34 @@ eIcicleError cpu_highest_non_zero_idx( REGISTER_HIGHEST_NON_ZERO_IDX_BACKEND("CPU", cpu_highest_non_zero_idx); +/*********************************** Execute program ***********************************/ +template +eIcicleError cpu_execute_program(std::vector& data, Program& program, uint64_t size, const VecOpsConfig& config) +{ + if (data.size() != program.m_nof_parameters) { + ICICLE_LOG_ERROR << "Program has " << program.m_nof_parameters << " while data has " << data.size() + << " parameters"; + return eIcicleError::INVALID_ARGUMENT; + } + const uint64_t total_nof_operations = size * config.batch_size; + CpuProgramExecutor prog_executor(program); + // init prog_executor to point to data vectors + for (int param_idx = 0; param_idx < program.m_nof_parameters; ++param_idx) { + prog_executor.m_variable_ptrs[param_idx] = data[param_idx]; + } + + // run over all elements in the arrays and execute the program + for (uint64_t i = 0; i < total_nof_operations; i++) { + prog_executor.execute(); + for (auto& var_ptr : prog_executor.m_variable_ptrs) { + var_ptr++; + } + } + return eIcicleError::SUCCESS; +} + +// REGISTER_EXECUTE_PROGRAM_BACKEND("CPU", cpu_execute_program); + /*********************************** Polynomial evaluation ***********************************/ template diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/babybear_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/babybear_poseidon2.h new file mode 100644 index 000000000..4a54b17a7 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/babybear_poseidon2.h @@ -0,0 +1,317 @@ +#pragma once +#ifndef BABYBEAR_POSEIDON2_H + #define BABYBEAR_POSEIDON2_H + + #include + +namespace poseidon2_constants_babybear { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 12; + int half_full_rounds_2 = 6; + int partial_rounds_2 = 24; + int alpha_2 = 7; + + static const std::string rounds_constants_2[] = { + "0x76a8932a", "0xbb32543", "0x54a11a80", "0x29f09389", "0x4b8a8ec1", "0x3fa2f7a2", "0x2be3fd0c", "0x6ab70c3d", + "0xcd8e8f1", "0x3a34c8f0", "0x3c11bf77", "0x27eb37f3", "0x6dcafcd", "0x19fd4b2a", "0x1ccd65c3", "0x3733a0c2", + "0x18b43754", "0x2ed74076", "0x368f93a6", "0xe8024cd", "0x3b8f289a", "0x4f5afa7b", "0x64c82b68", "0x76245680", + "0x1ab4ac2f", "0x3ca5f68e", "0x14bd49b1", "0x52d03b15", "0x8cd74b3", "0x1edb152a", "0x3037497a", "0x498a68ec", + "0x6b11f228", "0x21214194", "0x640be0ba", "0x4bd18241", "0x20094634", "0x126e22d8", "0x42d213d1", "0x667db627", + "0x29345ea8", "0x4e79edfa", "0x22abc20", "0x36a8e6ca", "0x5f11d45", "0x311d4622", "0x346d7598", "0x61b18ef3"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 12; + int half_full_rounds_3 = 6; + int partial_rounds_3 = 17; + int alpha_3 = 7; + + static const std::string rounds_constants_3[] = { + "0x460c6c97", "0x763f1345", "0x354fb969", "0x650244d", "0x742c7bad", "0x420ae4e6", "0x24b1922f", "0x54b38487", + "0x67d8a525", "0xe3721d8", "0x4bb8f261", "0x67830d12", "0x70129a6c", "0x11ba69e0", "0x463bf841", "0x32d4a62f", + "0x67278981", "0x13955c1f", "0x26609020", "0x38f57776", "0x4684140d", "0x937fa72", "0x39c9ed0", "0xa8c4f4e", + "0x4353324d", "0x70ac28", "0x1bb3e99b", "0x4ebe72d0", "0x265dc2d3", "0x17749f7", "0x69265d86", "0xe8c9842", + "0x4c0cd782", "0x64374361", "0x158e5174", "0xb5c6575", "0x87a66c2", "0x67afa498", "0x1b7f0922", "0x25b48cdd", + "0x1919afc", "0x523aff57", "0x3c000cf8", "0x21007c9a", "0x3df614a1", "0x6f9ca329", "0x17fe10cf", "0x1858c1a1", + "0x6779c6fe", "0xa4ca12c", "0x36180c4d", "0x54d17e59", "0x23bcabd8"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 21; + int alpha_4 = 7; + + static const std::string rounds_constants_4[] = { + "0x1b149b6a", "0x550ada3b", "0x22880f72", "0x162976de", "0x1459035b", "0x5b23b851", "0xecb6c50", "0x5e25906e", + "0x2e627964", "0x13edaf43", "0xf39a91a", "0x4d1036b2", "0x7151a71", "0x688d32c", "0x640c2308", "0x4a823ac0", + "0x664a061a", "0x735f9276", "0x1d33aa59", "0x444266ad", "0x65a98dc1", "0x210f7e1c", "0x5c429eb", "0x12c9f1d5", + "0x56e16908", "0x2cc4000f", "0x4cc1175d", "0x4696830c", "0x7276ab5e", "0x429e580", "0x1eaddf35", "0x3d04814b", + "0xce9d10c", "0xc1bd2b2", "0x5c0afe62", "0x41d3d05c", "0x4ea8fba8", "0x36415973", "0x1f6c2a2b", "0xfc447c9", + "0xe06ec31", "0x759e0d3b", "0x53928b9d", "0x1f031a41", "0x84357dc", "0x18a44a08", "0x4e979922", "0x591b777e", + "0x1698aa28", "0x6c89ede2", "0x49941eeb", "0x23d71466", "0x4ca1ef20"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = {"0x35bf6f48", "0x698266a0", "0x41f852b3", "0x375cdab9"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 12; + int alpha_8 = 7; + + static const std::string rounds_constants_8[] = { + "0x11978cde", "0x531baacd", "0x62fc3e61", "0x6c5443d7", "0x213f7bea", "0x441daf50", "0x5b73b0ca", "0x37ac458a", + "0x578d452a", "0x1105d869", "0x5f972521", "0x638ac688", "0x22bb206c", "0x3d2bb74b", "0x8b3659e", "0x5c994035", + "0xbf823b5", "0xf126f71", "0x4b3f0e22", "0x3274c979", "0x2a7e2fde", "0x4c5efc43", "0x51c10a78", "0x1b63549b", + "0x3f6b4823", "0x4e3d9da4", "0x669fe91c", "0x51f27231", "0x47eb6c6c", "0x2cbe68db", "0x3a09b20d", "0x19cd3c02", + "0x3d69b95e", "0x47e08f02", "0x73d51f24", "0x18689a99", "0x2d7d8b9d", "0x2a19c971", "0xafebd15", "0x69b8a7ff", + "0x1bb20d3b", "0x24fa2759", "0x7334f71d", "0x9e230b1", "0x794f50d", "0x74d2212", "0x1a6c8f20", "0x1babe8f5", + "0x16d15c2e", "0x49fbb5fc", "0x1ecdf383", "0x63dc7bc", "0x545d4a85", "0x6a49504c", "0x3843670c", "0x586e0569", + "0x2aa801dd", "0x38b4af42", "0x5937ccae", "0x2d7d72a6", "0x511a5bd1", "0xdc9f554", "0x2c3e286e", "0x302b45be", + "0x6ee05fcc", "0x27638646", "0x2b6fc4a2", "0x4c10b913", "0x420471d2", "0x29b908d2", "0x33f97fd5", "0x6834fc5", + "0x70bee4ed", "0x4fe57541", "0x620e9e99", "0x6355ade6"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = {"0x17a3691c", "0x84987a", "0x1f7b62e4", "0x5967b11", + "0x427c865b", "0x3f3341af", "0x52490f5c", "0x468846c6"}; + + int full_rounds_12 = 8; + int half_full_rounds_12 = 4; + int partial_rounds_12 = 10; + int alpha_12 = 7; + + static const std::string rounds_constants_12[] = { + "0x44d3bb88", "0x774148c9", "0x1562425e", "0x5070628b", "0x68799490", "0x46f432e", "0xf2e4358", "0x53c99049", + "0x751c6051", "0x5b9ebc5a", "0x58893f0", "0xdd5dd7d", "0x4c2b4eac", "0x5a528be0", "0x675fbcc3", "0x740c9d60", + "0x4bc6dec2", "0x23c5a8e4", "0x3189bd8c", "0x11ce185c", "0x68b9bb90", "0x670e9d8f", "0x703eadbc", "0x7102faf0", + "0x576838aa", "0x1b6c76c6", "0x51f500b4", "0x15d639b6", "0x5c0245c9", "0x6f8df3bb", "0x4d0cc32b", "0x47b3c08b", + "0x19292b3c", "0x96230be", "0x173c9b43", "0x253558fa", "0x72787bae", "0x47ca9db3", "0x44234b4b", "0x4f47de93", + "0x7309f557", "0xe7113f8", "0x5ccfa802", "0x45f84e30", "0x518a065f", "0x2f6df559", "0x69815d68", "0x273fe8a1", + "0x43317763", "0x74e4c89e", "0x42162b7e", "0x2ea3f9a5", "0x2bb30c04", "0x24744474", "0x69e8a40b", "0x50951c70", + "0x47ff91bf", "0x5d7f98c6", "0x2bceacc0", "0x32a22f3b", "0x6e4b4664", "0x45d5907c", "0x2aa63f10", "0x48edb36d", + "0x4ce8a0f9", "0x190673fe", "0x74878323", "0xc953e5b", "0x6c251bb8", "0x6a1b0031", "0x66c83144", "0x29e57c9a", + "0x70c4d4bc", "0x4aef5f94", "0x358a7014", "0x78d8eae", "0x416be810", "0x77dacb86", "0x36958cc3", "0x3d125dbd", + "0x6ce43bf2", "0x16e0b7e0", "0x50de3232", "0x3466fea8", "0x1dabba6d", "0x5cefe2b6", "0xfcb3de4", "0x16d0a86a", + "0x2bb9da47", "0x1aab3a29", "0x2e0ada0b", "0x3c3ee3b6", "0x3a678be3", "0x19fee590", "0x84ff04", "0x35ae6b25", + "0x761eaf7d", "0xed3fca7", "0x156b59c4", "0x55e273f5", "0x2f1907f5", "0x3430dd1d", "0x101600c6", "0x66b38947", + "0x212250e0", "0x62befa2c"}; + + static const std::string mds_matrix_12[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_12[] = {"0x5ce6d180", "0x392b0108", "0xcbd124d", "0x6f099b7", + "0x6cb3ebb5", "0x363069b2", "0x4de47c38", "0x6af5a0c", + "0x52a0045f", "0x3e9f380e", "0xdf8c11f", "0x63a32986"}; + + int full_rounds_16 = 8; + int half_full_rounds_16 = 4; + int partial_rounds_16 = 13; + int alpha_16 = 7; + + static const std::string rounds_constants_16[] = { + "0x69cbb6af", "0x46ad93f9", "0x60a00f4e", "0x6b1297cd", "0x23189afe", "0x732e7bef", "0x72c246de", "0x2c941900", + "0x557eede", "0x1580496f", "0x3a3ea77b", "0x54f3f271", "0xf49b029", "0x47872fe1", "0x221e2e36", "0x1ab7202e", + "0x487779a6", "0x3851c9d8", "0x38dc17c0", "0x209f8849", "0x268dcee8", "0x350c48da", "0x5b9ad32e", "0x523272b", + "0x3f89055b", "0x1e894b2", "0x13ddedde", "0x1b2ef334", "0x7507d8b4", "0x6ceeb94e", "0x52eb6ba2", "0x50642905", + "0x5453f3f", "0x6349efc", "0x6922787c", "0x4bfff9c", "0x768c714a", "0x3e9ff21a", "0x15737c9c", "0x2229c807", + "0xd47f88c", "0x97e0ecc", "0x27eadba0", "0x2d7d29e4", "0x3502aaa0", "0xf475fd7", "0x29fbda49", "0x18afffd", + "0x315b618", "0x6d4497d1", "0x1b171d9e", "0x52861abd", "0x2e5d0501", "0x3ec8646c", "0x6e5f250a", "0x148ae8e6", + "0x17f5fa4a", "0x3e66d284", "0x51aa3b", "0x483f7913", "0x2cfe5f15", "0x23427ca", "0x2cc78315", "0x1e36ea47", + "0x5a8053c0", "0x693be639", "0x3858867d", "0x19334f6b", "0x128f0fd8", "0x4e2b1ccb", "0x61210ce0", "0x3c318939", + "0xb5b2f22", "0x2edb11d5", "0x213effdf", "0xcac4606", "0x241af16d", "0x7290a80d", "0x6f7e5329", "0x598ec8a8", + "0x76a859a0", "0x6559e868", "0x657b83af", "0x13271d3f", "0x1f876063", "0xaeeae37", "0x706e9ca6", "0x46400cee", + "0x72a05c26", "0x2c589c9e", "0x20bd37a7", "0x6a2d3d10", "0x20523767", "0x5b8fe9c4", "0x2aa501d6", "0x1e01ac3e", + "0x1448bc54", "0x5ce5ad1c", "0x4918a14d", "0x2c46a83f", "0x4fcf6876", "0x61d8d5c8", "0x6ddf4ff9", "0x11fda4d3", + "0x2933a8f", "0x170eaf81", "0x5a9c314f", "0x49a12590", "0x35ec52a1", "0x58eb1611", "0x5e481e65", "0x367125c9", + "0xeba33ba", "0x1fc28ded", "0x66399ad", "0xcbec0ea", "0x75fd1af0", "0x50f5bf4e", "0x643d5f41", "0x6f4fe718", + "0x5b3cbbde", "0x1e3afb3e", "0x296fb027", "0x45e1547b", "0x4a8db2ab", "0x59986d19", "0x30bcdfa3", "0x1db63932", + "0x1d7c2824", "0x53b33681", "0x673b747", "0x38a98a3", "0x2c5bce60", "0x351979cd", "0x5008fb73", "0x547bca78", + "0x711af481", "0x3f93bf64", "0x644d987b", "0x3c8bcd87", "0x608758b8"}; + + static const std::string mds_matrix_16[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_16[] = { + "0xa632d95", "0x6db657b8", "0x56fbdc9f", "0x52b3d8b", "0x33745202", "0x5c03108d", "0xbeba37c", "0x258c2e8c", + "0x12029f3a", "0x694909cf", "0x6d231725", "0x21c3b223", "0x3c0904a6", "0x1d6acdb", "0x27705c84", "0x5231c803"}; + + int full_rounds_20 = 8; + int half_full_rounds_20 = 4; + int partial_rounds_20 = 18; + int alpha_20 = 7; + + static const std::string rounds_constants_20[] = { + "0x30cd4497", "0x67cf7d92", "0x113ca786", "0x28f511f7", "0x4c850311", "0x3dc07be8", "0xc8214b9", "0x18090d97", + "0x684f35fb", "0x11eeba68", "0x567d0ca7", "0x6d3fbebc", "0x47028460", "0x9a8d433", "0x46bc5d5c", "0x110805b2", + "0x50dddc82", "0x1ee4fa", "0x55ed4719", "0x4708bdce", "0x1a530b2b", "0x6d372400", "0x32101d42", "0x2b0d7d0", + "0x3064f512", "0x670f3c64", "0x35735e31", "0x5a2b6144", "0x210d6ba6", "0x1274e66a", "0x212e3e09", "0x57e62ff0", + "0x6b631874", "0x6b577a1b", "0xd17fdaa", "0x24ebe81b", "0x34f6c9fe", "0x591d5a55", "0x5f45a942", "0x5e454f3f", + "0x23b75633", "0x55076170", "0x3caa9482", "0x6a2cbf00", "0x7224801b", "0x74bb2d64", "0x2e6d0990", "0x23eab921", + "0x663603a8", "0x3e8e97f", "0x4db5d3d", "0x64c1e827", "0x37c478fe", "0x35efc805", "0x555aaef9", "0x6563ad0c", + "0x14c9aeac", "0x16d6e172", "0x424fcbe9", "0x30380855", "0x74d4e5bf", "0x1275ba83", "0x56f32a2d", "0x3cf97f89", + "0x440c5711", "0x48687e8a", "0x496600f8", "0xb0e429f", "0x154b1e26", "0x379bb8ce", "0x277683e5", "0x4403e094", + "0x12033240", "0x3bd006d7", "0x4ee6ee1b", "0x62c6764c", "0x7230552f", "0x4f341de7", "0x3c8f8c49", "0x6fc6bee2", + "0xa3ef74d", "0x23710107", "0x24650c82", "0x12baebd4", "0x46c2f3ce", "0x57816fd9", "0x443fe51c", "0x2a7805ab", + "0x3f508ef1", "0x150b836c", "0x1c014ffa", "0x1c0786be", "0x10645190", "0x607b9c0a", "0x48961505", "0x6f20b7bb", + "0x5b5aea23", "0x1fe5355c", "0x27ef98aa", "0x43e120b", "0x647d5ccd", "0x455c81b2", "0x6ac27d3f", "0x279f6126", + "0x76a15758", "0x58c1b0a6", "0x4af83901", "0x45641d4f", "0x1dfe8c33", "0x3720c88", "0x3482d40d", "0x770d8960", + "0x6108b730", "0x63fc084", "0x96e2a34", "0x130514a0", "0x42bc3eff", "0x43775848", "0x702960e4", "0x6cf19c79", + "0x4c3030dd", "0x6dd27932", "0x64350de9", "0x480e8311", "0x6a22632c", "0x2814bcf6", "0x117197e3", "0x4844d419", + "0x76e181a6", "0x6155d7b4", "0x42dbed26", "0x62e9c27b", "0x105b4f11", "0x51d45858", "0x33fa0298", "0x26a08228", + "0x5f14581f", "0x3bd89737", "0x2325968f", "0x418512ba", "0x2f47442f", "0xe680af5", "0xc424cba", "0x6d3885ae", + "0xa9c8cbe", "0x2485f2a9", "0x1f99357f", "0xf58d531", "0x32d6f6b1", "0x2c26876d", "0x2de3d38e", "0x5a7b6cc9", + "0x1caec7f0", "0x4aa1f575", "0x77af0ccd", "0x19d3be5c", "0xaa619d8", "0x4cfea78", "0xdb3ab76", "0x2ddffaa3", + "0x52246767", "0x50d7f018", "0x318ceb9f", "0x2e69a506", "0x4bd9d1fa", "0x2a0b579a", "0x561238c2", "0x2877bb9a", + "0x6ed2c79", "0x229998ba", "0x737f0185", "0x609aad31", "0x2cee3551", "0x4434bd17", "0x1da8546f", "0x3532fbe6", + "0x2637b96d", "0x2b04084"}; + + static const std::string mds_matrix_20[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_20[] = { + "0x60531da4", "0x332932dc", "0x61f05e58", "0x614050f9", "0x4323c6de", "0x10b33548", "0x5e5ce1d9", + "0x19a24086", "0x3c697e94", "0x365de6ba", "0x71f95069", "0x350c9229", "0x3883d126", "0x51502e2f", + "0x1a4a8175", "0x1e081b3", "0x54c1086b", "0x1253bc2b", "0x50599b35", "0x25b97c4"}; + + int full_rounds_24 = 8; + int half_full_rounds_24 = 4; + int partial_rounds_24 = 21; + int alpha_24 = 7; + + static const std::string rounds_constants_24[] = { + "0xfa20c37", "0x795bb97", "0x12c60b9c", "0xeabd88e", "0x96485ca", "0x7093527", "0x1b1d4e50", "0x30a01ace", + "0x3bd86f5a", "0x69af7c28", "0x3f94775f", "0x731560e8", "0x465a0ecd", "0x574ef807", "0x62fd4870", "0x52ccfe44", + "0x14772b14", "0x4dedf371", "0x260acd7c", "0x1f51dc58", "0x75125532", "0x686a4d7b", "0x54bac179", "0x31947706", + "0x29799d3b", "0x6e01ae90", "0x203a7a64", "0x4f7e25be", "0x72503f77", "0x45bd3b69", "0x769bd6b4", "0x5a867f08", + "0x4fdba082", "0x251c4318", "0x28f06201", "0x6788c43a", "0x4c6d6a99", "0x357784a8", "0x2abaf051", "0x770f7de6", + "0x1794b784", "0x4796c57a", "0x724b7a10", "0x449989a7", "0x64935cf1", "0x59e14aac", "0xe620bb8", "0x3af5a33b", + "0x4465cc0e", "0x19df68f", "0x4af8d068", "0x8784f82", "0xcefdeae", "0x6337a467", "0x32fa7a16", "0x486f62d6", + "0x386a7480", "0x20f17c4a", "0x54e50da8", "0x2012cf03", "0x5fe52950", "0x9afb6cd", "0x2523044e", "0x5c54d0ef", + "0x71c01f3c", "0x60b2c4fb", "0x4050b379", "0x5e6a70a5", "0x418543f5", "0x71debe56", "0x1aad2994", "0x3368a483", + "0x7a86f3a", "0x5ea43ff1", "0x2443780e", "0x4ce444f7", "0x146f9882", "0x3132b089", "0x197ea856", "0x667030c3", + "0x2317d5dc", "0xc2c48a7", "0x56b2df66", "0x67bd81e9", "0x4fcdfb19", "0x4baaef32", "0x328d30a", "0x6235760d", + "0x12432912", "0xa49e258", "0x30e1b70", "0x48caeb03", "0x49e4d9e9", "0x1051b5c6", "0x6a36dbbe", "0x4cff27a5", + "0x1da78ec2", "0x730b0924", "0x3eb56cf3", "0x5bd93073", "0x37204c97", "0x51642d89", "0x66e943e8", "0x1a3e72de", + "0x70beb1e9", "0x30ff3b3f", "0x4240d1c4", "0x12647b8d", "0x65d86965", "0x49ef4d7c", "0x47785697", "0x46b3969f", + "0x5c7b7a0e", "0x7078fc60", "0x4f22d482", "0x482a9aee", "0x6beb839d", "0x32959ad", "0x2b18af6a", "0x55d3dc8c", + "0x43bd26c8", "0xc41595f", "0x7048d2e2", "0xdb8983", "0x2af563d7", "0x6e84758f", "0x611d64e1", "0x1f9977e2", + "0x64163a0a", "0x5c5fc27b", "0x2e22561", "0x3a2d75db", "0x1ba7b71a", "0x34343f64", "0x7406b35d", "0x19df8299", + "0x6ff4480a", "0x514a81c8", "0x57ab52ce", "0x6ad69f52", "0x3e0c0e0d", "0x48126114", "0x2a9d62cc", "0x17441f23", + "0x485762bb", "0x2f218674", "0x6fdc64a", "0x861b7f2", "0x3b36eee6", "0x70a11040", "0x4b31737", "0x3722a872", + "0x2a351c63", "0x623560dc", "0x62584ab2", "0x382c7c04", "0x3bf9edc7", "0xe38fe51", "0x376f3b10", "0x5381e178", + "0x3afc61c7", "0x5c1bcb4d", "0x6643ce1f", "0x2d0af1c1", "0x8f583cc", "0x5d6ff60f", "0x6324c1e5", "0x74412fb7", + "0x70c0192e", "0xb72f141", "0x4067a111", "0x57388c4f", "0x351009ec", "0x974c159", "0x539a58b3", "0x38c0cff", + "0x476c0392", "0x3f7bc15f", "0x4491dd2c", "0x4d1fef55", "0x4936ae3", "0x58214dd4", "0x683c6aad", "0x1b42f16b", + "0x6dc79135", "0x2d4e71ec", "0x3e2946ea", "0x59dce8db", "0x6cee892a", "0x47f07350", "0x7106ce93", "0x3bd4a7a9", + "0x2bfe636a", "0x430011e9", "0x1cd66a", "0x307faf5b", "0xd9ef3fe", "0x6d40043a", "0x2e8f470c", "0x1b6865e8", + "0xc0e6c01", "0x4d41981f", "0x423b9d3d", "0x410408cc", "0x263f0884", "0x5311bbd0", "0x4dae58d8", "0x30401cea", + "0x9afa575", "0x4b3d5b42", "0x63ac0b37", "0x5fe5bb14", "0x5244e9d4"}; + + static const std::string mds_matrix_24[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_24[] = { + "0x409133f1", "0x1667a8a2", "0x6a6c7b7", "0x6f53160f", "0x273b11d2", "0x3176c5e", "0x72f9bbfa", "0x73ceba92", + "0x5cdef81e", "0x1393286", "0x46daee07", "0x65d7ba7", "0x52d72d70", "0x5dd05e1", "0x3bab4b64", "0x6ada3843", + "0x2fc5fbed", "0x770d61b1", "0x5715aaea", "0x3ef0e91", "0x75b6c771", "0x242adf60", "0xd0ca4d", "0x36c0e389"}; + +} // namespace poseidon2_constants_babybear +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_377_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_377_poseidon2.h new file mode 100644 index 000000000..67cd24f74 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_377_poseidon2.h @@ -0,0 +1,400 @@ +#pragma once +#ifndef BLS12_377_POSEIDON2_H + #define BLS12_377_POSEIDON2_H + + #include + +namespace poseidon2_constants_bls12_377 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 37; + int alpha_2 = 11; + + static const std::string rounds_constants_2[] = { + "0x114e4b6b0e803c1a969645f7495cc94423c94e15f9a3936640041b662e95d54b", + "0x30a734bb9171c000f310c95cd946dc04c7e4bec3144c1cd22fc5bcf84780243", + "0x4f2eff729b5c8a810d972fc8ef728536e467db4b2bcd948f5d7ba200fb29e2b", + "0x3c328ea9b707e7ddab148e3c4989211704004b086f53d3c21a3457ef09ffe6", + "0xf5c98f9a2f3ed8299f455a36668e48dfeabede7712a1151123ca961e9be1e09", + "0x46d91fac24e691f479c5656ab590e7e8039340799843d37c573048444b585b7", + "0x1029929082d61f211c6b519fa4a1e991e0ec714e168277e3b163d79ed6050eba", + "0x4961140330e1032916f43b3b1fafaece2be35d29a8ca7ead486feb2150807a5", + "0x8d9b478912a4096232c1cbb746e3ed1f5782ed49cf2313a2a9a70d1e21be415", + "0xe3fe6503d502801b8940b6f62439f2152507178cd4a070b76d560faec1aa480", + "0xe1e40ce9c5b92e387fd94cd649e0ec6311065c5215491dd9fa088b4fc49fb79", + "0xdf373dd7cd905e8ce335c24c0d4faded2b9bfffc43d970c5d64af2a516737b0", + "0xae879af8a9ea868e1fbb503097cdae1214e5afb5c7d94c56119c51d79c0e5d8", + "0x971516cb84e54e42b4420619646d62507ef0bc9dac2b32e95ee926af6d0fb79", + "0xb3b8b3dff0a9545a5839ae831e1a0ca4b09a53e034644aec48bcb06c51bfa25", + "0xdd6b8944ce75b7cb6ae1092e9897d15f253e1962c85c2f50a68454f5ace7cf3", + "0xd0337a5ca85986807bc7944473101dc9ea9edce01ea1bce148682b2c2cf2b69", + "0x7821ab4d303449aadc1a057eecb208b8adc11fcc0cbb843a31f85e336374f58", + "0x514d5e9cc4932ac9418373a2f7c3999aad5d4fa02234c3018d6a2f2d5885a25", + "0x7d0f542ea401b320d04eb3694ff09961e0dfdfc4295074c9d8149f9ada2837c", + "0x6f88a10290ed0988a10da4b6e7891daa45954d8c4d983932060e8bf2dff1ef", + "0xb404e795e5eaaa3408a59332076af9ee2f9c80d26e47d0bbec6e510334ed81d", + "0x87e3c047e9528e0e9f876f17043a5791ea66bead850718a9b8f23b3088ee751", + "0xf8594d3b335179e9a24c4b666a86176cae89892c01d8b8cc3559542e546e86d", + "0x9f51d2d7c5f7079cd75c0e8c8853da54a693757ce12200b1930fa9d43288ce2", + "0x8baf396f95a2244fd3eeee5e539c5b92af4c0f3405cc98d7af61abda2a6dc00", + "0x3c6876d14cd05ffa2c9403f7bae8a3ff676032ac14dc0aacde98efbaafd0632", + "0xb1e50fb820be1e9be21ed74f6821c658551f06420f6b505823a4e763b6bb0ff", + "0x68a28708ef581ce8b16e96e967b6ff78d5b91d233db9abb7ca9e9dec19cdf43", + "0xde6e5518bb75099f16267042518f0189ace1d0c0621d3e0f8fdefca1017aa3a", + "0xa5aa23d706bc2a31e5856c99896a66b9bb542e5374b4d967adc33e1ce6c2ee3", + "0x6d843a76132120a213aedf8cd9a7c12c1f7e138c9a5500ecf28abcc91972210", + "0xe679d468ccf7455d9fece084995117c70f054ab8f25d53048306bc9ce7d3175", + "0xbe4d797e464d030a8f4db0dafbbc777e6fc93130b0043f3429b615dabdee60d", + "0x7e6d1f9c5d4c711953f46ace3c58eb9c3eff33cf0fa0e0cd922a8b3fd8d5346", + "0xe218de131a51881c346c467c678ebe3cddbffea05bf7e4c02ed0d17e25e435d", + "0x7a7732be6a3771a74e4f6b33daa40c9764a39fb5100f4d8b1d28fa57ae19cef", + "0x4000e38b3e5634e5504eaffcbb30eeea1d60cea3b2f61ef0e09ff992fa3a3e7", + "0xb4b369cf179c5e4b2aef8d47e253826e0323534ae17c53ce229a3a51df47b59", + "0xc773cc58e24de8602833bd16645402386297dbabf57c064feef7932cd765e4b", + "0x6692681bf29f777486bbd6c3443b45dfd992014ae2a91deaa6204c856d46e9c", + "0x93a241bcecf40075de5c61bce0aa0fd3009d5b25c3f60a1e310e760dd6f1fa5", + "0xea57c2be2f92318ce6d82f2631684d145a10eff76abd8e9d835ffa66a8f380c", + "0x113c0af3e060e4003c23dac0cc4acae161236775e22d8f92bdfdf345309ad293", + "0x107a1c84f302c478806d789963c6140857b9d6c816f56470e2efabb9430d259d", + "0x22822e6909203c39d361873406b61f21e3aa89daea51d26f66a854898dd344a", + "0x87c4d64205533a94d8fde76ca32af7e22ef1e0f5e6c9f68190c4d940e9911c9", + "0x568664fbb74eef45640f879af8314900301a5033d22cd9adf8eba688edf8466", + "0x2e8f1de0ca9b1327cb584c81788521538a732bcd3554b6022f58ad6bab2f1d4", + "0x55310c4f646a6efa06226861e156a5baf85c8c906d338d428a3ad059684873e", + "0x7b2e950b6073c08248bd0cb84bc739c743c13c3d50efb8c37453dc1b19b47a3", + "0x39d3db09a5b4f0a29286c0dbf1500b8cd5eb49f6badffc35e8273685c4d9efb", + "0x391ea57d87bf983d3a72baf8cbda96a2077e01420665c63b7494023e8b972ea"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 37; + int alpha_3 = 11; + + static const std::string rounds_constants_3[] = { + "0x894b84bdb19c99b174eef89446c8042b49d9d2a82fc46c4d653ebdcd127a9aa", + "0xc6b7ff8356bd516fad4f06f4c5354bb1ea26d27b3e9b156e89f0c9ba9ea1163", + "0xd03966afba794725c52dd8f7507a62b3441fb8608becf0b0cc077744ed99175", + "0x8c34d497d141ad73833b13ced2b8f457312a3ed8b5a6d9387f6efdc451260ac", + "0x11e6eeea347fd87200953e431bb652bac5e86acc07849fcc34066fc43475cffe", + "0xb9034e2459a594e1be61dc0359ee295ae75b00fdce16ef62f4d8ccd13ffb859", + "0x4b223f6f682ee44bf4a873f3213f089c3d177918571ad89bbd14dc41d6a24e6", + "0x837100b8863659249a0f72e38804af3e1297893de888f0d9fec16cfba2ab82", + "0xc81b73f232fa3111835446ea4cfc56e28be0582edfb0f83d4ebbefb278afbba", + "0xb78e340840581b85f52728896d521caf8ae8cf427068415b04a53d27dc289b6", + "0x574ee59fd4970e96a6614a64f18fa36a685c18580dbdf781438efbfa4b09514", + "0x38f66ae633f3b619c8c56dc8229664af8206a45eb72d87f1ffd2476e4888072", + "0xb49e75e262625b53ace4b7f65bb2c21939ffeef5972cea323bf413452bfdf72", + "0x1041c87189c3c09a68d02fa4987a40b64d8fc292b4e4bdfa6aa1625d4b4e347a", + "0x617005b62e4dcbb8498f7b5f43ead4675593ccc72cf8b2f4a01fa2e1da60b1a", + "0xa1251b1b798a04e658b1434bd328d5f3ee68e1ac1bb6e817ea31475f0f47a56", + "0xb336196b7d36dde674677dfba167bec7603a3c96bf20899a9d4c616f0ffa402", + "0x128e08a771214fc069a55f842eeb0a8c370a8c94cbbd573432466b555f9231f1", + "0xc790be90ed5461394e69ff6624b1e65fbe25dc9daebfee6b6965a039eff3744", + "0xb586c3356fa5d91c8bc23605141464545007477bcc96acbbe8efced6246e980", + "0xa728798fadfc910fd1549526343488b5ee1de16c9471212c85b85892f5b60e4", + "0xb88a3d215d130dfb3c39c7ed503303704b58e16d7710dfb5f9bf9e3d5a20e8d", + "0xa1d326b6b608ad8565c3e8e7e7ccd497d4cca0ee291f9a73114b4e9824cfb69", + "0x57113400390d93f8389e1bec27e88e0793cd3949228717f795276915d4ab828", + "0x84a8a42dfee951df4471112d863f64d7d5460f046289b4421087d3869e1a1a4", + "0xd23209a191a79b5e7228d9d19956724a256c57bbb7136be0864edd0a70ff5b6", + "0x6f851da6c82b3a1a672bd64a45143572b504037935f373bf7baf8299342cb26", + "0x7eaafe8322cc00fd21fba188b4e00ce5a7549316735482ff55f8de90f17492a", + "0xa2c1b6cd105105347b6cccf1b0a75124a4e7232b12fb39925e7c2f776e5ba30", + "0xce6cab1e12a67f98fc9705ffa96c8a10e4c11f29a31ce28273bf8b50c7e4729", + "0xfd2ae97a893ddc5aabf968d4067b6e7da71e548bd744e13179410dd4ad40fe2", + "0xc397b9593b7e3a15609549af9ee1c305ace3233a8b70d791d47d273091a197b", + "0x48e2850c540b39acc7bce93429d2bde169ec7249b3cf361bd3f7de3f51d576f", + "0xc2d5af8414c6c7ce014f345fc6b0bd90d313d794f3274e7396b18eee353c6e1", + "0x5232e19ed5be0cc0a6f158edcca9fcdb53684db1379a6ccd0cd9b43e898cd1e", + "0x121d8e282bba81dc8a608140dde24856e4289abbc1cc213c85842db14a7392c3", + "0x11ac4b1250a86aa1cdb9b103d9bcc7d6ba641d012ef557ada2e571e27d241708", + "0x56a6c575f7a3ee274f91e6fca0233d3e4a9bb1eb3c58fb052af73acc8df2b7a", + "0xbca1f27ae2e39fd568b543f19336d2d1003446982b00317eafb7a56bcd06730", + "0xe9f191a928aa8c498873d150994e6bca51cdbdaf2285eccb2aaa93cc73291d", + "0x4465495bdea2589718a8f12ad7198273aea88c72442ddf8d879093cc51a7586", + "0x1040f9e259df7c4a09ed900afcee53107c7608b276477ae51b3b4bfd40e2b825", + "0x11d223e26d5c6ba13a8c4382a51f62d97cc553f9be8770470cbd248deda5044f", + "0x3bf579fa65a5e93fbd27d67791c493cecaa1c55b505c526b84c738b073e085e", + "0x7967b3d5778a590b6cc278493a64559445188c3cdb0224585c60603f73a6014", + "0xbf4c86a238f1e63bde595027513d18e26fa557cb4ba00196159778578133cb0", + "0xa582308f6a557cb37cb0a615659d7211f228a09f591fa0a4f28b7cb42b4bde8", + "0xdcc13ae2b4c6179a435253fcbb275f8e4ee4c1cb0eae8d679b512a299a56dc8", + "0xcf02a438c9896590f44512473a4dd39cbc1bde9a53f0b3db38fb6d2f18e91a8", + "0x5c647cd7fc470cc99e170e20270423b8eee990919b1b09cfc4a386e6fe5a2ce", + "0x6a3eee48a5ca08253fb4269241ed389e45ba8db152b8850de999b2de2c10257", + "0xe4b0350a154112207e2eecfc173ad3896cf9a7d8942249c71bf318f329141e8", + "0x7e7370481cc29ffce69ba474f5655078ab875161563fbc9379890411996613b", + "0x28d1224a254fc72827cd40c6e516f74b412cb9bffe167294ebdeda4f2dca32f", + "0xedd071622a8d683a1ac9143eccbf8716b3dfe11fa0ae2aba3abe87d615de44a", + "0x10ba95e17edfec41ca46d94471f755059fe31b505746f9d5401c127cdc295aa3", + "0x87f089986c09c923d0546aa9a950094fbf66086c5877be7495806dc6ff1e75e", + "0x1881b97f72998e6c78f6fd491a33dedc163190de20923ab7b3198af285a9aa7", + "0x99c71834ef68ccc063eb2b57cf6967e2d5e08cdb32eafba0ddc659323b49a9e", + "0xa4312710936ff86b44d9bbe51dd26faf32bdc6f774eac9dbcf1c96faba24394", + "0x19e2b92497e2585e28fd0c5cbdad9c93faa238d34d5eb24a3e8e81ac9b5f343"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 37; + int alpha_4 = 11; + + static const std::string rounds_constants_4[] = { + "0x12885ea31bb116a3d94b1e3e06e6690d84e08035133e7dbd5d16103920e5565e", + "0xfe121d3a78b69c16c365e2ec6e8f65f34a86865fc3a1d04ce75954a784696e7", + "0x1215da3254c044b9c57fb80416628b822ad4ab35354db98938080506902b5c6", + "0x14a48971e3de165a9ff7e4239818ea0b8f017b8fc55595f4fa705cbe7db63dc", + "0x43a0402d3aa09557118fa68c93f7ea40854d5254eb877ce7485b7aefb448e70", + "0x46b0a3cf073f331b9d9ab3e366bf6991ef0173cdac7ae5e11cb9a7cfd846353", + "0x11189607e8e779867cffeb3b6bb64330d79d7bb82445830c87e7c541762237bd", + "0x9e41a79a199061dd5540ae3cc7b86ef60837bba1b572224814b46b4c71f2782", + "0x88f4fdd56936e0ff0e0a913b7db10e90956a54dc1196b1276bdec89123c4996", + "0xcc59b59100f67a649fa191e17b99eb65f2dac5ca601dac03c4845c30681a992", + "0x6ad45ad39b82bd8e2117087878b7e1020c86adc2b8f5e89688e02aa7ff351d4", + "0x7ed8c2af42eb4eb3210b012b596a7c06a219d2a41069ac066df9caaf295a029", + "0x87621d954d89d40e9a6557303d2dad5d0a9091e1833c06a4b929fe38ff7a319", + "0x84ca019a3ea927f171cd66467022ebc864e6b9f0160a76070958a72a3fec672", + "0x46a50c367a342e676db18e6c881d87512a248197f0ac27feceb62e8549a2a87", + "0x1b39826407dbb458ad477def3e0eb64979e9abc3588e78d6d2a484312b29d4d", + "0x102ae631c1eca395b2c7d74199feefdd8ac66fd241744ab3bc719ac1d28003db", + "0x39b624dda6dd131d8ef120a7afed000fcb956896283800abcccfdddeb95acb2", + "0x79b320e0382dc9f41da9b90e4f3492034a0f3abb60d8967bd90924a8eb9444e", + "0x212d34e8a5f057a4a3eb1e0892c4789562db79442a72d9b81c9253378363e2c", + "0x101b2409d0c6538a70511158716d5e99adac1ca7f73af8d10f35d2a8e16d70b", + "0xb4de7feaac1b63a6f0355a2059aadc95c99b8626f2a4f5768bb6e474ad387d1", + "0x5a0a9e6b928d0d3155821283e7f7682fc4b3367d3ba282e5bbf83b6eb1a2eb8", + "0xc74bd49a1abb4218e6442a53192eeebc9e24e2afb63764ab2de3a07ec0e0603", + "0x11bb0d942918769fe6c90b9718290c2858b9e2c8cc6cb2fc1afe0343c8b74f8a", + "0xdd2da4ec6f5aa4af6d09d5c74e19f70a543aa5f1eac87d438802248117cec5d", + "0x107f083fdaa422661e1d05a21e1e1b97ba98bd30bd837f07b1cf296be90aea97", + "0x544b48f37e48c5bb034ea07b445fbbce8075ebdea1dda5f19aedcbcad7205c2", + "0x3c2019d5a813a6433ee7024bcf00cd7dafa683dc9596af869d7513661401c9", + "0x11c4da52bed34c877beeb1e4cff2f2edf2b4a72df78195ae46ea9d040b8d071b", + "0x10be67d9405b730ad76365e7512f33802d305b0e02b5285fceed02872106b7c7", + "0xf52b7008ee6e0ced185891dff5553e05e93c8b168a44b10d394766082e894a4", + "0xbfd83ae5c36d78b71959d376bcc9feae494f51870ba0897cc5c772f04f736ab", + "0xf0fb893bb9adf471bb8791248638a0a92ac0b3698a4a7e217887ae9e2a1b141", + "0x71dd32016b49c093bec9e798605ecdef083a8aeb3e0066304d8f6c9789ff111", + "0x975d1e4fd95758dce4d2ab4b2e0e882923dd3a136a72bc0ddaa43c96ad429f1", + "0x6220c38e1250d0c3550ec589802b895ad80a2c16bffe9aa25d3e25c60a4ca67", + "0xe2adab317ea43be7ffd0e8bcd216d1bad3fd9d32e764a371520fc179a9b7bb6", + "0x212ae84c3727d7f22d6d2f9bf3dfdc55259aca2514c929b1bcb9e0220c391d4", + "0xc9e0b3f35198193b125618a361f2a864d3889ccb6f647a50a41b11a636607fb", + "0xb1d4b2dc46c269c1c310b7048fbca337674d952efa80d021b276bd03af0d1c2", + "0x3a8c756d0c28c519c3dfc3047c04d1962ec207f7f87fc45f78ed7cc5f2258e6", + "0x2d48d9abab25bfdc393085f917c4fc4b1f0d8dfb42615dade62c78481910f43", + "0x19a69cd85683dd9acaa6504056a56a37c21bb98c911bb7ec18156dd59909f45", + "0xc6d2227472fe78d91d39a23eb59db6efbb337a720091ea0e01760483dcc03e3", + "0x124c28e5a729d44cd8b68bff28a23b49e9211022c8181429dd938ea8421ba88d", + "0x12246d437e8d341f14b2b12af22f6b63b664296e647127c18778057d698f82ad", + "0x111d1f5ee7f6f7608c8649fb0686e578b19406cdfa44621f1e5380f2bce462bf", + "0xb5225d17275d61e47bdaef76c3fb1b2b02038ea4bb6d6b90258761d4c28f716", + "0x286d9d9bdf21a6319e69e8d4b08924714f0a5cb4a9e7dc5013b66be99565acf", + "0x12213a410d62c65bbc1f995e1b21c5d6b519e12fc94c2d31c7119a0837ff2e18", + "0x63320a3c8169cf281625d9ab77e7c11f90ef3a985a9298cd1059178eaf9b336", + "0xe40c0a6b038970cc68d1860e50b3cadfb984e557efb8afad7b2722f3d6466e2", + "0xdcc0797a79302b55bfc1083d5d693c272e94f5afb9244d5d5e955969df05f83", + "0x5c308060bc6486a9482ee87a15aa65f4d86efbe3a8cb26f9b5f78e6618d5f9b", + "0xaaa64f8091b9c8fdad697e84a022c1051423be2cb2abae0b3ae33ace87884ed", + "0x54fadaea5e70cf892b7f5f7737689238e02d62f3751232f77c5a3bab780f3dc", + "0x599d22bd664a572e4488b5508096db6056e112f30c78f9e47f370ab0575b82", + "0x30c62b088d07f793b382b442c34359fb82cf913f080805da98ffe263c80028", + "0xce557d55076bfc68500e5b15e249d4e32aad7095eeb127c7cdc4bd8f44fe938", + "0x126019cde39d89d53e1ae3f22afde1242cc7b2014902e68cddf7a8d1080a3e27", + "0x127dd1d65ef6a2f1def912ade3704677c484d74828af871f8cff3455966ce753", + "0x3e2d47a545dc4e095b45232b36b4f7861f7b54e8b6b77fa6b0b55a1b73ddb1c", + "0x3a2282e8ff99bfb2ea871cd583725db1bb7e532e35810f4fdfe859dc0be3b5d", + "0x5c94ac0d551df599d2dbfab49d2456475e4a3810a06b38c8d0bb2511d10ab32", + "0x17991af0d9944dbfd827bc2c8d4900b37c6be85461f99b1c1dc37dbc0203364", + "0x9190a24b47ee4be9067284948934a1bb38973d52d0291670adc6d6857b74570", + "0xa13281a495c4cbf7da7eb78ef254257a2432ad3e2054ba1ae41595c73fc15cd", + "0x7ea82da8a19a2bc6ef4220d452ca4a24dcfcb35d5127c3ea9e8af0277740903"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x2574ac64ca91d12d02d4f3cf6b23e59851e4c86d1e44c6fff1482975b339a4f", + "0x8a2a4bf394d807c5b866ab3ed8b00f179eaa9d2cab8c9fda1e0f4d635247c2e", + "0xbc3c399d590b573f0ea83593fac1d48926141d8f1860be322b3ea01eb84f67", + "0x13f32136409547ab2b37398c7bd60d76689c0a3a3d963f5e7ffbced1fd574cb"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 37; + int alpha_8 = 11; + + static const std::string rounds_constants_8[] = { + "0xc41ba529d3a519fbb431094f9511053b921ae8db909b40e315520a8e18cea1d", + "0x819c18df5f5f0f58af9557b14c4fec0e4376fe2f8bea3eb74410fca83d9d7ce", + "0xd2f039a35d1245a5448b75f036a67f26a5b68a682c88294beac479cb513f467", + "0xe0af6216d18cba2dd62313e539ee492fcc34b5008aad7b65006bca38f21eb41", + "0x3536edcda23f24d94ba61270e2fdc5c080aa13641448c978760f4ffa256f619", + "0xe2a35e49a0ede07a9ca4a74f290d9b36293b3c551ec165345bf6c217f372feb", + "0x29a12bf08c217c41ff23509df6e99c51bd0f41f3a9b4eb09ab0216b16996fc6", + "0x11f864e5a3bfd81febf3b90f9e09c836a38cb979cf7a8f45f6ad164769ff0e3c", + "0x35d13dff2b0b6311d2b820ce2543419bc9a9b2357c405ef72ad3471850c9f68", + "0x4c9ce61b23c0925d0eff7e3e1de7ba8b7273466687bfb4163e93ff8f52e155c", + "0xdbe6fe74ea1218edcf68315e6e721a8f609d29560f79308fba7703eef819b50", + "0x11827ae33943c198b7909089c3677c09ba6ca940b0c2fd6f0757dd20395b7a7b", + "0x35b0adbdd2afbeed881b4f12b9f4e370190475343add790be77fcdfa977dd0c", + "0x113b2fd62932b5a170e595510b567ed82a9006ff3d1b00bf72795a500c5fdf02", + "0x10291c9280f3b59f0f974e3c6d13f66b6a05c14222e69c973a74bee34720a45f", + "0x74a6a82128bfd7ea1c043ead20a6b9973749494bd84f870446e1cb243fc7a37", + "0x5ce3826e0f53247d7cca6ec66fb4617ca70799eae39c614646357a6eb24a118", + "0x52f9664ea3c376662d946c4281f3c12f67079c8e28784357a41cb0624d77a1f", + "0x1289ec8249f56de999baa164e3dce21e626cd05c45fb103d095b3ee338045134", + "0x5da836b5e5193d8a2acb191238c6273304e10cb3c94314fadfb964fe16e1f4b", + "0x5debdf44e14710fc7d8db6b954cd85e5ed076b11868d36febe848dac949a483", + "0x9ebe877858c0fe536c2f04ed8ee6909cff792145cf8d32d797930762efb119a", + "0x49998d599a02b2fa2c9a4fd415b931289613b9ed7fd401b870d1c828bd41cf0", + "0xf125389f8ae2ccfc897551ae56ad285b7e1c60e91d7678ffdb17e04ea757045", + "0xc97bfaef0c6ca5edf029a7f384b5dc575cbe0d6c879fc13fefbff75d939655e", + "0x63ede48cecfa669cf843be5aa36da93df8306fab1bd983b277ee9822e8bd1eb", + "0x123caeb384828123eb388aaea4088e7d9bf5ee4467f70d61a9126c23d1991631", + "0x9f15b7cce2c2a15fe65deb6559d02b1a474734a1631c98ed1f11f0d39b784bc", + "0x3fb05554fc23ccfbc3bad525466f7762c1d6b640a89f4abf3f47f3d328acd06", + "0xe7fc391ca471bd15d83f1208546bbd078b49ad372d5bef6f92365168f422074", + "0xf9918216043e5f9f7f28d9279171b604c3bee24d732b3bf9369688e9e86c94d", + "0x722276f5b586e35a4255fefa13bbd4ef43cec0a2247e029023145d7d765cd35", + "0x80be08eb446ff21199b5e129a786a0adcc2e79aa9239710c5de0e2948fcaaba", + "0x6620f3dfdf3402cb459ffa00dc27750d40103fe5eedff6a78303ad9b70bca25", + "0x104e440d7bcedde67f4ae033fe3abcd263890d270020b37f31d5aa0eecf40c3b", + "0x3942137b62ef3d5a90d112c8a6aecd96002cdf4d4497f18f9cef4c73045f2e9", + "0x8e5ed62cbd1e220d6b05dc8c826d6a3b578c5c2b0f47af071606e69d4358eaf", + "0x7392bb3180b7d340119ba8d909df53e8801e5b0c205ec9532f84edb64fdbb22", + "0x5ce255a8ef9c3c090f29ea89510c75bfc7a55b12986b4cda85eabde436dd82f", + "0xb80c203e91684800457a1e6405b073674eac2349e5db53b142cf14799046cf0", + "0x1bd177cea81dac6436353a8258b1a3808a023f6288567b36606f83351be0f0a", + "0xd3e15eb4504dc5a29fcdd554ae3e09a5d54e33fbd7d2e0efd99e119a01435f2", + "0x28bf02db5b5b7d6f57c797ff4923c451449f87043b95ff9d793b2e75f122134", + "0x123b166e2528d22a24212ace4a9cf82fff1f497128aa44af522a80ea60f818f7", + "0x84a849ba3aee38e7fc247708de4a0e19b168f2445183cfaeba8371ff5827aa2", + "0x857ca60d3742b573d8eb1c5da4109cccc84ebe2afcd16352f8d5a4ed8d55bb", + "0xe0898169c8d19e89eaf021bed906483cdf79896cef51de9a6987321d72ad131", + "0xf509aedb1efda7144c8ea83147d5ac9a45ddc98cbb9c7f590d9fdd404203f5f", + "0x5b0d33f975b3566024e5556b540fefef00beddc32d8c9fd905cb4b47b911e3a", + "0x2ae98f78a6c3a09a47bfe611f5c11cb0409f35e7bfc5b57f191ed70bebe1af9", + "0xec743cc1ce63201e833ec63fc7675be6ff792bc6655c3c7b23f8e424518afaa", + "0x27e60e492a616a4b0233a37979b0b4b619a651a58e5b0b86f15ca3c0240616c", + "0x9a07c90b149dbec54922b148519cc62ec18c3ad292989f4f967c9a84edd6d65", + "0x5c9fcd9331854e900cd227a7e65678338d08aa8b7b3701368728aa4dd40ece2", + "0xeca0dbc74c3039bbac0cdf1da8c28e5f49589bd0b8999a36544e3f40fb32adc", + "0xdc540b8fba75da383334bea596ba3da31e2e8c196cf1e29c866fa7106959566", + "0xf0a24dd41d4e2e81adbdbc2173b8b974c4fdc6ee22431ffa8f3b924707a2ef2", + "0x6a2d7f400c155220fd84a7c8c5e2d71a49a4338aa93f20df4a382371e41ac08", + "0x11e6e0c0c58db28b72dd9264b22d6bcd8e62a45570d717426f89760661f535a1", + "0x8f80011d4c2ec659c5a41ec3c7d837c07e05a3f2c9fefd872a0eeca5a470938", + "0x8ad8d63c6b0c7fa6f1fd49d4cf91d15d304c38f92be8edc434ec89616660d39", + "0xf8239a1e382381b33fd1c9cc5a08122839afdfae082dc2fca35b81ecffeeae4", + "0xb4763ebcdb94a737c9356991bbb4994485ccb707ef62e6c85b570e73a7c709a", + "0x8287667cff0de7902e5a244092eefcdec7ec50f75ff29a6dd7ae4b69d6ff24f", + "0x8274652fa69b56dac8241bf21bc5ccc08117dc0cbb5c17696076c488e2bc22b", + "0xb2592b2e72ff26ea66079d31b56fc526083663ce111a6efaf43da8b0d7a626e", + "0x7b6efb36ec4c7cead45d62d82639ba8bb0b6d664ec72136d7e8f69f6ae2c8b2", + "0x1091b2238f47a889f4f50a1e7677489672ee2e77dab2476d1394802fa4d92ff0", + "0x74989778c95394e113b83abed8046019ec93481c1b4d43b72cf4b14bd862b38", + "0x1d5a7f602dde5429d496559b113fa0b02c8a851985a85c850ddb9628b6c8ff3", + "0x731418f2c9ac9c8971db70b27368c1f63960befa696c4f2883c216a8fcc6972", + "0xe49d0f9bb4bd19a40e15c73c706a0b054ccd717fe4c1c21e04eca84949b4ef0", + "0xef0f54d983fda36b64a8bc4e45708e4867c96564c9463c9e3c3f805bff0f0d3", + "0x19fa0017405e341d13a47523715ddb6528f919186db7eb8e21357a0e9e59afc", + "0x989d1b92eb027bb08350df4bc52e59e89c45b3369bea55c94a3c4892822728a", + "0x8a8f2f550a3a3bc49d19fac02e007c13b28c5c27ddc3543061261c8f61b7a3", + "0x6c9d9c92c6204ec582ed5bc34ff93ff95f34ca2c7d9122307845f71eed9c39f", + "0x11bf083a13fbed6a62b12129e54f3af9cd8b2fcad85f5d387edcea1f73eb3f4e", + "0xc24ccfd8de70cb1b8d51d5a10ea6fe209205959f398ab44b93162d040938573", + "0x4760ee86117a435852f6bad5284422e2cd678ea7079c159ebddc942c11b9b76", + "0xcbcdb22af90a22d786f0aa179237a1369f155e94549a7d0f0350cc8113bc2d7", + "0x11145b33bfaba602df83609782394c9b7441e3349a64d011bfe2f3cd3e2a4ec0", + "0x67a8678cbdc8b93d8db15ebcebc46c74ffd6c8fa0a596cc70ff7fd41f8ca24", + "0xa88696b0defcfa315fe7402d49d15d776fc4131dd377b1db159c15c55e747e2", + "0xf85ef2ecc02d38766377fc63aff2c55222e1eb5d1a81ace3b69ee06de333cd", + "0x100d76fe02f8db53128e501cbf18de63540244232f105fc80a798213b1ebf334", + "0x125d95857ee2bf89133d65e0deb310d9485f786c4758a7acc2969b5766549d16", + "0xb7fa77afdb0e8720687b37e22a5252de4293a9eee981c19ea0d9bc24291b04e", + "0x117851716248c4c2b646fe74d478096b94d5950f626d0c86a0bcde68f9676dd3", + "0x1d78e7ad7883b6387bc01ff07e39ae168a92ec27d5543a8df8fcfe7212c9ca4", + "0x54446b4a2257acfe532468fa3ff6c502fc0ea43d6924d115187c4600684fc02", + "0xf8ab920c3986de717aa86d0c908ee6b8ed23faa1758cd717aad9231a904de12", + "0x57c5e6e9082d3183a9cb0772cb688eec2a2a8567ddd78cfe12807aa40f3f250", + "0x43376301ec9e8655258f969a61642f8b2eccfa74f5da08ec42f8cdeae113aef", + "0xc26a42c06737cce75b17ed93c4c39d3d16d20ada9307efb3a69922fe70d28e7", + "0xca48ab108fda68fd777c8a0b108f21670f4ffc218a49e9b85f78fbb159c08f2", + "0x690295a4452317cc2534d43b2156c65acb91598a568b1bfb60876bdffa6562c", + "0x40a582cc80cd85f62d94c271cbebbad576ab37a598c8187759b4b2ce67a926c", + "0xc73c556684a63cabae1ad9a7404d7360e5cba5f64b8519328de4cb747dcfc0e", + "0x33de8abebd2c5430bb309a241e428f1cd1ebb09a46246783df0333cad454f89", + "0x48fe2580726aba2044432c17b190e0471fd1b356005f603f432a828a6e1016e"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x86f8ffd65bebe5137654c441bf8e9520fbca080cc233c0f6c64062c99f2e199", + "0xcafcb5a1551b2f5d6345456b95de2b6dc3f2bd8a5b114f6d8e4daf26cea902c", + "0x33def38d6cbd4417f40e33aa822f7b0b3743ce4f32dcbb47033f96ca9ea4339", + "0x806f5b5dd08360b1cfe54899a7cf8f3c543b5dbe3dc25c08ffa00b89f167182", + "0x2addc4612044efd1937f6238fa77092b98d674262f8b1fbc2a6026daa881a60", + "0x11f4fec8189febc1c7c4bf540320cdce84c0fb90ab38c16276ba1106811c9371", + "0x4763569f19baf961b5c3f3dcdbe54b5feaed59d0c6876fd33153812f01fa547", + "0x362799e791390a5cf391ad263db8fc7823fa117cd9be80114c73177e96fe611"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_bls12_377 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_381_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_381_poseidon2.h new file mode 100644 index 000000000..d9ae7200e --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bls12_381_poseidon2.h @@ -0,0 +1,477 @@ +#pragma once +#ifndef BLS12_381_POSEIDON2_H + #define BLS12_381_POSEIDON2_H + + #include + +namespace poseidon2_constants_bls12_381 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 56; + int alpha_2 = 5; + + static const std::string rounds_constants_2[] = { + "0x6267f5556c88257324c1c8b00d5871b2eba13cc39d72aa10dde6b69bc44c41c7", + "0x30347723511438a085118166c68bf0c4f4ab5c10a2c55adb5cf87cc9e030f60f", + "0x10db856965e40038eb6427303181e7b7439f1a051aa4630c26cf86d0a0451a4b", + "0x5a3d2dcd541e4faaae7eb143eec847a0f652b6dc1b92e3f39ec23c808b3a5d63", + "0x3b07f0ff7edcf93b1dd0487bc9fab1c6905f9ceee38dcce83efeb3a320398526", + "0x40c73c524b9fd0fab63128175befe07b5c63ccdde9ca10e1a37205c9607fdf8a", + "0x3a933861cf23752376d94dbb24b0f3c61630787928875c07672b68abfb9191e0", + "0x71cc165e208570b2d5ef81db84e3c5e714ea4edfb36fc7fb11ef65a64b2d9755", + "0x6c0dc9eb332b5d968bec8ad68fe24ce34087ea54093f153618434475bce402f8", + "0xaf5bafd335dae5c86967b11d5dcefb986a54c9d60d35eb06dc7a3fd779b3906", + "0x6e12847918f030f2626c150ab69e4be0f13d202ae1f8bc87ea74323e93372e3b", + "0x5565d40e21d059a26db241ca125d9316283eadf144b1318e604e253eeae1fe9a", + "0x608e01b42d3dca09fed9b54eadaaba3e4ce6aefe92b0dc954a0fa4683a9678f2", + "0x16bbe434b24f94e2c40ed1f4f9bd7d17e5be96c3aec15579b35fd80f0f80de9e", + "0xd1be811a8e73220cab01ce981d475522c3d7dd9e2716c3a2cf4ddd541546890", + "0x5997a3affb18f942868b86f8ee10a68966e90bac7bbd8c65ede7e6e5ef1f6320", + "0x4d92e86d270041061eec80278079fca771499dea5ccdc99682a953bb3a038b8e", + "0x616c8c5ce232b9314f694fc6a968446ea9daf7a4079ce1a75fcc950741d680bb", + "0x677e31e7846d9131bdc350eaf11a8ff918dd258ddd800444424afab34dfdfe3d", + "0x4e7d7f85aefc110b233525ee3e53851aee7d3241e2a132585e0e25005eee0b0e", + "0x6a8b4539488b7dddc48c3a226dbda313f906e106f844196d55013d321244f13", + "0x5091517b6a85783108999f8e6bda3c793bef3f2e9589641d260bdfde8bdef00d", + "0xd2703e5b30f54d7f414e901802d54f8c14cd6355415df6e0f063d16bef9c43a", + "0x56f69096811148eb38eec143d32565c077b3d1a4a4351f2b458f43b1659d4495", + "0x622d94d38d1ded428afd062008c5709b43a678f6ba518ec56383e8ffba473504", + "0x2730c607bba7333723a4a44577819b7db82a24574f6d13eee4c856c1ca3de9c7", + "0x1ac5f59256c5004dc1043c53b23800a3fbab53eb1a83f551056f227b514b9f6", + "0x790b92523c973f1c95b94937afbb5796d89481e7a56328b44bab5ba81ae42f3", + "0x1d63b59d97bc269d13964fb3e8771d0acc749bc83eb2f0372484e266142bb8c0", + "0x1a52d04e5f14a3a05f7a01262df9e68c77fdf7e2bfb56c8b252d2140efdf0914", + "0x5aa9b3b808812b284857e8622843a8717fa5cb49b217017f31d79e8d0f963fc0", + "0x6a3d18fdbeb1d77ec1304539b00e6188786dbbc4435269b4c6281367f42656e3", + "0x4743e860df269a85dd76fb99dbe9d840eb669dc859754b3f74805e57ba288b00", + "0x6c32cac3946825f80a434c5ab397fc1a1c6a9bdfaab53175d4cf3d29ddb6cbc6", + "0x333b0eea5da7ed1e3959d16280a361aa77dd24ecbfb28e1b2583ac4e9894305c", + "0x3b503fc333b795ccc0c5bb3ae26b077dc3742cb745ec8821648c5ce7ebd9df18", + "0x4fa5853188d9f728a17532d94bee6fb28fee510380a5d50927c6c5b1ce283444", + "0x5d2ed8a6603a905bac490ebfb9e6c18f0bc9da1bbc2173291b18de6b6186118f", + "0x2d830a53584c5556264852f075c78f7f9eb068016ae88af9cda933d6ae52eca7", + "0x250f4d6780ad29ae60e55f135b9ac80ccc7c81e3add37db276c26f1a2b1b86e", + "0x6e3e9595f59220599e23e830728d4a0c4d62515ec1ed10b72446cf4df5b4c308", + "0x2cd3314555d6faf23ee90cdb884f1c4697ebe98e3a450a624c4d896233b93cd5", + "0x584a408d0f370543b8413fee70a060a394e561f504d8679f7bece4bf222e4108", + "0x499cd53437b9fcbf7479c00fcc21295759074ce9bd1bb1fbd3460237aef4759e", + "0x56a9b567bd0646effd0608d74d537991136098d9a06af6cb3ff8f010efb57578", + "0x6a5fae2b00d968b931441b374e27ba4d03b306bd602d48731677169e75a67e8c", + "0x2e1cc28e390e64aa1d60edb99c0aeda7c8c32bdb01ba11abbad5026b46eccb27", + "0x2d4820000675df7c276beac408fe2e851e734a7008ae09bbcb3c96c70024f71b", + "0xc2fe101a2b52b538b902c6b2dc992cb266f7636e05b0c068385b5fa19e97142", + "0x209b790b78c0e7927c6a178ef2f00b8687fc7bd4f21a9e02578551535002bc95", + "0x2dd0926cf56bbaaec6491513d08a9983f94a910852a7b4ea4bd4222b93e14c10", + "0x4316b39dd7d65b1bb575198104d409b169236a7ade371f7ab176fcbae75a5f0d", + "0x540276d61041b91f6ea3068ec260a9338b6e3da15d934e648c24f35aee04e535", + "0x37af612900b839977b146324c84772c58a4ccc0f6494cc054571827e74bfd2d3", + "0x2af00c93d59ed14c9911e5cb3781d772371e83228e4267bbce11d065c1955338", + "0x62b48779b0cf7ff2c10fd9b91a6ff7b7a99f935e961a5a94aa38f9d4f71c8b4c", + "0x540bf5bbe01f28563bcbe11a2ce346d8231a2cdd0fe07641f9fa89e5c21978e3", + "0x232b6c847a6d23912cb10ecbe50b53491f67f71e9b87a4a30446f2218017874b", + "0xab34adbe77b8f1e57a370e4fd626071eea74b3f0b66644a629efaa0e96456c0", + "0x1a83e43ef118c90046b1bdbeab8dd5cdcab632807c2cd0dc9147cbc5b7084be8", + "0x1ec6fa41b41b672d9005468720918130b642567462a3d557a595d4dc6c56f2f9", + "0x1f81a153199a751a111b8f5212cfc5bf82aacf0287d03e1864f8e5713fe4a17", + "0x2617307587a675f4ecd73a54a7b206162d751cabf3d9fd007bcca4de2c6f0649", + "0x1647be94c515178c7974a245624b642bb1ae6e2d4e1682087e362d7f98bc953f", + "0x6e690b956e00b9e339dec49d675586f661f9b081ee3fa7696d73977658aa6fea", + "0x660b85bc22de06d476c47bf084ad436f59874f1d630c0f5c91fbef51d5e738c5", + "0x32bf3d451b69dde075fc370eaa8c1b77b5c0bc2aab1c7b46da7ef9d1840b0419", + "0x73924b40beaa9c1ce4074c2154d1af4d658c09395a568b99b2fbcc3b5685e810", + "0x17cbb3ee0adcb9d977e96e9152b36042925244fdd0aa184c7a89a58a2dc40097", + "0x29d76a821e3220775c552f6b5977ab94956e52b8dac36ef88ace050d553766a3", + "0x62b1a6c06ab26881a1fe57eceac56b5aec0b96da7211557f4e27ec24296d7db6", + "0xdfc474151e5c605a693a51ae8227cc0a99fdc4524fc2810c6eda9035d04334d"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 56; + int alpha_3 = 5; + + static const std::string rounds_constants_3[] = { + "0x6f007a551156b3a449e44936b7c093644a0ed33f33eaccc628e942e836c1a875", + "0x360d7470611e473d353f628f76d110f34e71162f31003b7057538c2596426303", + "0x4b5fec3aa073df44019091f007a44ca996484965f7036dce3e9d0977edcdc0f6", + "0x67cf1868af6396c0b84cce715e539f849e06cd1c383ac5b06100c76bcc973a11", + "0x555db4d1dced819f5d3de70fde83f1c7d3e8c98968e516a23a771a5c9c8257aa", + "0x2bab94d7ae222d135dc3c6c5febfaa314908ac2f12ebe06fbdb74213bf63188b", + "0x66f44be5296682c4fa7882799d6dd049b6d7d2c950ccf98cf2e50d6d1ebb77c2", + "0x150c93fef652fb1c2bf03e1a29aa871fef77e7d736766c5d0939d92753cc5dc8", + "0x3270661e68928b3a955d55db56dc57c103cc0a60141e894e14259dce537782b2", + "0x73f116f04122e25a0b7afe4e2057299b407c370f2b5a1ccce9fb9ffc345afb3", + "0x409fda22558cfe4d3dd8dce24f69e76f8c2aaeb1dd0f09d65e654c71f32aa23f", + "0x2a32ec5c4ee5b1837affd09c1f53f5fd55c9cd2061ae93ca8ebad76fc71554d8", + "0x5848ebeb5923e92555b7124fffba5d6bd571c6f984195eb9cfd3a3e8eb55b1d4", + "0x270326ee039df19e651e2cfc740628ca634d24fc6e2559f22d8ccbe292efeead", + "0x27c6642ac633bc66dc100fe7fcfa54918af895bce012f182a068fc37c182e274", + "0x1bdfd8b01401c70ad27f57396989129d710e1fb6ab976a459ca18682e26d7ff9", + "0x491b9ba6983bcf9f05fe4794adb44a30879bf8289662e1f57d90f672414e8a4a", + "0x162a14c62f9a89b814b9d6a9c84dd678f4f6fb3f9054d373c832d824261a35ea", + "0x2d193e0f76de586b2af6f79e3127feeaac0a1fc71e2cf0c0f79824667b5b6bec", + "0x46efd8a9a262d6d8fdc9ca5c04b0982f24ddcc6e9863885a6a732a3906a07b95", + "0x509717e0c200e3c92d8dca2973b3db45f0788294351ad07ae75cbb780693a798", + "0x7299b28464a8c94fb9d4df61380f39c0dca9c2c014118789e227252820f01bfc", + "0x44ca3cc4a85d73b81696ef1104e674f4feff82984990ff85d0bf58dc8a4aa94", + "0x1cbaf2b371dac6a81d0453416d3e235cb8d9e2d4f314f46f6198785f0cd6b9af", + "0x1d5b2777692c205b0e6c49d061b6b5f4293c4ab038fdbbdc343e07610f3fede5", + "0x56ae7c7a5293bdc23e85e1698c81c77f8ad88c4b33a5780437ad047c6edb59ba", + "0x2e9bdbba3dd34bffaa30535bdd749a7e06a9adb0c1e6f962f60e971b8d73b04f", + "0x2de11886b18011ca8bd5bae36969299fde40fbe26d047b05035a13661f22418b", + "0x2e07de1780b8a70d0d5b4a3f1841dcd82ab9395c449be947bc998884ba96a721", + "0xf69f1854d20ca0cbbdb63dbd52dad16250440a99d6b8af3825e4c2bb74925ca", + "0x5dc987318e6e59c1afb87b655dd58cc1d22e513a05838cd4585d04b135b957ca", + "0x48b725758571c9df6c01dc639a85f07297696b1bb678633a29dc91de95ef53f6", + "0x5e565e08c0821099256b56490eaee1d573afd10bb6d17d13ca4e5c611b2a3718", + "0x2eb1b25417fe17670d135dc639fb09a46ce5113507f96de9816c059422dc705e", + "0x115cd0a0643cfb988c24cb44c3fab48aff36c661d26cc42db8b1bdf4953bd82c", + "0x26ca293f7b2c462d066d7378b999868bbb57ddf14e0f958ade801612311d04cd", + "0x4147400d8e1aaccf311a6b5b762011ab3e45326e4d4b9de26992816b99c528ac", + "0x6b0db7dccc4ba1b268f6bdcc4d372848d4a72976c268ea30519a2f73e6db4d55", + "0x17bf1b93c4c7e01a2a830aa162412cd90f160bf9f71e967ff5209d14b24820ca", + "0x4b431cd9efedbc94cf1eca6f9e9c1839d0e66a8bffa8c8464cac81a39d3cf8f1", + "0x35b41a7ac4f3c571a24f8456369c85dfe03c0354bd8cfd3805c86f2e7dc293c5", + "0x3b1480080523c439435927994849bea964e14d3beb2dddde72ac156af435d09e", + "0x2cc6810031dc1b0d4950856dc907d57508e286442a2d3eb2271618d874b14c6d", + "0x6f4141c8401c5a395ba6790efd71c70c04afea06c3c92826bcabdd5cb5477d51", + "0x25bdbbeda1bde8c1059618e2afd2ef999e517aa93b78341d91f318c09f0cb566", + "0x392a4a8758e06ee8b95f33c25dde8ac02a5ed0a27b61926cc6313487073f7f7b", + "0x272a55878a08442b9aa6111f4de009485e6a6fd15db89365e7bbcef02eb5866c", + "0x631ec1d6d28dd9e824ee89a30730aef7ab463acfc9d184b355aa05fd6938eab5", + "0x4eb6fda10fd0fbde02c7449bfbddc35bcd8225e7e5c3833a0818a100409dc6f2", + "0x2d5b308b0cf02cdfefa13c4e60e26239a6ebba011694dd129b925b3c5b21e0e2", + "0x16549fc6af2f3b72dd5d293d72e2e5f244dff42f18b46c56ef38c57c311673ac", + "0x42332677ff359c5e8db836d9f5fb54822e39bd5e22340bb9ba975ba1a92be382", + "0x49d7d2c0b449e5179bc5ccc3b44c6075d9849b5610465f09ea725ddc97723a94", + "0x64c20fb90d7a003831757cc4c6226f6e4985fc9ecb416b9f684ca0351d967904", + "0x59cff40de83b52b41bc443d7979510d771c940b9758ca820fe73b5c8d5580934", + "0x53db2731730c39b04edd875fe3b7c882808285cdbc621d7af4f80dd53ebb71b0", + "0x1b10bb7a82afce39fa69c3a2ad52f76d76398265344203119b7126d9b46860df", + "0x561b6012d666bfe179c4dd7f84cdd1531596d3aac7c5700ceb319f91046a63c9", + "0xf1e7505ebd91d2fc79c2df7dc98a3bed1b36968ba0405c090d27f6a00b7dfc8", + "0x2f313faf0d3f6187537a7497a3b43f46797fd6e3f18eb1caff457756b819bb20", + "0x3a5cbb6de450b481fa3ca61c0ed15bc55cad11ebf0f7ceb8f0bc3e732ecb26f6", + "0x681d93411bf8ce63f6716aefbd0e24506454c0348ee38fabeb264702714ccf94", + "0x5178e940f50004312646b436727f0e80a7b8f2e9ee1fdc677c4831a7672777fb", + "0x3dab54bc9bef688dd92086e253b439d651baa6e20f892b62865527cbca915982", + "0x4b3ce75311218f9ae905f84eaa5b2b3818448bbf3972e1aad69de321009015d0", + "0x6dbfb42b979884de280d31670123f744c24b33b410fefd4368045acf2b71ae3", + "0x68d6b4608aae810c6f039ea1973a63eb8d2de72e3d2c9eca7fc32d22f18b9d3", + "0x4c5c254589a92a36084a57d3b1d964278acc7e4fe8f69f2955954f27a79cebef", + "0x6cbac5e1700984ebc32da15b4bb9683faabab55f67ccc4f71d9560b3475a77eb", + "0x4603c403bbfa9a17738a5c6278eaab1c37ec30b0737aa2409fc4898069eb983c", + "0x6894e7e22b2c1d5c70a712a6345ae6b192a9c833a9234c31c56aacd16bc2f100", + "0x5be2cbbc44053ad08afa4d1eabc7f3d231eea799b93f226e905b7d4d65c58ebb", + "0x58e55f287b453a9808624a8c2a353d528da0f7e713a5c6d0d7711e47063fa611", + "0x366ebfafa3ad381c0ee258c9b8fdfccdb868a7d7e1f1f69a2b5dfcc5572555df", + "0x45766ab728968c642f90d97ccf5504ddc10518a819ebbcc4d09c3f5d784d67ce", + "0x39678f65512f1ee404db3024f41d3f567ef66d89d044d022e6bc229e95bc76b1", + "0x463aed1d2f1f955e3078be5bf7bfc46fc0eb8c51551906a8868f18ffae30cf4f", + "0x21668f016a8063c0d58b7750a3bc2fe1cf82c25f99dc01a4e534c88fe53d85fe", + "0x39d00994a8a5046a1bc749363e98a768e34dea56439fe1954bef429bc5331608", + "0x4d7f5dcd78ece9a933984de32c0b48fac2bba91f261996b8e9d1021773bd07cc"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 56; + int alpha_4 = 5; + + static const std::string rounds_constants_4[] = { + "0x1a3bdcbfc11dabfb6ed0dd5f5a9b38191488bce9eecd811c10f9378b32db8c61", + "0x52b733e857912fdd2248dc9638dd79b1ce18b285b27792238b44c2b23c0f5d5f", + "0x47d6df02d73e6c78ced550ec8df1a459ac41f318d8b904a37652b581b2b766b8", + "0x11ec284726dddcf3cbb2b81862c9cd95e9de81ce0317302e1ef432d59b913388", + "0x19e21d749905904f3e10cd57f7817c2564c06ec1b1e229def2129e79a7a77738", + "0x6eeecf4c83e1ec164217f3c00956d83c3bd845bee2d86b263cf3bf89a345e5e1", + "0x10d5808ab47295f7a950dc72f968398b9c67426a217811b9bd7e97f2a261992f", + "0x25d334fbadcbfd26449c4ce1472f961f7d401a3ddf40a70af5c10ac9176d151b", + "0x3ef8a46ec07ee551ecba60b1601cbf6e3664418331a254729b7c6a5c3d13a6c6", + "0x30d373e298c09d2a6efe661d708fcfa6163dc61ae1eb103d98cf88c63e482125", + "0x18769839949b2dda9ef3f111acd86e10250ffad4c4c4263ea970e4f4726cfad7", + "0x2c941286d1534ff3be3a66f9dd59833e65b1fa67db23511f7b4b2ae3b3d66bc9", + "0x8b6d9c90b4139ea70497ac8a22b30fb9b76b8ceabf70449d282b57d98c60ddd", + "0x3a8a2dd917222a71ca678b5c0a803a43c62de2f2c9fe37931b5b2a017fe64638", + "0x2dc17308abd0e731b3cffafd296cc3e6e2403dc563baa1c797a68da9754dd207", + "0x1d04e542f54431c23f9d1812392a0c87203144e343c459d3ee640b04e203be6c", + "0x500760e2ef6bf463fdecbf7b47f4adaa8214c797e59359439d63169e1cdb9dfb", + "0x61f36faac1c12d756dcc3b5491f2b22565409a4e952b8f8e726ee126c0e1c0e6", + "0x49e72db524a48243849fea068e58d0c078b0c738cd482a2e2160602657456ccb", + "0x4a74677fff94821e97b20b86063c36d35c6a2908c0a19a9f130edde9c8ceb6b5", + "0x62d27fd5080b44a436e13066ce1c80ddef2af086c2a4806bd99fa02de9726ded", + "0x15a26c92fc51dd285a61c2c1379f6731377aeb29c62696aa6a9c109c2991f200", + "0x1db900a5e9b2685be9f8f02498123ac71bd7bfa40b6853ab527a8d2512b9aefb", + "0x6ff755d237742498e0b78829cd8358bdb831e96fef08eb192b7e334123080afa", + "0x1595447e5b94a64c8b3681f57068e19ee3696440ef785e35123886311f48cd1e", + "0x2b0eabc08eef3abae3304cbb2efc67e7b437bd96b6f7d175daed6da5a2144e8b", + "0x3a345ee8e715f3226e52838652219202efb4e6d4f057f904d69d3fbd781e39f5", + "0x49eb2a07b5da81b57b7aa4fab19e691f9a684baef4cfb5afb6f46d23cbf1a9cd", + "0x3051663ef7de7674506f2c873409725363849564815b8bd291f00b9c60b4daf0", + "0x41a632a7bc167f67ca9c3825021a05b13f81f814ee101d37716e12efec3121f", + "0x6a5ae006b70bfebc1a485eed2c078654dc0f10514e8c739ca2a7019f42444ce5", + "0xf3dba730b64dda2bc2eaa50ede0fcaa86a37c74c3a17be97a9d969fca21fb37", + "0x6d6c02004f2a4cbb965f9e73799041fafb49f61aee66232f45ae09972af08e86", + "0x60391f436a32fdb0eeba8578313579c04c48c126f4eb6a0c49e249ff1c1fbf4a", + "0x570a30710a42539d4440ce9a2cc7d9ac102409a188960d0fbd249fc4352bf3e5", + "0x35cb6ce55352599332471ad8be46ddc0cf598e0e36b8a8fa5fae6f26277b318e", + "0x48a8116b254b171052251f353c93ca3816734e4e0baeea10b4269bbab9a2be55", + "0x126258211a4bb2035121c7ca129eae719d4ddfefa99921a8befb7a160e0f845f", + "0x5bf6985473bc5500f140844f5b66cea85815772cce03596eda60e6c7dcb4ebbd", + "0x5af46d3dd02261d893c418582188d328a8a84ff8f6ac6c1997d3aaadf64220d9", + "0x5e3c84925609016da58df82c1f2b51590e3b91e5502dca2eba13d8354916ddbe", + "0x410e6fb4390379a8b726cfb22a9eaab7232bc4b60eaddb629a4aacfc7dcdbfcf", + "0x2ca5debb9de1c4bbfa0204543dd9757241611cd28b5eac2d7f37baa293fa2618", + "0x4a1554023154a99b4572572ccd5d89fa8745c117a2a85e5786ef6ef39410d611", + "0x2ca75fb22881b238b6c96da6b908f922da8b54f909237051775c64fec8d5920c", + "0x546ea8ad3dffe14c4c96e4d6d8c43c644212fb663486165b34cb26ddd717f341", + "0x6b168ee87f2c532efdb378116dfe462f632a18eccf1e9bcfc740d35e535b2735", + "0x4cf917a780b850292f44502b80865d3664d75213f89e8ae5861dbcb52aa95e76", + "0x2e8dfe9046d8b951532466bdf1b62571b85e551b34c8bbfb1ccd3216271b73d", + "0x4a34d2abd01f09f743cc56a3f87febd60ae5d88e224918d840656da973d9252e", + "0xa3fad26c6318d471fa376fbaf02d341e41e687db6f3da88266de21c7157e940", + "0x131c9df7176eadb9af3a14f0f53a9b87196ef60bbb89b3630142ff8d9d69137b", + "0x5753682a8120106b42241c86deee879263d81fe8e3423e01f567316d9524647e", + "0x5ed9725af6a91090027acfc12100733a9dea89771048aa2dfe40daea9546645b", + "0x2c7b7a87f31ebd2464be9f211d41719b453939d53ff7be07a2cc21741d48b467", + "0x118159eb07353fef60e9733077cc82f92a6e2bd361c88d8122e9a292217757e0", + "0x5b4626e787d4a4b00ba4693fd7900ecaa19624be9f2fee6b9c3b538d4f896b8a", + "0x18cad22ae06bb0e8d043f7928477219e4d38ac544ce81c4c685267089e4c7003", + "0x511149594758e789b440ce534b52b6c508ae1881669d1fa4a7e551ef84e4dc4", + "0x428b8532efa194a7f5cbf4c296786346ddfcfe8f2bab26f25321f5d984dfc307", + "0xfd035cc129e91eac66d841e2864989d1ff4853662166143535603bf9460621", + "0x2c167565114475412c76f0df1961eaca9deb17622c9fb6f5ac8a89a29f42df69", + "0x10cac3ff02125419ac84ff80295589d1124a1e65a94e8d9b63a411317c7f5728", + "0x7213c2f17aec536d0a5196e877d1626a63d7db5b4e3bd77327eb3617b932aee7", + "0x1b86ee2e45fbcd59fa43edee6630dda5cb3b894eb4701eff5fd53967abad2666", + "0xb941850091bd16875f408f183fb93d250c538e5ee1e8979e960b5b499b2f070", + "0x31f75d53bdd5ac603c252925148a74fa5f3bf5d9ffabe64c6e932be904204ec", + "0x55296a48dd399c65798cdbda11e89f26f998f2d33cf328e87a1c364e05be492b", + "0x191175ec337e64a48785a083559176168bcea3db2822630c48f1d497d03e1e35", + "0x33200b518e6b1a1e96ba214cad18929e7f5b4e3336e522c5fa1febf69c0818c6", + "0x2f989e24f97dc06c075bb53404e3eaaae32a1b6d89d9e09acdeee65712aa4216", + "0xde4b77163f1572bbaa325f48bde7a429b6b0f803ade45a0e72cd2bdbd84680c", + "0x6af270d408f492402b7271432b6c443abbd1f0e220888d73f47498d59044d7cc", + "0x3d5b5310e7b6be63be8f12594ecd68108f4b3f6266683b13178d0c80d8530c2f", + "0x5f69d748d06e22916088bd21fb472334ddbe5223ff494b6c0dcdf62db69d43ac", + "0x6c1fd7dbb3298da86dfe5d0435b26e0a91fe6ad6aa25b9407d5da544e6b9cd27", + "0x37172dd49bf14ebca52e1c31b60f31de8213644e330bcf2cc59684606e62537d", + "0x509cf829b68e58861c3d6bce6046ac1b6e9c065378fe9556348c0c1814808e20", + "0x529d5dd132f5cb4b71994ae6b330b7944f0fd8ba319582d2414b9b10768b7448", + "0x5d251391abee228833dbd24be99d163ba9f8c92a2cf73a4e1f8a87e9c4ca97ba", + "0x1abe1d77226f2eff6f1a6bfc6c8d9e00dde1da9d67858e6984e53bc2aceba535", + "0x4ca74ba72baea6d84fa8f2a05e387a1c41a5a1b2f1a479fb11bbf9d5e09bd01a", + "0x232bfa6a3120224814967315ebf3d8c88b2eb0ea8c20c79ce854f90aec7a9b91", + "0x109f5bd722c8cf28ab6a3852970bcb665f398a8dc9d331958dc291d49a1ba9b4", + "0x4a181a5de6c79a05c02533350ab51deee24b8f5b9154c5cf09ba5e25862ae176", + "0x6e063b99c16028df94b1eb719164ae8c8336894791516ca2c37c5a1a394bb0d7", + "0x6bbd2d3a643d301d25a8cf156542165abee3039068fecf501e9d39f313ca2a87", + "0x4690fe1be7c7b8c10c81e63f5e508fe93853c61f0435f81eabc9997fa3b99f3"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x7564ad691bf01c8601d68757a561d224f00f313ada673ab83e6255fb4fd5b3e", + "0x6184e3be38549f7c0850cd069b32f6decbfde312dd4b8c18349b1b3776a6eaa5", + "0x419289088178ad742be6f78425c0156b6546a18fd338f0169937dea46cfb64d3", + "0x3244cdec173b71a4659e2529b499362dac10cb2fd17562860c8bb9d0fd45b788"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 57; + int alpha_8 = 5; + + static const std::string rounds_constants_8[] = { + "0x53ada42ebdbe3750f185d8aed927c2a339b1023dfde196b58aea362b1458208b", + "0x52a4bd5eaee58d29bfe574cafd97f987b1da709987e3d009ae971b0c627edad6", + "0x3b7abfefc73e31a012cebfd0420df327dd6cf8bb1a94aded25e40cb1d97ae623", + "0x18f6087444787b863f51d5f92722674e3440a076d35b3827ae2a34e2349fe613", + "0x1f6c10016b4ca694f41014517b6fae4134912bdd35b66c1c61a40023f362f7e3", + "0x37f5dd623b97256aa92ba9838b52e6b951481779f841cf5b158b52b264e19542", + "0x3bcb78486b25ea78993bdcc3ac524daa00ccb29bace59b43147a6cd34e90ea9d", + "0x42f7f2057893b0118ba72dee0390745595018499c07080263525fbee179f453f", + "0x1ebff9e98d8913caea56fcfbde1fa0e28e7c88a6fd26ed1caacb2167ac01d46b", + "0x50bc0b19ec65ae49190380dac906851effc5ded598dfc3a6dff9d193e28caa92", + "0x173542f5c5f705e8c07eebce465ec04075911da44ffeba6135da9b9908661651", + "0x104f0e4495d78b0988796d5099b0814c068357681e1f68df2e7589eab107bc18", + "0x3aa82015f9de71497b0d3ab99e353f15fd90297226b3b0a721ef4637c3266da6", + "0x218a066557035447f5f65c9ca1f6591b2e89836299bebb6434a4dc795df2575e", + "0x4629ccf1af64824871ea33c70b354c6da36f8fd52c3e2377c7bf9ae7f3e9c30c", + "0x4eb2718149318548c4f70554ea54d9e86c4fe4b5fe84dc4093b1369060a39d98", + "0x4ef417e3aeededf50ebc47a5a8e2b571f3acbae751b3c263ee26c7cc25545b5b", + "0x5662913ab2c59dc3413a934f86805c7442b258adeb728c3edb61a5c762945b84", + "0x12e9df9b98795bd66de91037d43a8480cde436b30a5ed77be71f9d6674d7d445", + "0x4927f30e0d987d23605c7cb4d903a3825bdc6ac7d08cecec1607621cbea26b47", + "0x9388b6f741eeafbfc7cc4479778c2ea0013e98b33b767d117c0bd780bc6d7eb", + "0x653915b04769ba57e58e29a163da6105c18897fe0c43754fcdf4275d0a89fcc2", + "0x32aeaef7bcb8b97f927022113baffac5515ab9ec7f6e56c94924a787ca3b1043", + "0x14d39fe74d6c0ce57ba40de0dacae628428f0b3021ac71e47856eba4ba1068b5", + "0x65dacaec232936d47c3441c960736cfa3fdbe13e2599263ebdd5453cf716dbbd", + "0x30838e97b66df6a39cdcda903a9c7f2834cba1f11c5a18a1a25ae1a851cd7cc5", + "0x2ba21920ed4441cca37a95beff2c1dbabc66c089fab42787feb9c7d63f563db4", + "0x48e82727bd3946dc067719d5387e7d8d8b96d150708c6007fade6ae7d8bb97f7", + "0x72beb7592e1a8b5ffb67f9127f7eead42ae5c9565629b44aec7ee8064664b581", + "0x152c4c7e8f09d7d288077304f9e6f23d7be63746f73a6b486d66debd68be87b", + "0x7658150e9fa7bafea32db94237a985857f11e7179d0d1665f5500eee99a6bbd", + "0x625e07f82a451842d18236aeda5ea8848405c54eb2bc2e9c721715d89e60e00", + "0x6e8e2fef1424c978db61ab5307c57f5ae977cc0f992978a079898b818df71c38", + "0x3bf1dcb8edb1778b295861f3f44653974369aadb6dc7a657ecf1e9b9f9975d0d", + "0x224b5e5260d5a374a52d205dc4cf2f6ddd2e268c19d4d8c23a9a83ddd95f3b56", + "0x258ba50efbf08421f9d84439e7198cf6d6d744c322496cbee7b0fad515483ce5", + "0x57a9861d98e4f0c7f48a1c0f78b8c254db8f9023da33c0ebd80e6a2fac37a9ab", + "0x6b4a81edff2101a784940a5d94d4997e1a7064e7d11cb30c8d44fc17fce5c7de", + "0x646b6fe0fc67d8eb957fc7f5c71bb2eb49deb4d800f869f4a851d48452837f80", + "0x72d1470e483ec6a6dba9515903f930b8913878c4d61f75264cb78bd6eb3897d5", + "0xeb84e097a3c154e3edcad691467aa2833cd6e2c034fc67c4aaddea3e612c0e4", + "0x16726722e28b6834cf52a476e2c85a7796db36654e163d98a90ca5c9c5ec5cf4", + "0x603a8ce41cd89892de62f80c2a69bf7c525ce2c9d73e179a40335573dafb5344", + "0x6d29a4353cb4ce51421f99e98cf3cfea5df6cb84fda5972de3507926e1ce8517", + "0xb4bcf8b8440ddfcd96960ad3a942f08ee530594a22ba68902ac5cdb09dcb004", + "0x57f898067bf97291642fc3f277c72aff1815dbdafaa153dd3f4dac4cfef65c4b", + "0x21f7a5a0c323149d5ece7d787c5fffc64e3539ee2a9d0636bdee1fd4fc743195", + "0x252bdc65bc46bae728b14a2cd124f9d89fca1d094a13938d5368bcbcfb61af24", + "0x49e04438484178086f10025d4dd075129db6ee0543de3cd6260f005cbd1cfd12", + "0x284070bc321a19aac8f72293ef5ee4047a25905571aa0fc0c92a99fb9aae502d", + "0x432b6f998822a8bc1863d18966f0257e4ca02860d48b5da94b54c44e50148e9e", + "0x2250a97daf4a6ab7e7ed38d562e45e557c6537095d5e82d8f8770c5606cc3723", + "0x2190b0a04860c1754bfaea7c6656754719019afda4db1c2bdcc02e7077cb8fe4", + "0x1ca5242b5b822ce4e547ef1044c25fa8e4e8ab34740ee80934bb783dfcd8ff00", + "0x13ef424fbfa8f57f530b7472049e399b52d243ce631f46ab53e83896cccd1753", + "0x313b6724e1ef1a2f8313faf995b286ca6c4e2935c938eda423799ad1ca4f074a", + "0x71d6f906d7670070ed88307456824180c88df4d6c5c430ecde2d401468317dde", + "0x5da276ba589d6ae24ac895bf495c021a5db46841aa15592ca792418c610392df", + "0x5522c5df7aad8e48c28ff2409728ecbff493cde8ba22627834b472bd5f7e6159", + "0x39fd68c744782320742384c631da42657f76ad1fbb4b31cd39f9b99871a658a9", + "0x7073f7f19a99e127202010143d73eb9c607b8a472d08eef5028c014296aef92", + "0xc9b173245a88129f945616b7753804a79a923a9486099cbc68eeab1a18a3ecd", + "0xbc470541a2d0d36132b8c062b988a7a7fc617a194763d1df0d185870d435214", + "0x14cef28cefade54ab09245615dcd4812f5838cb7e53cc3994db36597a839f598", + "0x673b6489cf57eee2649fad4ed7917c77c01a510091db44cb0631ddee2970fda0", + "0x1adf80dd643887e745ceb8f8a7482eba2fa9e3b2a9d78c04e34faf05edac21fd", + "0x3421bebfd00f6d9984f8ae8713583cf904bc1cc931d9f2207e46f316bee5575b", + "0x3377ebbc99869b1130415a8b6ef6828a091bbc962b770679ba2533b859b269bb", + "0x531c3189cd8061e25c7b2880a75b5cf54a38eaffbe16a6bb8c03072177edb17a", + "0x1de23e2b6a76564e456ec0ee314dd1137cb721458c6aea42e68db34f7bee4987", + "0x3c63febcc1037470db1fefde11feafa09f6b93d1bd7f4ab69421204c7b909742", + "0x27f9a7845ff4c11b37eafac24e732e279f871513b7e505964a44962f261079d1", + "0x131e543c8cc3d66c79e2d34b339edb4e8de104f16222108cedf5ede0bc2a259c", + "0x4903aacba7d57fbd9f8d5eba89a65e69c6dc17d00e0689ff78a853ebf2045260", + "0x62c6809bc54290477c60ba3344b68e73079d2acf142f6fe1647bf77f7a9ecc0b", + "0x1e88401ee384c7074e4cf262ce0fad617fac21c3179b13bfb9b9ae28b76b2ed9", + "0x80a8905ec7191f9e1fdaca749100b1eaa03948e2ba109f9b235258574cbc103", + "0x220515bc8e5f1b4b0e074e27f73c02b1fa4a4bab6623eab03681186a26a96dd7", + "0x21d170c9860f7b318902d6e3e7892cd11d1d4a77f6f9d1bbc000f710686be1ef", + "0xab7fc35aa93f80a4ed6787d9b121f34c2914515940f6d8ccbf44a1dc3d5e66f", + "0x920c263adbf43e70433816817a1a36526eba5e26e81a596abc53cbfd4e10c9d", + "0x6263f1b033c09db0a316ee60ebd770795ea8910483248156918ae1f50a203de5", + "0x61aea53c82e80114591feaf47fd76539eccaebeb7898f3861826c064b69442aa", + "0x442d65617945bc65cb2c687fccac2e731a78cf925d848e9a26a5896c7cf7d6c2", + "0x4045127d05c3cb34d005bcc59af6e7bf514c50e8287638f2af91309b1bb566b9", + "0x21248b251f2613ad1e0037db0f662e480ba376a59211d53c0d4005b10ed07a72", + "0x610b8e020b302c1e75de560c266e89758490a2852c7376e76999cbc2ecd4dfea", + "0x4ce82f499dabebd5f5864d7b0545264a332c7bec6bcb8505e38cc6cc87940208", + "0x323b2e2f2ccdb4fa2b7e0aa8ffe80fec5ebb2748371b1ee7367f9403a3017a45", + "0x4ee2adaefeb04dd7d8d567bbc11022fb1ed7be60dddb7c1090bc2c2eaa20b3c2", + "0x49df280184ea12aa38e1b7835016037fbe2214dbfffbed63b3afb3587fc4a2f8", + "0x742c9cd494e1f349b5cdda1354407d15528cdc5b149d52178bd749d11a6a62e", + "0x4c3088160d362a2d49baee41a920d11d4a4fb1230b51923e3e8bc2931b3b1c14", + "0x4146884271f8fddf477d774c4ea7e590a904858958cffbf2ff759727c6f4307f", + "0x35852bcb36414611bd9416003e36e2fda46639647b009f20a1571fb62255c06a", + "0x71380a2e9af86d10d3c853206f27affed5c8bbf04209265ec53dc16c3097cd6e", + "0x316825bc6a3d33bc4574a2bc080b267e9f9032cdba13b392f3cef5651b7bd73b", + "0x39ee257a7ab11b83ca2f84b4c3d2a43b9979593a3baf7fff31a1582463c9cd4", + "0x3a7d9e3631877361748eaded828a1226a8fad1d9a26b904bb7672c5a1098b010", + "0x8b2dde1aa612b89c9634b1984823f331515c10cbe93da28d579b4ad02950083", + "0x286dbe8166b75b79b9382fe5e03d6a8e89e3e14a0d868222534c1840da654262", + "0x5cd2d752b980033b428a3c8428e7c04c13b016659a9db1680ff0a8250be4345c", + "0x664175d23039d55ca0721aafa919aa2d9e58f7a6585056e72f7861cb5c68df51", + "0x17422f285fe185e8409bf4e808013694982a6b828e25b9d026fa94099d8c7f7", + "0x4126fedd4ce3edd708f5504a7fb80d4568974d8efd2522fa777a205b59939d76", + "0x362d386157a988e327180aea82fed73187fc9bb4317c8065074a1cefe3d29120", + "0x5f9b6f0a37e1f10579bb8fc18c0e2f1a9accbb709f555d931d81939baf21a843", + "0x451b11c73a54b552b6772e686b9f372c3a88057e3862538fe4fc93f3bca45220", + "0x6dc7c344510f5dbca0bc1c8a43faae5562cdcef2195d3a98cd1cc0b80937ddef", + "0x1acf4fa571f2dfa559eaa2ed75617022b7926b7e38969c3c404cb6b40a55c8d4", + "0x601692f0671f9a0e5b645b81f6659fcbbec95700c6c49cc26551d006e2e2abc2", + "0x2c418cde54947690050586e9fb648d979a04117c6a985951ac99d3a056091e03", + "0x1099ebe36b8a483ff9160c7e49cf27d1275f35638f60d15c251d004bdf0be43c", + "0x705ac07ef6e6f30e8587ddf3097181f1d6a821978343818ad66d0b2203e44990", + "0x376f4d399472844d9823bc00f9d9ec7251273dc1f085c6aad969986f791ced02", + "0x60dfac12ac5884c13e13677413285279d5f7b5dd0602ae87f028979005ea5c68", + "0x41478c307faeb9fa78ca4fd7779f00688c7b7f77092f28fccd5a0263727ce5c4", + "0x3d7640dc7ad95c1a5fe3bff9b6dd9f66d27bf6bc99d17ee167feeb09c4b77d9e", + "0x427c360b99fe9d869528cf4e8abba951dea32b5b9b6fea4e3f39d9e715cd573d", + "0x4e0fe9315cc9434a08a87aef6d65df043f8961650226f1cbe26bf55dd7ac2b76", + "0x69a03bbfabd2a06359ad8c748bc99ec36cc1e2726940915317f15a813be413a0"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x1118b610c2544efa26b70d9d60ca6ca362afcfff12436cf3b0f8a3ec5895d9eb", + "0x5ba288c5197e71745a8fde16aca575e379dcc19f21042d8b9375e478f809325c", + "0x79a987d87d7c80d5f4a3b4018517c50f5067ecb516f6bd14d79eabaa8349e63", + "0x4c6497b0b99e1f1af4ec0322dc38869b2dfb79db3ab5fa68936cc8b6025aad20", + "0x483b5c5071e90c98bd353556453f04113442f29a1c4c236b4ca31890136bee4e", + "0x3ef76c8bae0aa755dde594d8ec22b157f913323e5b29bbd0652e4b74973ac8fa", + "0x91767b280c59a58a39f293bfc22ae944cb921c2efa240262b5b66312724f20c", + "0x45ef82a5684137e5fc9613e0581cb65b5ad3d43470eacf0f060e1711c4c57624"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_bls12_381 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bn254_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bn254_poseidon2.h new file mode 100644 index 000000000..006eb17f4 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bn254_poseidon2.h @@ -0,0 +1,477 @@ +#pragma once +#ifndef BN254_POSEIDON2_H + #define BN254_POSEIDON2_H + + #include + +namespace poseidon2_constants_bn254 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 56; + int alpha_2 = 5; + + static const std::string rounds_constants_2[] = { + "0x9c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a7", + "0xc0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81", + "0x1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30", + "0x27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f", + "0x1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03", + "0x2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d3", + "0xb66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0", + "0x12ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e21", + "0x252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9", + "0x179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f1", + "0x2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91", + "0x1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b05", + "0x255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56", + "0x28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd9", + "0x28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043", + "0x2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c9", + "0x7abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9", + "0x230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c", + "0x1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9", + "0x2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc", + "0x1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8", + "0x2e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e", + "0x1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e", + "0x1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f582", + "0x283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7", + "0x1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc", + "0x216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd", + "0x2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f94788", + "0x16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43", + "0x175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc5", + "0xc7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32", + "0x1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d", + "0xccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f", + "0x14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e796", + "0x962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052", + "0x1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d", + "0x10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b", + "0x57e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d", + "0x287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee", + "0x21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d", + "0x1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3", + "0x268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c1", + "0xe17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6", + "0x4d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af40", + "0xddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e", + "0x2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b", + "0x1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9", + "0x21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b0", + "0x379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b", + "0x2d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c35049", + "0x123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6", + "0xbe29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec1", + "0x1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a", + "0x1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e", + "0x12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212", + "0xfc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba", + "0x1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762", + "0xebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d3", + "0x2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1", + "0x1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf", + "0x2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f", + "0x23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c060", + "0x5872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7", + "0x1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a7", + "0x19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376", + "0x15bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f", + "0x2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1", + "0xb069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc", + "0x304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429", + "0x15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc", + "0xab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6", + "0xe32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 56; + int alpha_3 = 5; + + static const std::string rounds_constants_3[] = { + "0x1d066a255517b7fd8bddd3a93f7804ef7f8fcde48bb4c37a59a09a1a97052816", + "0x29daefb55f6f2dc6ac3f089cebcc6120b7c6fef31367b68eb7238547d32c1610", + "0x1f2cb1624a78ee001ecbd88ad959d7012572d76f08ec5c4f9e8b7ad7b0b4e1d1", + "0xaad2e79f15735f2bd77c0ed3d14aa27b11f092a53bbc6e1db0672ded84f31e5", + "0x2252624f8617738cd6f661dd4094375f37028a98f1dece66091ccf1595b43f28", + "0x1a24913a928b38485a65a84a291da1ff91c20626524b2b87d49f4f2c9018d735", + "0x22fc468f1759b74d7bfc427b5f11ebb10a41515ddff497b14fd6dae1508fc47a", + "0x1059ca787f1f89ed9cd026e9c9ca107ae61956ff0b4121d5efd65515617f6e4d", + "0x2be9473358461d8f61f3536d877de982123011f0bf6f155a45cbbfae8b981ce", + "0xec96c8e32962d462778a749c82ed623aba9b669ac5b8736a1ff3a441a5084a4", + "0x292f906e073677405442d9553c45fa3f5a47a7cdb8c99f9648fb2e4d814df57e", + "0x274982444157b86726c11b9a0f5e39a5cc611160a394ea460c63f0b2ffe5657e", + "0x1a1d063e54b1e764b63e1855bff015b8cedd192f47308731499573f23597d4b5", + "0x26abc66f3fdf8e68839d10956259063708235dccc1aa3793b91b002c5b257c37", + "0xc7c64a9d887385381a578cfed5aed370754427aabca92a70b3c2b12ff4d7be8", + "0x1cf5998769e9fab79e17f0b6d08b2d1eba2ebac30dc386b0edd383831354b495", + "0xf5e3a8566be31b7564ca60461e9e08b19828764a9669bc17aba0b97e66b0109", + "0x18df6a9d19ea90d895e60e4db0794a01f359a53a180b7d4b42bf3d7a531c976e", + "0x4f7bf2c5c0538ac6e4b782c3c6e601ad0ea1d3a3b9d25ef4e324055fa3123dc", + "0x29c76ce22255206e3c40058523748531e770c0584aa2328ce55d54628b89ebe6", + "0x198d425a45b78e85c053659ab4347f5d65b1b8e9c6108dbe00e0e945dbc5ff15", + "0x25ee27ab6296cd5e6af3cc79c598a1daa7ff7f6878b3c49d49d3a9a90c3fdf74", + "0x138ea8e0af41a1e024561001c0b6eb1505845d7d0c55b1b2c0f88687a96d1381", + "0x306197fb3fab671ef6e7c2cba2eefd0e42851b5b9811f2ca4013370a01d95687", + "0x1a0c7d52dc32a4432b66f0b4894d4f1a21db7565e5b4250486419eaf00e8f620", + "0x2b46b418de80915f3ff86a8e5c8bdfccebfbe5f55163cd6caa52997da2c54a9f", + "0x12d3e0dc0085873701f8b777b9673af9613a1af5db48e05bfb46e312b5829f64", + "0x263390cf74dc3a8870f5002ed21d089ffb2bf768230f648dba338a5cb19b3a1f", + "0xa14f33a5fe668a60ac884b4ca607ad0f8abb5af40f96f1d7d543db52b003dcd", + "0x28ead9c586513eab1a5e86509d68b2da27be3a4f01171a1dd847df829bc683b9", + "0x1c6ab1c328c3c6430972031f1bdb2ac9888f0ea1abe71cffea16cda6e1a7416c", + "0x1fc7e71bc0b819792b2500239f7f8de04f6decd608cb98a932346015c5b42c94", + "0x3e107eb3a42b2ece380e0d860298f17c0c1e197c952650ee6dd85b93a0ddaa8", + "0x2d354a251f381a4669c0d52bf88b772c46452ca57c08697f454505f6941d78cd", + "0x94af88ab05d94baf687ef14bc566d1c522551d61606eda3d14b4606826f794b", + "0x19705b783bf3d2dc19bcaeabf02f8ca5e1ab5b6f2e3195a9d52b2d249d1396f7", + "0x9bf4acc3a8bce3f1fcc33fee54fc5b28723b16b7d740a3e60cef6852271200e", + "0x1803f8200db6013c50f83c0c8fab62843413732f301f7058543a073f3f3b5e4e", + "0xf80afb5046244de30595b160b8d1f38bf6fb02d4454c0add41f7fef2faf3e5c", + "0x126ee1f8504f15c3d77f0088c1cfc964abcfcf643f4a6fea7dc3f98219529d78", + "0x23c203d10cfcc60f69bfb3d919552ca10ffb4ee63175ddf8ef86f991d7d0a591", + "0x2a2ae15d8b143709ec0d09705fa3a6303dec1ee4eec2cf747c5a339f7744fb94", + "0x7b60dee586ed6ef47e5c381ab6343ecc3d3b3006cb461bbb6b5d89081970b2b", + "0x27316b559be3edfd885d95c494c1ae3d8a98a320baa7d152132cfe583c9311bd", + "0x1d5c49ba157c32b8d8937cb2d3f84311ef834cc2a743ed662f5f9af0c0342e76", + "0x2f8b124e78163b2f332774e0b850b5ec09c01bf6979938f67c24bd5940968488", + "0x1e6843a5457416b6dc5b7aa09a9ce21b1d4cba6554e51d84665f75260113b3d5", + "0x11cdf00a35f650c55fca25c9929c8ad9a68daf9ac6a189ab1f5bc79f21641d4b", + "0x21632de3d3bbc5e42ef36e588158d6d4608b2815c77355b7e82b5b9b7eb560bc", + "0xde625758452efbd97b27025fbd245e0255ae48ef2a329e449d7b5c51c18498a", + "0x2ad253c053e75213e2febfd4d976cc01dd9e1e1c6f0fb6b09b09546ba0838098", + "0x1d6b169ed63872dc6ec7681ec39b3be93dd49cdd13c813b7d35702e38d60b077", + "0x1660b740a143664bb9127c4941b67fed0be3ea70a24d5568c3a54e706cfef7fe", + "0x65a92d1de81f34114f4ca2deef76e0ceacdddb12cf879096a29f10376ccbfe", + "0x1f11f065202535987367f823da7d672c353ebe2ccbc4869bcf30d50a5871040d", + "0x26596f5c5dd5a5d1b437ce7b14a2c3dd3bd1d1a39b6759ba110852d17df0693e", + "0x16f49bc727e45a2f7bf3056efcf8b6d38539c4163a5f1e706743db15af91860f", + "0x1abe1deb45b3e3119954175efb331bf4568feaf7ea8b3dc5e1a4e7438dd39e5f", + "0xe426ccab66984d1d8993a74ca548b779f5db92aaec5f102020d34aea15fba59", + "0xe7c30c2e2e8957f4933bd1942053f1f0071684b902d534fa841924303f6a6c6", + "0x812a017ca92cf0a1622708fc7edff1d6166ded6e3528ead4c76e1f31d3fc69d", + "0x21a5ade3df2bc1b5bba949d1db96040068afe5026edd7a9c2e276b47cf010d54", + "0x1f3035463816c84ad711bf1a058c6c6bd101945f50e5afe72b1a5233f8749ce", + "0xb115572f038c0e2028c2aafc2d06a5e8bf2f9398dbd0fdf4dcaa82b0f0c1c8b", + "0x1c38ec0b99b62fd4f0ef255543f50d2e27fc24db42bc910a3460613b6ef59e2f", + "0x1c89c6d9666272e8425c3ff1f4ac737b2f5d314606a297d4b1d0b254d880c53e", + "0x3326e643580356bf6d44008ae4c042a21ad4880097a5eb38b71e2311bb88f8f", + "0x268076b0054fb73f67cee9ea0e51e3ad50f27a6434b5dceb5bdde2299910a4c9", + "0x1acd63c67fbc9ab1626ed93491bda32e5da18ea9d8e4f10178d04aa6f8747ad0", + "0x19f8a5d670e8ab66c4e3144be58ef6901bf93375e2323ec3ca8c86cd2a28b5a5", + "0x1c0dc443519ad7a86efa40d2df10a011068193ea51f6c92ae1cfbb5f7b9b6893", + "0x14b39e7aa4068dbe50fe7190e421dc19fbeab33cb4f6a2c4180e4c3224987d3d", + "0x1d449b71bd826ec58f28c63ea6c561b7b820fc519f01f021afb1e35e28b0795e", + "0x1ea2c9a89baaddbb60fa97fe60fe9d8e89de141689d1252276524dc0a9e987fc", + "0x478d66d43535a8cb57e9c1c3d6a2bd7591f9a46a0e9c058134d5cefdb3c7ff1", + "0x19272db71eece6a6f608f3b2717f9cd2662e26ad86c400b21cde5e4a7b00bebe", + "0x14226537335cab33c749c746f09208abb2dd1bd66a87ef75039be846af134166", + "0x1fd6af15956294f9dfe38c0d976a088b21c21e4a1c2e823f912f44961f9a9ce", + "0x18e5abedd626ec307bca190b8b2cab1aaee2e62ed229ba5a5ad8518d4e5f2a57", + "0xfc1bbceba0590f5abbdffa6d3b35e3297c021a3a409926d0e2d54dc1c84fda6"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 56; + int alpha_4 = 5; + + static const std::string rounds_constants_4[] = { + "0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5", + "0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6", + "0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa", + "0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8", + "0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902", + "0xe35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e", + "0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996", + "0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e", + "0xc009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738", + "0x11f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06", + "0xed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549", + "0x4dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b", + "0xa3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8", + "0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f", + "0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1", + "0xa1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447", + "0xc6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf", + "0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811", + "0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75", + "0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5", + "0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0", + "0x11003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574", + "0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c", + "0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5", + "0xc246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d", + "0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b", + "0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85", + "0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb", + "0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c", + "0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08", + "0x64760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59", + "0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87", + "0xe070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c", + "0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb", + "0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b", + "0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db", + "0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926", + "0x62100eb485db06269655cf186a68532985275428450359adc99cec6960711b8", + "0x761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b", + "0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d", + "0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a", + "0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b", + "0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0", + "0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5", + "0x70dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9", + "0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da", + "0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729", + "0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa", + "0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf", + "0x94975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e", + "0x4d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65", + "0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187", + "0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3", + "0x3fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0", + "0xb7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64", + "0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a", + "0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f", + "0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d", + "0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f", + "0x832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173", + "0x2f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16", + "0xe2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705", + "0x493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a", + "0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9", + "0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16", + "0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0", + "0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5", + "0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505", + "0x44cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d", + "0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025", + "0x2fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355", + "0xef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac", + "0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38", + "0xa76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5", + "0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c", + "0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f", + "0xc817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a", + "0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96", + "0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce", + "0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959", + "0x5ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b", + "0xf0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4", + "0x558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf", + "0x9d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455", + "0x328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335", + "0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b", + "0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df", + "0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e8", + "0xc28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740c", + "0x544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac16", + "0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428c"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 57; + int alpha_8 = 5; + + static const std::string rounds_constants_8[] = { + "0xdad22d08a6b8d81d4a5ffc34b9677a7c5254c85e953551f9eba9a0a97590c10", + "0x3cfc441111f1bab6e75957b9f0274e92d17aefc2d8da460435dfaf259bd1039", + "0x27c6d1b8a2e2ce670376cd2970192a2a08e4290883f6ca49e7976c6c447d6392", + "0x28f2882b9abfda8efc2d121da0c871d2d5313a53c67d0407eef4e93ee23e6c2d", + "0xa3943390fe4939fa2e931e18094c7c93aa107ced2bfaefcfe5e613a3f1262d5", + "0x2a8f37d8da8f2319e188f8909007408b57fba3555bb784c1ad6c7b0755805456", + "0xcef8658e33f20c39649528f353ef5d03198c75683f8493534add693a4ff4f0f", + "0x1cdc2a6f0f0e7c6c62ee1c0cad4fd11363a48db7095171faaf9a7b6e01c3e52b", + "0xa2e681a2db19c8d1cfb0c28f0b7b3d9830d35fca8c0b076b4e64328060139d6", + "0x16f013cd703be7de16b4361ce5c67cc2997f858e8a808885da67fbafd30d2717", + "0x29af57131c9cf548be669fe76c675e6d90bee17a76cccf4ddc5d35f9a936ebb8", + "0x21807b1ec6258bb155ed159da90b815dee119eae8138b1bdf950111bf5205b3b", + "0x7c00db8c50a8c860fbcb8ebd234a54350bdbcb8747891a4e5adab1c4abc6909", + "0x22bc08fc054d08a3dbb6094396d0de373a4c33205c49a1254cf25ebec1747765", + "0x2dad58bdf3e24c78f21146de084d9b8afad58956fedce67d43f7d375a813bb2e", + "0x292cee6bc19a64dc5a8a74036e676e238f60b4577db86213ced417906f1d6e91", + "0x27d655ae125928ad6b48bba54593b74ca0c23002b32a0a9ef375939a22387a8c", + "0xe0e2e781fe9ac0a97f0d961c7b359a415d1ead41c99eccee90e56b68fbfa2a8", + "0x13fec23e678d1c9943b6daed8ed8212289116ab96344ded7ced8aac2f09f1672", + "0x27550dd21647e37fc31640684e02cb07810669b1c1545443fd58204b2cde73c2", + "0x1de6d5f356a92c48c7b9f6aa45c8a6216e0a6adbc799c0bec242054674cb8f09", + "0x14c5347c4580363f74c885d1fbb378c61d953e490892b10baf84f6e1f3a3f39d", + "0x27f2768023c4df7952ca0d967f14034e98c4ca76973ae1cddfccd212cbd78683", + "0x1f4f499fc4853f7e189ad6d2269c467f77e15bbd28963c516b4fbf1ba7b88f95", + "0xd62ba9a8de3b97c72a5425a97a7f027fbad23f299ff46bafa12dcffb0e72bf1", + "0x22b649ae468f20c7cbfb435d932ba9ba4be14ea40c0c54e6bec970ab4c513f04", + "0x3a1aae439e47e7e14186d5513da5e263e063a3da6d042c16e55cab2e81a8e95", + "0x25c7eee1fce422600f5b1e78323f2e99cceee803f62763217eadbd046c1e0e6c", + "0x1c66258f103a955274ed71de56169bba34ff6aea97a2c32b98805dc3b011a383", + "0x29403b00757a647671a3691094aef420ad830f95743d45894d6d7f40aa356e4b", + "0x13496363ef5f7d0e91fd1319fd5dc0269c5190d05d8a0ad28a3ce0638a133e0e", + "0x1c6a4586c15c4638a1686921d7c204e2b6e1a88c1fc49dcfb87ded2a1ed7edc5", + "0xda23df12d0bf47bb92f15ee189386c20f552d0bc66ae492b92d69556b2fe75a", + "0x155be88bc5ddf8e0c6c741286cdd5ddd559279a455b9bbb61d5a0b004e545d5e", + "0x553fbb5b32db860e0bb12cef3aab4e0dbbdb1ea8704d335a18fa8b4df112c36", + "0x12f6a3a61a3139221cb5875cf455b942580c00942499932dfcacf6f75cb80ad6", + "0x2faf9e95457781b3c61de8a1faadda67f76f52bb81255fac8819bcc104071e05", + "0x1c7639cb68d3cfa69f3d795d1a1dd4eba176d0c29701e7b677ea0750b4ccd1db", + "0xd9d85a46281f81502fbcfb430f4d08ab504c502d2feae2ab4a26d87bebea0dd", + "0xa9b7074ea11d9931cf4af16952f398777aaa36413df14cedc101c7693812d3", + "0x7fab349ddb7d62a5edc0b6a62b300715634e5dccab808d8fa6ae62b406705a3", + "0x11f8f3afbd6fe6bda7d055a536ab3de9c40c8155b31d397f63ef21ac974cf52d", + "0x7c569f8f49899805d22a1930883968a3cf058993e0adfd06da437ae50e830", + "0x15dfb18bf1b6087c0e638f2189a7b34534549ffe8fca5afccf7e528a3338cc92", + "0x2140caa062d2fa72722ad48fb71bbc9f534043dab90dfa24b96664eaa2f0ac6a", + "0x11c06fe4e5398d4704271b84e6023b07b189dd1d2023dd599b33defe4251b715", + "0x775f90bae5f8f8157eb73bbc7ae69b74d44761cf0df3b4666eeb2860878c0df", + "0x225befb64b758b837a4305e104d5e510d893653559d8768dc79325ff89d6b9f", + "0x201a730245d9227f1232cc02f486c18cfa1fba40665ed3d1bbbdcd19b03cac4f", + "0x128b63b12a6647f80c686aaab15b0563c1a33f475dc18caa434ab64f1e290acb", + "0xa34ce8153d4e2e1158de05d276530cf3c749c16c7e09f3b671a973b0efb0839", + "0x2809c5d323665513c8c4a96ea4dc08e3aba43699bca1198f2b559915082495ce", + "0x23b929e7d71fe425f36f32975e9a68bbf83c16622678f061ed78a0c9ce318be3", + "0x1ca1a93d02ae448ab773f95c6b88c0d01f89c0c3d25ad625042771dd5a7e74a9", + "0x3c7381ccdfd209a8cba5627a058c33f472b24d2b1a55d9dd47f60dc7b474e7e", + "0xbe1a29bb668a25eaedffccef6c01c90688229e8fc4be9812e371d4d61c3015", + "0x2c821bfbd5c415fc076fc83895edab9e5256ee826946a865b8c82f0189af4626", + "0xb8ff5b252182f6a15cff90144c1e7ac1678739882c90fe46d0a29db7a0cba77", + "0x1c0e94b15306baf1b017623888b8d4c5402ee81fd213c4a5e42f52729deb7d5c", + "0x2031deb0f13ce17a5b44edbacf5a0410e23348c2c7657383a8ffdeb5c5ca1cd4", + "0xe34d14f44e8eb98ac078ec90eb718c3034249fbaeb13d24f3d5b6a4002018ac", + "0x2a10f1b76f8b1cc429820030c58b3d23ebfb775a43b07928b9868891c2cb4cca", + "0x535bf4f7fb763f981d2c0c7ecd2237a461ac385e2235fb35222b512f1dbd1b7", + "0x12ccb3fbffeff74fb7ce3b9943f609dc0d7fe34e3b5e6b199628e86d5576cc18", + "0x1f44cd78220a2e66be6c9eb3bcffc498a47f22c3eb476591cf456d518e3e126c", + "0x1d60e9e3444a748b8c22d7d10e825c536290b723fcdfa046436353d6f9abc073", + "0x5a3ccc67bd014ef2544927f9b96ff58e348954e40af67861ab88d78ff4b6688", + "0x1be5b195896e9ec23b9d3eb898734c385272ed64bdcb236223f5a3436986dc6d", + "0x1d6427dd07a0b46a8ebacaa82e8c04de8e7e94a18849c9275b8b4827a873cdab", + "0x2f09a403f946b692704fe4d5ae69625441c93a7f93dcb4f8f7d337baa735ad9a", + "0x1807540511593488e084b7297b6ff67b748c71731b6ca64aa8d3823e81f41b37", + "0xf1daab7a702ac80d108b24845bda04b732f3564ebe57392e470380199522e1d", + "0x1797d0f72bf0b47a45ceaf82df261439bc5e3b0ae55cf1069733d5a0b51765ca", + "0x2adbb9b4003631c5e3d02ce959930c75d4d25281c86febc61dfdf35e00cfbdad", + "0x1347ad87393ef928d2800fa2a548328ef9bddf5646da79d507d2f2055db335d6", + "0x15658e02d31e2c200dadf6a985652eccd30cb959168cde7b74c7239539d2df1e", + "0x1f00dc28bced12a74c3ce687dd3fa996d6f8bb29bc60cda4f3aed191a6fe8d0", + "0x154ebcc230244b68b9a8f51a56ff0541a92ea2cbb3e77b263cb03a8bd89491f7", + "0x1f65f74b523a8c875885378e93d1946c7a3f810e2eecdea94b80c4f741ea6cf9", + "0x2504a559a4bd23ed689acc9b6cb4062479a6b29692e2b8cce40058daf0505778", + "0x24496d9926e4e565ef860e52396a2935689c87ca99abd046bc279ce1bfc43206", + "0x2c9ccd22b143f4d8d483846d1960e7144a5c9354ea48cd1a71bdc82fbb929838", + "0x2b9bd02e1b064a8db321a1cd212a7a6dc47274f6eb5fcfa4f17d6f690dddf8c4", + "0xb21f0004118382f32fe441fbf36c0a38ae41873ae42d3b6ea5f0c6816e00472", + "0x10756efb491852587059f3e48b605a3bebabaab0a1ee5ff1758eb30623b7602c", + "0x127574a38823886d1f4841b540e29d67efe35aa8b3c685f969b6bc6cbab5064a", + "0x24751d620ed2a3db4382265b8c33b666b85beae7aa87f38e28bd2f8d637ff9d0", + "0x2e3d7208892e8a92e887fccccfe04d8d0fe994bc443641a9fc76c43da02f453d", + "0x11c3f6719071e6810699be20e1b1858b9ed00d8166bf15434cd5e43507b9d62b", + "0xb86112693a4e7f3ac4eadfcc3f04d24a7afe51a87f82d4a435ad27f30aa2f9", + "0x1a77348400a87f0180e294286a7a06c857f590e8ed17eed7a6b4cc1ca5a97929", + "0x207feb0ffff2e419bc967dd544abbdd2dcc601316f49957f2319c9a04f56157d", + "0xdf4aac4e6483265aa3fc462835a90380bc84004fc46d1a85e61baed3196ba48", + "0x2f2df3db6ed0e27d3151201dfe7f57fc2e5ccc69c2458535dbdbb5d88aeabb4f", + "0x2f51811c3568dbae396f86838c5c8b1bbf9b5bcb2ce98542e289184b95f74b7e", + "0x1198ec466dc8c3f55b048369eac0490e835928891325d4cf4461da1d22230219", + "0x19036827eb0714a1ee4fdd653d8667df192402e290dfdfc39bf005fdfa86c043", + "0x978d774018c29f2818df365312371ce4082a6c8c52d2a965516b76436349069", + "0x231ed2d94767eb9ace111af9317b233fee037214e3f6d7e366a5812c8fd1dce5", + "0xfbd8502ceba8ab93eb04d1db535d25f4c3be8acac4e8e0467b9d606653456c2", + "0x20e9fac35dda464e436a4d2eae4cdd5b52c9b712d5b4bfa43334463f8478d4bb", + "0x15ba9fc4b175278a12a5ab39ee0121b06dd09b923bdedb69a26182821445ba00", + "0xc3c9aec9048b10a06d062675b63417a1ae8704f2918382466bf575e22a654d3", + "0x2795a46eb4c79595a9de2191c524f0aaf92f764153b23c357ed50bf3a91cddf0", + "0x10ab7893c4253d861276ea30f229eb86b90c69985fb6dde4aa50e24828caa81a", + "0x2d4509d8159af62c44503f64fc01e953e90c6dced8ba75c58df2aa090a5fd359", + "0x157946957f4feb94eae09b9a6c272204d107ea7b0e31b67524a6c9ee7f04e7b9", + "0x30464efe02b65b862f9a0b59fea6d6934b393e65cdc3d29ae67a751a0d0f136a", + "0x965b3a2d05666d38ffcdac4e5ed020c742ba41d760e70f74dcd8f8b1324c901", + "0x24531c784663d57639928f0a8f152038a779eebbd70f6585dacc971668ebec55", + "0x2202070df8f85b79bf7debf24a9cc0f2cf30370f26a9372e01718dae7cb6171d", + "0x8282fc0baa2e9eb76167b9ab2405db9c78f1f37b168be6435d5385a806e745a", + "0x178c3d6e47cd33e5570311ec8ad8dbca0dbf54aadd1393738d898384c57795e7", + "0x12ad905f9d82f33643b1fefb90dcefffeb818d1ec3f4fc3d6857203eff5ed1ea", + "0x229682c9e4165b6ed1a2870c14a1c8bb7b1c7d3b52f42ce0228b85480666b4c4", + "0x25190d853744dc11d155de5e479640302a333d47cf18dbf1ff241ce42c88d4c9", + "0xdb47fadc76bf4fd8dcfe26908fe48ab42d399da939ac1f167ca8600cfbe7bc", + "0x2ba5e88adcbe025760f2c8654935f0557d14c6d4125a838f312f2ba439e2e94c", + "0x1376bbae85699dcc294f850c858b4b370e51ff3139bc3e0a1e52eb58d08ca41b", + "0x1333fda1e3d58e0747f5c7361d5075526933ea283eee2ac37b6042c6083b6a42", + "0x28bfc4dc9594e9add687744b79f4feb979e2143d742d4e4d1d5bb64bb799a02a"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x5bffb5e301d8c468c35e24eb2165b6b71725fb7ac9a48efe5ce041bdb05676e", + "0x2aa7a81812688343fc6d78073312996d75f4c5505db0ed22af5ec0df7888cdc8", + "0x2f5856fd71dab60d78cc3af15a89c1e4d61ba189849a4cea10acc1dd228faf01", + "0x12299a260999ac95d271e184968cda40bd4358877a6dcf43d779251fffa61349", + "0x1443aad4693d692a62a8e21f03d5643a123f0c8783a3d27c275f9d01089685fc", + "0x21561b0204a44488082e31472f5885a3adc179bb278233aedc4b316369ec9938", + "0xc7cc2afa53f9898f30a69b294a4e24f6b2176e1ae0ca49b021792d55e34e97e", + "0x2dd221096053de389fae88e7caa5c43ab55e22aeb758ee130d1246c1dff47b54"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_bn254 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bw6_761_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bw6_761_poseidon2.h new file mode 100644 index 000000000..71af86a01 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/bw6_761_poseidon2.h @@ -0,0 +1,477 @@ +#pragma once +#ifndef BW6_761_POSEIDON2_H + #define BW6_761_POSEIDON2_H + + #include + +namespace poseidon2_constants_bw6_761 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 56; + int alpha_2 = 5; + + static const std::string rounds_constants_2[] = { + "0x220a0adef4959539547c65abc32e7212b0d9a8c43eb7db8a60d977846e875f185c607f22f6f3682c2f2dd325ff5bb5", + "0x10ac66becb5a53079112a77bf83c1a372e71508e8862639bf4d90de860c642752c31448e6e8e71023bbe495629c469a", + "0x17e20f5c7d5c9addef08962122efde34f3a8113731f3e0a3d9e61083fc4a7dc9b0b62a1c1dba2c7a4548330216ebd7f", + "0x50f2e673065f77d5d5a93b7b4aaa0d67e68b5321858f31aaaf8634508fab663198743f1f2207fd367e1803037f8cfa", + "0x5861fb23e38eb32761f4e73439a2deafaec3a9da05b9a906b75f37a1a46ed8a026d76fcc5190e29fce1419ea1ce461", + "0x5e3cf20d57769b07b2a28f94bd7c0c2389c110744ddc8bae1a87ba4631355ab8439889deb1d5f5a1c3df4d46fcfa26", + "0xcb67dc610bb3ca2baceaebb75248af246774678c6b8901f3385301ab194ffdc03296c332e164168a8f01a4e5755987", + "0x1a48e0626493925a2e89a3f5de4ef1f73996e7e67d1aad119fd6777285fd15a1a4d2ba2ed7561e7ed20f3e8b0fc0f5e", + "0x651ebb9acbaebb46e227df5b21e077f106ff95ec7a366aba470149acf8977f70dd0dc09f9d9bb1f0b7a386cade4cef", + "0x1685f36c379c39cb53789525dfdd7dff2800df8e94b27b42c719af74c9253ee9689cb40516b01e6afe4c71f8a9ea0e9", + "0xa4fc7de9a4c29639d66b0586dfd75b3205bb8949bc41d6e2c2566bea2f8dcc72203dc51fb0599244e5ade5402b4802", + "0x5921f0107f9df39bc7a9243bd43fec3b36eb5c9caa2f68d6effd4291e8bd8c661989c9ae3f4edf3c26efa57cbf7aef", + "0x68755a2fc4c66da57788162eaa85f308bfbe71259facfbf82ff6fc6560fb933b33feb9b3511c565790f85b2da67ee8", + "0x4df9f3410f24c323b76de56ca373089bba79173c00ed7c5c601837e8118372b2a776161c5e103ceaf6e81866d8808f", + "0x1f5f84bd8dcc113a4e319cd11a3bc5a76a91127b9a70560205897b08e680ac008172d9ea0abb7c3b9837a3f918d9f8", + "0xd5e400483c0ce421e6dc2e7afb7e3333b069aed9621b8476b8d6424fb0bf66d167009c0b25a535ef557d20fe7e13d4", + "0x1636bc7e3d7c62315e5736e0666b6336f701381d2239c77783e2832a647bf1e983b47f3e96a55e7c53e1d670dbd1c0d", + "0x797fcb4e22653ad78d78de0bda0adb1c3b01fcfff0b9adade12a7dee262eb1d35bbe24a9d8d917aaa14a33145d4284", + "0x5bdcbb80237eae5f5c2ee4e3d77365b8c682780d4c41a396f7e100812ea5cee4a4ed0438857f2584052b4cb158c361", + "0xd21765a80c100b2c1de4fc3534f17783c912f7024958ab53346457cebac187b029af832372ffbfe2473ba4f495779a", + "0x5176d87dc3b68f3480322902fbe0948a8d9d189724dad2d79884ccc2d39fe61874fadda90bf91df0ba2935738973f9", + "0x87df946b1d6d19d0d4706131745d5708e62a69affebbcdd60c8f5c98ae497837c33aa61b8abd2241440d3baf3a6f88", + "0x5e1670162f9f3975582774893c7928a0657b9a40e915d5ab5f1947fe078845dfd3e1b4749962f9809b517c205b4471", + "0x166bdb05bbe395397f415096529b5fd3247912a07f9934d314be2d6746360dfc73f99f916d0da7f8ad2ab679c8f7352", + "0x9f84dc543d84dec17bbba07e3f597d38dadf3d4444481bc6c453a771b0000c4dc86f74ba5718d8cea222c43195773", + "0x285fd400751457d0af3917b08a45032e6cab84efa3fa97ac88b83a9f04d3c6ba05504e58835f1df94dfdccb99fbec8", + "0xad94882e7453362cbe445c970e674c644669ec63a4a7b233b2fddebcd4fc6acdf71c2727bd1ede7d49324af9cb68f8", + "0xc804f43eb0649d75729b17872ec3c6b2833bbe5978d7bb8a54f1e519728a40b65c76eca52ce1e0c1a64fda1c34178", + "0x10fb626c97a85e094499cfd49586e48c5d2759886e64751f1e27884f7b4bc01c5cdb1e6b8b2a29b821bb653e93d38f9", + "0xa3a47a4f3c07f5b867a47cf0d990f2678550ecf99673c735ee5018b99c9522740211b64fa6f54455b72eef8ed4afdf", + "0x751f58b80441ee59ced31ff968ec61266edae918a1559113eba3c3f19437a873274b7a4bb1f73f4f955d8b0b0a1bca", + "0x13a843b9707ca79788fc51373686175bab36a94a62bca473380ec2a2c6037785f1bd622569144294848b07fbba1f502", + "0x126c7da3b0b55cdce16a0a3b9b0539438f27f148970ce0575b53f8f30c15b823d55db1448d3d62fd3d9850c536c5853", + "0x5425b12ce8106d0939bcc3ffa1abc3ff2a3dad4ca27932e9247933076294e8fdd2f77ad4b3731811945ebd32be855", + "0x239473243e3d66db657c734e9ee99c3ce74b67b266b4c496581f978c69e9d8f3f253a37025ee787d40b9bb63e31d59", + "0xd5e375d1eb25008faac5c050ee9eb08938c348c971bfe5372434dbd330bd88de215108f7ea72e7387220fbe148e950", + "0x113f76c237c5cc27dd84a0ae406fd898b2ab68e0c83064acd8e4a79011312b6b6ccb396fb198bb6fa8617d35d21c5fd", + "0x1a351d4e5dfe9c1652d544e64bf99562d6682903b59b172c405d4d44effadc1e7e72f9ca80dd6596744645a745acea9", + "0xe3e92c81c82751871fa482a3287107bad6889f75eb5b40a7fc57b69d764d8cafb2a067c3e14cfff1d7b92b500bf93e", + "0x18dd4baaf007d8d5841c78dc08f5c1b0468b74e8a29df14d7c86b57fe2cac1d3718f5380d80a6c32d2c33cfaacbc050", + "0x1076ee29a14d0b674d644dfe1a2f4b76a0ee4014df2b6a42fbaa3e88fe2463b7e047f10e372e6beff433d1a09b6c384", + "0xb3c39b69f8aeb6ad708b819d8afd0869297b113ae88248f986d90fcee9bbe64d1191739c3e84e026d716868dd350f1", + "0x15257be0544b76d0b3fbbd22d2f5848af69b98c36d017e333be1bbec914f4ae9dd9fdae5c7bd61bb29d62eed89573fe", + "0x172401bd1fa1d1b96289dbd385d50b3b4c7b614e7427c49c4d3d5811e1214d388083748ded69cfb77f61b8044905f6d", + "0x66b649800a75fc762dca87aac31e851aa22f6ffd531a55a886f0b995dc064cdf1e49c3a32e7471bcf64db5b02e76e3", + "0x193a6728ebafc82f73dde21dd03cd8d0833d5f7de4df8f2326c5ff26f276539ca6d32522f9049f4e5e6db7fcc9752af", + "0x6cfa1a4e1470f940fb1c52d91d269e68ed9f3c4e245aee261bbc6290252a1a8f0a51cb1e29da326278b7bc424f1e85", + "0x1672fd20d16dff1e04de01e0f441e6c191e01f53bd6d431d592418d691dbbf181b52a5c1543d160d027d4eac76e68d3", + "0x2d94b03a811d8fef67b94267ddaf12b4c8b2657c6654f50b204dcd65cc27d35672f6a13ebe655ee8205f26ec03e866", + "0x73ef80a70e37901fabf4d127b24c6e9d5088d4a94a8eb4878324efad9f3aca4d79592eadaf8a627d01886af9224a97", + "0x140e40336d021ed222f86024d528b2853757fe7eaa19a2d0a24fa11ea5ce4572ac2fafb670ef2e777919cfa1066ec46", + "0x2175e2de5988b7cbf76a7a00d3d5809e37419cf11dbad6f0c518f1a7f1cf0ff4fce9c7de80174454c94800237ff612", + "0x4cecf233df3b974d27633fc3b9370303217a2fafd0aef9e7071eae49cdc15ecdd3ef31e701c7b38b46f5fe65eb6d2b", + "0xc89ac99bb5e4efff6e196f464bfa4fd698e46dacc1a10b5b9fe0e34ec9fd2c0ff5d39a0f549f2bac37a9b0b55b10e4", + "0xf95f82726f6bcb75a9174e28eb7e05456d8d40a26257c69171f92367fce904eb4ec8b7957345b0558c8c0803abe74d", + "0xc10fdb0388e073d2d03276cdc685775b201a98c42f8f1201f5403781c59ef9204c158136bfea19809953e9dd4f1bde", + "0xd919dfd016807ed8e464f0749086a0e5d36a7e8db5c536fc73a74abd8da938cd90490cbe6adf69372bb4f79e48400c", + "0xfac42b1d5067aa7256b9f517dc7c6e7fc3867aa64fd6e8183d4e610efd1fd1f393d217b183666d5a5b0ccd429c65a5", + "0xd945f3962b471ffb6791a8481a6161b5c6d3805624bc083d1414469ccff4e4c1eae912b4a77112cf38524d3397a770", + "0xa92f08cdef67bba56a8a1f76b7591fa03460958ad494b4ae5bf0378ab4de64e7b34f86748ea1e52374d475a9ffada3", + "0x110a73e17594a0d884f269f0d145cadc0da4b84268e43a09ff2ca86987662cc1793763544829d03d4af3cc78fbf1c5a", + "0x7f4ef3021c6bd8a66bba17a88d70ecb47f27cb7c8b284a0c57a82912223bfa1188fb2fbd1a892df8541a261e4a3437", + "0x83df71ba1434f11ca8459be1bd92d3234c6191500e8147bd96bd86c68e868eaa4b0af0649ba2fca2b7514436b45665", + "0x4ddf0c632921479e22d47dca94d31c4780c977bac42021e159838ae308c15ad394afb3f84d25ec63f8598df2d96742", + "0x1497cfd9cfcd47bb2dcc84da7dd999b03dac07e4b58e2b092d59f62229b9c740fb361e3cee690edcc39e1a5b2dd4bd5", + "0x173f07e2e2261fde9814c14b4687f55346bc365a955ab37834ebcb497c71a313cf2d6aac4a960e2a49b07736a56bb9e", + "0x1a305dbafe17fd1bbd08db9876f331684c47887e221d2ab444109d15fc67e8a7ee79440530da07615220f24574d37e9", + "0x13c7e8baa837b141b4ab21f3e4a0c95574803646edade8860f19fc6fb1c7f4694c70b1f05e99a298ffb34e48ce9324", + "0x1146cc708959e767b31a3693908b9b83fbbd82079c7c449a106faff51c69967c8a7e31f7af69d1575d6f8b7d3e48b94", + "0x14ff55ad6c91499da456dee9d32182d7f2b24e8162366d07a28ed5b8b26f8c83f3a7059f4a430155e30fc990df70431", + "0x20943f2f0f9c6bff2e1cdd22cdb3ee582d893b2580ba9f576c2e35dd2f7fedd5457041d30ae0a64184182e1d7dd7e7", + "0x5b4514b7661e018e32a6e3dc09d9e69cf46f2cc479a6c3337355055f932bb421594d34e247eb66f93ff5e7cd41f74e"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 56; + int alpha_3 = 5; + + static const std::string rounds_constants_3[] = { + "0x16459e35fcfa367c842dc40935289915332895c129d33092d67d51dcec53339306b10c3028b4d30837d4be092d18e00", + "0x42961a4abc7f2153d90ecf30b28d0a261923b8a7c2aae0f384011dd4c3a1a5d5ccdfd93dc4b4ebb42a254b393b35e8", + "0x5ac3740171af59dc84ded78a820f3330c3cb601c98aa988290ba3108e1760f023a37d7d314bb1c7c4833b72bb87eea", + "0x3676cb278806e554ea391b1bd8467469a0a24d27677c98f649ea186d5688327a350a3f3f82ffb9d0fb6e3abc5fb13c", + "0x5f2e02a78f4749d36ccf25b9ddab118faa6a5a4b0f2b67c6ef51f324bc73296ee9cd8c2965cdb23a090c2f548bb5b", + "0x4710fe15114968a6b52adbbe0647e2e262a234b113c90851e12725c5359a5e73dc82458a1ef4197eeb6e8dda45ead3", + "0x1d2139ebc03b9bc221028fefeadc5d2f5e956fdb132e5149fd0a9813095dee22ac50c2487b19704d4d106ac9aa8a04", + "0x11fe71562c43aad9ee87bd0801a31bebc87918d62b418fde73bab6d049281a92e312da58d2477a8b641baa82495da55", + "0xe40f436fc2ea368a264e77bdd67e91aafbd6a07cb19296024a91f2d8238158af7245e970d0cc9d53a0230d5ea3dc8a", + "0x542261caf5a1b80438c57d6f9b9d9f3ec6a6d2a6bd41b7c52fa83bb418234210146a5c1cd2c4f43fcb6f0a577dc3bf", + "0xec3a88501cd491f138cc7ba8353c76ebafa98e0e7eb078645966ad7297f3ea094f6e33204edfb28b59ce05b1a16545", + "0x7faeea9a70a690084edec781f124f7b63326018fcbcabe7add257b73bea0765ca4c90143d0515cfa50a65a6bfd5a1d", + "0x15dcfade3ad79af97df317b940379d5017c75ad5ef61cce697906a015abb43ca66f40c3c45fb82b1817fc14d5bf1e04", + "0xc9e0f0d2b7a3cb61210c053f0ce944976874109258e5242299be04be5d1ef8c77fc661f5a9d0e4d73c665f4a85453c", + "0x109d04dd6f6ccc60adf4bf344f51f643ec966699ed85f50cc49644047eb3f73535ed78a460d8930dce47b0e9f0fd1cb", + "0x103320d680bed0591e6781c5e60c1911a7cb320cdb4b956b21e84fcfe7629bbe711c1b9e830e508b7da919385ca152c", + "0x14f92aedc1ac6f5f2c60f3d3414968476622450223f539c0c0632a019112ff624c8e393dc2aa46494b24d930984c92c", + "0x125b9c470d1348b3abae361f5ed91c6465023e1c7e0f04e7c3fe2433e7aa024be588f7497dd799c9f907fe688322bce", + "0xc2bebdf2a8fe5b39014caded5a7f13b73eed4d65d39f625b34c2084044bb1a8a38851800d5786c893080b6b7a8ead8", + "0x4fd6b043299233bc05ea62dfa62fabc6a0d484fc0abc9f7c57f0100e714fdfc1083f41663dcb05c7ea3abe0f28aba5", + "0x175a6d77b91e73b0c0b7dd0db981acc389f2536c90b5822465bf5f92bd7b07abdd41e5782a6295b3fb239db158462f", + "0xe6e1ddf39975cf03c734aad4ede267b0fee3661a2c9052a09bfd1da968553346bd83103266b581e1e5d9953c76d8d1", + "0x1e25a02e69d56a211360de67657e7a7ad51bcbdbfec40c098ae7e8f2ad03d5f6e617ae9542fd6e447b5a3628cd78a3", + "0x17c1b790b0decc48ead7478671268f2b9d857aa924bc40dac7c1585e0e6b56ac0f2e42853db579b6eed415f692f6e74", + "0xb0b361ec80b76eff08f0b3bde72e2ebf6d4cd9aeebd89c973801add45e8c821f1bf6976698abe21291a87d7f534a87", + "0x19823469cb641e8e5e07b829d50b35268ca76d904bb78165cbdbb10749f9dcb8b48dd0c803c573605c305c3d9789f56", + "0x15554cc0360127dbe921408be780605df99993a3656204728b9aca02a92e52fd0547ba9e97d49076541663f0e753ac3", + "0xf4e05e0459724b4d529511c7a80a70fb3ce41e006c3566ffc600d2107d0551cb27df7b7ddfdfc0e5cec721d7024756", + "0x151f0b5a2cbbecc7eacba2fdf8453656d59f22cd9250672e721305f65f780949d90a792f9aae069f34e39d0c0017b4c", + "0x1d643280b92326c9d49e69fac19ce26b1fea06186549260a69a705fb742e7074557d7d1311c94c3cfcc11cea03b3b2", + "0xed62ded450bffc9c29cbbcd97cb18117c7a4fae7f9e51af8674e8b58b3f8b3c60c31b5a1650647f4fb3e8b333ab605", + "0x10dcbdfccd3200080979e2cba40af372468552aa3f841d5d1899516b364d029a08b0523569417268efcbf1fbff39e4c", + "0x194110a9e370f729b4b8adac6326a4a42a21d098a7eb915196982ba77c6ac130b546e2a9d7f062ad2d9d78835fd30ba", + "0xde014216ae467845d80688e7c7d0407d64514c440145659731b32807b1755cadcfa244679021c2fee603e3278d5bfe", + "0xb9affcdccf98a270afa8d6c0ceb2a5daf7a6f3635cd1a58a5302ddfb92ea73e0b3535d43737504acff013f746ee2fb", + "0x10283a1ae280cbfbcb7caf74a10548f117a3385602a787d35228ed522408d7b984777af097e6633ee5eacc53e93a67b", + "0x18353dcd95803a42e6321d512fdad80e34f79cd5ccf515916e1fdb76b8cf908e74c7ad04170b5cdb55c4ae3e8f0b172", + "0x1a20f82d9a2a487b620ed8867bc7114ed7c0caae292b815f33f1a2029e1f8f2ff4f29dccf13c18bebed43b25497d6fa", + "0x135c404e2292375b81950f9c0a190cc2be3f1d6a86af25c42bdf864400886070bc795c425e64b54394c9bf352debfa", + "0x7f470f89b1d8520405c54a5adef1f17e1910ea2489e374861a1d316919eabb5b40e9d59b26a0b4ea63d968b496e847", + "0x13f889c7abaeccaf936e8ea44ff78f436b1c0f9d3760f9506e1c3f52e65e8959533d4e2e972f6adb1fdc3b9344ad30", + "0xfd4360e2abd64890882c0bc0ae86c0674ef2138f97894cfea71429a4b43b9a1bf37b21fe0b05d295a2205ae160bf09", + "0x17571dc54da246f6c1445ce7707a298afe87819bf8bec34e6588d4445a746185074909bcddaf53a7b368b6c0be43f95", + "0x1858e8640c6065200800cd45d3c2612d1cd83a5293cd3a13b1ec3aac2842e309da9147cbac91c4375f8be238970d415", + "0x2b23a3d7936791eeddd92c2beaa4900243dc97a7fe8b4f4f122b8cd164948f311d95390c29252fce2bb09549eda17", + "0x19ff76e961c2a237a81a79a0f3c80175ee1a1b8e56206c9593acaf38bd895ce16e4e7ede6e3b0d2c7606f3672a7b4e5", + "0x4edbdd43012e07fc982cf0f04751592f9dd93a54cb0174e591dca8d3d23b53765c9cfcad1869bca93b82d56d6f37c5", + "0x19471825d6bed9a0848bec63e67b907b768bb5b0e785a0279ae20fa1742f0ee9a1f2bb50713fcdbb4748ca06ff35ed4", + "0x11a5154a97529ca98c3dfafd777964e12de131ffb7e1c00c49fd397fd38e053368b681322bf06e6bbdeab06c1a1e4d0", + "0xd7047afcb04d3004e7c04f832a277ba62304e1129201726cd6e96396032936abae2d6bb5e1d082296077cffd6551bd", + "0x1737457e802f067c5b49c2d8ef0a1c857cf29434b44eeb6fba82b6c867be72e84055e14ed27ae865a2919cc3b8ebaf2", + "0x178d6c929f4f23050f6d150f881ae9eba77ab3e548be3aa90cf02031f76b3c080fa3e796a6d1d3f742fce4ee01b5199", + "0x895f29871ddde6959cac27e8b83487ea4bfa587fea7a1aa36515572fb1b1a90df2b899a09cf0bbcbb205984d50fc29", + "0xdc04efbdd8fe171b0f3dc2d1da7eb25751a852efccb2bb656117fd6c5f047ca97da6b73beed8eda9424ced85ead39", + "0x164b7272b1bec3899910cfbfa8c8765d5f4036825229534cf851e7d8c5d2429ac4187fd34bdc1cb454bef040b50a96e", + "0xe271159113145a92a7e6f75a0686fe4df92902f82fe410a88c7ed37d5743f91cc08a9fd287e01ecf6c46e4814ea11b", + "0x8344bcce247d041886fdb9dfcb9c68993d372fde7fd32e68ce80312bc2bcb660a91fa8cabf43c2910373d017d78e0c", + "0x17474ccdfa018d45fd335a273016fa16521c181816290a3c3482359e4199964d282b556e78cdb04dae6f00aa7efa31d", + "0x89b0909955e662766e156f5408adb45919c18e0840bae25f74c17023e9e975407c42f636eda1753e2e00ccadad010f", + "0x15383416209f71d2873db672647776726bbd6d6c405d4bed6c0caf4a1a4bd63c0d111358a390f3e72a369949751bccf", + "0x15e5f2d6db3c6a6401d53b2a5730e04246e631047212b4bfdd130ca0a97a37500b58df332b202e4cace6a4ff13eb02a", + "0x185c90601a4f63501317e2ee6e201cd0e1e1699491cb8f5dc4df3ece66f0c117a5f9642dc2a8c533ec724877ed05603", + "0x50644cded2aef8bec8e42e3c411825b4cb1d1074e0e791f23ae13d5c7c6f8244967530a89eaabedc681382715339a4", + "0x1608478a8f2c4cbc73e654337f9b7603c627f3d7cea1d18d593f739175cb9e4a7e571aa0643866c42b7e9a9f628e5f4", + "0xd7aafb34e694e8fabda1b7046a40cb0867b0ca1e794903b88ebbb8d1e0c0e19393ef46465095e3c7b82770870e0efc", + "0x15fca17f560acaaa7b74110ab181b21f10b112a72dce34463db360f2f257e47ac6ad40a255f6e1f1b1d28f507930ec6", + "0x371e1c7c6bd6c16ac36cebd6f09a829886e7b3d0c4ce37de787cfe1f08e86a2337e5782be1daacca510baffeb1954d", + "0xd188e4d326d9631dde3abf830b3334c531b7846d7454664ad678310b82e38fc1b28b867f46d4ceae62070fdb80ac95", + "0xc0397c7518760a331dd0af7e266492fcf7c4e3bfbce675a2124294ca2b8e14f97cfafa0775f7769f09d9721768fbd", + "0x120863e28d9b5130be764fe304d097d4f1b514a926723ded5677603e21cbbcd1af2e5cf1b9543133260e1936cf2d58e", + "0xd7bddd1eb9485bcaf94485860a3008b269349af45b384ed0cfc45394982b8f91a1d018f5c595967ab0230f707f8de8", + "0xa0dd891ff61513a98df9948c7bb34a569e3844bbb7ae3cf4134490d5b03287ba8c006983068ea5776d16245685f5ef", + "0x115d8efce7dab96a27d2b7e683d3b2c462c21162398f7c8b39148625834a285629f27c94705d2292fef17aa1297c772", + "0xc3d63f12929bebfe71a4ab1f66020dc4ee935cce5441ee06b4c13f4682c1b3948755b453a0be1c0bb2d8eb63695609", + "0x1364c1de26dfb376df800fb143202c3d40b4b4e539e0a581844a8c7b8566d1611545489bbf2abc8f26ef6a7f1658baa", + "0x104189233432b4eb0c7172d2444e75b8595451431910df9e30ff45560dd919157295c869f8e9a098d4ebd37d80068b1", + "0x86850157d615f14a6e0650cb657de51259a2ce243eb666f6c76b5a706fa744c0d745a696f7e190b9e51fa9d2580e3e", + "0x11f0f91f56088b8f4165dad3f59ad5ee60c9b8abc07478296a69d8b13ab4653d9a5b014c7a5c98b4d8139a776376051", + "0xfd9ca346fd063f6d40802bbab5dfa594e23c49a70ffaed3ae716afb03b7d581efc4c6b82f91b3b0e158f358434c3b0", + "0x40c8119d7ea08092b3dc8d1670b96f5be14d00cea342338f4016015d08de90129cdece1890f072b355ab5c40fd4c3f"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 56; + int alpha_4 = 5; + + static const std::string rounds_constants_4[] = { + "0xaf2dbdeed854b38ad69338fd686b68e7492db9725bceb1a5602661729471a3d78c8f96559791518ae8f05850040ae4", + "0x60d91251606f5cda34bc2b46290dedb05a6367a5a8fcc1e14c33657362eea6c3e1abdc1c055a303c5407f4b8212f1d", + "0x41f6a30e7dff034b64a7fd2da3e8c6e26d7ecc564f0d4bbc955be419436cc5b2fa91a9a6dabd9ad375e83770b20ad5", + "0x19d9ee38081cf75169ef74b7e4db1e730e3d1992c027222328b0631fb13789889ea265a20358dea5e00e251e7932bed", + "0xe76237431f4eb5c5fd15959360b1b8d454e1ed73cb52bc3308b042dae7e901f1c31b00543ee385f6d9e1ce51892c14", + "0xd31d3c93fe423812cfb329b2321ddc6cd9c9b96c1868817846af8952aff303d08e80faa92c210a510ee7a5323abd8f", + "0xc28ab3ea3728d85ef46d63d7e1f2a96df6132b1b550df9bde53ffd3471277afe161a4d76bb5cb7056e6e05f3f1e717", + "0x13cdc350b1984093fbcf77475a3ac60644505dd6c057eae6b5d4f9899730ff2c227e782a75cedef00966a9fa41632af", + "0x72c290e8c33f83370245b7cb1cdb9fd079d2553a774f2efdceec15355a0a04c1c9aa5cbc353d0bd7e93217fd15188f", + "0x108b00f5604dce0112e97112f2bf1d2394e11044aa0399dc40da6a2c72fa304e58eae9bc919141b2c7abf98eda9a4ca", + "0x186cbea1d1e07d8b90d1c5a26e675359126b0c1b83cc0d45b29e50d3e3de2c7f58588ab1786cda8789a38aec26e9887", + "0x89f56b4aaee97f8ed3152c45390f3034d6c001122e0c4e87e080352e9831aee832a601517e3fcb78dcc985df37c825", + "0xeda29ed1719da5878ab7a6e5c713d6c4feacfc39b3875dcd61268eb64addcd469e92c8c6612886c2041af5b4334aa8", + "0x14cfec762a0f9fc0bda26f649d2d0c8c2159ea5ad9c8a9f9c9f0b982fc4112e0c600786b6ac9d41e25d137a73f419af", + "0x1a0d460fe2d39c7665766d46c978a895bc7b33b9903086c6a97e1ee18c619aa737b984ffa48023f1cdf2709c64eb32", + "0x16da036b4e308f6b0afad2ecaf41b587e8b652c6566598867195eada3c6eec38f1143966442f12e61bf78ce49feca3f", + "0xfd927fac6f1a6d34e7d41436e93c3c53b3b018e44b3000376de1f0a3389800b464d657e49a9c2d9cbf6a5b1256264f", + "0x8c6beaa25aa8b906000bad7e66921b02ee292ac49a4b34f0311517673fb80bb1da2890827a1493ade2265224d25aae", + "0x340f6b8ca96d64258c91286d9c64780bc8f0decd9cecc52972b0a5604582a90ce45d85127a1d1822f33b6c0405914d", + "0x882d242a21bba1087624ef55e25eda2c00ce8f51051ea4a1cbb840a195160ab03e96b7bd788da40f446e79b165e5ce", + "0x21fbe9a72d7a036ec96ba74bada2c25f9a283002da5e67f05c14c74662ae01ae12a7a3b2662b2d3beb33ea71ace2ed", + "0xbf6216bffd8f3c6818d703c64bf3ef79a599f98bafe2e54f0a5c78c37b9aeea9ac07d72f949fbcecf317be55ca883a", + "0xacc06d890770074fd2d86b0c247d5c6417146d0cf3ef169ef1bfac3fcf3dbea4b27d7ba2492bec06ca31830b01bf37", + "0x13d728b620c4344d0ae9c041e1c5017d82f3d69b6e91e2186645b2fc5fdf2c8c98ca0b9c22261fbe4ece66d686dd4c7", + "0x12c720d9730913b48257020d8a0f6ab4276d07d9ad85083b30043dce88784dfdf39fc4c9bc959b0acf958bae039ba3b", + "0x648e8e51ba0d0066a20ffb560b2a597519c2eb4eba73f3bff62a6cf20587aebb63018dc4075e75713348fb78ba636f", + "0x17010553a76e15c14397c898334a05fa81175fd22bba00459cb0c32980ee2d77057e733f4fb92d24fce7e4f1cdc06ff", + "0x103894f79376fe1ff37cdce31f6ad7597974f38174877d0a2f517950fa5f423e5c5353527fdfa35b7e493352e0f46ef", + "0x1349e51a4dfe5cf0966293568ba9b4999b08db8f5c6a8927b381e5e716f4c6733d8508bb04f17de9b6cf77ca6f0530c", + "0xc5ee1ccfb6939063cf2b43acf37c49176ee4cf5c739d71950ffeaf76b08dff4677042a16462cb2858b87d41ce8d016", + "0x7579dbbcd18e71c94b8c6d494f92b2520a8477184be78786eaff5ef062dbbf605577143df8380f54df0ba0fc67a202", + "0x131fa837c16d30bc51159d81771a5c4e139679358fb4e3baa09eb28dfd1202f745ccb3932e79f0f62b2ed6ef22489cd", + "0x15f04d217084477c898ae05cbe2e6759b24d93f8ab142cce8b72ad0c8e7db00755a2d681458d0187c11d9fc614543ab", + "0x771d36600c438ddbabe353947f470bf8c6713e5671c45536d1ba389e2b396e4d8c486c76a801e89858ba42d2398f09", + "0xa1d03dc6f62ee38d57ba4fef8ec971840b313aaa1b515c4b5884a5b8ec04f30700af1ac422e148fd58e22825d8c410", + "0x9b51d24d2dd73889c0e807e654f94ae999b640d3b1dc9f38a25396a7757d1a05d36f418ceb41dc8ce6987561ce2481", + "0xfb67d24d8a547a677085d035c01bc96d2e78630bf99cd0210822cab7db048702c8b5f4aa07eeb5ed3020a0066f0234", + "0x12003dcd079892602179dc3546ec2f2b71d8a5436e644171049d24340ba36ef6e5d4711fab8a75cbd4f8b479dbba5e7", + "0x956c226edce03d747ac53e0986d364b19a884836ab2a63ca4cbf1e485d6c0979b968018d2ea7794f999cdbbf9d49df", + "0x1981eb8c30d33a9ee2b52dfce030dcf358d5e47303ef4fdca38e4c57141d7da47bed61ca120aebe91660590ca0428a7", + "0x5891bbf09a67c25c2e95a682aec4dd8f2bcb742bd1cc807dddbd0307ff95243fd0c0ea549ee5629f592ff8e0deefae", + "0x14e5e5df026cf04889e56586c287b1b32fa84bc856876c652a4d8726539f4d96a3b2d58f02ed57a584bf3cb8641582b", + "0x105bf9f01b6f41bce48c9813a62b7e08faf2fafa9b40f3805318d59ad17fe345b15d07567ebb3139d296809347cc0b", + "0x54e6534b837f47667bd2a7bd0a18692af882c71cee54b43582f71dbddc1926cbdbb734e9d2bcf3d91cfa67cd3e8eb8", + "0x43c56f0becd042a2321cc951fd661812374cbdf94a1a69d561193672f622b2ec5e2b22fac705c541b62869b3f9d67b", + "0x7debf84e5d8508452f6dd3feee8d54df33cc1afbca3ef76250f77aeaae709cb4e12b2147d38d3b9de991b7e63af9bb", + "0x5fa3f8ee1df0e894338337c4818dcb798a9409718f6e77e1980b51d842322c1f4b853ebe131140e7e1850448212ab6", + "0x183725a7e4c9a1bf8cc045fd21f9635ba667d034a1fb7a2e92bcb62b83a22e9baf072963e2dc77b7040baf94d9017cd", + "0x13a58ec3d60d9747f7755291bbc1f4fc0b9f729e920b747a511f0318540b8db279147737965c15eadce6a5f8e3dadea", + "0x61e753c4cb9e94de235c140d6e3cf86bc73b23c75a9b4916f344a5129ca711e34ad5c6395897ab62ad4d18d93146dd", + "0x17a7c121514127231e20347900389c1f9530c1d0e28eb6aca6c9afe18461cae0111043f41c10ebf1676a5ce92374101", + "0x194128a29d1a4bd66c77da56765e26ae346e3fbe9e6590318d1e5c44e732ddc4b64f946389739d3e0f4d6383f3bc9d7", + "0x117c8ce83934f36101e92a98ad1444dac575c4c6b22a6db1ee77e854dbe49bc9b17ebb91eebdab253da5591dd2a4119", + "0xc988b0ff3c149e158f66324afde392450340ed127ce878b343fe14fb2ff565e55cf38a6311a47d42c16af0f6b77f6c", + "0xac1114645f611398a1273d3fba00067a969f830abc7f985a7fed3bd2382d0d0a2d7a1edaac3b14545846a57e6133fe", + "0x5f8a63bc8462fcddb1cd86d2c647b4ff415140c0490e6dd8568cadf205445f3c481fbc39e2c8cb7b56874e576f019f", + "0x13f4ab363f6357cdb5256e7f846a9a77875bafe5fc02559a3aa90368b27ca1592c5a9b98f84136bfc9b727a34dcef1d", + "0x119af6545487b8aab3c247722585b73eea243c58179f6eddc7e5f2c71faa15c4fe4f11770ff9d9d046331d5c9570a1", + "0x3821c8ddf092eacaff01b5a6f93d6e17d76b43ea193d59a268387d8220d14bf2fe2cba0ff1b5d059eb248c508deb4e", + "0x5fe5f16d419a2066ea1aa082f1344cc7f83574c57c27af4ab34eedc2e5369102da8e3715b460cdadd8f7cd135a330", + "0x146f881bb35e11dbf6364b279402467efb8dc32f55a5ed1289be1030c479695d72f2acfa88c9bc67fb63c105a004928", + "0xfae38f134d930e2b1d839850f41e5e20678c5b7fecb26cf1de64d1c3b17881d287f4fba8a4acfb7abda78086073cb7", + "0x14edb1b92c981223acac89514b710cd84e9d5651af5702c6275ba9e9d045901a45321e244805f0c93e9251bc9fcb8c6", + "0x1ab856db2ae85d970d4f348e8634c11651051a8daebd7b17c9e3ed56d895f047a9ef6e8fb7f68bb49d86c1fe06208c8", + "0x77bdcaa3d2622e3e04c5110985185b54530db94db30b7d92be7e37b61be07aee80177d272713d944a8f4eadf4fd498", + "0xb1b77a2bed0b471262aee500fec2ebc9b8316e29667f3f99b9db4b45ad51f364631cd52ad4929e299c1d6a143288f2", + "0x2703feb722fd73d364972a0132e7f553e4d482a7659598e8fb9ed92e527a6f192ef48feb3cc482a5e74761781c037b", + "0x17dcbbf25a092c89f1f8cd9f95cd74dba1d90e5369bae9e5a972815f1cb255ec3fba8eafd0ba86f95f369a00a2ae6cb", + "0x3de864fd94b62863821229db3cc8a51233f5fa913ecf0038fcf9658b44472d84561c63795434804c63505a3769282b", + "0x200414997a384438c3c4cd8993e7542ebf6a9c2ff939acd963dc505f854c842d6b0b4567bd66bdea1bbb365d2d0239", + "0x16b9120ff94b8a079355b6a37b457016a7e3049afc9c47c620408e628ed2f35ca9dec0fdc6713aed8735e0f45a1b0f3", + "0x18bc99cbaf49de7f46dc16dcc92ae4363d0bab42b0c67e62903b4659ec198841a8575fc5cfe3cdecb8667bc20518d9a", + "0x11ab59000b8bc1a82f0e06248122facf7677740982cd34c115af3bff82c144f2cbc72695c87b2e516bfb55ee18f51f9", + "0x6f15fccd05bc48b5e5595a64ba92279ecf602b926008968243a68a45f9ba3945d16bc7e9297a7cc2714a44acb0d89a", + "0xf357a5f258806b5f1764d5098733a5b813ad53cfad5c1d0dfac550ad3d651cff58c8ffb84c84d14d6e091a59ce7518", + "0xc4290640301802fba3965046da1a95ce263c99020827914386f0c181642e3f92547a43328c330901a7e4454d461a3", + "0xc33ca5abea6aaa71acfe2a0f35afe91a71aa763eb8560988e4d242fb27a454a943bd30d101c44fc554edd95ae3aa4b", + "0x11bd3445141b84475a45ea1d5148f99cafced57d7296b65f49d4cbf705cd8c41d2319ef60cc49ff3a04e98d6d607597", + "0x11847f95082143db31f36b06347289d01bff723766e60e17affdaf84639f4a7816d6da7c6db3b8d7affecc3682dab7c", + "0x105bb1d6030308f20f805abcaa8760c5354d85a22a5aa04110da0f81f207a2c3b38b4d27c105e5eea9c1fb486c9a4af", + "0x12c3a26c4b0cdf343c299571ac09ffa4c497274876795fb83f2c6b6af1a35b98d4c9bf9b65ad7b1675115caa15cf949", + "0x9328800e48a30ae9dd3e93da2cb2f21f02521c7796d64ff31e56dc2bf9dc65367f592dcb4e2de0ba30d2a03a4b7121", + "0x169b280c81bf4280881f5a5f19906468f2ac165e66d36732a83a87aba642e5e6076a31a17f5ade562619a4406aec81d", + "0x6ceeb884f10edec757bf3bdf471d10d589af63ce070a22f3dbf8a69e14896948c404dcaef51201854e68e15fbb0f71", + "0x157a55f577db09bea10b673d4d7fec89b49493a8f2b52ae233d960f805fe6a7ea6eb4de2bff3582438d9b894949b4a4", + "0x956b43258513c3c7c71d636bb5561278152a5b8a2f0c6c22f4e997ca95ac682d2da5dc02064da7885232c6388d61ab", + "0x21f6311d56ecffbb92fbb9f27d409c3e83264b0878495b4f622fb2db9db5361a65c444b3f21a63d340fe677c77d80c", + "0x2ad8a3c585e39a167b591462af9a62b663a94b5cc23dd1768d7ceba78eeb33534576cecda9bcafa809bd765e96e65d"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x136cf372704846da70badcb3decf38a0716427a0b322876ae06e3135ae080ea1d5ea713293398b2e56a9f6d8eb64d8", + "0xa7ad2777f0341b4d1c20c2d71dbbb8f60f37ad02d0985bf4f0b25bcd0da68acf6cc5428d8e0c24607656829db1ef98", + "0x110697454712c6a1ba993dde5d0e2fc6903eab458a5d073bb78233f7414c69d9c19d2752506cf11fba16bfb09abba7b", + "0x4212dbbf9ba6e53b1a17c72dcba32dcfe6e89a547a395b0f2ccc6e182a0ae8b529d7e0eadb17e868972e36d2f14336"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 57; + int alpha_8 = 5; + + static const std::string rounds_constants_8[] = { + "0x4b69ae0ea3543e631619325b693c3ae8b42957a47460a69b5f499f86306110477e5b571ded13898282a53d851dd15c", + "0x99420415b1d0891d58989a935a27f0afce78f99ef2a3b03a30c41415927ca0ca0c41583a06a745ed638aaea5554a8b", + "0xbb4ae97f5d45c31a2ae0efa519b23f5293eb6b24596c4bcc24fe7c76bed1b9057df3c69fc8b92adf5281bc4b30495f", + "0x132ce5451482706437ecb0f16b132e92aa3e1e5d02b5c25b42f6178680033bdadc1fc98c4feaf9601e579713076c378", + "0x139e188692b12dc16755a27e209b978f84522fd8e3036294d5b2e1c4c8d1438137325b7a34e6bbf5873db2b9a2f47f2", + "0x5af5e533870cd0be84cdc55a09f3d463feb29bc57dacf318f196cb9161e8d9512dcd12a68c926f5c7f9431a61bb786", + "0x17550ac91856efad6af997bcde62db0cdbc8edf634414f240e582f249d4999f3b2f813747fb2276d1146f243631c8c1", + "0xad54a9417dd14560d7ca97d254c69d46388decf0c048a11c675f9d4127a56da8ebd61a6ef459e6e5f5cac424ded61d", + "0x1aeb5c3ff90d1a6d64251ad75a605ce37a25e180b73ef0690f9ef73eabeaddd33fac4a0951974bd7d02dc7b1c56470", + "0x8ce6e1197ebc499e59bb6dcef32042a4fec89a42844f5aaa080c9e16dd36779b13b732251f748110121bb4c98a6d8d", + "0x828b9f615d4bfd69db74c91e49b2345842d0ded27f7d9a64c686ef09a972069a09283a2e569e029e5f87aa58013cf4", + "0x3d208e5133d8b13b7060af343c63e1a753f4ef98c3b66bc2cf66673bec4c9c92673f523260bd4a6a12b9e96233d257", + "0x8384b2f1beb71ba421cbeee82b5b6d0a50afcf64871d2f5f8043a4f2081b001f66c66d6a4b0ec55e018fa339221832", + "0xb2d13e9d42e92a7d47cacabb23abeb0796320ac9dc90ffe89b53df0f147aa7a73b1eef9578c128e5ccb19c6ec7e383", + "0x17fe3127e704b70ac10a8dbde56a5d95b94d843cb6e361a2b166174820a4f3ff9d55ceee696ede4ff59f109d92531d9", + "0x11e5a6044015e86b4abf159bfb4c8bc0aa856ef879bea2e4a234787a0288fe8fb3004f16b2988be70b935248216ae5a", + "0xb6e3e59d795dfe460bd774d11c749c377b2ab2f632313a7c6a854dbfaad1e54d8bd7228cd14d6274b0aa53d42be1bd", + "0x5426db89d779e72d63eb05f62e13662c8dc8072290c2ea0718aa762fce978faa793430d25d622b9f4d07e32c6f8181", + "0xcd004aa97e96363eb768852cfa3200a820da1ecb454d03a62187a480428d570074031087d77ce734daee4a7439f3dd", + "0x31074b235a3479cf963c4ee942b730d7896df37b5a77d0389d46359b4078334f5f796073278a43fd8a0ec9d1426bbf", + "0x995916f99b6e601490ac6ee457595ae5de6605f7a5171b80f3ffef36fffdb9d829854390dfd1383578ab303e077592", + "0x5fa75f6384b9c67d835070db75a18aff416f2a4b7bfd91b5784a151aae7ddc3fde6a627028fdaa26f753d8ef50c8cf", + "0x17e6dfa4db989922499f93ec7f4c182856e609b2f1284bcda761ec67f6cf7ee918bd8a603c21e32280fcac55da45291", + "0x9811e5c5f664b1dfdb4deb1563563ddfb769cbbe878de2d8335f229cd19330c1db48e0f7dfdcf4bff3b84a3c5d6e9b", + "0x2ae90de4ecba52cf440a0fbb121b2b279c41e6194eb9da305ecd4dfe206c1d35cada41202649aa27b09bd6a9cfa805", + "0x154d4cc9cbc0a0a08f1a31815815384678adea78f6a4ee84307808d704d89b7084f9209436c72287145461ba6897dfc", + "0x1a47dc42b9097167a771c9300d8608aedd8adfe6c74de5fce0eb268390613204f3f2a34e26996af7065b35ce916fbe2", + "0x902486a6a7fa5e471598797a09bb84423b809195d6e171f3b91cf7bd7ae5409303ef95c4e6a48c1b1a559ed40af93f", + "0xac83b81ad4f48be991afb3b41e47a25deb97fcaa045d629b45cae29daf19fdb31e23c37f45bf3a8a09bd3f462da2b", + "0xb0877aa125439cc9cb8483f74e778b4dee8b967f3d82826f45de84ab1d679584cefe9135ac2578d7341f09ae092e06", + "0x9ebb7fc169525a3d75c95db7317473e555b7e6fa521b05bd7afa03796e3f9f03556fdb398547ba61d30b92d9424fe8", + "0x311f50a2c8430002a14e6d1e4e08221a6847f789dea3de7bf2fce9197a45552fabc273504c453953ba901cee8ce2d5", + "0x1049a3475d25dafc2a0fe3a2b2f8e863cc0546456a8c0cd22e90c784268e7e62b81dad277e5208e24cc5c4eaecf7d35", + "0x16c219510a8926de17ee603ef0f2bb581455bd774c4e9ef2d377ff8b74a443ec2ad3052a2713ee77f8d798cdf4acb8", + "0x1963e15f5726967bda8bb6b91b80ac332d1da60ff1dd4f30444e4045414a63c88bda13d2e63c3d7d4620e78e08aecf4", + "0x15a9fd8e756ff8f766d0a4bbb1c14ccac9ac60e050f0fe8c69b9a4745f9492b8d264da3555e68f782a836c636c08564", + "0x173b56088f0d426228e139d8b9714ff8e3f9dd696b63123cc088254a6538ea285879297cd39992e2e2b7babdd3476e5", + "0x151ee79d14a70d39e23baefb74ad1e7a283475f97d5624a1cf7e03cffc26cb50cafce0c166a42e9fcd60cc2ee734ffa", + "0x423613bb91a8f8b8c35fcc0e2b50f8c9a39f60e62319df2e64b6efed69aa14037030c5aa668ec80a0bb855cf6ccb9c", + "0x174706d77bef15fa6f58b3719a2a90937cfe9f855941e708346d0880e136da834d763bf3b427883ab1a283e1f00e45e", + "0x99a94e1a5be7b73e5b8d8c1b6efba17bd406bdb53cd21de12de9b9442f4ce3dffd3f0e164fb8b668333cb2027eb1be", + "0x188bbf73c4e25f85572c8c603001a4682e29a4d897287551daca8c3bb8b7b6556985983eac9dc6cfca4856993321aaf", + "0xcc969cd50b8bb54091023f3063963fcbe71072bdc3b07a8cd297c25bbef5fcd20dd6dfedd45525bf563006c8daec27", + "0x89f7d50d23e077fff6b086cda17268e54999875990e9e3e972ae57a8d6cf9c5adae4ee3db8c410773e6256bd70aa68", + "0x124c639a5e04b6d85e5b949dd66d51e4ef8e592db4157c2e034f17cbe8c9562f571c58c861250611605ae37af7bea49", + "0x166c79267aa91cea5ad2c5fe01c14e0b51ba356aec9213b30ffc1317062ae6aced4ed86ec38a4c1a817f57fa704d55c", + "0xff4d848216a807526b78c8bcf49d4b4a3ece5eb51f08d53d29a4e8d76d4292845eb2e29ee3d65ef03a35673ae7bfc0", + "0xf83d088ded07beebbac37be1b2d1b8c35599ee1e2d50ff6393fce3b79aa9a488363eaa4c745730377111d710573038", + "0x140d6c381ad4b0978e987a124b3a08086533e81f30961a6156e0c36efa255e0e02ecba413f6f0345b637536357dfd02", + "0xc09465d3d35ddaf0a99d03ed614d4488bcb397179482eb3a070f2a637ae1dd77fe053cd9e0da3d8f508a087b956564", + "0xbf809736a281bd68cd059bed59a8e4020f11580a9acc393023c5b16c26518f17c131f74d2abb9fe058035151890fe7", + "0x88b0a48cf1dfa38cbb1783d7abfe3e8f7b0e65a2caa17a38d952de3bc69e44832b0e071ffb7a0b12629d4e5749cd40", + "0x1758d4e14e81df7775b4c98aa24eb7d99ab5f79425a45ddcf8585d91cb9f0dfce1e80ba60157b08b5b80b485b8ce668", + "0x3674e371bb3dd719a780505d9fcd1d3542f151e94172ec4e1cda904dd941e0df7da6fcfeb9128d9c1ab971deaf8bf5", + "0x300aa8b2ba2dbce74ba5de405eef2a401b32a3d3452a6352098610ec1b468341bb3abe4e33e5984575733ca7da8d97", + "0x1645e2d74a1854ed5b1e59689b1045608bd82e945621aea3a4fb791bd65818ce901078474250345f9aa0ba7040a46b6", + "0x24750ab110db6193456be6104397952454ba5fedc88c10c5ae931b497d808eabdf319c9f0520e45f6151daeead9ac9", + "0xacbfc37386cd098d5491ce25c248c9890e0a083a5dfd305f93d7bb11272467fe25842d336c59c6a70b230dc2d3cb93", + "0x8c2a6447540c3784943fcce442ebfd02045ca098fb0eb3ec959789a7d7fc3bf39ecddc36df6a496912183477dfc9df", + "0x17c51d95c57d455d01c192f3d17d0818308d5489b4009d0bb6dc73b3303e800c989d143157eabb6675f8fdddad33008", + "0x3a5a7bc776e6443815c59b2fd9716b00e994c790563f22c89ead2704baa9cf5520090370888806f52ad1a7a146d45a", + "0xa8d57c53e3093660a9dd68ae9e8747024c308b0af09b375e40fa4006a0a314f69d063db8733a1df6e846df0d0f5927", + "0xa865d076916de6b45adcff4a6e78575c7d55c55ee9b38fbb3032a2ee832ab4f3b4f617bc29ce1ae5837fcd524195be", + "0xdd57b67b095004d29cb3a27bf86310ee02c36782f4c4151cb0168f2f18e77b0ebb8a55f9ea00da222746e988ab5769", + "0x6927254ede31537098fff0b07a13e44df45fade23c82d1a1e06e85b99c7480178d25c1dda7c42738190f00c17aa3cf", + "0x1e7c498b01f32a86ac89ad9c153d4b0e11c89214df81831066320ca4628b8b38c695711afe5dde84b5a2164c4b7fe0", + "0xb5078007d9eb6e1f34c9e4b9efa18e5e763a220499d8b6efae82ebfb215edb0ddd93c6e17d254c347af76ceb1f82de", + "0xf0d56b4f0be3884c75e93ae3cbbd2536577b788c40ce826c88f24dd94d72b42b1f59c58e4ada331576860e796ff991", + "0x894014a9b85f4e04fa584f6a18f562077244dd824ad9c78ec1f7b1e87928a74757f1acb89813090d685aeae62bd3dc", + "0x3745cb1365d25b950cddf7085ba100e03149450681e996b1fb54d91f39fbc601902d5852ad70b7ec7ee3f5ac530f1", + "0xbb921aab804546c969a59773ad4dea1df83c6de356973c396077994ce40aabf05cf872700908dc39512d4b675e00c7", + "0x976e3b281a2e81f3a143c767de84ede5a6e7663f84f5e253f80daffb2ce85d473fba8b8859e56c734080eb0503a25f", + "0x75e844dbc2e3d0f38d131c3657c49c1497e2aa4ca0c41c882f4c8edc02ea80d12bfe673dd78d71590898ffe017b654", + "0x11afe465e5901b7281891174904c40bc8d281b0aca9454609c6f108e0161ceb3bf23ab4be6c7483d60998a287ce5953", + "0x8727d09d20d2ca70ac8296f8b05382e4a1fd82b2d21ca46737c951c7d3743dd19ebc02165881b584c2b23a3580cbf0", + "0x8be651c4727671c77f3cf96415400c6161ebb255ad05b029a70667d82c33699d278bb233f04c6487edd125212145a4", + "0x317a792db76f1cb4ca0cc9b61f5fe270cb093fd486b923795a25bc892965ddcf3132f7481f857b83fc4bc5b5cbd3e5", + "0x35df97ed63743287534716b9bfb1b2220f730b57f2a606c48a4b608ae1e507336cd4682be4c0cc3178d9fd68a7cf79", + "0x1a893562a0e30e713648a914ba67382df8e9ca5641fe104802c75e792401b93a6164602d488af1b37a5ed9a46605cb8", + "0x5cb9440589794670f30581f4033e54d55d4db76aba7955015528a1153514489cae043895d9adf3d9f8b42cd4d3b9d5", + "0x159b02836a1cff16248e91c965369f05c25d6ffc94a749892f806a67a58833e7679263749000b0af58488a7cbe1c63f", + "0x1204e768620edcbc14ce71979736c030eaf7a42ce28901ff4f0e703c2ca531d69def03dd0328a129ca9d8a7ca80b7b0", + "0x18f072531d066b85a40f53e982a0d119eabb61c4349cdaaba8361a7cfa487e5366c968cb3890a081a1d13322ae21989", + "0x195e324b8abd97e3dd845dad3cf87a6bfbe4cdf923bdd55109522683c6c18a598227bcfce7250581aa35d10c415163b", + "0x410a7bfbfc2b01a360cfdba23bca71d2f892b927b73625c27f9de1d38e6f5413b1740dd890f8874c369881be599084", + "0x2c7f0dc742b0c66bf454fb24296883288fdb0d89a02d14d9130991180408d4e7826023a0ea6e847833ee947e961b04", + "0xd53afe53a04e5aa995523340bd61576128e753b90bf01ed00a09d2207486400334f9d6eef8027075d841ffa7acf062", + "0x1650c58de06bf24ec98ddc636f5f011ca6bad5dc67635f7d3d0635544fffa0fecf988348528951c8b7c37f9fca6797f", + "0x4177c6e5462cebcb7d7dd96a054127dae8784881a988357c6f2a5e599cee56e5331385e630a56905ec06f7f802dcd7", + "0x979eb089173fee3199cad4990f7c56669524074eaf6422fb4e2bcb3c87928c8fe0af4cbe1b18de6dcf42cf36ae72dd", + "0xb7c847bd32fb88b1dc45462abe84faf133c3bd7d8bb2855079af7033560edf00dda35d4c80439ca90440d8ccb7a05b", + "0x3c47be509c257f90d598a1f687155ee935afcd9f7240925899ee60f102b780ebbf5c88a4f66e15d0cc7e4ce629ad16", + "0x5955989a7ca39cf481a26d421db6f83e397fef7ccf613d4246b08326386587590591dc9f7c48502f78c02fdc0cb51b", + "0x1518de0cbe7c41c5ddaea6e0007a276a86c256712240cb66318b8398217410b827d44b29e63dc6a6e0515ff290885b7", + "0x43ca48e99952bf2637ee1253e968e45dbeed3c05184ae32ee29598116b4bdb228445c7cb872edaa95035e8d19de47e", + "0x3d5caf27c4909a5e8bba656323d050ceca0d7439d29cf0d37e016f8e6090138b6c646c03469090afea10d9c3518395", + "0x7a532fc76a51db0cda14de706d5eece4fcf0f88dc1f6aee2535289ed335981f9494d2b886f3a0ecb2d76ad51b9517b", + "0x153b0dbd41111d9f72b239a4bdfb3a7aaa700e9a41634f4309dbb33daec80c2ee30424d652a5c1bc6e0a8c2277bb789", + "0x13889d8ab3e35309720f7eca90d5afb882e59bf646a0e4891eeb555ccb033965889c50f114e4c9b3e16ea955552ad18", + "0xf56c09a3b8c0b8a5699e40e716838909727bf76dd17e1446e63ac80e6050ae5db15122b5750aed07fecfdb68b757fe", + "0x57d2bc746f2e0d666e90a1a82d3d584797144c9f3ecf25932ab0ab5f4b2ae053f4869dc755ba3ce59cb93aec226da3", + "0x45870c27b7f75257abfbc0a4ec2d2197779d46ecfaccc6c43134d180e88b886744823979dd748c9b4f5a9471d77b5e", + "0x48202087479cd745d37f66e4103cbc8c5289115632f39de4508c950e6222d2e4afc830ea90d7a5a1797f116c3ad3b2", + "0x174f50da4065b8c4a8f1f57f4b0af239232cd0b96b7138a66c8acd47afc20760b1c791b05133331b8d13d667b7b3b73", + "0xeb88cd586cb8aef62e7d2587e07fcf24ee0f18106db186dbc2f11f7cd98fe6afc5d2c8d78acdb88e1ddd5660813ad", + "0x11dccd5858696509d6e2ed50c6eaab2d1c2b7260a3bfd9b69f0dd48d814fe9faa0870382ed4a47e3e49f9b0ab1ce930", + "0x31fae5424f4ba5841234727ddd6192804b6a04e41f8987656fa27859ec124fe28987b999032d0ca1b4783d1fd3c275", + "0xe10cb099e239e18a5e50afe9d9ac158ed816328e3908ff14eeef3a81473cd3e3c6e09318d4ddc41e79cb9d931c7628", + "0x989c82bc870582194d57c17475864d8b21ce11a899064b62231728c67f8c9cc1f9b2994cd6880d52193ef192ffeb81", + "0x10eddeeb9e25477ef87e26fc7a6c6d9434713f32ed0eec3cb0e360497e78752ff5cf40b0b0e6094f8a8979abad1f8f3", + "0xab67cd6505188c58d607e545d488bc2c17982e9b6d2b88c8c324d037359b7f3d019a7cbb706cae84bb2cdf32d40bf8", + "0x11c4786ca9c133224220c54f1cf2df0b0f71d6756426bdc8c45826d1d0c2ea384562b729a305990395e633e95ac55a5", + "0x13bd9fea302907009fdcd985525ec64f97f724b32702554dcace64d85001d82a8ebaa78036ac34b3599f34eb9a66009", + "0x19702a442ef2e199a861c6d778e936b0680b4a42796e8ce8cd0c0df29533bf89a523c4821d20af5e5ab541ad389afa8", + "0x161d7c824fc9fd5ebc05b8eec1119e13a6fe8ff391d69722ef53561fdbd0566db5f1a56bdacda44814c11f55c37d730", + "0xe15cb328232cb54bbfbaf2633ff9521d50e8bdda5fed3854408fdedccf225131b9a8fc4461c25a852d5851b3be426d", + "0x1c497fc5143ebc43a353ed7060810c6f36ebff103f14ae52bda4dd67785c897016bbe296a7289e70e440c499e2901", + "0x1a981a84519feac010da092541b250266148dada55d9a747d6a5324c3c8e01d50535ce2f683c83a8da5aa2a0c0c9966", + "0xd432d7618f801aabb3dfb21965a0da30bc8b58045eacf15b09f62e49d7f6776a94497a316fe1f31b2a808d33f143e4", + "0x4e313a733b09931307204351131b58c2de261e21ed683be89d066141227c6ab0474de8338ee36b00d5e3cca8385039", + "0x1abcaff54065d2c05f6eab83fbfdcc300dda8487794af5a3bb6fd03b2349268dd065b509fe7b4a8c562f3d9781a9dfc"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x12fa808923e5fcbd3c5a24835ad01e8a4d38856366956b0be918de41788258785099ebca55289502eba09d243a72903", + "0x960471946b6d281935c4d1e9a4d5ea110af0e7ffb688b568d4ff0d5b2ed19beaba709e6e41110fc3bd638a807ee67a", + "0x39db9d1ce85c0dbd66fce0a5459085719f3ecd3a3eaedb434f54148e154f99011310119b656348bea1a5815db3b675", + "0xb3ad6c615ee6c84953152d2491d36a5e00863891c11ebe88387364a7631a40d684debf2024bc10e4a478e3f3c29239", + "0x55fdd68dbd26f60d90df1844cf1a36ea1234e2ca99535bf9c4c5de165246f5050a98cdc138fc2f245cec99cdf5f678", + "0x1753f94fc15ac965db052a2cc7473541bd0208f41007448e39e8d91860f45601f6635704684093df40644d3b2cac36b", + "0x23034333ec552e619cfba19c479c56042b693771c8d18ec8839a21501f6dbdc37711629cbb2a786146697d8a5f8bd4", + "0x21b60c45de8f3b5e7013883021dd7cd6f6f57419e177543d649ef06aa23452de58001105163662cb08afdadd4c09a5"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_bw6_761 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/grumpkin_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/grumpkin_poseidon2.h new file mode 100644 index 000000000..19bcda0dc --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/grumpkin_poseidon2.h @@ -0,0 +1,477 @@ +#pragma once +#ifndef GRUMPKIN_POSEIDON2_H + #define GRUMPKIN_POSEIDON2_H + + #include + +namespace poseidon2_constants_grumpkin { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 56; + int alpha_2 = 5; + + static const std::string rounds_constants_2[] = { + "0x9c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a7", + "0xc0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81", + "0x1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30", + "0x27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f", + "0x1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03", + "0x2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d3", + "0xb66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0", + "0x12ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e21", + "0x252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9", + "0x179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f1", + "0x2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91", + "0x1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b05", + "0x255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56", + "0x28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd9", + "0x28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043", + "0x2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c9", + "0x7abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9", + "0x230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c", + "0x1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9", + "0x2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc", + "0x1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8", + "0x2e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e", + "0x1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e", + "0x1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f582", + "0x283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7", + "0x1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc", + "0x216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd", + "0x2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f94788", + "0x16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43", + "0x175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc5", + "0xc7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32", + "0x1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d", + "0xccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f", + "0x14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e796", + "0x962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052", + "0x1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d", + "0x10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b", + "0x57e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d", + "0x287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee", + "0x21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d", + "0x1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3", + "0x268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c1", + "0xe17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6", + "0x4d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af40", + "0xddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e", + "0x2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b", + "0x1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9", + "0x21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b0", + "0x379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b", + "0x2d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c35049", + "0x123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6", + "0xbe29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec1", + "0x1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a", + "0x1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e", + "0x12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212", + "0xfc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba", + "0x1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762", + "0xebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d3", + "0x2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1", + "0x1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf", + "0x2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f", + "0x23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c060", + "0x5872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7", + "0x1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a7", + "0x19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376", + "0x15bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f", + "0x2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1", + "0xb069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc", + "0x304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429", + "0x15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc", + "0xab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6", + "0xe32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 56; + int alpha_3 = 5; + + static const std::string rounds_constants_3[] = { + "0x1d066a255517b7fd8bddd3a93f7804ef7f8fcde48bb4c37a59a09a1a97052816", + "0x29daefb55f6f2dc6ac3f089cebcc6120b7c6fef31367b68eb7238547d32c1610", + "0x1f2cb1624a78ee001ecbd88ad959d7012572d76f08ec5c4f9e8b7ad7b0b4e1d1", + "0xaad2e79f15735f2bd77c0ed3d14aa27b11f092a53bbc6e1db0672ded84f31e5", + "0x2252624f8617738cd6f661dd4094375f37028a98f1dece66091ccf1595b43f28", + "0x1a24913a928b38485a65a84a291da1ff91c20626524b2b87d49f4f2c9018d735", + "0x22fc468f1759b74d7bfc427b5f11ebb10a41515ddff497b14fd6dae1508fc47a", + "0x1059ca787f1f89ed9cd026e9c9ca107ae61956ff0b4121d5efd65515617f6e4d", + "0x2be9473358461d8f61f3536d877de982123011f0bf6f155a45cbbfae8b981ce", + "0xec96c8e32962d462778a749c82ed623aba9b669ac5b8736a1ff3a441a5084a4", + "0x292f906e073677405442d9553c45fa3f5a47a7cdb8c99f9648fb2e4d814df57e", + "0x274982444157b86726c11b9a0f5e39a5cc611160a394ea460c63f0b2ffe5657e", + "0x1a1d063e54b1e764b63e1855bff015b8cedd192f47308731499573f23597d4b5", + "0x26abc66f3fdf8e68839d10956259063708235dccc1aa3793b91b002c5b257c37", + "0xc7c64a9d887385381a578cfed5aed370754427aabca92a70b3c2b12ff4d7be8", + "0x1cf5998769e9fab79e17f0b6d08b2d1eba2ebac30dc386b0edd383831354b495", + "0xf5e3a8566be31b7564ca60461e9e08b19828764a9669bc17aba0b97e66b0109", + "0x18df6a9d19ea90d895e60e4db0794a01f359a53a180b7d4b42bf3d7a531c976e", + "0x4f7bf2c5c0538ac6e4b782c3c6e601ad0ea1d3a3b9d25ef4e324055fa3123dc", + "0x29c76ce22255206e3c40058523748531e770c0584aa2328ce55d54628b89ebe6", + "0x198d425a45b78e85c053659ab4347f5d65b1b8e9c6108dbe00e0e945dbc5ff15", + "0x25ee27ab6296cd5e6af3cc79c598a1daa7ff7f6878b3c49d49d3a9a90c3fdf74", + "0x138ea8e0af41a1e024561001c0b6eb1505845d7d0c55b1b2c0f88687a96d1381", + "0x306197fb3fab671ef6e7c2cba2eefd0e42851b5b9811f2ca4013370a01d95687", + "0x1a0c7d52dc32a4432b66f0b4894d4f1a21db7565e5b4250486419eaf00e8f620", + "0x2b46b418de80915f3ff86a8e5c8bdfccebfbe5f55163cd6caa52997da2c54a9f", + "0x12d3e0dc0085873701f8b777b9673af9613a1af5db48e05bfb46e312b5829f64", + "0x263390cf74dc3a8870f5002ed21d089ffb2bf768230f648dba338a5cb19b3a1f", + "0xa14f33a5fe668a60ac884b4ca607ad0f8abb5af40f96f1d7d543db52b003dcd", + "0x28ead9c586513eab1a5e86509d68b2da27be3a4f01171a1dd847df829bc683b9", + "0x1c6ab1c328c3c6430972031f1bdb2ac9888f0ea1abe71cffea16cda6e1a7416c", + "0x1fc7e71bc0b819792b2500239f7f8de04f6decd608cb98a932346015c5b42c94", + "0x3e107eb3a42b2ece380e0d860298f17c0c1e197c952650ee6dd85b93a0ddaa8", + "0x2d354a251f381a4669c0d52bf88b772c46452ca57c08697f454505f6941d78cd", + "0x94af88ab05d94baf687ef14bc566d1c522551d61606eda3d14b4606826f794b", + "0x19705b783bf3d2dc19bcaeabf02f8ca5e1ab5b6f2e3195a9d52b2d249d1396f7", + "0x9bf4acc3a8bce3f1fcc33fee54fc5b28723b16b7d740a3e60cef6852271200e", + "0x1803f8200db6013c50f83c0c8fab62843413732f301f7058543a073f3f3b5e4e", + "0xf80afb5046244de30595b160b8d1f38bf6fb02d4454c0add41f7fef2faf3e5c", + "0x126ee1f8504f15c3d77f0088c1cfc964abcfcf643f4a6fea7dc3f98219529d78", + "0x23c203d10cfcc60f69bfb3d919552ca10ffb4ee63175ddf8ef86f991d7d0a591", + "0x2a2ae15d8b143709ec0d09705fa3a6303dec1ee4eec2cf747c5a339f7744fb94", + "0x7b60dee586ed6ef47e5c381ab6343ecc3d3b3006cb461bbb6b5d89081970b2b", + "0x27316b559be3edfd885d95c494c1ae3d8a98a320baa7d152132cfe583c9311bd", + "0x1d5c49ba157c32b8d8937cb2d3f84311ef834cc2a743ed662f5f9af0c0342e76", + "0x2f8b124e78163b2f332774e0b850b5ec09c01bf6979938f67c24bd5940968488", + "0x1e6843a5457416b6dc5b7aa09a9ce21b1d4cba6554e51d84665f75260113b3d5", + "0x11cdf00a35f650c55fca25c9929c8ad9a68daf9ac6a189ab1f5bc79f21641d4b", + "0x21632de3d3bbc5e42ef36e588158d6d4608b2815c77355b7e82b5b9b7eb560bc", + "0xde625758452efbd97b27025fbd245e0255ae48ef2a329e449d7b5c51c18498a", + "0x2ad253c053e75213e2febfd4d976cc01dd9e1e1c6f0fb6b09b09546ba0838098", + "0x1d6b169ed63872dc6ec7681ec39b3be93dd49cdd13c813b7d35702e38d60b077", + "0x1660b740a143664bb9127c4941b67fed0be3ea70a24d5568c3a54e706cfef7fe", + "0x65a92d1de81f34114f4ca2deef76e0ceacdddb12cf879096a29f10376ccbfe", + "0x1f11f065202535987367f823da7d672c353ebe2ccbc4869bcf30d50a5871040d", + "0x26596f5c5dd5a5d1b437ce7b14a2c3dd3bd1d1a39b6759ba110852d17df0693e", + "0x16f49bc727e45a2f7bf3056efcf8b6d38539c4163a5f1e706743db15af91860f", + "0x1abe1deb45b3e3119954175efb331bf4568feaf7ea8b3dc5e1a4e7438dd39e5f", + "0xe426ccab66984d1d8993a74ca548b779f5db92aaec5f102020d34aea15fba59", + "0xe7c30c2e2e8957f4933bd1942053f1f0071684b902d534fa841924303f6a6c6", + "0x812a017ca92cf0a1622708fc7edff1d6166ded6e3528ead4c76e1f31d3fc69d", + "0x21a5ade3df2bc1b5bba949d1db96040068afe5026edd7a9c2e276b47cf010d54", + "0x1f3035463816c84ad711bf1a058c6c6bd101945f50e5afe72b1a5233f8749ce", + "0xb115572f038c0e2028c2aafc2d06a5e8bf2f9398dbd0fdf4dcaa82b0f0c1c8b", + "0x1c38ec0b99b62fd4f0ef255543f50d2e27fc24db42bc910a3460613b6ef59e2f", + "0x1c89c6d9666272e8425c3ff1f4ac737b2f5d314606a297d4b1d0b254d880c53e", + "0x3326e643580356bf6d44008ae4c042a21ad4880097a5eb38b71e2311bb88f8f", + "0x268076b0054fb73f67cee9ea0e51e3ad50f27a6434b5dceb5bdde2299910a4c9", + "0x1acd63c67fbc9ab1626ed93491bda32e5da18ea9d8e4f10178d04aa6f8747ad0", + "0x19f8a5d670e8ab66c4e3144be58ef6901bf93375e2323ec3ca8c86cd2a28b5a5", + "0x1c0dc443519ad7a86efa40d2df10a011068193ea51f6c92ae1cfbb5f7b9b6893", + "0x14b39e7aa4068dbe50fe7190e421dc19fbeab33cb4f6a2c4180e4c3224987d3d", + "0x1d449b71bd826ec58f28c63ea6c561b7b820fc519f01f021afb1e35e28b0795e", + "0x1ea2c9a89baaddbb60fa97fe60fe9d8e89de141689d1252276524dc0a9e987fc", + "0x478d66d43535a8cb57e9c1c3d6a2bd7591f9a46a0e9c058134d5cefdb3c7ff1", + "0x19272db71eece6a6f608f3b2717f9cd2662e26ad86c400b21cde5e4a7b00bebe", + "0x14226537335cab33c749c746f09208abb2dd1bd66a87ef75039be846af134166", + "0x1fd6af15956294f9dfe38c0d976a088b21c21e4a1c2e823f912f44961f9a9ce", + "0x18e5abedd626ec307bca190b8b2cab1aaee2e62ed229ba5a5ad8518d4e5f2a57", + "0xfc1bbceba0590f5abbdffa6d3b35e3297c021a3a409926d0e2d54dc1c84fda6"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 56; + int alpha_4 = 5; + + static const std::string rounds_constants_4[] = { + "0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5", + "0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6", + "0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa", + "0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8", + "0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902", + "0xe35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e", + "0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996", + "0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e", + "0xc009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738", + "0x11f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06", + "0xed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549", + "0x4dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b", + "0xa3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8", + "0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f", + "0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1", + "0xa1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447", + "0xc6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf", + "0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811", + "0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75", + "0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5", + "0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0", + "0x11003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574", + "0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c", + "0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5", + "0xc246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d", + "0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b", + "0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85", + "0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb", + "0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c", + "0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08", + "0x64760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59", + "0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87", + "0xe070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c", + "0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb", + "0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b", + "0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db", + "0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926", + "0x62100eb485db06269655cf186a68532985275428450359adc99cec6960711b8", + "0x761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b", + "0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d", + "0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a", + "0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b", + "0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0", + "0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5", + "0x70dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9", + "0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da", + "0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729", + "0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa", + "0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf", + "0x94975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e", + "0x4d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65", + "0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187", + "0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3", + "0x3fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0", + "0xb7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64", + "0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a", + "0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f", + "0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d", + "0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f", + "0x832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173", + "0x2f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16", + "0xe2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705", + "0x493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a", + "0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9", + "0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16", + "0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0", + "0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5", + "0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505", + "0x44cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d", + "0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025", + "0x2fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355", + "0xef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac", + "0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38", + "0xa76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5", + "0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c", + "0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f", + "0xc817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a", + "0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96", + "0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce", + "0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959", + "0x5ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b", + "0xf0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4", + "0x558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf", + "0x9d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455", + "0x328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335", + "0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b", + "0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df", + "0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x2ef1e0fad9f08e87a3bb5e47d7e33538ca964d2b7d1083d4fb0225035bd3f8db", + "0x226c9b1af95babcf17b2b1f57c7310179c1803dec5ae8f0a1779ed36c817ae2a", + "0x14bce3549cc3db7428126b4c3a15ae0ff8148c89f13fb35d35734eb5d4ad0def", + "0x2debff156e276bb5742c3373f2635b48b8e923d301f372f8e550cfd4034212c7"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 57; + int alpha_8 = 5; + + static const std::string rounds_constants_8[] = { + "0xdad22d08a6b8d81d4a5ffc34b9677a7c5254c85e953551f9eba9a0a97590c10", + "0x3cfc441111f1bab6e75957b9f0274e92d17aefc2d8da460435dfaf259bd1039", + "0x27c6d1b8a2e2ce670376cd2970192a2a08e4290883f6ca49e7976c6c447d6392", + "0x28f2882b9abfda8efc2d121da0c871d2d5313a53c67d0407eef4e93ee23e6c2d", + "0xa3943390fe4939fa2e931e18094c7c93aa107ced2bfaefcfe5e613a3f1262d5", + "0x2a8f37d8da8f2319e188f8909007408b57fba3555bb784c1ad6c7b0755805456", + "0xcef8658e33f20c39649528f353ef5d03198c75683f8493534add693a4ff4f0f", + "0x1cdc2a6f0f0e7c6c62ee1c0cad4fd11363a48db7095171faaf9a7b6e01c3e52b", + "0xa2e681a2db19c8d1cfb0c28f0b7b3d9830d35fca8c0b076b4e64328060139d6", + "0x16f013cd703be7de16b4361ce5c67cc2997f858e8a808885da67fbafd30d2717", + "0x29af57131c9cf548be669fe76c675e6d90bee17a76cccf4ddc5d35f9a936ebb8", + "0x21807b1ec6258bb155ed159da90b815dee119eae8138b1bdf950111bf5205b3b", + "0x7c00db8c50a8c860fbcb8ebd234a54350bdbcb8747891a4e5adab1c4abc6909", + "0x22bc08fc054d08a3dbb6094396d0de373a4c33205c49a1254cf25ebec1747765", + "0x2dad58bdf3e24c78f21146de084d9b8afad58956fedce67d43f7d375a813bb2e", + "0x292cee6bc19a64dc5a8a74036e676e238f60b4577db86213ced417906f1d6e91", + "0x27d655ae125928ad6b48bba54593b74ca0c23002b32a0a9ef375939a22387a8c", + "0xe0e2e781fe9ac0a97f0d961c7b359a415d1ead41c99eccee90e56b68fbfa2a8", + "0x13fec23e678d1c9943b6daed8ed8212289116ab96344ded7ced8aac2f09f1672", + "0x27550dd21647e37fc31640684e02cb07810669b1c1545443fd58204b2cde73c2", + "0x1de6d5f356a92c48c7b9f6aa45c8a6216e0a6adbc799c0bec242054674cb8f09", + "0x14c5347c4580363f74c885d1fbb378c61d953e490892b10baf84f6e1f3a3f39d", + "0x27f2768023c4df7952ca0d967f14034e98c4ca76973ae1cddfccd212cbd78683", + "0x1f4f499fc4853f7e189ad6d2269c467f77e15bbd28963c516b4fbf1ba7b88f95", + "0xd62ba9a8de3b97c72a5425a97a7f027fbad23f299ff46bafa12dcffb0e72bf1", + "0x22b649ae468f20c7cbfb435d932ba9ba4be14ea40c0c54e6bec970ab4c513f04", + "0x3a1aae439e47e7e14186d5513da5e263e063a3da6d042c16e55cab2e81a8e95", + "0x25c7eee1fce422600f5b1e78323f2e99cceee803f62763217eadbd046c1e0e6c", + "0x1c66258f103a955274ed71de56169bba34ff6aea97a2c32b98805dc3b011a383", + "0x29403b00757a647671a3691094aef420ad830f95743d45894d6d7f40aa356e4b", + "0x13496363ef5f7d0e91fd1319fd5dc0269c5190d05d8a0ad28a3ce0638a133e0e", + "0x1c6a4586c15c4638a1686921d7c204e2b6e1a88c1fc49dcfb87ded2a1ed7edc5", + "0xda23df12d0bf47bb92f15ee189386c20f552d0bc66ae492b92d69556b2fe75a", + "0x155be88bc5ddf8e0c6c741286cdd5ddd559279a455b9bbb61d5a0b004e545d5e", + "0x553fbb5b32db860e0bb12cef3aab4e0dbbdb1ea8704d335a18fa8b4df112c36", + "0x12f6a3a61a3139221cb5875cf455b942580c00942499932dfcacf6f75cb80ad6", + "0x2faf9e95457781b3c61de8a1faadda67f76f52bb81255fac8819bcc104071e05", + "0x1c7639cb68d3cfa69f3d795d1a1dd4eba176d0c29701e7b677ea0750b4ccd1db", + "0xd9d85a46281f81502fbcfb430f4d08ab504c502d2feae2ab4a26d87bebea0dd", + "0xa9b7074ea11d9931cf4af16952f398777aaa36413df14cedc101c7693812d3", + "0x7fab349ddb7d62a5edc0b6a62b300715634e5dccab808d8fa6ae62b406705a3", + "0x11f8f3afbd6fe6bda7d055a536ab3de9c40c8155b31d397f63ef21ac974cf52d", + "0x7c569f8f49899805d22a1930883968a3cf058993e0adfd06da437ae50e830", + "0x15dfb18bf1b6087c0e638f2189a7b34534549ffe8fca5afccf7e528a3338cc92", + "0x2140caa062d2fa72722ad48fb71bbc9f534043dab90dfa24b96664eaa2f0ac6a", + "0x11c06fe4e5398d4704271b84e6023b07b189dd1d2023dd599b33defe4251b715", + "0x775f90bae5f8f8157eb73bbc7ae69b74d44761cf0df3b4666eeb2860878c0df", + "0x225befb64b758b837a4305e104d5e510d893653559d8768dc79325ff89d6b9f", + "0x201a730245d9227f1232cc02f486c18cfa1fba40665ed3d1bbbdcd19b03cac4f", + "0x128b63b12a6647f80c686aaab15b0563c1a33f475dc18caa434ab64f1e290acb", + "0xa34ce8153d4e2e1158de05d276530cf3c749c16c7e09f3b671a973b0efb0839", + "0x2809c5d323665513c8c4a96ea4dc08e3aba43699bca1198f2b559915082495ce", + "0x23b929e7d71fe425f36f32975e9a68bbf83c16622678f061ed78a0c9ce318be3", + "0x1ca1a93d02ae448ab773f95c6b88c0d01f89c0c3d25ad625042771dd5a7e74a9", + "0x3c7381ccdfd209a8cba5627a058c33f472b24d2b1a55d9dd47f60dc7b474e7e", + "0xbe1a29bb668a25eaedffccef6c01c90688229e8fc4be9812e371d4d61c3015", + "0x2c821bfbd5c415fc076fc83895edab9e5256ee826946a865b8c82f0189af4626", + "0xb8ff5b252182f6a15cff90144c1e7ac1678739882c90fe46d0a29db7a0cba77", + "0x1c0e94b15306baf1b017623888b8d4c5402ee81fd213c4a5e42f52729deb7d5c", + "0x2031deb0f13ce17a5b44edbacf5a0410e23348c2c7657383a8ffdeb5c5ca1cd4", + "0xe34d14f44e8eb98ac078ec90eb718c3034249fbaeb13d24f3d5b6a4002018ac", + "0x2a10f1b76f8b1cc429820030c58b3d23ebfb775a43b07928b9868891c2cb4cca", + "0x535bf4f7fb763f981d2c0c7ecd2237a461ac385e2235fb35222b512f1dbd1b7", + "0x12ccb3fbffeff74fb7ce3b9943f609dc0d7fe34e3b5e6b199628e86d5576cc18", + "0x1f44cd78220a2e66be6c9eb3bcffc498a47f22c3eb476591cf456d518e3e126c", + "0x1d60e9e3444a748b8c22d7d10e825c536290b723fcdfa046436353d6f9abc073", + "0x5a3ccc67bd014ef2544927f9b96ff58e348954e40af67861ab88d78ff4b6688", + "0x1be5b195896e9ec23b9d3eb898734c385272ed64bdcb236223f5a3436986dc6d", + "0x1d6427dd07a0b46a8ebacaa82e8c04de8e7e94a18849c9275b8b4827a873cdab", + "0x2f09a403f946b692704fe4d5ae69625441c93a7f93dcb4f8f7d337baa735ad9a", + "0x1807540511593488e084b7297b6ff67b748c71731b6ca64aa8d3823e81f41b37", + "0xf1daab7a702ac80d108b24845bda04b732f3564ebe57392e470380199522e1d", + "0x1797d0f72bf0b47a45ceaf82df261439bc5e3b0ae55cf1069733d5a0b51765ca", + "0x2adbb9b4003631c5e3d02ce959930c75d4d25281c86febc61dfdf35e00cfbdad", + "0x1347ad87393ef928d2800fa2a548328ef9bddf5646da79d507d2f2055db335d6", + "0x15658e02d31e2c200dadf6a985652eccd30cb959168cde7b74c7239539d2df1e", + "0x1f00dc28bced12a74c3ce687dd3fa996d6f8bb29bc60cda4f3aed191a6fe8d0", + "0x154ebcc230244b68b9a8f51a56ff0541a92ea2cbb3e77b263cb03a8bd89491f7", + "0x1f65f74b523a8c875885378e93d1946c7a3f810e2eecdea94b80c4f741ea6cf9", + "0x2504a559a4bd23ed689acc9b6cb4062479a6b29692e2b8cce40058daf0505778", + "0x24496d9926e4e565ef860e52396a2935689c87ca99abd046bc279ce1bfc43206", + "0x2c9ccd22b143f4d8d483846d1960e7144a5c9354ea48cd1a71bdc82fbb929838", + "0x2b9bd02e1b064a8db321a1cd212a7a6dc47274f6eb5fcfa4f17d6f690dddf8c4", + "0xb21f0004118382f32fe441fbf36c0a38ae41873ae42d3b6ea5f0c6816e00472", + "0x10756efb491852587059f3e48b605a3bebabaab0a1ee5ff1758eb30623b7602c", + "0x127574a38823886d1f4841b540e29d67efe35aa8b3c685f969b6bc6cbab5064a", + "0x24751d620ed2a3db4382265b8c33b666b85beae7aa87f38e28bd2f8d637ff9d0", + "0x2e3d7208892e8a92e887fccccfe04d8d0fe994bc443641a9fc76c43da02f453d", + "0x11c3f6719071e6810699be20e1b1858b9ed00d8166bf15434cd5e43507b9d62b", + "0xb86112693a4e7f3ac4eadfcc3f04d24a7afe51a87f82d4a435ad27f30aa2f9", + "0x1a77348400a87f0180e294286a7a06c857f590e8ed17eed7a6b4cc1ca5a97929", + "0x207feb0ffff2e419bc967dd544abbdd2dcc601316f49957f2319c9a04f56157d", + "0xdf4aac4e6483265aa3fc462835a90380bc84004fc46d1a85e61baed3196ba48", + "0x2f2df3db6ed0e27d3151201dfe7f57fc2e5ccc69c2458535dbdbb5d88aeabb4f", + "0x2f51811c3568dbae396f86838c5c8b1bbf9b5bcb2ce98542e289184b95f74b7e", + "0x1198ec466dc8c3f55b048369eac0490e835928891325d4cf4461da1d22230219", + "0x19036827eb0714a1ee4fdd653d8667df192402e290dfdfc39bf005fdfa86c043", + "0x978d774018c29f2818df365312371ce4082a6c8c52d2a965516b76436349069", + "0x231ed2d94767eb9ace111af9317b233fee037214e3f6d7e366a5812c8fd1dce5", + "0xfbd8502ceba8ab93eb04d1db535d25f4c3be8acac4e8e0467b9d606653456c2", + "0x20e9fac35dda464e436a4d2eae4cdd5b52c9b712d5b4bfa43334463f8478d4bb", + "0x15ba9fc4b175278a12a5ab39ee0121b06dd09b923bdedb69a26182821445ba00", + "0xc3c9aec9048b10a06d062675b63417a1ae8704f2918382466bf575e22a654d3", + "0x2795a46eb4c79595a9de2191c524f0aaf92f764153b23c357ed50bf3a91cddf0", + "0x10ab7893c4253d861276ea30f229eb86b90c69985fb6dde4aa50e24828caa81a", + "0x2d4509d8159af62c44503f64fc01e953e90c6dced8ba75c58df2aa090a5fd359", + "0x157946957f4feb94eae09b9a6c272204d107ea7b0e31b67524a6c9ee7f04e7b9", + "0x30464efe02b65b862f9a0b59fea6d6934b393e65cdc3d29ae67a751a0d0f136a", + "0x965b3a2d05666d38ffcdac4e5ed020c742ba41d760e70f74dcd8f8b1324c901", + "0x24531c784663d57639928f0a8f152038a779eebbd70f6585dacc971668ebec55", + "0x2202070df8f85b79bf7debf24a9cc0f2cf30370f26a9372e01718dae7cb6171d", + "0x8282fc0baa2e9eb76167b9ab2405db9c78f1f37b168be6435d5385a806e745a", + "0x178c3d6e47cd33e5570311ec8ad8dbca0dbf54aadd1393738d898384c57795e7", + "0x12ad905f9d82f33643b1fefb90dcefffeb818d1ec3f4fc3d6857203eff5ed1ea", + "0x229682c9e4165b6ed1a2870c14a1c8bb7b1c7d3b52f42ce0228b85480666b4c4", + "0x25190d853744dc11d155de5e479640302a333d47cf18dbf1ff241ce42c88d4c9", + "0xdb47fadc76bf4fd8dcfe26908fe48ab42d399da939ac1f167ca8600cfbe7bc", + "0x2ba5e88adcbe025760f2c8654935f0557d14c6d4125a838f312f2ba439e2e94c", + "0x1376bbae85699dcc294f850c858b4b370e51ff3139bc3e0a1e52eb58d08ca41b", + "0x1333fda1e3d58e0747f5c7361d5075526933ea283eee2ac37b6042c6083b6a42", + "0x28bfc4dc9594e9add687744b79f4feb979e2143d742d4e4d1d5bb64bb799a02a"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x723ccf7c498015cd549cef6743238a58ade9af4415735b42e828554fbcf71f2", + "0x968a83486ce526883ed90ef5613f8d1f00c07f0af7413483eed10646cf5dc32", + "0xe3d17c07b227916d604413558736db2f8c94ae727a833dd0ba482b72fec4825", + "0x1958661d97d79fd7cdf32600b8032aabebc99019a95ee1638d504e04b84cac6", + "0x4156d00fd8f3b0abda3325467fc057733ac6c7d3c954b39fc88df5c3e3a69de", + "0xd14327670e665314608c5732f5bd203e826355def37d1c092bcde4cff19fdb4", + "0x2c6ccd298468819ce4a397e73f1175f579321054b837f51e12970f5e96a0f951", + "0x1a9331b5aacc657f86808efeb512d53eb0ab5b571b6ec7a7ca829d2645517209"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_grumpkin +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/m31_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/m31_poseidon2.h new file mode 100644 index 000000000..ccf566702 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/m31_poseidon2.h @@ -0,0 +1,318 @@ +#pragma once +#ifndef M31_POSEIDON2_H + #define M31_POSEIDON2_H + + #include + +namespace poseidon2_constants_m31 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 12; + int half_full_rounds_2 = 6; + int partial_rounds_2 = 25; + int alpha_2 = 5; + + static const std::string rounds_constants_2[] = { + "0x4c7e5ab4", "0x5981a113", "0x776aae0f", "0x23f3b647", "0x333f99a3", "0x78e2b909", "0x72457fd4", + "0x67fee18a", "0x749c1e5d", "0x20153da5", "0x288a369c", "0x39bb481a", "0x584d9033", "0x4fb38689", + "0x2769dac8", "0x1350c5c0", "0x31bde689", "0x4d399c82", "0x3151e4ba", "0x56c67c21", "0x12aeae36", + "0x7e7b0890", "0x28fc522c", "0x74766e76", "0x57d58330", "0x3414ea35", "0x38e5c441", "0x1e369712", + "0x15b6d9f3", "0x4808490a", "0xad3f306", "0x70dd4d9e", "0x47f5a80f", "0x670f0a7d", "0x69515f5", + "0x33e1c76b", "0x1388a4eb", "0x374f2db2", "0x648f79a", "0x3418c169", "0x60735181", "0x71035d19", + "0x561879af", "0x649d6193", "0x26fdb0a3", "0xa50811d", "0x1e91c913", "0x293bcdd9", "0x1dcdb10"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 12; + int half_full_rounds_3 = 6; + int partial_rounds_3 = 19; + int alpha_3 = 5; + + static const std::string rounds_constants_3[] = { + "0x6630420a", "0x6e77b6b5", "0x85badf3", "0x6d17b3c", "0x2d2ca8bb", "0x3e585d13", "0x7f96d29c", "0x2c60c89", + "0x3d73c75d", "0x44685392", "0x7545b9b7", "0x14abb4e4", "0x18bc8537", "0x204f93c1", "0x4081b364", "0x5cbe9f9b", + "0x7f9f90a1", "0x3cbf7bc2", "0x268a6eab", "0x6f243411", "0x2c7554f8", "0x5fab2c61", "0x111376ae", "0x2cfe0ebe", + "0x36b2e729", "0x29909ad3", "0x28b820d6", "0x54323e5d", "0x786e4d2e", "0x324f30d3", "0x65f93d17", "0x4f8c73b2", + "0x23d9fe34", "0x17909bd1", "0x74864a54", "0x7120da84", "0x4c238376", "0x28d0791e", "0x154f4ab1", "0x27cd497e", + "0x32d48f16", "0x5e68b6", "0x686a839b", "0x3c24c8fb", "0x530722d5", "0x23fe799a", "0x235dc05f", "0x1912a500", + "0x5bb5c2b0", "0x5742d7d7", "0x37477606", "0x1d600471", "0x427a8b2c", "0x7d89eccd", "0x378e1019"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 22; + int alpha_4 = 5; + + static const std::string rounds_constants_4[] = { + "0x16af2c22", "0x7804cd6b", "0x246e234a", "0x5dd3cd12", "0x321bfb5c", "0x5950358b", "0x7264a446", "0x78a0325e", + "0x56c502c1", "0x459d26df", "0x73a880e9", "0x41ec4bfe", "0x5543742f", "0x72f68275", "0x19ed08b1", "0x147cda79", + "0x637ee4ca", "0xad181b6", "0x6cba3e5", "0x6d19581a", "0x6e0ce518", "0x67ecfcba", "0x1338163a", "0x1b7388ed", + "0x33965b46", "0x4e8fa553", "0x305411f4", "0x58754ce7", "0x4380543d", "0x4f3f78ec", "0x7e2bafa9", "0x60e96f27", + "0x30158e74", "0x64dbacc0", "0x3516eedd", "0x200643cc", "0x714c3435", "0x35a7ae39", "0x22a8d380", "0x17b1c7b5", + "0x14588589", "0x6325321f", "0x18a12d4f", "0x1cd62c68", "0x1ef5bafc", "0x83f3012", "0x6e334dc0", "0x590d574d", + "0x14213a07", "0x74c3e1c4", "0x4b7fc4bd", "0x3a29253d", "0x14b8230", "0x13228033"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = {"0xf15107d", "0x4628fa65", "0x254112b9", "0x8a004cc"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 13; + int alpha_8 = 5; + + static const std::string rounds_constants_8[] = { + "0x12910754", "0x36ed49be", "0x7c97497", "0x40d71fed", "0x2dee313c", "0x26de4470", "0x5d7a5ae2", "0x1f1e33ff", + "0x13c00c61", "0xcc4e3f6", "0x54c32ba0", "0x4c77e54a", "0x7951cd04", "0x4c05faa2", "0x6e479da0", "0x38117730", + "0x7374c4ce", "0x50281aea", "0x48232e55", "0x36539d1e", "0x5e5a4ac1", "0x77ea4408", "0x1cefa067", "0x9ce05ef", + "0x26d24c81", "0x4c873b15", "0x77d2ea65", "0x56b28bb3", "0x2b2b9f8c", "0x4a57e3f9", "0x32c445a7", "0x782f41c7", + "0x6c205891", "0x67503f5e", "0x756c593f", "0x462479a", "0x4271c9ca", "0x4d1af3ce", "0x180e9999", "0x25328db", + "0x398b8c99", "0x3f4755c", "0x68c74b5f", "0x5f548c81", "0x737a627f", "0x6177ee3d", "0x487567c7", "0x67f94f4", + "0x2cd1087d", "0x304d9054", "0x490e2bab", "0x5c659e18", "0x7c47cce3", "0x61a387b5", "0x3857def0", "0x2624467f", + "0x7ef53cc8", "0x1d2ad358", "0x796caff2", "0x10eac4fd", "0x7f4b54a5", "0x35086d00", "0x41b5005f", "0x49ab9f3e", + "0x7d0cf6fe", "0x13904839", "0x67dc28cd", "0x28322a3b", "0x291d6b95", "0x4b5e6304", "0x5e4b793f", "0x1c3de5d4", + "0x52cd150e", "0x7852055b", "0x3f71122b", "0x408ba008", "0x76d7ded9"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = {"0x3128b57", "0x4d7d3aff", "0x350942ab", "0x2ea8c3ee", + "0x5ce80b49", "0x765afd81", "0x198f06fc", "0x7c1b2a17"}; + + int full_rounds_12 = 8; + int half_full_rounds_12 = 4; + int partial_rounds_12 = 12; + int alpha_12 = 5; + + static const std::string rounds_constants_12[] = { + "0x68b6c0e0", "0x4ec257b5", "0x50d9f348", "0x2234cb53", "0x4e4b9ee", "0x305981fe", "0x3352aef9", "0x1c3c33a2", + "0x7aacf58a", "0x6cba897", "0x7af46fc0", "0x51e5eb08", "0x94c6e20", "0x61460e39", "0x693211b7", "0x18cab2e2", + "0x5ab3d0e", "0x61c0b778", "0x7ff68d71", "0x7eedb35c", "0x61ba0c6", "0x26634770", "0x3f0102a4", "0x4aaee298", + "0x38e7a9e8", "0x6f98c0f", "0x75516ec1", "0x692857c5", "0x1d912c5c", "0x56d84ff", "0x2f2d7061", "0x2da16acf", + "0x92aa6f8", "0x1ae7576c", "0x3ba868b1", "0x17199a1b", "0x3cad0e76", "0x42f237e3", "0x7d0453bc", "0x88dc5ca", + "0x7288cf9", "0x5f1b1828", "0x4428bef1", "0x29cedc7d", "0x49e66341", "0x2072a1d1", "0x6803953e", "0x53bc35d3", + "0x2b3dd9bd", "0x7aef95e6", "0xe5b46d0", "0x7d822e91", "0x74a3ffcd", "0x2d1340e1", "0x59f279a", "0x54907d93", + "0x3b46dbce", "0x77aaf554", "0x6cf5ea09", "0x5f1deed7", "0x3c462ae5", "0x14bdbb1f", "0x369dd818", "0xd82f8a6", + "0x1bff0de0", "0x5de6e94a", "0x3d48d65a", "0x6cf6d84", "0x7b48cc6a", "0x447b57d3", "0x76d578c5", "0x5be6b1f7", + "0x539e1fa4", "0x3bd278c3", "0x9bc1c1c", "0x54b09520", "0x6dd578fb", "0x7817c3a1", "0x121990ef", "0x48460fa9", + "0x10f7a489", "0x2dc1eb30", "0x6baed45f", "0x1f88aceb", "0x776749f5", "0x29f0e0a0", "0x39af070f", "0x3ba0ada6", + "0x1c9d037c", "0x67ec538e", "0x47269542", "0x31903718", "0x3f7c997c", "0x1edaeedc", "0x6e6588c8", "0x13dc160e", + "0x7a6589b3", "0xba42ae7", "0x405c7385", "0x3fa52e7f", "0x20cb72d1", "0x65935cca", "0x6cb5cea0", "0x37fcdd04", + "0x56bb831d", "0x17e6dd1f", "0x2a948729", "0x68ae5b61"}; + + static const std::string mds_matrix_12[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_12[] = {"0x4aa20d67", "0x3767088d", "0x5e82bd8b", "0x2833018f", + "0x59423010", "0x461b8a6d", "0x3c643b86", "0x4c08c05d", + "0x569f76cf", "0x4728dbb2", "0x758d80ec", "0x33fa823d"}; + + int full_rounds_16 = 8; + int half_full_rounds_16 = 4; + int partial_rounds_16 = 14; + int alpha_16 = 5; + + static const std::string rounds_constants_16[] = { + "0x768bab52", "0x70e0ab7d", "0x3d266c8a", "0x6da42045", "0x600fef22", "0x41dace6b", "0x64f9bdd4", "0x5d42d4fe", + "0x76b1516d", "0x6fc9a717", "0x70ac4fb6", "0x194ef6", "0x22b644e2", "0x1f7916d5", "0x47581be2", "0x2710a123", + "0x6284e867", "0x18d3afe", "0x5df99ef3", "0x4c1e467b", "0x566f6abc", "0x2994e427", "0x538a6d42", "0x5d7bf2cf", + "0x7fda2dab", "0xfd854c4", "0x46922fca", "0x3d7763a1", "0x19fd05ca", "0xa4bbb43", "0x15075851", "0x3d903d76", + "0x2d290ff7", "0x40809fa0", "0x59dac6ec", "0x127927a2", "0x6bbf0ea0", "0x294140f", "0x24742976", "0x6e84c081", + "0x22484f4a", "0x354cae59", "0x453ffe1", "0x3f47a3cc", "0x88204e", "0x6066e109", "0x3b7c4b80", "0x6b55665d", + "0x3bc4b897", "0x735bf378", "0x508daf42", "0x1884fc2b", "0x7214f24c", "0x7498be0a", "0x1a60e640", "0x3303f928", + "0x29b46376", "0x5c96bb68", "0x65d097a5", "0x1d358e9f", "0x4a9a9017", "0x4724cf76", "0x347af70f", "0x1e77e59a", + "0x7f7ec4bf", "0x421926f", "0x5198e669", "0x34db3148", "0x4368bafd", "0x66685c7f", "0x78d3249a", "0x60187881", + "0x76dad67a", "0x690b437", "0x1ea95311", "0x40e5369a", "0x38f103fc", "0x1d226a21", "0x57090613", "0x1fa42108", + "0x17bbef50", "0x1ff7e11c", "0x47b24ca", "0x4e140275", "0x4fa086f5", "0x79b309c", "0x1159bd47", "0x6d37e4e5", + "0x75d8dce", "0x12121ca0", "0x7f6a7c40", "0x68e182ba", "0x5493201b", "0x444a80e", "0x64f4c6", "0x6467abe6", + "0x66975762", "0x2af68f9b", "0x345b33be", "0x1b70d47f", "0x53db717", "0x381189cb", "0x43b915f8", "0x20df3694", + "0xf459d26", "0x77a0e97b", "0x2f73e739", "0x1876c2f9", "0x65a0e29a", "0x4cabefbe", "0x5abd1268", "0x4d34a760", + "0x12771799", "0x69a0c9ac", "0x39091e55", "0x7f611cd0", "0x3af055da", "0x7ac0bbdf", "0x6e0f3a24", "0x41e3b6f7", + "0x49b3756d", "0x568bc538", "0x20c079d8", "0x1701c72c", "0x7670dc6c", "0x5a439035", "0x7c93e00e", "0x561fbb4d", + "0x1178907b", "0x2737406", "0x32fb24f1", "0x6323b60a", "0x6ab12418", "0x42c99cea", "0x155a0b97", "0x53d1c6aa", + "0x2bd20347", "0x279b3d73", "0x4f5f3c70", "0x245af6c", "0x238359d3", "0x49966a59"}; + + static const std::string mds_matrix_16[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_16[] = { + "0x7b80ac5", "0x6bd9cb34", "0x48ee3fa0", "0x4f63dd1a", "0x18c546b4", "0x5af89e8c", "0x4ff23de9", "0x4f78aaf7", + "0x53bdc6d5", "0x5c59823f", "0x2a471c73", "0x4c975e7a", "0x58dc64d5", "0x6e9315e", "0x2cf32287", "0x2fb6755e"}; + + int full_rounds_20 = 8; + int half_full_rounds_20 = 4; + int partial_rounds_20 = 18; + int alpha_20 = 5; + + static const std::string rounds_constants_20[] = { + "0x30cd4497", "0x67cf7d92", "0x113ca786", "0x28f511f7", "0x4c850311", "0x3dc07be8", "0xc8214b9", "0x18090d97", + "0x684f35fb", "0x7f4e478e", "0x11eeba68", "0x567d0ca7", "0x6d3fbebc", "0x47028460", "0x9a8d433", "0x46bc5d5c", + "0x110805b2", "0x50dddc82", "0x1ee4fa", "0x55ed4719", "0x4708bdce", "0x1a530b2b", "0x6d372400", "0x32101d42", + "0x2b0d7d0", "0x3064f512", "0x670f3c64", "0x35735e31", "0x5a2b6144", "0x210d6ba6", "0x1274e66a", "0x212e3e09", + "0x57e62ff0", "0x6b631874", "0x6b577a1b", "0xd17fdaa", "0x24ebe81b", "0x34f6c9fe", "0x591d5a55", "0x5f45a942", + "0x5e454f3f", "0x23b75633", "0x55076170", "0x3caa9482", "0x6a2cbf00", "0x7224801b", "0x74bb2d64", "0x2e6d0990", + "0x78317bf5", "0x23eab921", "0x663603a8", "0x3e8e97f", "0x4db5d3d", "0x64c1e827", "0x37c478fe", "0x35efc805", + "0x555aaef9", "0x6563ad0c", "0x14c9aeac", "0x16d6e172", "0x424fcbe9", "0x30380855", "0x74d4e5bf", "0x1275ba83", + "0x56f32a2d", "0x3cf97f89", "0x440c5711", "0x48687e8a", "0x496600f8", "0xb0e429f", "0x154b1e26", "0x379bb8ce", + "0x277683e5", "0x4403e094", "0x12033240", "0x3bd006d7", "0x4ee6ee1b", "0x62c6764c", "0x7230552f", "0x4f341de7", + "0x3c8f8c49", "0x6fc6bee2", "0xa3ef74d", "0x23710107", "0x24650c82", "0x12baebd4", "0x46c2f3ce", "0x57816fd9", + "0x443fe51c", "0x2a7805ab", "0x3f508ef1", "0x150b836c", "0x1c014ffa", "0x1c0786be", "0x10645190", "0x607b9c0a", + "0x48961505", "0x6f20b7bb", "0x5b5aea23", "0x1fe5355c", "0x27ef98aa", "0x43e120b", "0x647d5ccd", "0x455c81b2", + "0x6ac27d3f", "0x279f6126", "0x76a15758", "0x58c1b0a6", "0x4af83901", "0x45641d4f", "0x1dfe8c33", "0x3720c88", + "0x3482d40d", "0x770d8960", "0x6108b730", "0x63fc084", "0x96e2a34", "0x130514a0", "0x42bc3eff", "0x43775848", + "0x702960e4", "0x6cf19c79", "0x4c3030dd", "0x6dd27932", "0x64350de9", "0x480e8311", "0x6a22632c", "0x2814bcf6", + "0x117197e3", "0x4844d419", "0x76e181a6", "0x6155d7b4", "0x42dbed26", "0x78c7db7c", "0x62e9c27b", "0x105b4f11", + "0x51d45858", "0x33fa0298", "0x26a08228", "0x5f14581f", "0x3bd89737", "0x2325968f", "0x418512ba", "0x7e416920", + "0x2f47442f", "0xe680af5", "0xc424cba", "0x6d3885ae", "0xa9c8cbe", "0x2485f2a9", "0x1f99357f", "0xf58d531", + "0x32d6f6b1", "0x2c26876d", "0x2de3d38e", "0x5a7b6cc9", "0x1caec7f0", "0x4aa1f575", "0x77af0ccd", "0x19d3be5c", + "0xaa619d8", "0x4cfea78", "0xdb3ab76", "0x2ddffaa3", "0x52246767", "0x78632df8", "0x7bd54641", "0x50d7f018", + "0x318ceb9f", "0x2e69a506", "0x4bd9d1fa", "0x2a0b579a", "0x561238c2", "0x2877bb9a", "0x6ed2c79", "0x229998ba", + "0x737f0185", "0x609aad31"}; + + static const std::string mds_matrix_20[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_20[] = { + "0x1dae800", "0x7ff6f82b", "0x34a931ad", "0x5615364c", "0x7a21d143", "0x5c54896d", "0x2d0b6849", + "0x3bcadb4", "0x4a99a481", "0x3d1d9670", "0x1f312fd0", "0x2fd5a426", "0x5077536f", "0x6e6534bf", + "0x281e1388", "0x23d4b043", "0x17196fb8", "0x5e92eace", "0x28a23c09", "0x2e8a998d"}; + + int full_rounds_24 = 8; + int half_full_rounds_24 = 4; + int partial_rounds_24 = 22; + int alpha_24 = 5; + + static const std::string rounds_constants_24[] = { + "0x1feaba61", "0x53224454", "0x6bceb9e2", "0x5019f9b4", "0x48726592", "0x2b22d0a8", "0x6151bbf9", "0x2f474b21", + "0x2eb5f337", "0x3b645d87", "0x942cef0", "0x65228c52", "0x78ffb30f", "0x4d2837c8", "0xe17ac4f", "0x5546686", + "0x46c06cc", "0xb51c3b6", "0x568db763", "0x38b334e4", "0x57f5acf0", "0x19d32611", "0x77d02f4b", "0x6c82e9b8", + "0x7148c1b6", "0x8067c75", "0x46d1e8c9", "0x30973b07", "0x20614f3b", "0x5c3ff851", "0x30503329", "0x4972e7cc", + "0x2d1d8bc", "0x9d5bfa6", "0x97104c0", "0x7ba49a34", "0x4a07c2fc", "0x24c1ee69", "0x28a6ab41", "0x5d9108a0", + "0x3a7851c7", "0x1dd495f9", "0x12b49ff4", "0x7bad5760", "0x5fed64c2", "0x66f5c96c", "0x7eafbd02", "0x39b3593b", + "0x4a653b49", "0x75091dc1", "0x56e488e0", "0x1704a355", "0x745e4ff3", "0x392ef16e", "0x31e33fdf", "0x2c28c66", + "0x36c3083a", "0x3104d1fa", "0x5b03cda3", "0x6641e1af", "0x37754b56", "0x396f5af9", "0x1a1a461a", "0x688e26f2", + "0x6f829784", "0x1bb91d69", "0x5b788016", "0x704aa5c5", "0x181869c", "0x41211e56", "0xce803a0", "0x23bff3a0", + "0x17fb7064", "0x47317220", "0x76914b53", "0x219c1905", "0x16655528", "0x4df35544", "0x60808465", "0x3350f833", + "0x3bccdc7", "0xa87180a", "0x17a99f5", "0x6e945726", "0x15445504", "0x780533b1", "0x3b91bf38", "0x3fc77eb1", + "0x4b4d960e", "0x3cd93d2e", "0xea4e976", "0x1d5306cc", "0x3a7ac284", "0xec22934", "0x4d979713", "0x51a41c65", + "0x22776a11", "0x5fa34268", "0x1415528d", "0x563fbd14", "0x34f45244", "0x120ea1b6", "0x261368a5", "0x27665ec1", + "0x36be2805", "0x345c4784", "0x17efdcc1", "0x393e6530", "0x6da0b4b8", "0x31e5ded3", "0x675b27ac", "0xae88c30", + "0x577841cc", "0x5fe06dec", "0x56b0691a", "0x7242de1f", "0x3c377529", "0x339b7523", "0x1c662299", "0x57c955a", + "0x7ab6c0f2", "0x25a6ad0a", "0x75850b58", "0x48fd3793", "0xb4366b1", "0xfdd0d49", "0x7db419f9", "0x49b9cc0f", + "0x48949716", "0x29c35890", "0x76445485", "0x1c27d30c", "0x10aa7a3b", "0x30f34fb6", "0x6fe06435", "0x2135ecd", + "0x6caaba96", "0x3eb290d0", "0x22fd8d3b", "0x768b1525", "0x5be95814", "0x523d7fe9", "0x55e94cec", "0x47c42e1f", + "0x1aa53b5e", "0x2fd1fe7e", "0x59230e91", "0x7472da66", "0x6443f2df", "0x2d9de19d", "0x6f7f6a84", "0x77800430", + "0xf014bc8", "0x7bf3d095", "0x26afd318", "0x582561f7", "0x5ee3198c", "0x6acc0000", "0x2f315e26", "0x27cac040", + "0x2595081e", "0x5963b7da", "0x7e073565", "0x6cf3f5f1", "0x9f8a3a4", "0xda8ccfe", "0x60be2365", "0x7ed742f5", + "0x668b8031", "0x4bb03494", "0x59019333", "0x700e2878", "0x1cc45856", "0x1d1617f7", "0x7b988da6", "0x4eb4936c", + "0x78c9f87e", "0x63ce3e94", "0x7178341b", "0x45bc2f86", "0x5b775bc", "0x704b0244", "0x29eed278", "0x47f43032", + "0x2127b2e5", "0x1997903f", "0x24b3ce03", "0xc32298c", "0x7d2b6f3a", "0x17fcaa81", "0x72f37fef", "0x3028e7a9", + "0x5edd4d96", "0x1f96583b", "0x4cd6918a", "0x14880f0e", "0x69170359", "0x173cbd33", "0x969e7f4", "0x6e7f23ab", + "0x6182ea87", "0x4dcb1f5c", "0x585fa113", "0x729cb3b6", "0x1b3a27a", "0x1ba173e7", "0x4b33bcea", "0x63d93bbb", + "0x6b3fbf99", "0x6f17e9d1", "0xc3dd8ba", "0xbc1f9a8", "0x64d3f370", "0x465a6a18"}; + + static const std::string mds_matrix_24[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_24[] = { + "0xcd7eceb", "0x74a071f", "0x66aaaeff", "0x1c334b66", "0x4d094cb1", "0x2f8579aa", "0x2709471a", "0x710093ce", + "0x53d435ad", "0x7306a110", "0x57568906", "0x4967d8e0", "0x7f74627f", "0x682145a", "0x478d7525", "0x1eacc229", + "0x651f1141", "0x42f397f0", "0x24e49ad7", "0x5ca35700", "0x42f300ea", "0x2fd01085", "0x28a86484", "0x104402b5"}; + +} // namespace poseidon2_constants_m31 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/stark252_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/stark252_poseidon2.h new file mode 100644 index 000000000..e23f3dd71 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/constants.barrett/stark252_poseidon2.h @@ -0,0 +1,586 @@ +#pragma once +#ifndef STARK252_POSEIDON2_H + #define STARK252_POSEIDON2_H + + #include + +namespace poseidon2_constants_stark252 { + + /** + * This inner namespace contains constants for running Poseidon2. + * The number in the name corresponds to the arity of hash function + */ + + int full_rounds_2 = 8; + int half_full_rounds_2 = 4; + int partial_rounds_2 = 83; + int alpha_2 = 3; + + static const std::string rounds_constants_2[] = { + "0x547c0b2119ccef0edbc86fef139ac3b009371cd0e7b823d39086db668f01a67", + "0x25d13966d9b1d8a8b0a24461d3548b968034a2df3baf003380f6628fc031395", + "0x3bccbb230b3e2951552f50783cddfefcd69dfbbe69b9e3b374da25b09ddcd5d", + "0x21dd7103eebcfa472c21d0071d7fe92c59ec5d27b47ad2a2284049e184e980d", + "0x5f29c0816a486384e7f80f3bc851421a590462a07f4c94bf2e9feda3f796f44", + "0x2cafed0401fcd9e7e471d428b5029935eb90cafedbcc2061417e694258004a9", + "0x1bbe0f12ca1a4896ac0d8a9acde51016c354b5b2b32ea01d8c6480be8eb6515", + "0x5a00c0e49379f32aaca35ba153e947ca0cb0354b3d066ffbb51c5d35db97274", + "0x4ed2eac0f68dc99095ca866a1f8de54c2ce24d7b2eea53b6b3d6a2f0655d2de", + "0x28f07ea801653c1f3e92d077be3f5f80e21b398f6f0984a960fe1ef953808c1", + "0x3031352c19ed7c9b4f9189f1661b74e5d79306940d559c0fc1e1cf8205baf17", + "0x29d4ef4f86ef2da1108691d6eb38ea16ac6040c227f110d94103565c2cfc809", + "0x3c6197ee62401f1f8977382b49b73ba48ac51c7f19031e277ae3b98f1df3641", + "0x1a989777c18e767d3ba23bb7d092d25ec8978fe9052e3e9b5b089f65be4f600", + "0x4d86e1df4ca9f1d14661e0dc8bca94bbb857b55e9ce0eaa506aa9f75d2fdbc8", + "0x4e2435293bac0c255aff4e43d7ddd82bb96b28f7e0945fad04c6e76174c3833", + "0x1687b18f40aaa3b781ab58b35e48931c1d901e3c1bd2a2574d6059d4baf1383", + "0x61ae7be0477c61ad41a6970bc9be7be513d31f81d1193f2a1780cf05b1c46bb", + "0x4c7e92fe815f23146a4ec82e7291a08a5b177ef5764dcf46df2ca214f970c01", + "0x7f92042f6010c6e0cd9a7e19f1faa9c9dc2f43481ed1660bcd0e8c1caa5e91e", + "0x37e4fb5f740b26f6ba0ee5ff3f2c53821178996a7eb902b1f1083c81db164cb", + "0x16cf786290c436e88ad1df8ac7168e25e18305522efa0829208c24bf86b5669", + "0x92c72a27c02ee315ef00e56f02238aa85537543a29b7b3f0c3e9e2a8cc0a60", + "0x1d0551aff5c76b13f93d024efb943c21cf311ceb8ef3e7bf2b27a76493b6a5", + "0x180dc73da8e91917462275367c3e5301bc76b00d521265a5ec41a4d6af10182", + "0x44c7608c594a3acee1aa1a97fd7b9c721d15dc5d1cfd880ac281c5480552584", + "0xc81530a72f213c5a9b84c8165052f83d3f45a79706411c19aa026f67461be8", + "0x7c983049b9a9c7216a4fe15846ca6252c4ff30a07b18f228ad624f66b44fbc8", + "0x2e270ed79af756eb7d526c8381dd650b56acebf3d1a47b92f79f123431227cd", + "0x2bee386fbe7d24ae7baf9edf2e72410a88234f388d61307b77f43df3cecb723", + "0xe4b72eedc660ddff42c37a9ce1c81f3643bbe6db5df2b8779975943b73c2b5", + "0x7adfd649cbe1e15a2dc03a9080cc0d163ccc972c22d9394b5cb390c9d78f0e", + "0x758669f21b1dee03b8c3da7f45a694a48c3e353be1039c5b1db16591620b0cb", + "0x66fff1c7b640bd0e2c4b380b116e31e8882cf3870b343a84d96ff15ddbcbd3d", + "0x13514bc819eef10dfdf7ad2c4bdc2a0bf264f9b3d360ce940a71b6b8e561a82", + "0x2d5d38ac5c74a536239987e480ee76d139e94f294520d4d24630520fa93fedd", + "0x5ada8c0d37e34ab419e2ac4e251a98693405dceafb3f698dd8c0e23e801b0ee", + "0x2d8a431002eb79faf0caa66a74e9a4d3c1dcbcdb8035b97e29fb623b261c2b7", + "0x246b834aad5cff22d6f8178662be73677348ec988ae060fe271d101a78011fc", + "0x74a630a4a6a6b4443784b7146362bc295bf928f84aea5a67587e6e4e03ad6be", + "0x5db46563ed853ff54e08677fdbf01d949fe1f0c96c7a926afab0356eb074e74", + "0x31f4e332ec2fe8e993688914786bb8f5f950395576fbeb19bfdc56bea49caee", + "0x1b0b4876b253e95ff1394b933c226e75ede88d5023dc44573f38664ef350a21", + "0x5c37c814dffc2cfe37720760b434a1682623212530c5929ceb82ef7f025ce5a", + "0x4e370cb20d62961681326a38b6d77319ce96f1d5ea1a0712c8269cf7d984ce", + "0x7753e11f6e929f72e3e7c8a73341e57cb9b69e2a9771d6695df9915facc6e2", + "0x75a6ff65d7240c38fd58bb5b648d17a2920a8be26578256f0349e94b47e30a6", + "0x1e6e4b3ecf515d600dbca93a19bba9192c71235dd26f805c9e4c9489fed0737", + "0x6c71a1d241aabf094ab7cd883c8793a194c29285a9e257d76577594b4fe80ea", + "0x5e09a515a2c2a575ef9d36c5f7dba753c17458085ff9bdef92d490a557414a3", + "0x4e33bfdbde19b204b37819258fab2324b0c5d13f6b7d8f229e9aa9400c4db7a", + "0x3235c515b0abb1d7ea83dedc9e73c4ff94c6d89c087fbdf740cb6a5f1a7d88f", + "0x3776e363b266f1649545c791d98008bdf2a81a15b80c88d3f33d3d5bcd09d83", + "0x2e9f55dd45fe9b0e98e8cc3b6158315cab3dace7484d3718cb8893336c8e8b4", + "0x5219ff0ed15e8c02731b1fb696e4d832db1981620fb4b9017cc88422216e949", + "0x135c64c5898ddf9ffe2f29ca8e59e208c8c803b375af5927f6d376617c36bb9", + "0x72a5c93c6ca7489ee1fc3be830fec666f1417c273547e727862b88e5db1b546", + "0x9bbc3f6a03bab8fa14731c8e16e936444720d4cbb3d55ce1275cdc16880342", + "0x3a81bbf22787518445d9d0ff992f5bf5ccee2616cf86b5966105f7a448f3508", + "0x5a1d9c05b71975fee04503657d8350ca3e577114eb3dc246ac5e639971a8f1c", + "0x317c885cee24ac8039e3c46f747e6adb8377ef73b93f004073b4e92d16622aa", + "0x7b87d4724075c7dd7619cad770165090b1845fc064a06dbaf4ba018df21667e", + "0x7995afbb2c5916bc56967866ca2e04ea35cc40d4dcac5fa1182b5e3193c9e2", + "0x429ee3d90493feeb715f7fa9fc7b7515473ff84c8d59c5c71273636b5c53335", + "0x460b2e3a256bd633733d59bf785e1ba089509bff8a453bc52e1e8c4eab86685", + "0xa9cabbe0d7dcd5011b30a60b1cd32f08fc126e18f2d05c6e721485f4d14f97", + "0x728bb0861a5e024d9d476bd5e505e753874690cb1e6d6f234b9de0e9b0a015d", + "0x4e39726d6f50b52ed26241dafed19e2e09611a93045d330b271a2db4c1d9d92", + "0x518ca3cd26b67044826335d1c551ac4845c1d744e7d462fbaf5c0979f05a427", + "0x18375cc71cba17be6660ce77b26812e06a4776e4358e57d5d8cfbd6593b7265", + "0x339d48eeff4196ab53d97ae0363ce9ba4494bcbbd97498f4661431345482c0a", + "0x39fbc157fa6c43721f0dc424e0fa5a1d449c37433f7bbc99ffdbfc588c78e87", + "0x712bf71264b6ae18fbfd1463893f0168e797cc73b1cdaf46a4a95ee363a8452", + "0x495e1038adfde7f84eea0a18eb4f26587c8abcb8609931430a5870f54463749", + "0x71b316c21bb7118b81095eae756f80582b9607c5f717c0459311ae30930a27a", + "0x334f9dd79a0f6c414a3a5ab35af1e82d4850d12e1bb667aecdf193db60d986", + "0x69fe47c40a6a2cb5f04f3433692525b1fc94c2d94da3f17d72b66b17fb83568", + "0x7e36a5063e3a2f3995c758d753ed1b83efade0904e754c45ef347c169a81b0f", + "0x1ca747d60329c52b79e2b9e441c048f59632c8ef746caf06e6ace7f4da7a4d1", + "0x983bbb25e2a25d26246a358c85b4ab2b972e1529c6bb79caa997b7b2c9f835", + "0x15d17ec5c8ea2441151a685f3b7897370242f43856ab4510dc5ad8fd8bc622a", + "0x25773c6d359f9f47dd3b9aa43a74cd10eee88c9b33e6cfbe5cef5913376b98e", + "0x18b7d09ea2160a93d704a7fd6ac433d03779bde1bfa6e0e8249672c05f33d5", + "0x3c605071a551b3c627189556e66306eb0252a20b883ff03bc3216a8bd3076b3", + "0x7bc95c89ff975920f966976541a844f95e0fd839a6f8d55a2fd1ff271689d85", + "0x311a4fc0648a10eea000bb87b694bcd1de36dafc42bd3e85531b7b4da54d003", + "0x263bdf49ef52abdb380fa39d099816fc5b99d45539b693227808320a5434844", + "0x7221b729f57c11996225e97f05e871d497c8d5e0ca51c45777b286869a055aa", + "0x5ae850634be1177ddfafffce8483e6f2040c50c2ea845ea08b9cde7ca5ff6da", + "0x2314df976789a54ce4748fb27c5be848ec9b35d978b203ea113de0be57817db", + "0x5ed9ac105b6e780b443c04acd33aec92c47e4bc4e22d5f804b9637f3e724890", + "0x645367c00075f5ad00074cb63c54ad3737ac523e8485a1dd85c22ca1cb57528", + "0x5d11d6479ae2f83709e55748409776a7697d325d0ca4f4be33e9f4df19bdc3c", + "0x66abdc8ee54c2e5f57f39383b101cc43d1de20ec7060cd322162edd1603e832", + "0x514b2cfde5b0e7b842920feb1d2d82a5a8f8e1fced5afc497f2ef83cc952b9a", + "0xf8bc333bade920251d130c5143117bb178aab3e49f884f5370adb294b98f4c", + "0x1e1d534634535da8e078192b583ce3c53313fca61db75fb1dff94bfa84b8421", + "0x3aa63047d50ee752fef88aa3339f8b04c3f4b890904ec7e09571b9351ba4633", + "0x66113b91714e3aa9bf802907f20c6bee21a5c4daf5c5097f236559f46d8f948"}; + + static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; + + int full_rounds_3 = 8; + int half_full_rounds_3 = 4; + int partial_rounds_3 = 83; + int alpha_3 = 3; + + static const std::string rounds_constants_3[] = { + "0x1caafe19abc51e89d9e19e96658904fed74eb9e5769b70e3f9b786afb30dc0a", + "0x6a49348a28b19f4c27358c56b807ada552c834c555fb0039e59af9de62c2019", + "0x5228a48d4fc955881700a9c8d791626098428056657435212fe5e9f844b06d", + "0x3ba61c6bd818a9f8226c750ee48812ca090a6b1e61c4c403d59018076e4bc8d", + "0x6e2a2531c5b77e40fa42f804978db49ec3128dfc512eda0322e76ba7192c1e8", + "0x46401bacd635a7dd2d291a4029da3c669881e860c0b6ac438f32d720cc5080e", + "0x64ff3a8bd01c025e3121cea2ba866f3f5bf7ec9f670443c93dc560a8d412387", + "0x55bfd0d83713139db5d42260cbe94f3e4c1cf21ecd5af4ea9ec8dc1d7ea2096", + "0xc49838bac6734c9e84cfdebbfce7761c8dff31bd112aa068f3393ac6922f03", + "0x4cdf3f1c45550cf9903fe83ff089dc57fde71f21b766cbacaa3e6c578357216", + "0x78ca37a2a066d3cb56e4d7ca4ea372ee2e9bbd19775a196f5f879ae13fa5ab2", + "0x69739e32d9ab7cdaa0b0bd066ead0664e8d96bb7f4a42f7d587b5de6944d329", + "0x673fd4917a99e14cb199ca240a313958995e9eb1c47a913be7ebfbfa5d2a7d2", + "0x30baa62b25de6a89bbc71fb99c9dc870a63d023937fe61f43b27c57617fdd80", + "0x64886a5ef665b774177d5b4b440ab04b7a5c1a89612951b59da0d02ead8ff0d", + "0x7d1eb7b032165794cd31827245d187ffd8f9abbdc81af7ec1cb18856a2eb4de", + "0x2b5a99a6b751957843aabf081ea79c3c9f5de2c31262ccf3734f80fcd2762ab", + "0x1255793b24f0f860522e3f75b6ebc07cdb7e6ff8210c16e7dc5bf7c7c71639c", + "0x4ecddac96630b0cb9becfeb0d7dcebb50dc750362351b28888247179a8d628", + "0x79893ab13a1e627462497ac166ba177a956ca1e3c2e8bec31c3a3d8ef89d85d", + "0x537edab27f234a11cfbbeb3d88034ea9be6d15906806af79e83d88c7e4ccb0b", + "0x7430f75cdc58f7263447bf5c3274918b526abd57bf1bc3242480bb1412ebd09", + "0x65a5821b2a99f38d220b0b82f71bb614be03f4eae7cb61bfb3567765757a64f", + "0x1fef33ca367918040276992b8e2afe308a72d58966aa187db6d6d96d0143c5c", + "0x417e2859a8d763d9579a2de1c5b34b1f60b8abcaac63b68c3ee29460838c0c2", + "0x659fa303e5a1b91a233b43ad73b4ab43a161d045aff0f462a3619c8c504659b", + "0x58a5ee378a9f49acd2a79373c382573beae03a057bc40016f9847dc274ee873", + "0x480e72fdc7c17178576f277cd3e34a78f58ee64ba969ca24c6a67e52f399d0a", + "0x4ff6b8383cfa589064600cccba02175d4488440e2d78154c5f2064688521e9a", + "0x1d55afec1a523ad72d6d2599fa37c9860843ad37949e273e1a71049bec721eb", + "0x533e1fd0e8a47ac2d434c2158f2898ef5c05d76dbec11df13d3a96b77cd1f03", + "0x1f75036b4d208493a66f0693794c3b06ea52ddbc92f938b038587a07fa1cf74", + "0xf27c19da832f5f96835a024d153cf0a55ac70cb6850926e5c3565cce0f098", + "0xfa6dad9c5d5fc88dd1c65bd87abab4eabb9034966c00f10a9abfbdff7721f4", + "0x1525a9da8d1ee034362e5d750cd94c72ea2231cbf2f4bdb3a2a8dbf356c517f", + "0x5ea0f5cd18645f5dbf6ffd7de437a7f28d756b0da77e26908e70a2582258c53", + "0x14730fe1334bdf46740b0c47aa11b9d13a2051abc71318135a9d41651bd2ba6", + "0x691f607600e792ecfcfd03dd9d1049486bca2aa0a1b5304ad5dac77cadfeeb4", + "0x700810ac7be2633ff68f5ba8a7832675b4528d7d372daf74654c5dc5f76a44e", + "0x1b9367599c0850cbd1b2ad107a7a0cf82a5fa873121ea5c97f06197144c5da1", + "0x510d4b04f2c26e18846477272d500c929275c497e690d3ffdf4edf1d843fe8b", + "0x2d0b0edfd9483002bb58b93b9ec72b77a323cc270d522b67e27f70856355c11", + "0x18651665380759d056a47dd537a065b9927e26e4e08e66be57eb889617076a2", + "0x46fe1ddfdad9e163a88677680f9805af9db4a7304f1e3da42671813120e1f9d", + "0x686745b1f6d0f97e5e78f3b5319bf20f488f4aa8cf3654ca27642e27caba0d3", + "0x3670f90ff89791db3c80a7cc4e4ccf84a6f986718e4b44acf05b78c1e4e445", + "0x206310fdf701f1286e498c637e6a49003054923754908b11c8b733407308b25", + "0x679fe3addfab71e90be3157923e14cfcdc8cf022e0c93d0a3f823e7e4b0ddc9", + "0x3efec7fc8b364d48c4b740591411d5921f32fdf3dd1b4162564d3ed7a447918", + "0x2519db11ea2efcbf153a26e364bf5c91260913be3ce159d26119d09868eafe8", + "0x2359738c04c88a78e93588b994b8aa800b9a458b6a71c7689fb1c8bd647e1a4", + "0x3dc42a576a8d93f29ccaaf9641e2481e8a552181c09836415dcf4f41ce41e1", + "0x88b2ebf0d77df7961cf95c1712a11438f258d6c3d2e014113e3d9aef7aaa6c", + "0x431df2e4aa221ae184afbbec3b8a06fe9ddc3ad1a24bcd98946ed1269f7fba0", + "0x2085926430c0c3a93f8bbe276008a73413d85aadeb87c35bca9c42d05a66c34", + "0x6ee17a022415361e687000e8cd1bfc7ec46ace8f2de29b0893e4a0778f10d85", + "0x6b690f00074215603edab594f98465e4de28fecd90f5ba2b2cafd6a7aaa9759", + "0x769d18543a2369458dbe0c9b7628fd2042720f8941cfe1a44358091f47a69aa", + "0x78f414a24db5f2c6d08451073649e356c4edbd8ca66a5fd212eef588d4706da", + "0x75a859ba682bdb6c2967300d5151dfc32e593a6c66a5f416a44466adc18ab93", + "0x6d3b2cc9b371e8feb31d30105f13bd901fb68d66b90959248378c3cf7bb7f73", + "0x150bd3a290bb6a4a8818d2a69aff52d5b6ce4747381f71ab996e23138ec72e6", + "0x60e7d9da09840d7c8615afc8b77d8dbc66408514effd708aac8bd728cedc3d8", + "0x34ddde2b9fddab828de31956a6995885cfda7f16748dd9c73c6c3e19850dbb3", + "0x7cd1821a677861bd5e1772e138616c62e149b03972a79c902af2f21e8da7c7a", + "0x7c6a80fb6b4c8268f0165d904f861df60ca04f2a24357a2d4bd00915492197d", + "0x52ac8cac9cb8bea5abad085f9bdccdb1f4cc903248db7f9be69a21f65d248ca", + "0xe9f66065c1fcde646aeeb6cdf2a9c923f9e6300e1a97965a0723cd2e038423", + "0x572f25fccd60c87d7308a66a7fcddf580e849a6b84a9a743bd434150a9c32ec", + "0x523f4914b37a6e6a93ebb32f11a2b676f64235f71d18881b7c79d8a9399cc8f", + "0x48c368a4c21b1e46256bcb3c110e6ffcd418e5c33bc6bc82e18885f82eafe1f", + "0x7f7b9dde8d7294927d73df6ed2e70fc4dfec7b1a402dca5abf8c0c648586724", + "0x670ff50da1a477ae34d44e27a3c0e87e267322843a2f04e86c8088934fcdf57", + "0x47d2e3788a6ce634c59af265553549586deb4c10038e6e6513ef64c26475f7b", + "0x4096c37cc4770dc8049b4ab483818f5746ffb05cc4916a1479096113fc95720", + "0x6322f2251894cf8934d5974be5a1018258acd2978fd99e0669ea61ce63944be", + "0x5fcaf134497a35fd68e39a5faa41939908d1b6cfba0e1d10764cadc5892f3df", + "0x27e8c046ca5751dd329fe0f499150bd40a7859f6616a31de35c0b73fc14e54e", + "0x1ad15273316815c320ec79d42e535070e2b1f67e5fe6d0d54bfc1336f176189", + "0x4c601a0d1098288096584faa8736bf4ff967e4d3a13389e2dbe2f7fba8b1616", + "0x32c0df48c19587bf6176c7bb18fff5a4c5e6025f07f3bad827fdc8b1da682f5", + "0x6bf016bcfe1b346dce014fd0683b65ff06c5deb8a311261ec5f163499a4f506", + "0x68f22e49430097a2fd3446160f6900a106d6c84f7e2267123c26394187cd0e9", + "0x28943ef3ae18150e46230d933e4799e98b1c9a8eed1b62c13ff182ca75a8497", + "0x51939bd6cf778aae328f9812517e6f860c4b9dbe771a2755b7815a40d12f31", + "0x72f0931ee56e22b129a42c51535b583ffc61859c08be04e0f144760ed0808bb", + "0x36f52567bf4fa74a79ca7b625bcb7eb57103c525b7aa28dd08aa659cbdd5650", + "0x635b5b1847b2a7fc7687c1b35f0d76fafbf1ecd26595e83c3025d96a535675a", + "0x62357f8f54bd53cd32087d324aa13b14355702304205feb23e5a50ab611281", + "0x6ef2b3a77797f7bace6a9866b02cf1d98f48f8c719061b6a07c698dc18d3ced", + "0x28fcdfc38b8059df3534a0bb29699eae6a7ccd2dd6f1a28d791c95780e924f8", + "0x6540dc764d1ef62efbacb347f79780a7b0526e6930426fb2f698364c4563120", + "0x19c2eb9ecae2f62c644bbf6d8f0161281308851f95202d7c4b6b7741a54eee", + "0x1dbbcb555d2b9ebe59b13c5d230539e05a1355cd45912c05e6751adb66155ef", + "0x455a2fd9e3c2d8034d550c80e10736d99682733b35ded2775185a24012109a2", + "0x534757d0cf17a80a60130345f66ceee6ccfd0eddb0b9e1740c71cf99f0d0dc0", + "0x6facad21e991ed6a3871491dd8786dfb6b2b1a6ac149b6735ed249a8c9f3abf", + "0x7dcc26d042cdb987f73227a56df5524c5b9aadfa0714a52de109c71d98bba03", + "0x5592f68cb8c1003b35476b2b3a78c4c619d3196bd90d79412a209b1c51ae9e1", + "0x204601234388ac5ce77bca83703b923512c87de9cd8a9191ef9f749540becaf", + "0x5f359edc9ec808c9e1585d191796834690c8dd7c4f9b20d1fd4b34ad5ba76b8", + "0x5c6dcffa770d4a505fc55da6a90cfdfd5b62062310e876cb3806a4db1768c98", + "0x20e8945ed0f5c1ff4576d28bb683b859ba545a812ff20861bc73cb7c94a94db", + "0x5e1bb202bd0ffbe37c7246abc67f34269e66be12c88b3b734ea52acd3652987", + "0x426cd1b02689f178a17ea7858f8379ce10b2354320a7a4a2e579bf2c79832ea", + "0x6c44f485087cd57554c72dcb55d962e0b3210228825e996de0fba726c2f3a", + "0x6f8b831ecded2b6fd51fa94dc117dfd2e7a5990fb0ca4bb7171920ab38c17b1"}; + + static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; + + static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; + + int full_rounds_4 = 8; + int half_full_rounds_4 = 4; + int partial_rounds_4 = 84; + int alpha_4 = 3; + + static const std::string rounds_constants_4[] = { + "0x3ae0f1e227f07d44afdc33df7b8915d2bd01ab6dbaae60b2a134e9259cfcd27", + "0x114d526f505e83a1b28c3d9b887ef1a3c8c5748ab23edad68598c7dcd478902", + "0x249a1be6fdcbae398a1e73f8587cc1fca77980ebe0db094bba708090567dcd8", + "0x6e9b4a2f5aa3ce950f161b95bc2748fd9503bbbd3044c4b14c8fcb06d614471", + "0x45ddf8f194953abe944d9dfe6b89db5afeea9e71cd49a4b0d44d58ce67fa956", + "0x61319c4779db0dbc97c6fb6d324769c0643323132f0f63849e404b8038c1060", + "0x69f88e718b6f214c7b38d06fd1f7a660b24845fb218c4704b57eeadc8d1edfa", + "0x24eb120d474e6707c6055cbbb4e5a3b787898f3870be190334bab08e9faeace", + "0x392af08685367da5e82b508122766fc36bf1c966c83e2df55885bed13e164c", + "0x2d1ea3eaddddd61cbf57728cc07425aac654dd92327807a10d71cd997733b3e", + "0x1ea43fd7073a73547c58b9ec4f7b603d1131e1cbc390da838630a0ec5681d7e", + "0x2cd7aaaee44883cfbfbc3eb2bc10fdd88363db84917f3fee72f1d416bdb1137", + "0x4cec80c7cfd350d77b762c7761f294c2b9b90021d54800c800bb1ff25ada780", + "0x78dc8cc28efb02c8fbeedc9131f4cf47964236288ef33de68518d4f765ad01a", + "0x5364e342e441545b3da8e147c472b6fce34533bdf56d7358bcffc33676c2cc", + "0x2ec782c3c6af9a5c5f6af2722878d867f81a7acf7e7c3534465d1eef1d57b79", + "0x55b5b6a91382ef958dbc52221af428c0ce45f3c5a658587e24e9c5fe230e753", + "0x27d6d1f46463db0c4ee3734d6d6b3bd2565f650bc90257572ba6e69724a2c4c", + "0x44378d094cd0927fa638d954a01d6562dbaf0a0fd1a497aa9b20002a5becd26", + "0x2177f8ffc3264b921f642a1e308a9a6fb45a362ad7992aed465eab18c2bf8a1", + "0x7454eb1391bee4825bc1ea17efbf837a650ff4a1bb01b687e293988e4cd9dc0", + "0x59f530f80e6d8e88109a890b5754270a95d3a319fdc84bab642ea90e857305a", + "0xce12241eb2f1ba8761923efc2807f80a270e00e6cc15f48f46f03af36db9c5", + "0x4631319f803ab66aed0e67099a92ac43efe14d7b6eb93d854594d7560c75de2", + "0x7fba42108fbcb20270d591657434256b41e1f7ace4ec8a447ffab116e2c5fd", + "0x34afa14f2b94f6c860752924e9d66c96f71a903cf8852d3c064aa8575208075", + "0x16f7d35c844709af1263e781b173174dae0f3e16a29cdf4865a9bd241035a44", + "0x29e2baaa8c1f891de15c99e50238a0a2b5f24d66150d26fd7fc99ad76d22f55", + "0x6e95a6d02009bb383bbbe62904e90fff4c36c30ee1e2afce1d817c88c85844d", + "0x7f7d392e1ec8f1b46124d6021ce434db52d05e841e1ac4106debc7daadd5ec0", + "0x4c8881c6e3f6f7e2f56954fa3345ed7800bb62f9ac7064afeddc8bc050adae2", + "0x3df086d966e511986118d03226580cb232adc9881ec3a9fc985cc7eb501ba18", + "0x7fcc3f6a5d17440c5b4da4952c800b232bdc5d67faac8a2e86b855e30dcc285", + "0x5c2bfac3abd96afd11dcc6b5d4d8adf36216ca5c254a493c7c596be0791631", + "0x51fc674ff918fb4482f17d44cb9d9e9fb7e2bc649d157029cad49256dfeef52", + "0x7ffbfa9129d5e19f01eff68a07ed26af9c771356190f265de3a06e4fe842f4b", + "0x18169686c7e203a6c0ee6bde81ae847c8c112fb792a98e5057b238aea9e720e", + "0x1de182fbf19cc39e1e4613110edbc29e3629180fb3bedddabad9ec35b733d4f", + "0x3e1349e8d388ca1167c9c5dfe0b2147ce46935df062cb78a74bc2418479b457", + "0x43b1940cb83e55bff0e4f5c7e5869454fb06c00f5b8e3ff3f9bc5a1fc55999", + "0x422864182b4a4d14bc1d82734c4908c209d26ca7f155dfcccfade692e3fb2e9", + "0x3fe6d4a2d84aef0540ad998c3ebb46c883d117b2f8d976aa98faed5837f8f26", + "0x6546260850095602cac9da9fd063dfcb10187541517c7113fedb4ef33fd6ae7", + "0x3325d5be966acaebc0f5621a1afdd0a3c4e2739e4286fecce3b97f89f9aa5f7", + "0x77d11bf5378db4acb06901aadd9f658f03c1dd752d3fd9fb178ad91f345dbdd", + "0x77523ad82921c93a46e98616c6e1b1e2e5eec09e9e69faf825990f0f42a5aad", + "0x1212e3f4f2722f92b8f3224e2eed56273f5fc79f672aacbf1a0ac080114bc34", + "0x6b9ba762cca8b4bfef150dfc05027f4758f74570c5e93e3cf460d117c56623c", + "0x1768fa45ec882f38896ac997ccdf5fa312d8a6d79a0b3df9c72c15a8ee929ba", + "0x778ada07199173134eeb70da7e3caec528385fd95b9cc9f727b602f6a7058c", + "0x594101d59eb0bfe1733514c0a8d4940e7a8279eb502d6540354e800ba63f426", + "0x516adc6896a6ea907c0c5a87fbaa0e38e53c5fb60eef628ddd23e4a7a97aa44", + "0x588c1144b72cafe1251cba01b769757e70de457c7bcda9925db7c936173a716", + "0x4e628700227c9ce28efe3601aae7d8aa67178cd4c188157cf5b17f05d0598e4", + "0x70647385803086055e20181501dbe605836f1742fa3b96ba18c5ea11f18468a", + "0x10daf3a04df63e03036fcd547c6b413fad9e6e59f940dcfb86c072deeca33fb", + "0xed04326e3a573b37ea8f9953466520e795d4e12d1c64c52d3b536f47567987", + "0x4d992639f05752dbe6c70f453fbb53855d21cc88d56aec73896e405c900f96d", + "0xe7f902286b5a1b7d1ab7a6cec38956005b37999ac232f2ae4a6e16cf210d2e", + "0x65ce522826d4a6bb7dd00bb04f89faa995633f42af1a0e6964edd882e3f1fd0", + "0x64697b2715aacc32cdc721af25c5b787527acdcba5c09c13de40ac101701ed2", + "0x6c2bad942d5295cfd69bacb2af51bcbc4ba381c58796bf463c4221541befc63", + "0x5bbc4e2c48c21e8988fb5d91d92c60ec57993584a6dd5b8b4613df5c318107f", + "0x477a43755c395ebc06ac955766bbe802004602c084ffdd0e5e94ff520142d43", + "0x38d4fa47685f81b68003cea49e836861a7ea4a63586d2b6757be15a362b9e3f", + "0x639db31367c9b963a52d386cdfde4e93d674a3a5a9e4f24071cd9870112fc14", + "0x37cb29fd6477b46866bbb838a3547d90e890881c3e24a83286c03239a3071f0", + "0x6c060610fa0c67fcded8c19bafb693945b948fc875ce7621fb2a6b598cde7e5", + "0x23aa9f31fae639bf0644d9c7f4fcf0d6303763e538a25a167531f70e93cec50", + "0x56655709c14a4746a58de5745138701b0471dd8848eb60092362983296c4977", + "0x247ff957bc24c26639e3098166338c4901e89e866bc82c5a5347b4b974d1ab1", + "0x50d38bb080c38722cc3291bca23b789e82ec01e3bba9083c63bd1116ec1fcab", + "0x2745cd5e92aa47245ae1cdf6d93020181e340701f887fa2af4ef1420a373c46", + "0x61bf9671ae3d7f811241802ab1ec4cab48dc18259c1537762e7c8727f3607a5", + "0x54cd8aef42e41596b96667262ec1f7f2bd5d779c998f343843e5e368758969c", + "0xafda685909cbb95e99dce37d8fd59ac222d3f0aff3e8b23ce30e523255c80b", + "0x3f1f8a3a19407808c4abb6fc1fbaa40c5606fecd57740da92dadb4ff3585366", + "0x3c455b8315b2193d492cd7b602a38e711f996e3681ca1d29a80867b53b49d8b", + "0x30785b6eb4b26d66862c947385f29a62a3c5cba6fa0871c0fccd8c5662a9593", + "0x37af8afd15e516cf09f291587a29de7cc955f80bbcc11dc6e48a02dd49756ea", + "0x567312152887c81301e3c4a789d7a2cd0bc128a270f62410d706fc67c4c4cf5", + "0x17c28e94f6fed7c7ad06fbc5e58e7ed45bfcaa64d6f437cf907fc05765bf5c0", + "0x337629222d63f6bb7855f57ca6947efbf586cd8a216e79e24dbbac350dc47c8", + "0x6724110997ff954bd0aa70ea4d705a96b34def12f63057b07a0e843e8f5db38", + "0x5fe567d1b028686059c9e61de051919d998870781e82d13ff47cba051613c7a", + "0x343e6009b4885418f99fec23867045771ad2e0344db4e34e8d6dc30f648eb3c", + "0x4a25c02f017067d34fb912d5110189727d013efc23addf5afd879ada00d517b", + "0x6b2929df0a2fe1a7588afb20d7111fc2d8a10167b4ecf0a1de9f5ddf371bfd7", + "0x5f4483784ac58208082c0fec9cb199f2b7655025285342223d24d4f9721135b", + "0xb8ec66771d0346b595615e31b4ecf247778351bc8b0b443c9bd887f2538c39", + "0x76106c0e0db026825e74dec1b89c2d5012ae592bc1883dbea227a0c3f06c68f", + "0x183b5f2e16fb5a339e8ed191c690926b860b89516d756673760bb63e97cbcc5", + "0x46edbbbfced10a9111d5109d403e0d2a7eb69b3718f441d97fe7d40d4301f27", + "0x65bd7979cf4c4758d5458c47fa0f65af4cacacad39467a037a610ddfb0db579", + "0x5972219ffffc2d18e176c818cfb2a31323356473515644ca328994c9516849", + "0x3323e324563028cde244cb58d01d8456caca5653636569e19b0e499cb0ef769", + "0x162a749a5a5662c6df69b0c81242cf27bc55df0622aab292bb5b80d6342ba4b", + "0x48ade57b4d07dfe92125aa5b680a17f5bec402e1da0e880d3afe6537e5b0092", + "0x1bf69618788b072d29ff3439cb5c800a9e36fd453feae4098a46112d96df936", + "0x6c31f8ce89d5c8320e31017bf9a16bff4e40ee9d7c3a02f8c978449f578efc3", + "0x1dc5d9798692869ad4612fbae5d28aa93f7665755828a840ab8e968646651bc", + "0x5fb5fc52e128b1f2c8d81c59dd22a0fb725ac37b8de860e5a2f64a3957fe0ab", + "0x42c6d49f5bfa8f181223de55541f0a041f15028250bf82603e48028ea52ca70", + "0xaaa339517ebbb7f6327144f673e3fcee23227ef27b53a5cdad40f431bc7869", + "0x11374315bcd85f47a363f6678e3813621fdd00bbbac5b4207172337d6959be1", + "0x5e46d99703b99ace3266e979a62be1fce9cc8bd18490eafa39711d7b59be73e", + "0x4fca2a2507c5be8dc7b0159c8d5e6bb39e6ed054a7d9fc6f6c2be75f0837a1d", + "0x542d758cfe750b05957db7a7a457da24071ad8d878d458d3201152a12510fe0", + "0x2086e705c69d654403076efeba8bf38549c14445e0e571acc2b22ffe5c69ac4", + "0x78920a1bcf289a305369569bac0b11a7fd6c064bdfe677401c5162592e70c4c", + "0x414051123425efa9f182d41d822d0031327b95e5dfcaf39dd96e890403e018b", + "0x709f27b4cf78f1ca6ebed94ff7faf5bc8c5c3e09b93a9e0893b661fb5e650f4", + "0x2f0a8b9633d6d5495df7b726ca39b85581cd09d1d528c8eace4e27e1008af9c", + "0x63273b73e79fcc8af1c6e63a7fbfc3eacdb472d57e174cdb5df71cd7661e21c", + "0x228fb8cf7c3e83ab6d0532123db12787713637ee9c36e795433df8c0b0f79c2", + "0x215926ddc4ff0f97f19d96fcc003d05d8f04a241065233fe9d0a7cf09f3828a"}; + + static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; + + static const std::string partial_matrix_diagonal_4[] = { + "0x40c07e7bbd39b86fcae7e7523bc39fddaa886a6ef6e72580fd941aa08ab37dd", + "0x6db3ee78e607dc8f1f737405768c6a2ec0923070b1741cd6a36ffbfa900ab3d", + "0x7ea30c9d3115ea2571b6d0907ef784de7f2ddfdebc427dc871bd36a707403ed", + "0x7c3a59d4e85b2e64147d33e35156d7cea9e08a3124acc8dc9b8d2deb9ed7216"}; + + int full_rounds_8 = 8; + int half_full_rounds_8 = 4; + int partial_rounds_8 = 84; + int alpha_8 = 3; + + static const std::string rounds_constants_8[] = { + "0x1dc1b64cf421dced51ff26fc864b0030ca0c190f95bfb32baf8e96634cd0b06", + "0x67f5774f3a4bef2500c250992e1f75692676391ff561f05dcec031ae9058efe", + "0xe37a5ea09c1fdff416e0ba2e74e9142f695b281a7ad12b6d2cfe605972103b", + "0x2a26d3815a899d294341a81ea81be327bbfa0a718512b47c6f52d00b25df30", + "0x369e038ec1c2a5dccf7fb1022110551a21f9a96644a7b06b456bffa61b9578b", + "0x2a660a8b1eac3466fb17525d42cff5a42f77714e68d43cc38ec1b6ea794cced", + "0x420ec1546964e58c410560bbd1074f5b6691dc9eb00680492cd9b6a8dc1a86c", + "0x547647f34378b5b42a57df08fa5d959426f3c9a6bec1c7bd9e6ade8414814ce", + "0x238546938553fb2e75783d4362c8f8a2360efafa94867daa93a607194313394", + "0x175e440f41ce2dc9c031ec35e7099c71e2bc4ccf350a98c8594b39f4a2ea217", + "0x5a21109825acc58e4f6586b10e3cbc67b47f000bda60b4b146cd2402b74f98f", + "0x16ade3aadb7be24a8ed7370678f38c0af03ef5b7787e764b96b5eaf7cf3d18e", + "0x65db07fc98595c39be9fd0c588651a06f07007aa8091ae3441a640a3345088b", + "0x79299c59e40ebd9f09adf271dafe405d93416703d8d5e0a7754407fc1a522c8", + "0x18c322380912c0b08d0a80c0ac1627656f562cf5044bacdfcc955551c7e1aa3", + "0xb942e84022e1279984565b4dd6dadcf7183464cfe1ae56c01b7637246f508b", + "0x671cb1b08341c4acccb429e8ad3c87d9d56da3a55a8889942fb0962904fee17", + "0x66be6353fcc3f1c839844491238b83cf08f8b86af85b1fe28f0b72c74c18e7a", + "0x12fa56b5aa36f3c60f6a1601facef87d402b912cce05368e035cee532fbcf4d", + "0x5f200e942087fe4d99b74f2669774fae02b8b2e2dbe273c279cb63c1de3a8be", + "0x5a3bab97cc9535313ec85520e3046561c50c4588f993a65e3757f0e50041b92", + "0x538d85f1cecb88867bd31a4ee69dbf011e4fb9634c03707e80e024584f6ded8", + "0x23eb9fc9f188395e54597652ace1ce16c996427a68cc1bb25d62cb63a582cf7", + "0x3436ad14e88d93db8e11a44ebbdc419d88362ee0886fd7a33c3c5db30606aea", + "0x42377204e23a3a2742f703fec4455e88688ec55c6c6e1183ba1c8ac5f1caa34", + "0x27926b72ec39c22c5d85c4d68f243883b99ea1cf0609dc1d4af88681e8d125e", + "0x36d1dcba1c367120152c3ac81fb983fbbfd41382c3ee67132fa9f3da6cfb66a", + "0x45d157aa5e1c2058403309185ba61884255e8a4110502bc7b6d62978977944", + "0x73b2b6cac7201a6878d14996703f551fd0e491e5bd299f8d25d52e1e2874800", + "0x78ea702523d066eb77e0d89be25f06b86a4ac1da42bcbb4da211ee2b52def18", + "0x1054cae64b975a6f3aad9f4c62d2f2d3985673f3aee31bc181ece265c3e7825", + "0x45212df41ee81350c9eb7e555975fe898e346c69bbc12e0ad1f231a639f7dc4", + "0x7d13bb0d431b252d142d02fb8125c764cb95ed3b66175f8ff606ee28fe8bb9e", + "0x770b4f5ca8f1f4015aa7872100ed7dcb75f3738ad7c81cb61bfc69d1a9c0823", + "0x31e3809ab7c9b684fb452e6ef9079d659e20685b5129994679d8e51da1b1a68", + "0x727ad1c2130ed1bba0158a6b04b07faf80d64146ac828710e9a951e350dba6", + "0x1b415f267b1bca46e755e6011197adc42e3c558cfffd16f6517beb88e881397", + "0x435bdadddba7d9a75fa223d16785ebc613840c0be181341a0da28fd6bb06afb", + "0x1b63273a2fe917ec496fcaebf59fe08af6f4595b6b4745631d73083ae51ca3b", + "0x66b261ff1d490fc0a0b2d4f69585e33ef966182e6a6b1bf681c57862ab27ed5", + "0x1df5bd89bbfad687ed767ee34d49dd56d29f198749dbaf2f1c17869916dba27", + "0x6067a2abd3daa6fff26a7ce80b527cea2c97cd100971cfce5976298fe695a4a", + "0x748106a445f3382a9e85aee615b308b3c15653a6f3777802c458817e0c27db8", + "0x65145809521313c2656b3017281c246e814fa08d4782834900adbb292b9618a", + "0x7a3c9bc64576572aafd23213bf04fb07e4b87e4f5d0d65c8be438c31540a7f6", + "0x728a59c923362a9e6fb0fa9e59f155ce2774e94d6ba3f7b5e3f8ae560a884a5", + "0xaceb902a596b2f37965292b3bb6a3a9c49a79f3feca40804a649f493c75f9a", + "0x6045b97db08ddd7d2201471f3c67f9b090049634a185d13f487ab458bbe8d07", + "0x2da31f067adcd1fd88a8d0066f45978c6830628b79d6a4494b6dfb302cec555", + "0x4fdadfefe820945fed237faf6d63f600a31f5fe76117c804d35135acb700ae3", + "0x1198cafc274e5fc504a90430974031b234a753e28c0fa3c5137de8cfc11eab6", + "0x3ea656106fa1eba6e811570c7b57c81042cc8ef67bf4c1a70794fc7308f1de7", + "0x78637973d037ea2744c0af32fe1fe7449fa5107dabf20725abb2e5b91d30ca5", + "0x4df4b2c1475c04a1adfcf38060880aa80eb4cc16beac730d57e2824856925e", + "0x7e7fe4f54d69df0e8514964d5a2bcc4c216146fa892fd6b8ab4e03839cafab9", + "0x59d4f7671e8dd6840bcceba26d0665603005e6356db06f59eec3bb3c89c96a", + "0x3f304ca46a7f5415b164c9bc94878d26f0923641355ae7a07efc5a9f66c76b8", + "0x4d1f91e360a2ac75278cc8a0cf8b8e07fd0a568a7e756f651b52f769475bf85", + "0x7efe8ee65f8b4730716b7a0fa7b2066eb9af9ea98dd12b5f56637a5f073befb", + "0x2ec653a36f6cc74cceba2f7733bc4a84c0ffaf0afbe4f3b61568d97fbce327e", + "0x496c4158f94c51e02c532ce1403f600612a2ddb6c2019ec4cd2b1e14147ec56", + "0x735017e7df1d60ce4ab1d565c19c0ff0259b0567c6fab81c67f879871e7f330", + "0x799b6a8b60191aff54dbaa4d830ce2cd6293cfad13addd01be6b1f3276ea758", + "0x1b4aeba51045e0c3cea7501f82c36b53be7c3f1084ec5df68f389de68055ef1", + "0x70d2a624d2ed94cfab065697ff0860dfc455029debf748ec4cafd65fa60977a", + "0x68a09c859ba26fa25b9d05b62df6446487c7d0225f08d702db78c4539d5f820", + "0x4615ad3bde830e21fa37f95a9f22484d0b1f3a473aa8e4e10e47728b73d6e9d", + "0x70fc7fa52fd9e8e941e005a7a869a3085151c568fadd8c5cd386ef4b88ae22a", + "0x91964f379d56c0188868c6b67b9d3e94c340009e6d28e8c870e0c61a36b3f4", + "0x357df0815dceecf9368e7c19e9c021e8f7af6be41be5e3a66e0e65182af4d6b", + "0x46ac7146ab68332bf2ab8e6f884ba60c7962a4db6a9d00603d61fa087fc4a78", + "0x15d4ae46d156b32937364cf349aa0725a40feba408ec1b1113ddba5a644622", + "0x6aead9862822a712a47bfe47d82ac1f3ce3bb266a9a765900ed58e263d68282", + "0x33e85f827f791ad324ed1437011866dc29ee64999cdfe13f836f204f199300", + "0x2c7c67760cd8ce3c0a0582e808acccda386dfce99dfcc609c2cf14eae79fa9", + "0x6c1a7e8c78846e4b084d3d15134407508d7f7ee1932a5b991569731fa2b92f6", + "0x4ef901fc6049a379b2b6dec74e94b7f174249e213d20dbebd2b918168a11a9f", + "0x6e403c26f54ea179578ba3d43283049e8a97cd45bed41996b6f297124ff5c1d", + "0x2a3602932c8509c61b5b1305ba08844eaa012796d59d67fe8b9e6181a00cc32", + "0x111ec0aaff8cec77d1cde861af841e208a9347194457a7a921ec5bec216d14c", + "0x73b4d9fa1cb6b21a91a5ab71d126ac423a14e7d4376669b3032c455d3512d15", + "0x527a133541df13604aad50302347f140a8cb79961ab8dd6ae2751815ff3c732", + "0xaf242af3e0d089bc0f8db4889e7553c6455273d65695ceb74b4240172c46f2", + "0x5830bf5f04afdc52de5a252b88fcc811ec72806e2a27901d073feedcc2cf3c1", + "0x7424d997ab9b63c6cdea6fef723647eb870ef8940c5f26f46253cc06b68c139", + "0x446886c11ff303c299c68d14c1f2840be1077d94f5f63d5c687cb3ea3e4bbbf", + "0x631a09086fe684db052cda0555e31705277edc5e1d2a68e969b27f81ee285a8", + "0x26889f5ab4f2c2cafaebab554e514ffb75ef1a2c18bf54aca68d04e1619ebd6", + "0x7929f41feea5174fe06b989d8301fb5d484e99bf30ff120ff09cf9c8228fd4a", + "0x2be5044f968788cde988633416ea115160e3aaa8399fe3f4bd37f46f9708e4c", + "0xf17d0523891c7a7c620a1a49e3b4b909aac8062f1d1c1e0f57161cbca78b02", + "0x786efed5df1fc4c9fefe186a03370248d093ab2d664f1c4d580544ac193d006", + "0x6f373e69c7490462f53d3485d64bf27e587d773056f51dbc7382f8a85d61998", + "0x1cea0e2294a6e533485c60efad70c94e2c3c8927f1d6cbe7f6c25f507fc114e", + "0x1a8c70aaf9aa249cf6f193d6b45baa8ab9fc69997b5c0c6f0a4485ced0bf34a", + "0x178e3b45dc4d2603c3221121499b6968c5c5f089f42e599a0523dcb9666ac85", + "0xd1915ebd1aad0a86e8b4007f7239882c3cc314b3e044d38c6c4b3267dd6e67", + "0x7ca5dae4800695bd797bb97b384492dd2d0cd5e15d4b9fe6e1d8ee80a08b753", + "0x6b6082f77d4e9672768dd60fff6d267f561478407dd346ec50f1934dc37d88a", + "0x49aa3c242ac10b2cc4d3d14a63e58e891e112a5a4f817df348c52e8240b9cae", + "0x268e51cbe3d348e1646cc459cac6ae63be4f64f3028387932df65141377283c", + "0x1a7225429d1706d4b5ec4919a5d7387eb51216d159ef6594b0887b020be7893", + "0x13a0dfb7f10907e4222393f20753d04b371584ae194cc8c46da771ba17fb5b9", + "0x6b1d3097f50ac809a0d42bcf2cb92d69681ebdbbdc20132634dd0cf2d040fb9", + "0x56d79cc5d6c2b9a95543f17517ed6eb232ce288b32741f403e4acf1aeefe134", + "0x204aeb4a69ef10391876202e83352c18d16f0b17282c0a5b850858eac0ce3dc", + "0x540855a80d3f0c03a12bf57e08d2c11ee78bdaaa56500d9f997666ccead78a2", + "0x216d99f8c632ac1e0cbe6b972962fa12d649276cb41ca71658c18eca8eb70c3", + "0x333d2eff383822915a246ccd931180d1cee6357eb88a903133f102df79f79c3", + "0x67fdec9f13245cfa25b5dfa3d1f2707472c66383014d036fcbd4c2dcb351375", + "0x36deec64f5af15a8a303e2866fa8e247b7cee6051774baa2abfa65346e42ad7", + "0x338fbb3d25c08562336bcfcfd5aacb16df094575d914b8b9b434dee33344bba", + "0x5e80a38ec290edc82ac034f7c4a54d8b54574305c99f33ea84c274948c48bcd", + "0x32e6fe232bd548d72e154eb3ae082fdd03e7ea6370bc45c94bf04d55c1b8bc3", + "0x550d7139cef8aa52db0e466c5f0701a9ca4511bf234824f891bc7096c18e355", + "0xc747bb140fe98d97cb8b04df92df18bd178036e10bc631219b466b8e94420e", + "0x598c37acbdb9fb7655682efa60281accd5dd45db03cb2c99cfe0b535f5467e3", + "0x335c3a0be4056462d645cc5b009524b37d4058a0b2d1a26c1c471098c95419d", + "0x6d1a3dde9e63c23ef2d84ce4faddf4e524f2ca3b36fd9dd1b0bb520f732363e", + "0x17e9984cb5dad2ec8a6bdc79590a5ba49bc9fe00eb4bf03bab2f4f999e30384", + "0x4da49e6f7ef55cfbee8ccae70ff40cc7cd41990b15f98c8290cb059701cc25b", + "0x454fcfdfa7fd68864a35158d8032d98a8543d6461dfe6325a88f2561d9f572f", + "0x945b09474cd0b1eeef627117e09b1eabc18b9d92897cfa7ec938dff5abe696", + "0x3c7779fa40ae44a814bf74ee220e646bfa8bb2a1b37fb20866817bd9930fe3", + "0x7f078819f18bbe8a494784f4d3b79b7681a508e5508f4c7ac626e71d5e8bf40", + "0x6743b80ddf7a5fe812bc4f17acc5f84f6e8858aec6cc68ff4854e9ecbf79749", + "0x3779a8c7c1a6ac73e84c86715a939e350696de9f3718b8c93cbca66970bd5fe", + "0x502d3c3473bd8e7d688051f386dee6d9a3ef64faff2c58fc63dd0fe4b892d8d", + "0x1228692e214cbf7c58fb265a52a0090c8b94679fab9eafe1a76d2bea3a81ac8", + "0x6f4aed19a089339d7c32bcbbc3997ccbbe57a6c4caf2d0eae6a14329625e696", + "0x112d98ef8b3bdbb0ade40f9c20cf1e950573a3ee786311c452dc73b7ba6e034", + "0x655b897c83df406644b61ef9a5ceef9ea8abba78cc082688cc821c39156e669", + "0x5d4cd0079837a70ca9d9bed73f688d77869ae4fc04c8ae48e73a43c3aefa051", + "0x7aced74ea16340e0353df999e84280f6a5066a3dd56913909a01d8ad79d18e6", + "0x324da88f76c46bf96d54f1323b0f471788ef1679fefef4a29cfe8c8ed061e29", + "0x13adf50cd5381f068850e34a7ea2cc527fc6e62daa182efa305be2e2cba93fa", + "0xda8d6039f00b389f9664d7516dfb6c1062c539d34369a46a430e1c06e2c946", + "0x500043e7b438c9cdbf0effc0dad8373e0eba1377f05b7b4ceecf53bff9ef963", + "0x79154aa68d1fbe6dc60ed7180d74243de270588998a4a5750205a10e48f6d4a", + "0x5c54c8396cabdacb087e3e47919e8ac6af5bda3f0269a1b16180a7b14f1b92a", + "0x8b169c489fed2e3eff18fe7cfe70e5219e7edd244f1336b297e20b2d2182ad", + "0x1a90208c8757755b8c803678d5b4196eff0bf201831c572a7e68bd3d4e77f41", + "0x7ddc9bfff1b2b27a10be018b7fd1846bbf7b794ef2a03b578fbc2e4ca7d6c73", + "0x10fa23d64d0f34a2236209672eb2301e8fabfad10b200186da86851d9d72747", + "0x158c239bd20c6791f08f68de66bbb3377b287ba8e3bfa158dc57afd34f02cd9", + "0x1bf60e0492fd3fc2f7e2713bbb1a5d7249c848762eff5ba41af0120afeaaa2c", + "0x7f1ec099ba7d10979f4a42929f1fb0b1f839869e6fc4062fe96c9c9359c69e4", + "0x605bbb407d2116d4097fcc9d246c3b75f8fb5765c7a1453642148c567fc64b0"}; + + static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; + + static const std::string partial_matrix_diagonal_8[] = { + "0x497454d465e135e410d8d4d87eebf9044063e9aa1117404007501e8ce0bde23", + "0x7f4f3d75ab3aeffdbf3166723e534daa541733620e3ee68929dc651eaf47086", + "0x4a85139b01a3808e1c7621ecc3cadd4184dbf3f0fbfc0076db62ac98c960667", + "0x1f190d316147b04fd4fcae4e6805c017fa809726abd5a910b43014b261b5272", + "0x4c19e5f4d9572b169bdb0345212e23d7e1e62b35bf39451b1ead32bfe6bf135", + "0x1950706ae9759aa2adc97ae95b4d2cc61a1f3089effcc1ee09976a36f8d335f", + "0x6403158bda87841ea16e7a271b5acc5c5f36ced8d413b43c53802e638e7d029", + "0x6f393735a1ee452d20a6ff1168eaaf8941693a39dbe1e8de366b8b4b62f40db"}; + + int full_rounds_12 = 0; + int half_full_rounds_12 = 0; + int partial_rounds_12 = 0; + int alpha_12 = 0; + static const std::string rounds_constants_12[] = {}; + static const std::string mds_matrix_12[] = {}; + static const std::string partial_matrix_diagonal_12[] = {}; + + static const std::string partial_matrix_diagonal_m1_12[] = {}; + + int full_rounds_16 = 0; + int half_full_rounds_16 = 0; + int partial_rounds_16 = 0; + int alpha_16 = 0; + static const std::string rounds_constants_16[] = {}; + static const std::string mds_matrix_16[] = {}; + static const std::string partial_matrix_diagonal_16[] = {}; + + static const std::string partial_matrix_diagonal_m1_16[] = {}; + + int full_rounds_20 = 0; + int half_full_rounds_20 = 0; + int partial_rounds_20 = 0; + int alpha_20 = 0; + static const std::string rounds_constants_20[] = {}; + static const std::string mds_matrix_20[] = {}; + static const std::string partial_matrix_diagonal_20[] = {}; + + static const std::string partial_matrix_diagonal_m1_20[] = {}; + + int full_rounds_24 = 0; + int half_full_rounds_24 = 0; + int partial_rounds_24 = 0; + int alpha_24 = 0; + static const std::string rounds_constants_24[] = {}; + static const std::string mds_matrix_24[] = {}; + static const std::string partial_matrix_diagonal_24[] = {}; + + static const std::string partial_matrix_diagonal_m1_24[] = {}; + +} // namespace poseidon2_constants_stark252 +#endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/babybear_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/babybear_poseidon2.h index 4a54b17a7..a9156a83d 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/babybear_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/babybear_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef BABYBEAR_POSEIDON2_H - #define BABYBEAR_POSEIDON2_H +#define BABYBEAR_POSEIDON2_H - #include +#include namespace poseidon2_constants_babybear { @@ -11,307 +11,1090 @@ namespace poseidon2_constants_babybear { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 12; - int half_full_rounds_2 = 6; - int partial_rounds_2 = 24; - int alpha_2 = 7; - - static const std::string rounds_constants_2[] = { - "0x76a8932a", "0xbb32543", "0x54a11a80", "0x29f09389", "0x4b8a8ec1", "0x3fa2f7a2", "0x2be3fd0c", "0x6ab70c3d", - "0xcd8e8f1", "0x3a34c8f0", "0x3c11bf77", "0x27eb37f3", "0x6dcafcd", "0x19fd4b2a", "0x1ccd65c3", "0x3733a0c2", - "0x18b43754", "0x2ed74076", "0x368f93a6", "0xe8024cd", "0x3b8f289a", "0x4f5afa7b", "0x64c82b68", "0x76245680", - "0x1ab4ac2f", "0x3ca5f68e", "0x14bd49b1", "0x52d03b15", "0x8cd74b3", "0x1edb152a", "0x3037497a", "0x498a68ec", - "0x6b11f228", "0x21214194", "0x640be0ba", "0x4bd18241", "0x20094634", "0x126e22d8", "0x42d213d1", "0x667db627", - "0x29345ea8", "0x4e79edfa", "0x22abc20", "0x36a8e6ca", "0x5f11d45", "0x311d4622", "0x346d7598", "0x61b18ef3"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 12; - int half_full_rounds_3 = 6; - int partial_rounds_3 = 17; - int alpha_3 = 7; - - static const std::string rounds_constants_3[] = { - "0x460c6c97", "0x763f1345", "0x354fb969", "0x650244d", "0x742c7bad", "0x420ae4e6", "0x24b1922f", "0x54b38487", - "0x67d8a525", "0xe3721d8", "0x4bb8f261", "0x67830d12", "0x70129a6c", "0x11ba69e0", "0x463bf841", "0x32d4a62f", - "0x67278981", "0x13955c1f", "0x26609020", "0x38f57776", "0x4684140d", "0x937fa72", "0x39c9ed0", "0xa8c4f4e", - "0x4353324d", "0x70ac28", "0x1bb3e99b", "0x4ebe72d0", "0x265dc2d3", "0x17749f7", "0x69265d86", "0xe8c9842", - "0x4c0cd782", "0x64374361", "0x158e5174", "0xb5c6575", "0x87a66c2", "0x67afa498", "0x1b7f0922", "0x25b48cdd", - "0x1919afc", "0x523aff57", "0x3c000cf8", "0x21007c9a", "0x3df614a1", "0x6f9ca329", "0x17fe10cf", "0x1858c1a1", - "0x6779c6fe", "0xa4ca12c", "0x36180c4d", "0x54d17e59", "0x23bcabd8"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 21; - int alpha_4 = 7; - - static const std::string rounds_constants_4[] = { - "0x1b149b6a", "0x550ada3b", "0x22880f72", "0x162976de", "0x1459035b", "0x5b23b851", "0xecb6c50", "0x5e25906e", - "0x2e627964", "0x13edaf43", "0xf39a91a", "0x4d1036b2", "0x7151a71", "0x688d32c", "0x640c2308", "0x4a823ac0", - "0x664a061a", "0x735f9276", "0x1d33aa59", "0x444266ad", "0x65a98dc1", "0x210f7e1c", "0x5c429eb", "0x12c9f1d5", - "0x56e16908", "0x2cc4000f", "0x4cc1175d", "0x4696830c", "0x7276ab5e", "0x429e580", "0x1eaddf35", "0x3d04814b", - "0xce9d10c", "0xc1bd2b2", "0x5c0afe62", "0x41d3d05c", "0x4ea8fba8", "0x36415973", "0x1f6c2a2b", "0xfc447c9", - "0xe06ec31", "0x759e0d3b", "0x53928b9d", "0x1f031a41", "0x84357dc", "0x18a44a08", "0x4e979922", "0x591b777e", - "0x1698aa28", "0x6c89ede2", "0x49941eeb", "0x23d71466", "0x4ca1ef20"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = {"0x35bf6f48", "0x698266a0", "0x41f852b3", "0x375cdab9"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 12; - int alpha_8 = 7; - - static const std::string rounds_constants_8[] = { - "0x11978cde", "0x531baacd", "0x62fc3e61", "0x6c5443d7", "0x213f7bea", "0x441daf50", "0x5b73b0ca", "0x37ac458a", - "0x578d452a", "0x1105d869", "0x5f972521", "0x638ac688", "0x22bb206c", "0x3d2bb74b", "0x8b3659e", "0x5c994035", - "0xbf823b5", "0xf126f71", "0x4b3f0e22", "0x3274c979", "0x2a7e2fde", "0x4c5efc43", "0x51c10a78", "0x1b63549b", - "0x3f6b4823", "0x4e3d9da4", "0x669fe91c", "0x51f27231", "0x47eb6c6c", "0x2cbe68db", "0x3a09b20d", "0x19cd3c02", - "0x3d69b95e", "0x47e08f02", "0x73d51f24", "0x18689a99", "0x2d7d8b9d", "0x2a19c971", "0xafebd15", "0x69b8a7ff", - "0x1bb20d3b", "0x24fa2759", "0x7334f71d", "0x9e230b1", "0x794f50d", "0x74d2212", "0x1a6c8f20", "0x1babe8f5", - "0x16d15c2e", "0x49fbb5fc", "0x1ecdf383", "0x63dc7bc", "0x545d4a85", "0x6a49504c", "0x3843670c", "0x586e0569", - "0x2aa801dd", "0x38b4af42", "0x5937ccae", "0x2d7d72a6", "0x511a5bd1", "0xdc9f554", "0x2c3e286e", "0x302b45be", - "0x6ee05fcc", "0x27638646", "0x2b6fc4a2", "0x4c10b913", "0x420471d2", "0x29b908d2", "0x33f97fd5", "0x6834fc5", - "0x70bee4ed", "0x4fe57541", "0x620e9e99", "0x6355ade6"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = {"0x17a3691c", "0x84987a", "0x1f7b62e4", "0x5967b11", - "0x427c865b", "0x3f3341af", "0x52490f5c", "0x468846c6"}; - - int full_rounds_12 = 8; - int half_full_rounds_12 = 4; - int partial_rounds_12 = 10; - int alpha_12 = 7; - - static const std::string rounds_constants_12[] = { - "0x44d3bb88", "0x774148c9", "0x1562425e", "0x5070628b", "0x68799490", "0x46f432e", "0xf2e4358", "0x53c99049", - "0x751c6051", "0x5b9ebc5a", "0x58893f0", "0xdd5dd7d", "0x4c2b4eac", "0x5a528be0", "0x675fbcc3", "0x740c9d60", - "0x4bc6dec2", "0x23c5a8e4", "0x3189bd8c", "0x11ce185c", "0x68b9bb90", "0x670e9d8f", "0x703eadbc", "0x7102faf0", - "0x576838aa", "0x1b6c76c6", "0x51f500b4", "0x15d639b6", "0x5c0245c9", "0x6f8df3bb", "0x4d0cc32b", "0x47b3c08b", - "0x19292b3c", "0x96230be", "0x173c9b43", "0x253558fa", "0x72787bae", "0x47ca9db3", "0x44234b4b", "0x4f47de93", - "0x7309f557", "0xe7113f8", "0x5ccfa802", "0x45f84e30", "0x518a065f", "0x2f6df559", "0x69815d68", "0x273fe8a1", - "0x43317763", "0x74e4c89e", "0x42162b7e", "0x2ea3f9a5", "0x2bb30c04", "0x24744474", "0x69e8a40b", "0x50951c70", - "0x47ff91bf", "0x5d7f98c6", "0x2bceacc0", "0x32a22f3b", "0x6e4b4664", "0x45d5907c", "0x2aa63f10", "0x48edb36d", - "0x4ce8a0f9", "0x190673fe", "0x74878323", "0xc953e5b", "0x6c251bb8", "0x6a1b0031", "0x66c83144", "0x29e57c9a", - "0x70c4d4bc", "0x4aef5f94", "0x358a7014", "0x78d8eae", "0x416be810", "0x77dacb86", "0x36958cc3", "0x3d125dbd", - "0x6ce43bf2", "0x16e0b7e0", "0x50de3232", "0x3466fea8", "0x1dabba6d", "0x5cefe2b6", "0xfcb3de4", "0x16d0a86a", - "0x2bb9da47", "0x1aab3a29", "0x2e0ada0b", "0x3c3ee3b6", "0x3a678be3", "0x19fee590", "0x84ff04", "0x35ae6b25", - "0x761eaf7d", "0xed3fca7", "0x156b59c4", "0x55e273f5", "0x2f1907f5", "0x3430dd1d", "0x101600c6", "0x66b38947", - "0x212250e0", "0x62befa2c"}; - - static const std::string mds_matrix_12[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_12[] = {"0x5ce6d180", "0x392b0108", "0xcbd124d", "0x6f099b7", - "0x6cb3ebb5", "0x363069b2", "0x4de47c38", "0x6af5a0c", - "0x52a0045f", "0x3e9f380e", "0xdf8c11f", "0x63a32986"}; - - int full_rounds_16 = 8; - int half_full_rounds_16 = 4; - int partial_rounds_16 = 13; - int alpha_16 = 7; - - static const std::string rounds_constants_16[] = { - "0x69cbb6af", "0x46ad93f9", "0x60a00f4e", "0x6b1297cd", "0x23189afe", "0x732e7bef", "0x72c246de", "0x2c941900", - "0x557eede", "0x1580496f", "0x3a3ea77b", "0x54f3f271", "0xf49b029", "0x47872fe1", "0x221e2e36", "0x1ab7202e", - "0x487779a6", "0x3851c9d8", "0x38dc17c0", "0x209f8849", "0x268dcee8", "0x350c48da", "0x5b9ad32e", "0x523272b", - "0x3f89055b", "0x1e894b2", "0x13ddedde", "0x1b2ef334", "0x7507d8b4", "0x6ceeb94e", "0x52eb6ba2", "0x50642905", - "0x5453f3f", "0x6349efc", "0x6922787c", "0x4bfff9c", "0x768c714a", "0x3e9ff21a", "0x15737c9c", "0x2229c807", - "0xd47f88c", "0x97e0ecc", "0x27eadba0", "0x2d7d29e4", "0x3502aaa0", "0xf475fd7", "0x29fbda49", "0x18afffd", - "0x315b618", "0x6d4497d1", "0x1b171d9e", "0x52861abd", "0x2e5d0501", "0x3ec8646c", "0x6e5f250a", "0x148ae8e6", - "0x17f5fa4a", "0x3e66d284", "0x51aa3b", "0x483f7913", "0x2cfe5f15", "0x23427ca", "0x2cc78315", "0x1e36ea47", - "0x5a8053c0", "0x693be639", "0x3858867d", "0x19334f6b", "0x128f0fd8", "0x4e2b1ccb", "0x61210ce0", "0x3c318939", - "0xb5b2f22", "0x2edb11d5", "0x213effdf", "0xcac4606", "0x241af16d", "0x7290a80d", "0x6f7e5329", "0x598ec8a8", - "0x76a859a0", "0x6559e868", "0x657b83af", "0x13271d3f", "0x1f876063", "0xaeeae37", "0x706e9ca6", "0x46400cee", - "0x72a05c26", "0x2c589c9e", "0x20bd37a7", "0x6a2d3d10", "0x20523767", "0x5b8fe9c4", "0x2aa501d6", "0x1e01ac3e", - "0x1448bc54", "0x5ce5ad1c", "0x4918a14d", "0x2c46a83f", "0x4fcf6876", "0x61d8d5c8", "0x6ddf4ff9", "0x11fda4d3", - "0x2933a8f", "0x170eaf81", "0x5a9c314f", "0x49a12590", "0x35ec52a1", "0x58eb1611", "0x5e481e65", "0x367125c9", - "0xeba33ba", "0x1fc28ded", "0x66399ad", "0xcbec0ea", "0x75fd1af0", "0x50f5bf4e", "0x643d5f41", "0x6f4fe718", - "0x5b3cbbde", "0x1e3afb3e", "0x296fb027", "0x45e1547b", "0x4a8db2ab", "0x59986d19", "0x30bcdfa3", "0x1db63932", - "0x1d7c2824", "0x53b33681", "0x673b747", "0x38a98a3", "0x2c5bce60", "0x351979cd", "0x5008fb73", "0x547bca78", - "0x711af481", "0x3f93bf64", "0x644d987b", "0x3c8bcd87", "0x608758b8"}; - - static const std::string mds_matrix_16[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_16[] = { - "0xa632d95", "0x6db657b8", "0x56fbdc9f", "0x52b3d8b", "0x33745202", "0x5c03108d", "0xbeba37c", "0x258c2e8c", - "0x12029f3a", "0x694909cf", "0x6d231725", "0x21c3b223", "0x3c0904a6", "0x1d6acdb", "0x27705c84", "0x5231c803"}; - - int full_rounds_20 = 8; - int half_full_rounds_20 = 4; - int partial_rounds_20 = 18; - int alpha_20 = 7; - - static const std::string rounds_constants_20[] = { - "0x30cd4497", "0x67cf7d92", "0x113ca786", "0x28f511f7", "0x4c850311", "0x3dc07be8", "0xc8214b9", "0x18090d97", - "0x684f35fb", "0x11eeba68", "0x567d0ca7", "0x6d3fbebc", "0x47028460", "0x9a8d433", "0x46bc5d5c", "0x110805b2", - "0x50dddc82", "0x1ee4fa", "0x55ed4719", "0x4708bdce", "0x1a530b2b", "0x6d372400", "0x32101d42", "0x2b0d7d0", - "0x3064f512", "0x670f3c64", "0x35735e31", "0x5a2b6144", "0x210d6ba6", "0x1274e66a", "0x212e3e09", "0x57e62ff0", - "0x6b631874", "0x6b577a1b", "0xd17fdaa", "0x24ebe81b", "0x34f6c9fe", "0x591d5a55", "0x5f45a942", "0x5e454f3f", - "0x23b75633", "0x55076170", "0x3caa9482", "0x6a2cbf00", "0x7224801b", "0x74bb2d64", "0x2e6d0990", "0x23eab921", - "0x663603a8", "0x3e8e97f", "0x4db5d3d", "0x64c1e827", "0x37c478fe", "0x35efc805", "0x555aaef9", "0x6563ad0c", - "0x14c9aeac", "0x16d6e172", "0x424fcbe9", "0x30380855", "0x74d4e5bf", "0x1275ba83", "0x56f32a2d", "0x3cf97f89", - "0x440c5711", "0x48687e8a", "0x496600f8", "0xb0e429f", "0x154b1e26", "0x379bb8ce", "0x277683e5", "0x4403e094", - "0x12033240", "0x3bd006d7", "0x4ee6ee1b", "0x62c6764c", "0x7230552f", "0x4f341de7", "0x3c8f8c49", "0x6fc6bee2", - "0xa3ef74d", "0x23710107", "0x24650c82", "0x12baebd4", "0x46c2f3ce", "0x57816fd9", "0x443fe51c", "0x2a7805ab", - "0x3f508ef1", "0x150b836c", "0x1c014ffa", "0x1c0786be", "0x10645190", "0x607b9c0a", "0x48961505", "0x6f20b7bb", - "0x5b5aea23", "0x1fe5355c", "0x27ef98aa", "0x43e120b", "0x647d5ccd", "0x455c81b2", "0x6ac27d3f", "0x279f6126", - "0x76a15758", "0x58c1b0a6", "0x4af83901", "0x45641d4f", "0x1dfe8c33", "0x3720c88", "0x3482d40d", "0x770d8960", - "0x6108b730", "0x63fc084", "0x96e2a34", "0x130514a0", "0x42bc3eff", "0x43775848", "0x702960e4", "0x6cf19c79", - "0x4c3030dd", "0x6dd27932", "0x64350de9", "0x480e8311", "0x6a22632c", "0x2814bcf6", "0x117197e3", "0x4844d419", - "0x76e181a6", "0x6155d7b4", "0x42dbed26", "0x62e9c27b", "0x105b4f11", "0x51d45858", "0x33fa0298", "0x26a08228", - "0x5f14581f", "0x3bd89737", "0x2325968f", "0x418512ba", "0x2f47442f", "0xe680af5", "0xc424cba", "0x6d3885ae", - "0xa9c8cbe", "0x2485f2a9", "0x1f99357f", "0xf58d531", "0x32d6f6b1", "0x2c26876d", "0x2de3d38e", "0x5a7b6cc9", - "0x1caec7f0", "0x4aa1f575", "0x77af0ccd", "0x19d3be5c", "0xaa619d8", "0x4cfea78", "0xdb3ab76", "0x2ddffaa3", - "0x52246767", "0x50d7f018", "0x318ceb9f", "0x2e69a506", "0x4bd9d1fa", "0x2a0b579a", "0x561238c2", "0x2877bb9a", - "0x6ed2c79", "0x229998ba", "0x737f0185", "0x609aad31", "0x2cee3551", "0x4434bd17", "0x1da8546f", "0x3532fbe6", - "0x2637b96d", "0x2b04084"}; - - static const std::string mds_matrix_20[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_20[] = { - "0x60531da4", "0x332932dc", "0x61f05e58", "0x614050f9", "0x4323c6de", "0x10b33548", "0x5e5ce1d9", - "0x19a24086", "0x3c697e94", "0x365de6ba", "0x71f95069", "0x350c9229", "0x3883d126", "0x51502e2f", - "0x1a4a8175", "0x1e081b3", "0x54c1086b", "0x1253bc2b", "0x50599b35", "0x25b97c4"}; - - int full_rounds_24 = 8; - int half_full_rounds_24 = 4; - int partial_rounds_24 = 21; - int alpha_24 = 7; - - static const std::string rounds_constants_24[] = { - "0xfa20c37", "0x795bb97", "0x12c60b9c", "0xeabd88e", "0x96485ca", "0x7093527", "0x1b1d4e50", "0x30a01ace", - "0x3bd86f5a", "0x69af7c28", "0x3f94775f", "0x731560e8", "0x465a0ecd", "0x574ef807", "0x62fd4870", "0x52ccfe44", - "0x14772b14", "0x4dedf371", "0x260acd7c", "0x1f51dc58", "0x75125532", "0x686a4d7b", "0x54bac179", "0x31947706", - "0x29799d3b", "0x6e01ae90", "0x203a7a64", "0x4f7e25be", "0x72503f77", "0x45bd3b69", "0x769bd6b4", "0x5a867f08", - "0x4fdba082", "0x251c4318", "0x28f06201", "0x6788c43a", "0x4c6d6a99", "0x357784a8", "0x2abaf051", "0x770f7de6", - "0x1794b784", "0x4796c57a", "0x724b7a10", "0x449989a7", "0x64935cf1", "0x59e14aac", "0xe620bb8", "0x3af5a33b", - "0x4465cc0e", "0x19df68f", "0x4af8d068", "0x8784f82", "0xcefdeae", "0x6337a467", "0x32fa7a16", "0x486f62d6", - "0x386a7480", "0x20f17c4a", "0x54e50da8", "0x2012cf03", "0x5fe52950", "0x9afb6cd", "0x2523044e", "0x5c54d0ef", - "0x71c01f3c", "0x60b2c4fb", "0x4050b379", "0x5e6a70a5", "0x418543f5", "0x71debe56", "0x1aad2994", "0x3368a483", - "0x7a86f3a", "0x5ea43ff1", "0x2443780e", "0x4ce444f7", "0x146f9882", "0x3132b089", "0x197ea856", "0x667030c3", - "0x2317d5dc", "0xc2c48a7", "0x56b2df66", "0x67bd81e9", "0x4fcdfb19", "0x4baaef32", "0x328d30a", "0x6235760d", - "0x12432912", "0xa49e258", "0x30e1b70", "0x48caeb03", "0x49e4d9e9", "0x1051b5c6", "0x6a36dbbe", "0x4cff27a5", - "0x1da78ec2", "0x730b0924", "0x3eb56cf3", "0x5bd93073", "0x37204c97", "0x51642d89", "0x66e943e8", "0x1a3e72de", - "0x70beb1e9", "0x30ff3b3f", "0x4240d1c4", "0x12647b8d", "0x65d86965", "0x49ef4d7c", "0x47785697", "0x46b3969f", - "0x5c7b7a0e", "0x7078fc60", "0x4f22d482", "0x482a9aee", "0x6beb839d", "0x32959ad", "0x2b18af6a", "0x55d3dc8c", - "0x43bd26c8", "0xc41595f", "0x7048d2e2", "0xdb8983", "0x2af563d7", "0x6e84758f", "0x611d64e1", "0x1f9977e2", - "0x64163a0a", "0x5c5fc27b", "0x2e22561", "0x3a2d75db", "0x1ba7b71a", "0x34343f64", "0x7406b35d", "0x19df8299", - "0x6ff4480a", "0x514a81c8", "0x57ab52ce", "0x6ad69f52", "0x3e0c0e0d", "0x48126114", "0x2a9d62cc", "0x17441f23", - "0x485762bb", "0x2f218674", "0x6fdc64a", "0x861b7f2", "0x3b36eee6", "0x70a11040", "0x4b31737", "0x3722a872", - "0x2a351c63", "0x623560dc", "0x62584ab2", "0x382c7c04", "0x3bf9edc7", "0xe38fe51", "0x376f3b10", "0x5381e178", - "0x3afc61c7", "0x5c1bcb4d", "0x6643ce1f", "0x2d0af1c1", "0x8f583cc", "0x5d6ff60f", "0x6324c1e5", "0x74412fb7", - "0x70c0192e", "0xb72f141", "0x4067a111", "0x57388c4f", "0x351009ec", "0x974c159", "0x539a58b3", "0x38c0cff", - "0x476c0392", "0x3f7bc15f", "0x4491dd2c", "0x4d1fef55", "0x4936ae3", "0x58214dd4", "0x683c6aad", "0x1b42f16b", - "0x6dc79135", "0x2d4e71ec", "0x3e2946ea", "0x59dce8db", "0x6cee892a", "0x47f07350", "0x7106ce93", "0x3bd4a7a9", - "0x2bfe636a", "0x430011e9", "0x1cd66a", "0x307faf5b", "0xd9ef3fe", "0x6d40043a", "0x2e8f470c", "0x1b6865e8", - "0xc0e6c01", "0x4d41981f", "0x423b9d3d", "0x410408cc", "0x263f0884", "0x5311bbd0", "0x4dae58d8", "0x30401cea", - "0x9afa575", "0x4b3d5b42", "0x63ac0b37", "0x5fe5bb14", "0x5244e9d4"}; - - static const std::string mds_matrix_24[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_24[] = { - "0x409133f1", "0x1667a8a2", "0x6a6c7b7", "0x6f53160f", "0x273b11d2", "0x3176c5e", "0x72f9bbfa", "0x73ceba92", - "0x5cdef81e", "0x1393286", "0x46daee07", "0x65d7ba7", "0x52d72d70", "0x5dd05e1", "0x3bab4b64", "0x6ada3843", - "0x2fc5fbed", "0x770d61b1", "0x5715aaea", "0x3ef0e91", "0x75b6c771", "0x242adf60", "0xd0ca4d", "0x36c0e389"}; - -} // namespace poseidon2_constants_babybear +int full_rounds_2 = 12; +int half_full_rounds_2 = 6; +int partial_rounds_2 = 24; +int alpha_2 = 7; + +static const std::string rounds_constants_2[] = { + "0x496e51f7", + "0x3b852d97", + "0x65ba8e68", + "0x2343a6e6", + "0x676c3489", + "0x541ef7dd", + "0x212ef216", + "0x162baeaf", + "0x4a4bd455", + "0x11e9d456", + "0x1fed11a4", + "0x5d6b800f", + "0x28ae336a", + "0xc47274b", + "0x1470aec", + "0x151e4376", + "0x4da62b63", + "0xe0954d8", + "0x3dcd4061", + "0x30886148", + "0x68785d3b", + "0x335ab08f", + "0x6c7fd1b5", + "0x39fb5f79", + "0xb838c9b", + "0x274ef903", + "0x31e0c277", + "0x6faa6ba7", + "0x5e9c5053", + "0x3f164fd4", + "0x3491d3c3", + "0x98e7f05", + "0xdcab970", + "0x24a953a7", + "0x6548a9e6", + "0x1f208622", + "0x45d3f963", + "0x457524d", + "0xb98477", + "0x72ad1b94", + "0x240c67d6", + "0x44abde5", + "0x45b04867", + "0xdb23d07", + "0x69a97a62", + "0x539c81ff", + "0x1813c6d6", + "0x7cb2342" +}; + +static const std::string mds_matrix_2[] = { + "0xffffffe", "0x7ffffff", + "0x7ffffff", "0xffffffe" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0xffffffe", "0x17fffffd" +}; + + +int full_rounds_3 = 12; +int half_full_rounds_3 = 6; +int partial_rounds_3 = 17; +int alpha_3 = 7; + +static const std::string rounds_constants_3[] = { + "0xd4814b5", + "0x69deda63", + "0x4f226d6f", + "0x19441d8c", + "0x2c14d16b", + "0x18dfac7", + "0x58dc30e0", + "0x45a6ea1c", + "0x613b0b96", + "0x8d6424d", + "0x173ab933", + "0x59965877", + "0x1074b09f", + "0x25170689", + "0x65155d9a", + "0x19c7d746", + "0x21f7f5de", + "0x1b1c6a8a", + "0x27107756", + "0x2b3e6f83", + "0x4c87326", + "0x362ab098", + "0x7425bd01", + "0x2cbfab69", + "0x682fca5a", + "0x4787d0e7", + "0x2a734b17", + "0x4c01a7ac", + "0x2f137475", + "0x266fb11b", + "0x57d713b7", + "0x507b1954", + "0x16e13c43", + "0x2d1a62cd", + "0x6101cb41", + "0x23e1b5ea", + "0x26f4e7ba", + "0x5166c7e8", + "0x6aabb1ff", + "0x17c7f248", + "0x5e539ef4", + "0x30499a4f", + "0x5ffff22c", + "0x34cc47e5", + "0x75e87289", + "0x30f2852b", + "0xe68769b", + "0x6607ba00", + "0x11a03cd0", + "0x2503985a", + "0x4e4cbfaf", + "0xd86f0b3", + "0x29e16ad6" +}; + +static const std::string mds_matrix_3[] = { + "0xffffffe", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0xffffffe", "0x7ffffff", + "0x7ffffff", "0x7ffffff", "0xffffffe" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0xffffffe", "0xffffffe", "0x17fffffd" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 21; +int alpha_4 = 7; + +static const std::string rounds_constants_4[] = { + "0x231d3818", + "0x549c1e4", + "0x4b2a9a32", + "0x505c4e03", + "0x2a4bb828", + "0x1ec8d500", + "0x68381501", + "0x6393aa37", + "0x6e85e4ec", + "0x2be33fd", + "0x4fc27ed4", + "0x75cc9277", + "0x87205ee", + "0x3107a749", + "0x3548632c", + "0x488627bd", + "0x72e43dc4", + "0x44ef63c8", + "0x28d9f4f7", + "0x4f30a38d", + "0x2b8f68cd", + "0x14bc4649", + "0x59d96ce4", + "0x53f56473", + "0x3b53d43d", + "0x483ffff1", + "0x7620f827", + "0x44b4c98e", + "0xde7d1bf", + "0x5b8f0b34", + "0x4f468962", + "0x2eea20c2", + "0x7239cbb0", + "0x2b1585a9", + "0x35d223dd", + "0x61c8bb5b", + "0x4c188d2c", + "0x620b1a8", + "0x4e7b8ec2", + "0x72ea25d", + "0x1909aebb", + "0xa8a9c8f", + "0x1edb26d1", + "0x6eb9fbb", + "0x2f2fa249", + "0x5db72881", + "0x42b1865", + "0x20f3c4d0", + "0x2fe5b0e7", + "0x1c39acee", + "0x5984234b", + "0x39c53f94", + "0x16423423" +}; + +static const std::string mds_matrix_4[] = { + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0x76ab450a", "0x1774e7df", "0x51a1c9ed", "0x14f249e6" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 12; +int alpha_8 = 7; + +static const std::string rounds_constants_8[] = { + "0x153c368b", + "0x4759f47c", + "0x66a6822", + "0x4c72ead8", + "0x6c89156e", + "0x6757cd8a", + "0xe7387b2", + "0x349d93b2", + "0x629c8308", + "0x55d7a1b3", + "0x1a097200", + "0x15d25f70", + "0x5af421b0", + "0x46c04d8f", + "0x4eb81c25", + "0x253a662f", + "0x433b95a6", + "0x77ec55ef", + "0x57bcbdbb", + "0xa2e1808", + "0x5aac99bf", + "0x6e899d98", + "0x18cbb092", + "0xac93f5b", + "0x6c5a5dba", + "0x748b1397", + "0x6a88a0f5", + "0x5096fdab", + "0x134925f4", + "0x5845f68f", + "0x5217ca9e", + "0x1c7a6aa9", + "0xe7e2936", + "0x5354bccc", + "0x247200ec", + "0x5df6d291", + "0x4f7a15c0", + "0x317b1aa", + "0x3c459cb7", + "0x373b088b", + "0x1a754739", + "0x208ec4f7", + "0x3d1cd649", + "0x45752166", + "0x37e9a548", + "0x36420f", + "0x2bd07867", + "0x5a7bd451", + "0x2fa93747", + "0x6115a44a", + "0x27245197", + "0x1957b37c", + "0x6602e3b8", + "0x2ea0bb6c", + "0x2bfc5ee3", + "0x59acc709", + "0x327ffe04", + "0x23838954", + "0xd58c14", + "0x477a3061", + "0x317d7bef", + "0x94ab60d", + "0x50cec3d0", + "0x6c9ea48c", + "0x19bb558e", + "0x35fc3d94", + "0x59aae9ff", + "0x6dd1875", + "0x4994dbee", + "0x1b7ee587", + "0x188f77a6", + "0x390d88c8", + "0xfbce9af", + "0x72c6fa67", + "0x2767df5e", + "0x1e0b023f" +}; + +static const std::string mds_matrix_8[] = { + "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x6c9297c", "0x772908f", "0x566b5241", "0x4a0a2766", "0x914c606", "0x4962057", "0x583a9a4a", "0x74c3f8c8" +}; + + +int full_rounds_12 = 8; +int half_full_rounds_12 = 4; +int partial_rounds_12 = 10; +int alpha_12 = 7; + +static const std::string rounds_constants_12[] = { + "0x3e959e5f", + "0x30cb6e1a", + "0x3130ca47", + "0x6a32ca18", + "0x408f618a", + "0x13450dad", + "0x1fcea71a", + "0x4ea0772b", + "0x3314ee9a", + "0x26459d7f", + "0x1218fbcd", + "0x13e02ae", + "0x6ec0bd28", + "0x67a7f357", + "0x61bc0376", + "0x2c36cf9b", + "0x1f2bdf32", + "0x41d7d463", + "0x6b28cf6c", + "0x35020827", + "0x304af3ac", + "0x6a128b25", + "0x5045ad17", + "0x277449ac", + "0x2c407d4", + "0x62bf8150", + "0x944385", + "0x30b517c7", + "0x35db714d", + "0x39022f3a", + "0xdd040e4", + "0xb8487f5", + "0x5296b7c", + "0x6dfda9e1", + "0xf36d1db", + "0x184fa118", + "0x2de5e27b", + "0x736c2498", + "0x1f51d1d3", + "0x6b6f1298", + "0x2d4ab60b", + "0x1098733c", + "0x35005ddd", + "0x6d5d8a79", + "0x49065f9c", + "0x1d6893e6", + "0x5f7602c6", + "0x4e223b11", + "0x5053c4ed", + "0x5b503b15", + "0x4181f3bf", + "0xe4006c8", + "0x39632663", + "0x91d94da", + "0x1707d98f", + "0x6a0b9d68", + "0x3b33a8cf", + "0x1444b261", + "0x3945ae23", + "0x59fdab7e", + "0x525a5f97", + "0x5829916", + "0x5a81dedf", + "0x1235a704", + "0xdf6cbc4", + "0x354e7336", + "0x5bb3b865", + "0x629401c2", + "0x5ca537c6", + "0x16d221ef", + "0x25da952", + "0x134f7b18", + "0x17b6948e", + "0x3011bc30", + "0x6e3ccb8", + "0x67f189f2", + "0x32379101", + "0x6827af73", + "0x2dc6e153", + "0x3edb57c0", + "0x3bd959aa", + "0x2798d578", + "0x9bda854", + "0x701aac1b", + "0x5859e3d1", + "0x34ddfd1d", + "0x4f273574", + "0x2fa9f707", + "0x95be3f9", + "0x3b8d9fd5", + "0x46e35bb1", + "0x67bceafb", + "0x49b3af0f", + "0x1c457189", + "0x772232f", + "0x1ebd6b95", + "0x620166f4", + "0x602ef282", + "0x292717b8", + "0x7463c896", + "0x15c32ab7", + "0x6854697c", + "0x46d776a5", + "0x5273b1d8", + "0x34a83245", + "0x6eabc1f5" +}; + +static const std::string mds_matrix_12[] = { + "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4" +}; + +static const std::string partial_matrix_diagonal_12[] = { + "0xce7a912", "0x5b05543d", "0x4a698615", "0x5898f5a4", "0x6c0ce274", "0x1632c276", "0x4cea262c", "0x60de8ee3", "0x77ddd936", "0x6534087b", "0x1918cb9b", "0x1db85c3f" +}; + + +int full_rounds_16 = 8; +int half_full_rounds_16 = 4; +int partial_rounds_16 = 13; +int alpha_16 = 7; + +static const std::string rounds_constants_16[] = { + "0x2f26b49c", + "0x749c2ef8", + "0x30eede9d", + "0xdca08c0", + "0x62906bbf", + "0x6523c014", + "0x75972be2", + "0x8731889", + "0x5a4cdf14", + "0x110c2bd", + "0x61df4d5c", + "0x5562309a", + "0x17b1663b", + "0x1bb41133", + "0x4b9b8a72", + "0x6b80eebf", + "0x1ab3c283", + "0x33ed0692", + "0x1b598045", + "0x2d33b2e6", + "0x5ee0345f", + "0x176a5cf6", + "0x4e49c96a", + "0xa852b8e", + "0x143aa4f5", + "0x1df6d8dc", + "0x32cf0247", + "0x23011eb8", + "0x4b2ad497", + "0x4bce2948", + "0x278d6b10", + "0x2a3fd440", + "0x2260cd9b", + "0x1161788d", + "0x47db3b39", + "0x2aeeef5a", + "0x498c53f7", + "0x5334207", + "0x411e6a05", + "0x3b8f2aa4", + "0x29d55d49", + "0x35dff038", + "0xd6be289", + "0x677a7dfd", + "0x17749f56", + "0x1fb3de0a", + "0x3b379fb3", + "0xe5aaaae", + "0x24b5a42b", + "0x63729145", + "0x431a8b14", + "0x77f97d16", + "0x1e8bb666", + "0x5d081d6c", + "0x62452dd5", + "0x12167f0b", + "0x1e711729", + "0x15703085", + "0x4fa8e406", + "0x52ef7edc", + "0x1801bcb7", + "0x4da63bf6", + "0x703c40fc", + "0x4fc56c82", + "0x7771e23", + "0xfc01b80", + "0x2be5d6f3", + "0x1d1e9a39", + "0x7434335f", + "0x5c9ed03a", + "0x4065479b", + "0x4fcb295e", + "0xbe300ed", + "0x46054251", + "0x6c8999be", + "0x1a7b710b", + "0x117cdc59", + "0x1dcc198d", + "0x912da80", + "0x1078c392", + "0x496e8f57", + "0x13e45d70", + "0x33c0849c", + "0x639202f1", + "0x5e5e8820", + "0x5456bda4", + "0x20128c1d", + "0x75110348", + "0x6dbb5973", + "0x28b28c25", + "0x1d1408e8", + "0x1ebeadce", + "0x65862b4f", + "0x2e556d0e", + "0x5a83313f", + "0x2ffe3736", + "0xa5d14fc", + "0x74e8e0f5", + "0x5207dc7c", + "0x48c5b2f1", + "0x12de7f83", + "0x3fa13e1b", + "0x2cd8891", + "0x64cf5031", + "0x2540d29b", + "0x3f67cd55", + "0xf596502", + "0x1763e56", + "0x767b639a", + "0x29275fef", + "0x736ece85", + "0x3dedb591", + "0x4a737e", + "0x6e1f689e", + "0x512f5c15", + "0x5a67bac3", + "0x2a25389b", + "0x69a48948", + "0x3d13deab", + "0x51445ed7", + "0x3eae268c", + "0x37c11625", + "0xbcd21f9", + "0x5d760c4b", + "0x7079ec18", + "0x186e7a91", + "0x40355b9", + "0x704eb1ee", + "0x8ca1fc", + "0x6eb84e67", + "0x711e2b71", + "0x2c38f6ca", + "0x58af23df", + "0x375c4ae2", + "0x42a115ed", + "0x3de25b3d", + "0xf5ab6ef", + "0x642f33db", + "0x1d02908f", + "0x2f6ae082", + "0x51093af9" +}; + +static const std::string mds_matrix_16[] = { + "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4" +}; + +static const std::string partial_matrix_diagonal_16[] = { + "0xceb8b1d", "0x3af93c0a", "0x73379d36", "0x3a7c8b28", "0x211d8665", "0x75da9905", "0x3348eb38", "0x67f3018e", "0x4cca00d4", "0x27b217ad", "0x4b964db8", "0xbfc0eca", "0x2ff66172", "0x2e09f24a", "0x4dee8c41", "0x40536eed" +}; + + +int full_rounds_20 = 8; +int half_full_rounds_20 = 4; +int partial_rounds_20 = 18; +int alpha_20 = 7; + +static const std::string rounds_constants_20[] = { + "0x3f1d8f9", + "0x6144cf66", + "0x59d2b2d", + "0x1c4fecd7", + "0x46610dcd", + "0x76219df9", + "0x2a8726e", + "0x6e5cbe4f", + "0x40bc933a", + "0x14df392b", + "0x1bbee171", + "0x5377bd17", + "0x344194f0", + "0x1db250db", + "0x6c8c6939", + "0x55d54f43", + "0x51be03bb", + "0x67df0bc3", + "0xc583cb3", + "0x743af148", + "0x4bebafd3", + "0x2b80eaac", + "0x22997a65", + "0x5213bef", + "0x74611cbb", + "0x4a11e1b9", + "0x1efc6855", + "0x7d1ba63", + "0x74be7c1d", + "0x14501b4b", + "0x549b7991", + "0x3a3daabd", + "0xd742a30", + "0x6d808ed4", + "0x3a088b07", + "0x9df75b", + "0x57814aae", + "0x58f1c1c9", + "0x5a605c88", + "0x3b71cd9c", + "0x29e71b86", + "0x254d75f0", + "0x274a0c43", + "0x5ebf3446", + "0x263f775c", + "0x637c9c64", + "0xe7aa078", + "0x11b04b99", + "0x6af995b5", + "0x4bd45c46", + "0xad1beae", + "0x54867fd8", + "0x1483c336", + "0x4e77b32f", + "0xcf49ab3", + "0x5bd9f217", + "0x49d389f4", + "0xfa353cb", + "0x11447bd5", + "0x5491082f", + "0x63612d14", + "0x744f390f", + "0x7340e416", + "0x4ef5de5e", + "0x4f6a4dcd", + "0x52c3bd4c", + "0x41b5544e", + "0x44350e46", + "0x59497972", + "0x3caf3ae1", + "0xde7fbd9", + "0x6f7354b9", + "0x64c96401", + "0x332be8", + "0x3bd6797e", + "0x5ea3c617", + "0x4632d858", + "0x2b842460", + "0x1766e1d5", + "0x28c59acc", + "0x25122b6a", + "0xa32210a", + "0x212dd087", + "0x1c056ada", + "0x6c856259", + "0x3aa9224d", + "0x1f334fe3", + "0x12b32d28", + "0x3c76df00", + "0x698d51b0", + "0x4a20bbc3", + "0x521a1af2", + "0x4683ed45", + "0x6115bff7", + "0x6a931cc9", + "0x1976b37e", + "0x168df531", + "0x55fa71c1", + "0x4d66d4a1", + "0x2379865b", + "0x6ccf9d05", + "0x4603b9ee", + "0x461f7a69", + "0x65bc652e", + "0x1976093d", + "0x595387d9", + "0x50084bbc", + "0x65fb9c7a", + "0x28018c97", + "0x4c5325d6", + "0x4ffcfbaf", + "0x2102a0ac", + "0x407f3c9b", + "0x1155990d", + "0xdf0e40d", + "0x33b65067", + "0x38d0cde0", + "0x38093b70", + "0x605c6575", + "0x5bcb14d6", + "0x3ebb879e", + "0x52db3a77", + "0x551cbdf8", + "0x7323b878", + "0x6eca40e4", + "0x453f3672", + "0x5564b353", + "0x3ae9c86f", + "0x393197d9", + "0x482cf7ca", + "0x58af030c", + "0x267e1f7e", + "0x2e8d8988", + "0x40b7193d", + "0x688eec2c", + "0x16cc41f8", + "0x5a94f758", + "0x402a0960", + "0x282929b", + "0x1a1cb8d4", + "0xd91d968", + "0x58a21673", + "0x42ec7af6", + "0x3b7f716a", + "0x74ae58d0", + "0x290ab8e6", + "0x764b82ad", + "0x17a13ebb", + "0x29c55f44", + "0x28e7f815", + "0x1f0cfc36", + "0x777c58c5", + "0x3967b345", + "0x10644f84", + "0x5658c0", + "0x24737938", + "0x54a428b4", + "0x4addf4d6", + "0x71627c50", + "0x771116cb", + "0x6861b3d8", + "0x41c4553d", + "0x33256b13", + "0x67e3ee9", + "0x2f17a890", + "0x1b271a07", + "0x6430d488", + "0x74d59e4c", + "0x109c9d5d", + "0x5317e5a1", + "0x4cddc40", + "0x48f49c9a", + "0x2812fa55", + "0x3f3f364f", + "0x685d83cf", + "0x37411572", + "0x373c0704", + "0x6d21dd52" +}; + +static const std::string mds_matrix_20[] = { + "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4" +}; + +static const std::string partial_matrix_diagonal_20[] = { + "0x7140f175", "0x516da79f", "0x578823e8", "0x6043ede7", "0x18625f14", "0x162fc72b", "0x358a8b3", "0x34a843b6", "0x578f78fd", "0x6023d18", "0x366d881a", "0x276a0ec4", "0x33b7a972", "0x19441302", "0x63f4cb40", "0x3dff75a8", "0x2d987f8f", "0x74737b8f", "0x324b162f", "0x257c2aeb" +}; + + +int full_rounds_24 = 8; +int half_full_rounds_24 = 4; +int partial_rounds_24 = 21; +int alpha_24 = 7; + +static const std::string rounds_constants_24[] = { + "0xf53262c", + "0x67e8d182", + "0x2bf98d38", + "0x859c3ad", + "0x3dfb2d07", + "0x107eb63d", + "0x313f0bc", + "0x6c22058c", + "0x182a33e5", + "0x4f44d0e8", + "0x5c2e6f9c", + "0x6d3e8793", + "0x4cf5458d", + "0x1adef771", + "0x5e694c57", + "0x5faddfb9", + "0x222b8dc9", + "0x74e00d67", + "0x5f6bf19f", + "0x56979d81", + "0x731fa522", + "0x309fad5c", + "0x159f31a2", + "0x31d5ee9", + "0x63c28b7e", + "0x4aa8df68", + "0x3d9f7d74", + "0xb352d14", + "0x610cd60", + "0x3d9c8d6f", + "0x317be7ca", + "0xf708992", + "0x3ad176ee", + "0x86a631a", + "0x6c54eccd", + "0x71903fc4", + "0x6e7a38f8", + "0x76f7fb0a", + "0x1a6bcc77", + "0x41008ac8", + "0x16d8d5da", + "0x2ba371a1", + "0x5e15e435", + "0x2ed3b171", + "0x5cb82567", + "0x4020c16c", + "0x28a87c09", + "0x391c1eb1", + "0x170ae214", + "0x36467079", + "0x4807aa3d", + "0x2ef722a9", + "0x23356be", + "0x162b0c60", + "0x119f7dc7", + "0x2abc6361", + "0x43d2b6f0", + "0xcdc483a", + "0x15721392", + "0x5c9cddb", + "0x61b63a57", + "0x75aaf8c0", + "0x70632e9d", + "0x55836569", + "0x2eaa895b", + "0x18dae9a0", + "0x365a6f7", + "0x734a3285", + "0x321c8451", + "0x5689dfa6", + "0x4b8b8f63", + "0x4129fb31", + "0x67d4deb2", + "0x4b0c889a", + "0x3951a214", + "0x45fb722d", + "0x2a33a198", + "0x385aa19", + "0x5cce3b61", + "0x42bb87ba", + "0x32913e05", + "0x4303f6c6", + "0x3b85781d", + "0x5157fdf8", + "0x4ae0053c", + "0x6f49ab88", + "0x44a14107", + "0x6f3e7105", + "0x34852987", + "0x2d068609", + "0x2cbdc09a", + "0x3a5ac10f", + "0x312e0680", + "0x4697c6a5", + "0x76b46af3", + "0x75dec4a7", + "0x185e56a9", + "0x2d498fdb", + "0x51c5897", + "0x460743cb", + "0x3532e182", + "0x392ebe5e", + "0x2a3a623d", + "0x401a79c", + "0x37bd201a", + "0x6bbc8d9c", + "0x9547596", + "0x24619e59", + "0x735d6d74", + "0x4122e08e", + "0x6bc3e7e9", + "0x4495c5be", + "0x455a287b", + "0x50077b57", + "0x4b9694cc", + "0xb05c125", + "0x4e2a6d1", + "0x2ca0b16a", + "0x6207cd6e", + "0x74735906", + "0x27bec592", + "0x22ed7e8a", + "0x283adacc", + "0x3715d3b9", + "0x522d7360", + "0x3a1d607a", + "0x18692e00", + "0x764b3bdd", + "0x5d3d9ff7", + "0x5d77b918", + "0xceca4ee", + "0x59f1a46d", + "0x4a804dc3", + "0x2850cd74", + "0x1c3d1e8d", + "0x1466ec2a", + "0x1095087f", + "0x414a203d", + "0x4a7c747b", + "0x360a00bb", + "0x15d10215", + "0x131f9874", + "0x28b525a", + "0x1f2ecdb9", + "0x72d5fd18", + "0x45ba1b41", + "0x288ae83a", + "0x1f0f3bcb", + "0x18d678a5", + "0x3fdcbb79", + "0x2afcb40a", + "0x1d305d65", + "0x32fa8c64", + "0x1f3e879f", + "0x271949ee", + "0x5414d10e", + "0x80679d7", + "0x68d44611", + "0x44deaff0", + "0x2eeced5f", + "0x6914ed0b", + "0x5dc03838", + "0x12eadfe0", + "0x17f45377", + "0xe71958d", + "0x14555ff1", + "0x1e3f312f", + "0x2bfebc0b", + "0x77bba0e2", + "0x4bc9a955", + "0x334d3211", + "0x2af6e1cf", + "0x37665bd2", + "0x5e9dc6e", + "0x66d2d498", + "0x2437699b", + "0x1bd10d43", + "0x448cb57", + "0x1edbe0e3", + "0xdbbcd84", + "0x1b1e7cec", + "0x41fe9bec", + "0x48d09f49", + "0x12ebcb4a", + "0x5ae6dc96", + "0x7ac5349", + "0x45b1d67f", + "0x68256e07", + "0x3ce5ca1", + "0xb43c945", + "0x377034ba", + "0x702e3c1a", + "0x912c929", + "0x4088756f", + "0x17e13d6d", + "0x74449a4b", + "0x31789558", + "0x537772f7", + "0x56561a9f", + "0x52c3d792", + "0x6b23d111", + "0x7597e647", + "0x215a02f3", + "0x12a65d05", + "0x57343b30", + "0x1f648d01", + "0x2523e581", + "0x3c8869b2", + "0x75ab0b40", + "0x67be8d99", + "0x45aee2fa", + "0x41b59edb", + "0x703f0697" +}; + +static const std::string mds_matrix_24[] = { + "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", + "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x4ffffff6", "0x6ffffff2", "0xffffffe", "0x2ffffffa", + "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x3ffffff8", "0x5ffffff4", "0xffffffe", "0xffffffe", + "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0x7ffffff", "0x17fffffd", "0x27fffffb", "0x37fffff9", "0xffffffe", "0x2ffffffa", "0x4ffffff6", "0x6ffffff2", + "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0x7ffffff", "0x7ffffff", "0x1ffffffc", "0x2ffffffa", "0xffffffe", "0xffffffe", "0x3ffffff8", "0x5ffffff4" +}; + +static const std::string partial_matrix_diagonal_24[] = { + "0x6320d9ab", "0x1019f6cb", "0x68e7b382", "0x3140f98b", "0x26276476", "0x14b3d0ad", "0x255c044c", "0x3c78d299", "0x4cf0086a", "0xeb1ec3e", "0x6c6bcee9", "0x6935e282", "0x3fa302bd", "0x29bee8aa", "0x385a5a41", "0x66062a65", "0x2d0aaf04", "0x102cb00", "0x2b1c167f", "0x53cdce55", "0x52703c56", "0x116bde89", "0x37214a59", "0x1598a6e6" +}; + + +} // namespace poseidon2_constants_babybear { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_377_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_377_poseidon2.h index 67cd24f74..6927272ed 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_377_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_377_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef BLS12_377_POSEIDON2_H - #define BLS12_377_POSEIDON2_H +#define BLS12_377_POSEIDON2_H - #include +#include namespace poseidon2_constants_bls12_377 { @@ -11,390 +11,414 @@ namespace poseidon2_constants_bls12_377 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 37; - int alpha_2 = 11; - - static const std::string rounds_constants_2[] = { - "0x114e4b6b0e803c1a969645f7495cc94423c94e15f9a3936640041b662e95d54b", - "0x30a734bb9171c000f310c95cd946dc04c7e4bec3144c1cd22fc5bcf84780243", - "0x4f2eff729b5c8a810d972fc8ef728536e467db4b2bcd948f5d7ba200fb29e2b", - "0x3c328ea9b707e7ddab148e3c4989211704004b086f53d3c21a3457ef09ffe6", - "0xf5c98f9a2f3ed8299f455a36668e48dfeabede7712a1151123ca961e9be1e09", - "0x46d91fac24e691f479c5656ab590e7e8039340799843d37c573048444b585b7", - "0x1029929082d61f211c6b519fa4a1e991e0ec714e168277e3b163d79ed6050eba", - "0x4961140330e1032916f43b3b1fafaece2be35d29a8ca7ead486feb2150807a5", - "0x8d9b478912a4096232c1cbb746e3ed1f5782ed49cf2313a2a9a70d1e21be415", - "0xe3fe6503d502801b8940b6f62439f2152507178cd4a070b76d560faec1aa480", - "0xe1e40ce9c5b92e387fd94cd649e0ec6311065c5215491dd9fa088b4fc49fb79", - "0xdf373dd7cd905e8ce335c24c0d4faded2b9bfffc43d970c5d64af2a516737b0", - "0xae879af8a9ea868e1fbb503097cdae1214e5afb5c7d94c56119c51d79c0e5d8", - "0x971516cb84e54e42b4420619646d62507ef0bc9dac2b32e95ee926af6d0fb79", - "0xb3b8b3dff0a9545a5839ae831e1a0ca4b09a53e034644aec48bcb06c51bfa25", - "0xdd6b8944ce75b7cb6ae1092e9897d15f253e1962c85c2f50a68454f5ace7cf3", - "0xd0337a5ca85986807bc7944473101dc9ea9edce01ea1bce148682b2c2cf2b69", - "0x7821ab4d303449aadc1a057eecb208b8adc11fcc0cbb843a31f85e336374f58", - "0x514d5e9cc4932ac9418373a2f7c3999aad5d4fa02234c3018d6a2f2d5885a25", - "0x7d0f542ea401b320d04eb3694ff09961e0dfdfc4295074c9d8149f9ada2837c", - "0x6f88a10290ed0988a10da4b6e7891daa45954d8c4d983932060e8bf2dff1ef", - "0xb404e795e5eaaa3408a59332076af9ee2f9c80d26e47d0bbec6e510334ed81d", - "0x87e3c047e9528e0e9f876f17043a5791ea66bead850718a9b8f23b3088ee751", - "0xf8594d3b335179e9a24c4b666a86176cae89892c01d8b8cc3559542e546e86d", - "0x9f51d2d7c5f7079cd75c0e8c8853da54a693757ce12200b1930fa9d43288ce2", - "0x8baf396f95a2244fd3eeee5e539c5b92af4c0f3405cc98d7af61abda2a6dc00", - "0x3c6876d14cd05ffa2c9403f7bae8a3ff676032ac14dc0aacde98efbaafd0632", - "0xb1e50fb820be1e9be21ed74f6821c658551f06420f6b505823a4e763b6bb0ff", - "0x68a28708ef581ce8b16e96e967b6ff78d5b91d233db9abb7ca9e9dec19cdf43", - "0xde6e5518bb75099f16267042518f0189ace1d0c0621d3e0f8fdefca1017aa3a", - "0xa5aa23d706bc2a31e5856c99896a66b9bb542e5374b4d967adc33e1ce6c2ee3", - "0x6d843a76132120a213aedf8cd9a7c12c1f7e138c9a5500ecf28abcc91972210", - "0xe679d468ccf7455d9fece084995117c70f054ab8f25d53048306bc9ce7d3175", - "0xbe4d797e464d030a8f4db0dafbbc777e6fc93130b0043f3429b615dabdee60d", - "0x7e6d1f9c5d4c711953f46ace3c58eb9c3eff33cf0fa0e0cd922a8b3fd8d5346", - "0xe218de131a51881c346c467c678ebe3cddbffea05bf7e4c02ed0d17e25e435d", - "0x7a7732be6a3771a74e4f6b33daa40c9764a39fb5100f4d8b1d28fa57ae19cef", - "0x4000e38b3e5634e5504eaffcbb30eeea1d60cea3b2f61ef0e09ff992fa3a3e7", - "0xb4b369cf179c5e4b2aef8d47e253826e0323534ae17c53ce229a3a51df47b59", - "0xc773cc58e24de8602833bd16645402386297dbabf57c064feef7932cd765e4b", - "0x6692681bf29f777486bbd6c3443b45dfd992014ae2a91deaa6204c856d46e9c", - "0x93a241bcecf40075de5c61bce0aa0fd3009d5b25c3f60a1e310e760dd6f1fa5", - "0xea57c2be2f92318ce6d82f2631684d145a10eff76abd8e9d835ffa66a8f380c", - "0x113c0af3e060e4003c23dac0cc4acae161236775e22d8f92bdfdf345309ad293", - "0x107a1c84f302c478806d789963c6140857b9d6c816f56470e2efabb9430d259d", - "0x22822e6909203c39d361873406b61f21e3aa89daea51d26f66a854898dd344a", - "0x87c4d64205533a94d8fde76ca32af7e22ef1e0f5e6c9f68190c4d940e9911c9", - "0x568664fbb74eef45640f879af8314900301a5033d22cd9adf8eba688edf8466", - "0x2e8f1de0ca9b1327cb584c81788521538a732bcd3554b6022f58ad6bab2f1d4", - "0x55310c4f646a6efa06226861e156a5baf85c8c906d338d428a3ad059684873e", - "0x7b2e950b6073c08248bd0cb84bc739c743c13c3d50efb8c37453dc1b19b47a3", - "0x39d3db09a5b4f0a29286c0dbf1500b8cd5eb49f6badffc35e8273685c4d9efb", - "0x391ea57d87bf983d3a72baf8cbda96a2077e01420665c63b7494023e8b972ea"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 37; - int alpha_3 = 11; - - static const std::string rounds_constants_3[] = { - "0x894b84bdb19c99b174eef89446c8042b49d9d2a82fc46c4d653ebdcd127a9aa", - "0xc6b7ff8356bd516fad4f06f4c5354bb1ea26d27b3e9b156e89f0c9ba9ea1163", - "0xd03966afba794725c52dd8f7507a62b3441fb8608becf0b0cc077744ed99175", - "0x8c34d497d141ad73833b13ced2b8f457312a3ed8b5a6d9387f6efdc451260ac", - "0x11e6eeea347fd87200953e431bb652bac5e86acc07849fcc34066fc43475cffe", - "0xb9034e2459a594e1be61dc0359ee295ae75b00fdce16ef62f4d8ccd13ffb859", - "0x4b223f6f682ee44bf4a873f3213f089c3d177918571ad89bbd14dc41d6a24e6", - "0x837100b8863659249a0f72e38804af3e1297893de888f0d9fec16cfba2ab82", - "0xc81b73f232fa3111835446ea4cfc56e28be0582edfb0f83d4ebbefb278afbba", - "0xb78e340840581b85f52728896d521caf8ae8cf427068415b04a53d27dc289b6", - "0x574ee59fd4970e96a6614a64f18fa36a685c18580dbdf781438efbfa4b09514", - "0x38f66ae633f3b619c8c56dc8229664af8206a45eb72d87f1ffd2476e4888072", - "0xb49e75e262625b53ace4b7f65bb2c21939ffeef5972cea323bf413452bfdf72", - "0x1041c87189c3c09a68d02fa4987a40b64d8fc292b4e4bdfa6aa1625d4b4e347a", - "0x617005b62e4dcbb8498f7b5f43ead4675593ccc72cf8b2f4a01fa2e1da60b1a", - "0xa1251b1b798a04e658b1434bd328d5f3ee68e1ac1bb6e817ea31475f0f47a56", - "0xb336196b7d36dde674677dfba167bec7603a3c96bf20899a9d4c616f0ffa402", - "0x128e08a771214fc069a55f842eeb0a8c370a8c94cbbd573432466b555f9231f1", - "0xc790be90ed5461394e69ff6624b1e65fbe25dc9daebfee6b6965a039eff3744", - "0xb586c3356fa5d91c8bc23605141464545007477bcc96acbbe8efced6246e980", - "0xa728798fadfc910fd1549526343488b5ee1de16c9471212c85b85892f5b60e4", - "0xb88a3d215d130dfb3c39c7ed503303704b58e16d7710dfb5f9bf9e3d5a20e8d", - "0xa1d326b6b608ad8565c3e8e7e7ccd497d4cca0ee291f9a73114b4e9824cfb69", - "0x57113400390d93f8389e1bec27e88e0793cd3949228717f795276915d4ab828", - "0x84a8a42dfee951df4471112d863f64d7d5460f046289b4421087d3869e1a1a4", - "0xd23209a191a79b5e7228d9d19956724a256c57bbb7136be0864edd0a70ff5b6", - "0x6f851da6c82b3a1a672bd64a45143572b504037935f373bf7baf8299342cb26", - "0x7eaafe8322cc00fd21fba188b4e00ce5a7549316735482ff55f8de90f17492a", - "0xa2c1b6cd105105347b6cccf1b0a75124a4e7232b12fb39925e7c2f776e5ba30", - "0xce6cab1e12a67f98fc9705ffa96c8a10e4c11f29a31ce28273bf8b50c7e4729", - "0xfd2ae97a893ddc5aabf968d4067b6e7da71e548bd744e13179410dd4ad40fe2", - "0xc397b9593b7e3a15609549af9ee1c305ace3233a8b70d791d47d273091a197b", - "0x48e2850c540b39acc7bce93429d2bde169ec7249b3cf361bd3f7de3f51d576f", - "0xc2d5af8414c6c7ce014f345fc6b0bd90d313d794f3274e7396b18eee353c6e1", - "0x5232e19ed5be0cc0a6f158edcca9fcdb53684db1379a6ccd0cd9b43e898cd1e", - "0x121d8e282bba81dc8a608140dde24856e4289abbc1cc213c85842db14a7392c3", - "0x11ac4b1250a86aa1cdb9b103d9bcc7d6ba641d012ef557ada2e571e27d241708", - "0x56a6c575f7a3ee274f91e6fca0233d3e4a9bb1eb3c58fb052af73acc8df2b7a", - "0xbca1f27ae2e39fd568b543f19336d2d1003446982b00317eafb7a56bcd06730", - "0xe9f191a928aa8c498873d150994e6bca51cdbdaf2285eccb2aaa93cc73291d", - "0x4465495bdea2589718a8f12ad7198273aea88c72442ddf8d879093cc51a7586", - "0x1040f9e259df7c4a09ed900afcee53107c7608b276477ae51b3b4bfd40e2b825", - "0x11d223e26d5c6ba13a8c4382a51f62d97cc553f9be8770470cbd248deda5044f", - "0x3bf579fa65a5e93fbd27d67791c493cecaa1c55b505c526b84c738b073e085e", - "0x7967b3d5778a590b6cc278493a64559445188c3cdb0224585c60603f73a6014", - "0xbf4c86a238f1e63bde595027513d18e26fa557cb4ba00196159778578133cb0", - "0xa582308f6a557cb37cb0a615659d7211f228a09f591fa0a4f28b7cb42b4bde8", - "0xdcc13ae2b4c6179a435253fcbb275f8e4ee4c1cb0eae8d679b512a299a56dc8", - "0xcf02a438c9896590f44512473a4dd39cbc1bde9a53f0b3db38fb6d2f18e91a8", - "0x5c647cd7fc470cc99e170e20270423b8eee990919b1b09cfc4a386e6fe5a2ce", - "0x6a3eee48a5ca08253fb4269241ed389e45ba8db152b8850de999b2de2c10257", - "0xe4b0350a154112207e2eecfc173ad3896cf9a7d8942249c71bf318f329141e8", - "0x7e7370481cc29ffce69ba474f5655078ab875161563fbc9379890411996613b", - "0x28d1224a254fc72827cd40c6e516f74b412cb9bffe167294ebdeda4f2dca32f", - "0xedd071622a8d683a1ac9143eccbf8716b3dfe11fa0ae2aba3abe87d615de44a", - "0x10ba95e17edfec41ca46d94471f755059fe31b505746f9d5401c127cdc295aa3", - "0x87f089986c09c923d0546aa9a950094fbf66086c5877be7495806dc6ff1e75e", - "0x1881b97f72998e6c78f6fd491a33dedc163190de20923ab7b3198af285a9aa7", - "0x99c71834ef68ccc063eb2b57cf6967e2d5e08cdb32eafba0ddc659323b49a9e", - "0xa4312710936ff86b44d9bbe51dd26faf32bdc6f774eac9dbcf1c96faba24394", - "0x19e2b92497e2585e28fd0c5cbdad9c93faa238d34d5eb24a3e8e81ac9b5f343"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 37; - int alpha_4 = 11; - - static const std::string rounds_constants_4[] = { - "0x12885ea31bb116a3d94b1e3e06e6690d84e08035133e7dbd5d16103920e5565e", - "0xfe121d3a78b69c16c365e2ec6e8f65f34a86865fc3a1d04ce75954a784696e7", - "0x1215da3254c044b9c57fb80416628b822ad4ab35354db98938080506902b5c6", - "0x14a48971e3de165a9ff7e4239818ea0b8f017b8fc55595f4fa705cbe7db63dc", - "0x43a0402d3aa09557118fa68c93f7ea40854d5254eb877ce7485b7aefb448e70", - "0x46b0a3cf073f331b9d9ab3e366bf6991ef0173cdac7ae5e11cb9a7cfd846353", - "0x11189607e8e779867cffeb3b6bb64330d79d7bb82445830c87e7c541762237bd", - "0x9e41a79a199061dd5540ae3cc7b86ef60837bba1b572224814b46b4c71f2782", - "0x88f4fdd56936e0ff0e0a913b7db10e90956a54dc1196b1276bdec89123c4996", - "0xcc59b59100f67a649fa191e17b99eb65f2dac5ca601dac03c4845c30681a992", - "0x6ad45ad39b82bd8e2117087878b7e1020c86adc2b8f5e89688e02aa7ff351d4", - "0x7ed8c2af42eb4eb3210b012b596a7c06a219d2a41069ac066df9caaf295a029", - "0x87621d954d89d40e9a6557303d2dad5d0a9091e1833c06a4b929fe38ff7a319", - "0x84ca019a3ea927f171cd66467022ebc864e6b9f0160a76070958a72a3fec672", - "0x46a50c367a342e676db18e6c881d87512a248197f0ac27feceb62e8549a2a87", - "0x1b39826407dbb458ad477def3e0eb64979e9abc3588e78d6d2a484312b29d4d", - "0x102ae631c1eca395b2c7d74199feefdd8ac66fd241744ab3bc719ac1d28003db", - "0x39b624dda6dd131d8ef120a7afed000fcb956896283800abcccfdddeb95acb2", - "0x79b320e0382dc9f41da9b90e4f3492034a0f3abb60d8967bd90924a8eb9444e", - "0x212d34e8a5f057a4a3eb1e0892c4789562db79442a72d9b81c9253378363e2c", - "0x101b2409d0c6538a70511158716d5e99adac1ca7f73af8d10f35d2a8e16d70b", - "0xb4de7feaac1b63a6f0355a2059aadc95c99b8626f2a4f5768bb6e474ad387d1", - "0x5a0a9e6b928d0d3155821283e7f7682fc4b3367d3ba282e5bbf83b6eb1a2eb8", - "0xc74bd49a1abb4218e6442a53192eeebc9e24e2afb63764ab2de3a07ec0e0603", - "0x11bb0d942918769fe6c90b9718290c2858b9e2c8cc6cb2fc1afe0343c8b74f8a", - "0xdd2da4ec6f5aa4af6d09d5c74e19f70a543aa5f1eac87d438802248117cec5d", - "0x107f083fdaa422661e1d05a21e1e1b97ba98bd30bd837f07b1cf296be90aea97", - "0x544b48f37e48c5bb034ea07b445fbbce8075ebdea1dda5f19aedcbcad7205c2", - "0x3c2019d5a813a6433ee7024bcf00cd7dafa683dc9596af869d7513661401c9", - "0x11c4da52bed34c877beeb1e4cff2f2edf2b4a72df78195ae46ea9d040b8d071b", - "0x10be67d9405b730ad76365e7512f33802d305b0e02b5285fceed02872106b7c7", - "0xf52b7008ee6e0ced185891dff5553e05e93c8b168a44b10d394766082e894a4", - "0xbfd83ae5c36d78b71959d376bcc9feae494f51870ba0897cc5c772f04f736ab", - "0xf0fb893bb9adf471bb8791248638a0a92ac0b3698a4a7e217887ae9e2a1b141", - "0x71dd32016b49c093bec9e798605ecdef083a8aeb3e0066304d8f6c9789ff111", - "0x975d1e4fd95758dce4d2ab4b2e0e882923dd3a136a72bc0ddaa43c96ad429f1", - "0x6220c38e1250d0c3550ec589802b895ad80a2c16bffe9aa25d3e25c60a4ca67", - "0xe2adab317ea43be7ffd0e8bcd216d1bad3fd9d32e764a371520fc179a9b7bb6", - "0x212ae84c3727d7f22d6d2f9bf3dfdc55259aca2514c929b1bcb9e0220c391d4", - "0xc9e0b3f35198193b125618a361f2a864d3889ccb6f647a50a41b11a636607fb", - "0xb1d4b2dc46c269c1c310b7048fbca337674d952efa80d021b276bd03af0d1c2", - "0x3a8c756d0c28c519c3dfc3047c04d1962ec207f7f87fc45f78ed7cc5f2258e6", - "0x2d48d9abab25bfdc393085f917c4fc4b1f0d8dfb42615dade62c78481910f43", - "0x19a69cd85683dd9acaa6504056a56a37c21bb98c911bb7ec18156dd59909f45", - "0xc6d2227472fe78d91d39a23eb59db6efbb337a720091ea0e01760483dcc03e3", - "0x124c28e5a729d44cd8b68bff28a23b49e9211022c8181429dd938ea8421ba88d", - "0x12246d437e8d341f14b2b12af22f6b63b664296e647127c18778057d698f82ad", - "0x111d1f5ee7f6f7608c8649fb0686e578b19406cdfa44621f1e5380f2bce462bf", - "0xb5225d17275d61e47bdaef76c3fb1b2b02038ea4bb6d6b90258761d4c28f716", - "0x286d9d9bdf21a6319e69e8d4b08924714f0a5cb4a9e7dc5013b66be99565acf", - "0x12213a410d62c65bbc1f995e1b21c5d6b519e12fc94c2d31c7119a0837ff2e18", - "0x63320a3c8169cf281625d9ab77e7c11f90ef3a985a9298cd1059178eaf9b336", - "0xe40c0a6b038970cc68d1860e50b3cadfb984e557efb8afad7b2722f3d6466e2", - "0xdcc0797a79302b55bfc1083d5d693c272e94f5afb9244d5d5e955969df05f83", - "0x5c308060bc6486a9482ee87a15aa65f4d86efbe3a8cb26f9b5f78e6618d5f9b", - "0xaaa64f8091b9c8fdad697e84a022c1051423be2cb2abae0b3ae33ace87884ed", - "0x54fadaea5e70cf892b7f5f7737689238e02d62f3751232f77c5a3bab780f3dc", - "0x599d22bd664a572e4488b5508096db6056e112f30c78f9e47f370ab0575b82", - "0x30c62b088d07f793b382b442c34359fb82cf913f080805da98ffe263c80028", - "0xce557d55076bfc68500e5b15e249d4e32aad7095eeb127c7cdc4bd8f44fe938", - "0x126019cde39d89d53e1ae3f22afde1242cc7b2014902e68cddf7a8d1080a3e27", - "0x127dd1d65ef6a2f1def912ade3704677c484d74828af871f8cff3455966ce753", - "0x3e2d47a545dc4e095b45232b36b4f7861f7b54e8b6b77fa6b0b55a1b73ddb1c", - "0x3a2282e8ff99bfb2ea871cd583725db1bb7e532e35810f4fdfe859dc0be3b5d", - "0x5c94ac0d551df599d2dbfab49d2456475e4a3810a06b38c8d0bb2511d10ab32", - "0x17991af0d9944dbfd827bc2c8d4900b37c6be85461f99b1c1dc37dbc0203364", - "0x9190a24b47ee4be9067284948934a1bb38973d52d0291670adc6d6857b74570", - "0xa13281a495c4cbf7da7eb78ef254257a2432ad3e2054ba1ae41595c73fc15cd", - "0x7ea82da8a19a2bc6ef4220d452ca4a24dcfcb35d5127c3ea9e8af0277740903"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x2574ac64ca91d12d02d4f3cf6b23e59851e4c86d1e44c6fff1482975b339a4f", - "0x8a2a4bf394d807c5b866ab3ed8b00f179eaa9d2cab8c9fda1e0f4d635247c2e", - "0xbc3c399d590b573f0ea83593fac1d48926141d8f1860be322b3ea01eb84f67", - "0x13f32136409547ab2b37398c7bd60d76689c0a3a3d963f5e7ffbced1fd574cb"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 37; - int alpha_8 = 11; - - static const std::string rounds_constants_8[] = { - "0xc41ba529d3a519fbb431094f9511053b921ae8db909b40e315520a8e18cea1d", - "0x819c18df5f5f0f58af9557b14c4fec0e4376fe2f8bea3eb74410fca83d9d7ce", - "0xd2f039a35d1245a5448b75f036a67f26a5b68a682c88294beac479cb513f467", - "0xe0af6216d18cba2dd62313e539ee492fcc34b5008aad7b65006bca38f21eb41", - "0x3536edcda23f24d94ba61270e2fdc5c080aa13641448c978760f4ffa256f619", - "0xe2a35e49a0ede07a9ca4a74f290d9b36293b3c551ec165345bf6c217f372feb", - "0x29a12bf08c217c41ff23509df6e99c51bd0f41f3a9b4eb09ab0216b16996fc6", - "0x11f864e5a3bfd81febf3b90f9e09c836a38cb979cf7a8f45f6ad164769ff0e3c", - "0x35d13dff2b0b6311d2b820ce2543419bc9a9b2357c405ef72ad3471850c9f68", - "0x4c9ce61b23c0925d0eff7e3e1de7ba8b7273466687bfb4163e93ff8f52e155c", - "0xdbe6fe74ea1218edcf68315e6e721a8f609d29560f79308fba7703eef819b50", - "0x11827ae33943c198b7909089c3677c09ba6ca940b0c2fd6f0757dd20395b7a7b", - "0x35b0adbdd2afbeed881b4f12b9f4e370190475343add790be77fcdfa977dd0c", - "0x113b2fd62932b5a170e595510b567ed82a9006ff3d1b00bf72795a500c5fdf02", - "0x10291c9280f3b59f0f974e3c6d13f66b6a05c14222e69c973a74bee34720a45f", - "0x74a6a82128bfd7ea1c043ead20a6b9973749494bd84f870446e1cb243fc7a37", - "0x5ce3826e0f53247d7cca6ec66fb4617ca70799eae39c614646357a6eb24a118", - "0x52f9664ea3c376662d946c4281f3c12f67079c8e28784357a41cb0624d77a1f", - "0x1289ec8249f56de999baa164e3dce21e626cd05c45fb103d095b3ee338045134", - "0x5da836b5e5193d8a2acb191238c6273304e10cb3c94314fadfb964fe16e1f4b", - "0x5debdf44e14710fc7d8db6b954cd85e5ed076b11868d36febe848dac949a483", - "0x9ebe877858c0fe536c2f04ed8ee6909cff792145cf8d32d797930762efb119a", - "0x49998d599a02b2fa2c9a4fd415b931289613b9ed7fd401b870d1c828bd41cf0", - "0xf125389f8ae2ccfc897551ae56ad285b7e1c60e91d7678ffdb17e04ea757045", - "0xc97bfaef0c6ca5edf029a7f384b5dc575cbe0d6c879fc13fefbff75d939655e", - "0x63ede48cecfa669cf843be5aa36da93df8306fab1bd983b277ee9822e8bd1eb", - "0x123caeb384828123eb388aaea4088e7d9bf5ee4467f70d61a9126c23d1991631", - "0x9f15b7cce2c2a15fe65deb6559d02b1a474734a1631c98ed1f11f0d39b784bc", - "0x3fb05554fc23ccfbc3bad525466f7762c1d6b640a89f4abf3f47f3d328acd06", - "0xe7fc391ca471bd15d83f1208546bbd078b49ad372d5bef6f92365168f422074", - "0xf9918216043e5f9f7f28d9279171b604c3bee24d732b3bf9369688e9e86c94d", - "0x722276f5b586e35a4255fefa13bbd4ef43cec0a2247e029023145d7d765cd35", - "0x80be08eb446ff21199b5e129a786a0adcc2e79aa9239710c5de0e2948fcaaba", - "0x6620f3dfdf3402cb459ffa00dc27750d40103fe5eedff6a78303ad9b70bca25", - "0x104e440d7bcedde67f4ae033fe3abcd263890d270020b37f31d5aa0eecf40c3b", - "0x3942137b62ef3d5a90d112c8a6aecd96002cdf4d4497f18f9cef4c73045f2e9", - "0x8e5ed62cbd1e220d6b05dc8c826d6a3b578c5c2b0f47af071606e69d4358eaf", - "0x7392bb3180b7d340119ba8d909df53e8801e5b0c205ec9532f84edb64fdbb22", - "0x5ce255a8ef9c3c090f29ea89510c75bfc7a55b12986b4cda85eabde436dd82f", - "0xb80c203e91684800457a1e6405b073674eac2349e5db53b142cf14799046cf0", - "0x1bd177cea81dac6436353a8258b1a3808a023f6288567b36606f83351be0f0a", - "0xd3e15eb4504dc5a29fcdd554ae3e09a5d54e33fbd7d2e0efd99e119a01435f2", - "0x28bf02db5b5b7d6f57c797ff4923c451449f87043b95ff9d793b2e75f122134", - "0x123b166e2528d22a24212ace4a9cf82fff1f497128aa44af522a80ea60f818f7", - "0x84a849ba3aee38e7fc247708de4a0e19b168f2445183cfaeba8371ff5827aa2", - "0x857ca60d3742b573d8eb1c5da4109cccc84ebe2afcd16352f8d5a4ed8d55bb", - "0xe0898169c8d19e89eaf021bed906483cdf79896cef51de9a6987321d72ad131", - "0xf509aedb1efda7144c8ea83147d5ac9a45ddc98cbb9c7f590d9fdd404203f5f", - "0x5b0d33f975b3566024e5556b540fefef00beddc32d8c9fd905cb4b47b911e3a", - "0x2ae98f78a6c3a09a47bfe611f5c11cb0409f35e7bfc5b57f191ed70bebe1af9", - "0xec743cc1ce63201e833ec63fc7675be6ff792bc6655c3c7b23f8e424518afaa", - "0x27e60e492a616a4b0233a37979b0b4b619a651a58e5b0b86f15ca3c0240616c", - "0x9a07c90b149dbec54922b148519cc62ec18c3ad292989f4f967c9a84edd6d65", - "0x5c9fcd9331854e900cd227a7e65678338d08aa8b7b3701368728aa4dd40ece2", - "0xeca0dbc74c3039bbac0cdf1da8c28e5f49589bd0b8999a36544e3f40fb32adc", - "0xdc540b8fba75da383334bea596ba3da31e2e8c196cf1e29c866fa7106959566", - "0xf0a24dd41d4e2e81adbdbc2173b8b974c4fdc6ee22431ffa8f3b924707a2ef2", - "0x6a2d7f400c155220fd84a7c8c5e2d71a49a4338aa93f20df4a382371e41ac08", - "0x11e6e0c0c58db28b72dd9264b22d6bcd8e62a45570d717426f89760661f535a1", - "0x8f80011d4c2ec659c5a41ec3c7d837c07e05a3f2c9fefd872a0eeca5a470938", - "0x8ad8d63c6b0c7fa6f1fd49d4cf91d15d304c38f92be8edc434ec89616660d39", - "0xf8239a1e382381b33fd1c9cc5a08122839afdfae082dc2fca35b81ecffeeae4", - "0xb4763ebcdb94a737c9356991bbb4994485ccb707ef62e6c85b570e73a7c709a", - "0x8287667cff0de7902e5a244092eefcdec7ec50f75ff29a6dd7ae4b69d6ff24f", - "0x8274652fa69b56dac8241bf21bc5ccc08117dc0cbb5c17696076c488e2bc22b", - "0xb2592b2e72ff26ea66079d31b56fc526083663ce111a6efaf43da8b0d7a626e", - "0x7b6efb36ec4c7cead45d62d82639ba8bb0b6d664ec72136d7e8f69f6ae2c8b2", - "0x1091b2238f47a889f4f50a1e7677489672ee2e77dab2476d1394802fa4d92ff0", - "0x74989778c95394e113b83abed8046019ec93481c1b4d43b72cf4b14bd862b38", - "0x1d5a7f602dde5429d496559b113fa0b02c8a851985a85c850ddb9628b6c8ff3", - "0x731418f2c9ac9c8971db70b27368c1f63960befa696c4f2883c216a8fcc6972", - "0xe49d0f9bb4bd19a40e15c73c706a0b054ccd717fe4c1c21e04eca84949b4ef0", - "0xef0f54d983fda36b64a8bc4e45708e4867c96564c9463c9e3c3f805bff0f0d3", - "0x19fa0017405e341d13a47523715ddb6528f919186db7eb8e21357a0e9e59afc", - "0x989d1b92eb027bb08350df4bc52e59e89c45b3369bea55c94a3c4892822728a", - "0x8a8f2f550a3a3bc49d19fac02e007c13b28c5c27ddc3543061261c8f61b7a3", - "0x6c9d9c92c6204ec582ed5bc34ff93ff95f34ca2c7d9122307845f71eed9c39f", - "0x11bf083a13fbed6a62b12129e54f3af9cd8b2fcad85f5d387edcea1f73eb3f4e", - "0xc24ccfd8de70cb1b8d51d5a10ea6fe209205959f398ab44b93162d040938573", - "0x4760ee86117a435852f6bad5284422e2cd678ea7079c159ebddc942c11b9b76", - "0xcbcdb22af90a22d786f0aa179237a1369f155e94549a7d0f0350cc8113bc2d7", - "0x11145b33bfaba602df83609782394c9b7441e3349a64d011bfe2f3cd3e2a4ec0", - "0x67a8678cbdc8b93d8db15ebcebc46c74ffd6c8fa0a596cc70ff7fd41f8ca24", - "0xa88696b0defcfa315fe7402d49d15d776fc4131dd377b1db159c15c55e747e2", - "0xf85ef2ecc02d38766377fc63aff2c55222e1eb5d1a81ace3b69ee06de333cd", - "0x100d76fe02f8db53128e501cbf18de63540244232f105fc80a798213b1ebf334", - "0x125d95857ee2bf89133d65e0deb310d9485f786c4758a7acc2969b5766549d16", - "0xb7fa77afdb0e8720687b37e22a5252de4293a9eee981c19ea0d9bc24291b04e", - "0x117851716248c4c2b646fe74d478096b94d5950f626d0c86a0bcde68f9676dd3", - "0x1d78e7ad7883b6387bc01ff07e39ae168a92ec27d5543a8df8fcfe7212c9ca4", - "0x54446b4a2257acfe532468fa3ff6c502fc0ea43d6924d115187c4600684fc02", - "0xf8ab920c3986de717aa86d0c908ee6b8ed23faa1758cd717aad9231a904de12", - "0x57c5e6e9082d3183a9cb0772cb688eec2a2a8567ddd78cfe12807aa40f3f250", - "0x43376301ec9e8655258f969a61642f8b2eccfa74f5da08ec42f8cdeae113aef", - "0xc26a42c06737cce75b17ed93c4c39d3d16d20ada9307efb3a69922fe70d28e7", - "0xca48ab108fda68fd777c8a0b108f21670f4ffc218a49e9b85f78fbb159c08f2", - "0x690295a4452317cc2534d43b2156c65acb91598a568b1bfb60876bdffa6562c", - "0x40a582cc80cd85f62d94c271cbebbad576ab37a598c8187759b4b2ce67a926c", - "0xc73c556684a63cabae1ad9a7404d7360e5cba5f64b8519328de4cb747dcfc0e", - "0x33de8abebd2c5430bb309a241e428f1cd1ebb09a46246783df0333cad454f89", - "0x48fe2580726aba2044432c17b190e0471fd1b356005f603f432a828a6e1016e"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x86f8ffd65bebe5137654c441bf8e9520fbca080cc233c0f6c64062c99f2e199", - "0xcafcb5a1551b2f5d6345456b95de2b6dc3f2bd8a5b114f6d8e4daf26cea902c", - "0x33def38d6cbd4417f40e33aa822f7b0b3743ce4f32dcbb47033f96ca9ea4339", - "0x806f5b5dd08360b1cfe54899a7cf8f3c543b5dbe3dc25c08ffa00b89f167182", - "0x2addc4612044efd1937f6238fa77092b98d674262f8b1fbc2a6026daa881a60", - "0x11f4fec8189febc1c7c4bf540320cdce84c0fb90ab38c16276ba1106811c9371", - "0x4763569f19baf961b5c3f3dcdbe54b5feaed59d0c6876fd33153812f01fa547", - "0x362799e791390a5cf391ad263db8fc7823fa117cd9be80114c73177e96fe611"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_bls12_377 +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 37; +int alpha_2 = 11; + +static const std::string rounds_constants_2[] = { + "0x153f973c6d13d1592f777866072ee9897a6db552bcdcc4d37e63e5f5ff29caf", + "0xce05dc1b9d09f86e3752df5acfd87a3531d231395513014f16932b4cb385107", + "0xb6daab769d207406d5e80f967d6cc77f2116301a60e1ceab431d0af5cbf3f7d", + "0x6443f370dad1fbf393e58ec2bed30a9a00f91db4f88b1d6c05cdc23527d9f8f", + "0xd6597f85720f4c5984037c49b54ce709e67de2fabebab09d34453dd4c581585", + "0x74f7b91b3de0e83a8cc34871d2f938f37f63936a4667ba9d7a0693425c860be", + "0x79971ee8fcae02d07d8da13fcad7cdb350ba42a9dadaa3c99c6efa349b73371", + "0xdc00427acce490b4ca8a127a0a2310102284446b8f8b26234abe09ea7d18d9b", + "0xe2f83911ce950282643119aee348371200c6af3f1a30229658704725e20163b", + "0x84d4e6f652f81c62cd9dc580b56c4e79f4606c1ba322c12941f70ddf2943801", + "0x59fe2fc0349e1cf20a02946f7b2e218f1b53d6e899521f8f03a0b585e2736d7", + "0x84b5b8aa9fea080b46568b1d9fea99860e9cc013c8858123ef79fffbc2806f6", + "0xe8b0f4e7d4f9adefcbed824fbebb6680d6ddf18aa8f5324815d860575e55e69", + "0x553f52e3f41145d1abdcddc19ad1acc3a4cc74b541ab9e32c9185e72cb92675", + "0x1080ebe924fadd88107fdda788deb82bf1c6d14baad20d260fbfb211a52c5f3a", + "0x338524c9e87880b8d2589d3237eb02a84ce8f343e71cda9b8d0ad6a711cf8b6", + "0x1c9c9376b318132991b0f0393f51847dd51f4a35811f812a0696a1401af971a", + "0xf7904ef13ec56be596f088b0c9e9fdffec7a0b9037dc866525b8cf7366310d0", + "0xf4a10e4a508bbc316ee9233544f571793869ddee457984b395232392a740a67", + "0xff0b86e0637eb05e7324f17b23994bced2de8531edf9f85f12df3d84c68b880", + "0x9bc037a0596e626ceba68689bd1a97c89cb4b98488a974b602db951088a9a5a", + "0x3d225709f2d44d3bddc027190a761133994cd7eefea1636073ff89ffecd90a7", + "0xb6e72f0c92887c427b7534c93cb5b88d6cbbda7e4d693972e0b89f094965961", + "0xed694c7a3ac7bc3e9060813e13a2685060a24c6f7cae9f9857426e69212ce3f", + "0x5aa696e3efe2586b8932e08ad7ed3db0c863c3a867e1cfd12bf71020877a1f8", + "0x55264ebd3517e665dce1d19d164fe65d64980efd381f099e6230d04195822e1", + "0x10f7072b51cb2844cf97859ec64c9de7516ebd1881a7ad1606b84774b9620a05", + "0x274a40ec0ac7b4183c07e6ccb04a11b9e6237e4dfae549eb7592612ec042682", + "0xa5565ab36b7cd38f323c19611667eb25ad2a8bc3ca869fbb68bc5d076943b17", + "0xea88a336ed42a6ba7ede75197180b17b68f8d9b6e37e6e8683211b4d26f5303", + "0x4b7d4ba7f56b7d9730471128422b7fbbd4d93ff5cf43dde6d1c9f0e87706f35", + "0x100233f3206a489f7bd4968968fbcf9fbdac6b5ab2a71b74a728c62209ace5ca", + "0xe5637cbbc2290b57074ee79e4ff9c72048839741a1c34c4d6f72d73bca9edac", + "0xb9fd934ee7f6c387d9acc314fea0f83fa012018903aeb10031af62dd9edf614", + "0x45c3ade8b5927d0e5be764d5f93ea1e749c4a7b57026f7eba2b0fdce38e920", + "0x3a98110ece12caaf792ac5d86fdcee1f31aaa46f6aa685050f689f765596090", + "0xc1b0f04c1853526b5955c97efd83a2b43fb49417ea5e6a9399547f36129d004", + "0xdf67bda63a42fb23db7bedacb7dd91eebb095a07c6cfa5b682695db0322d09", + "0x48446e888ab9c2e091b9173b9d461e898dd7ee2056d8ea41e38642ecf79f3c2", + "0x210814edcb75cadc7433d8a0f3daa7bf9337868d692cceac48edd7f9fef0fe8", + "0x1b5f4bdbb1e26702edfba60669330a6339ae4c23e1ff421b29f46910076c232", + "0x115043cac712ea0e69fd229a1df0981abea23402e726f53e9730bd4b57349fa4", + "0x40dc4fdd17d399f186bffdecf5accb72cd27595ad02f6af42ef573ba14f6937", + "0xb40a8a51583b0959d243f6e1647d293cc1026560a084eb18eec387ef4dc57a7", + "0x105f499d07d08acb6ca9e11acfe670940594d9457d62847999cc59f63d7f4340", + "0xb2bb9ed566db7113d0b22c699179f762a85032c9d583f7d0b859545ceda7533", + "0xbb42b0c2e3a7ec5f8fb5196062eeebb2c7dfd712c05b48bc78309890757b9fe", + "0x709099f5a01844a91cde2b79a9b02b2cccf2582b571c7196a3e60541853f36a", + "0x20ba544e192db86033a3c57836400fdf60f0d5dde76a0c7d66f07bc7af11ab4", + "0x8a6b4b75d64147371091d6e15af28da782ecf69a034758b9b602df15ed4b52e", + "0xfd90622796286ca331bbb545b2350afb8193a486b5a90decae6db0eb86ebcb6", + "0x129d2f2785167dd3671e6501ed3aaaeba8d969bb62d9e160f57ad9b5bb3ad3cd", + "0x10ad9cb3f2eac925db2e5773fb4ef1274d7dd124317e5bbeaf974038a82c5871" +}; + +static const std::string mds_matrix_2[] = { + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 37; +int alpha_3 = 11; + +static const std::string rounds_constants_3[] = { + "0x606dedb9eaa3661ae1c56787db57a9f26c07c9d61808550e895926720a33874", + "0xcc14be5cd047c1fa61389a336a170caf351f6e7f0152c72237137abec0ae006", + "0x1e54827f80e8d973f12f8bd0a0a829f752a04fa72aaff79f4247f2c6b34b52f", + "0x9f530b30d94f652ea1b89321bab857e52495047f7dbc1240fda20821ff41365", + "0x92784cd10e9234cd78ea5dca5ee72cf19d8ab1b899ae576474887a1b23decc8", + "0xa1e14a39e79a9d2113615d233347e3a02fd3d4bd6b0e85807f85680023476b7", + "0x1bc5d60f2e9a71f79bd282be3212255335be300682aebcaf79293196fd075c", + "0xad8b8b0d61084774b55a636b0b7345e6dd6cc12afc076954e5be6c40e863e13", + "0xe1956da3c1872f16a645c6d6f653d03c31dc4d2d349b2845301d5132667649a", + "0xa9758e8889efb76e4f68c9de2d5c0ade065c910a41b4f1f8f1f7074289c2f16", + "0x346007d2dfdf27696dd217ec442dd2c08b1939062e2c35469c503d7eb6c03d4", + "0x3830c923431caa916889dacf802a9e155d961ae663633a5a2f0e82dc76f690c", + "0xf33cad3c932687336a54d06556094eb12cce7f7a38d33fb12fd02af8ba648bf", + "0x988567444699273288363f2d58d86a36831343d1630244b48df3450332fc473", + "0xcb7ad709f21adc499540780943e9b186d69354b274bdb17fca15f7f4b40fb0b", + "0x101d389bf0ad56ef9836143203faba2197433b39de0f1494343d8e2def6dbc63", + "0x77d0a5125e0256e8abd59f0ac62ca1ebc5f0ce70e7fe07d228c075070f0f956", + "0xc42e5248e6e176f8756e2d2898ac229e2d75d3c451a0a6212bb012745fe7649", + "0x1064ade8e9b8189f3b81a1fdbafe5c078f7b7e5ed0d2bc70a6541dbfaea77895", + "0xc1034c6e65cce1bc6a08798286ea999e52da7bbc0f6225fa7e67a8bad311369", + "0xeeb00b4af9c966e310d143bba97ee3cdbdde282af6176142d5e82639abe5ed", + "0xdceefe4d580aca0e50bcc7988cef8d0937d58a64e8ed7d19a9a39a038e5271b", + "0x62605cc5e8753eaf27340a2d3544eec44c951a42aed8a126fa4036729a1df7d", + "0x13848c6a530828fe7144c6b8a5e189af104579f7fb6dc0d00c42f7f5cfe6256", + "0xff3ceb4fbf293d0d3d54989679b5ac295126fafb058c021d86ed13733732d6b", + "0x29ad3ff33432844b9d383eb24d363d8ad99d78b1886a5bb65972420084d504d", + "0x1135d04c161cfae5793d883116a244193982d4ce42529ef4092197205f74c5cd", + "0x10726be8e862eab240f169e8ea2c6a91362339ff65051e8172d0d5c3761de7ab", + "0xdf85f17bbe6adcdb52b06f87bd770120cbbc3bf2b0c27f7da16fb4466bdc31", + "0x125ecf954a2089345ac96a1fbc90ed35f6ff872f8df558fb2a3fd67bdd4b7657", + "0x98e1a923d8fb8c34edc0475ac14f775390e5df7b656fd7ff6d6d4f31198cf1a", + "0x9ce6e642fc946c127a490d46b8d2e10ba5c791c748349ca0cb19caa36d3cdb5", + "0xd3ab1f6ae74a434896f1a3cb240d0e1eaf11407be94a3e246e0020b7859174", + "0xe8abb1bdce41e7e79fa10029bccbfb6baaefd065d79be53598b0cee1eb6bf7e", + "0x6d4ca2089badf61a97d12063d8b414020bfdde13966b9033e2fe83adfea14fa", + "0xd4f41fcfca4354b87beb65567cb0b75e2e9f4a959a33768834fbedc97708ead", + "0x24f1848f8143364b2c8b2121800d797def18df0a9a0e672553587f8be2c5117", + "0x6b3d684c0806022a5c09900a27add04540a50fa508f75664740af7a816f6175", + "0x172df06b6118ec8a817cfdcf4b8a2134f87a17092184c2477a09765a683e37d", + "0x11c969cc9c39bbb2b3007b454b9017c61967a9dbe9eaf706c109f05e154cc865", + "0xa00e0acb29a1ebb0e2d03ff4bf1ccdbf4e4aa34994f84834523a7407d40a0ce", + "0xce3dd4c72fb2a70a351fb93a6512999bd3a55bb5a7342a43a2f016215c2bd35", + "0x96bc55306ce86003ac56face2c0653841b03e0f09769bae6a84699496156e0a", + "0x1847b4ed901e1cabf00fc4824cade423baa0e4eca6737f63f8f1471c54903ba", + "0x69f86359e72c49249e5e41e0ca368cf8fc6c2fb570b0ab7c63a37e2124a1e52", + "0x82d7203a037f3f20e91e99c59df1a4311425824e3d86235feb9f5d230c83322", + "0x10413fe616f940f9c5525c3590e4ec0780a19bb91c4ee0b7b7e0b881083f33cf", + "0x1025dd23147cb56303870c3cf6ebc5202fd8b157f75b80bd4b3d319e44de589c", + "0x7309be7e839ae0e9001a75f38ced5467274a0683a573a0cb4b5ac574095203c", + "0x119c531ebfe4b6685ec79b83de83f8791b940772dfebbead5af2c4bd5773bd76", + "0x33667af76efc85086ec829acaa9c081117f8fa9c131b4dca1f28acca0d85203", + "0x6e5fb366523c51b1c8e68fa9e2ce31e702511d1827245b36928ab8141ebfe2b", + "0xc46a1030db79d803e7d550de749a27a17f588ae3b3b2db8cee967c4d0aaa344", + "0x5ed0cbed08b5e8353aeb097e39006adc11b5f2cd7732d2aac0948438ba0a1b7", + "0x9666e40f6ff8eaa4d9ebee2b57c680e136daf1b0412bd7093f6a7bb76d52032", + "0xe21c89aa35441c76257fffc04958c63ed8e0642a2593a79aee8dfc85adf6d7b", + "0x1220a55f5a172500f74865dc1bb7aad95e7c9bf6a31bc621c36195c4daebb278", + "0xc955816e2b27bfae1d1f6af59848fa208c7a32cef54b5652338c351691ce1d6", + "0xf2a44fd7779f0159c3452d0942571c8bcc52a118508ccc794e6497ecd26a7f0", + "0xfb4e777fffa6a7fffcef96c7abf9f4cb6cec7f9329b05b96f9f1b2d884e2301", + "0x4ada44e195e5bef0cd8615ba6bcb31f18034fb4d47c6bbb01b8985c0b8a79a6" +}; + +static const std::string mds_matrix_3[] = { + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 37; +int alpha_4 = 11; + +static const std::string rounds_constants_4[] = { + "0xf205a68c78bdf5865b19ffec52d3aaaec9c93fe04595f967c4952a19c5d03e7", + "0x11d3116a58e538ec1eb3764cca0962e25891dc2f003d920a145dcf7b3d8dd78e", + "0x5d431274a1ac2bde002c5c9c773c3cdd481b98116e4abe31fa71b9d28a46ec0", + "0x9304dbc1673c61302854b0ad76a4fa3a2e69b6ece2ee8ebebc2f6ce222991d9", + "0x108908506a53d7c7c9fb6e0bfbe34bc6fb8a99fbd5815f8f9390523bceac49f7", + "0x64432ec4264ec9fba03fbb0329819c0eaa63d99391df761f3d957e24c79b3e6", + "0xf598dd14b0d171cb2bebbb2e56c589bce505dca5b43c3cc2af9ca4dbee08025", + "0xcbae601f76824be808445bf74cf57e09f9f867a303bb7587836c57475ec9e47", + "0x382f2e6494169cdba6f41d3ff912fa8b4b8b91a5b7f8a08cb100426a35527b7", + "0x9e52829ac8cf9259ead7d99accb276a8fac8dd62cff937a261a5dd35a51ab6f", + "0xba29aadf3efee7ee6a74098c64d957c186e6ea0ebeaeed06f41b8006175c1e3", + "0x8c9e0e6e39f444d6e679b54551235895e94410f864ba996b32c66ebe7178c8b", + "0x822ac3237751d6ed7830cc1405abda4bc712d369cb942993638f88625ed736a", + "0x1257de1e07a56fa029d17a987ba581a6341009da4eec05607d69e6864c95ad1e", + "0xaddb5961d7168ae38ec9faa5c24be0c8d054f46077856dabf98d14e6a29f21e", + "0xf81ab01a1ad7f3003992cefbce4e513ae55b081cf84075562de4bb8561938cb", + "0x53c6b82b160099b7b794dbfeddc3a2d2adb73427aa9a5cee0eb26c0bdc85674", + "0x173b5d74cfee42d30d6805ca92b1e2ac59e003fdc51f42d1214bd29c9d08c9d", + "0x4c626ad2e8bf702a0c0935f15e51febc5d367ea9ed3ec6220703dc99059bf0b", + "0xbba853a6db2bffcc46601cd89c1be77f33f02fdefc4055a0f8bc938521daa56", + "0xde718c1e824c91714fe939edd1f4192f20d1a4bb17970827fcf16c116334fec", + "0xd0556b5c465ad0d886427fda1c7a9503f833248c73855632d2dcc2de7f9f2cc", + "0x74ee9f6cb8fff195aeab93b22b4bcfaa7f9b5191f88eaffcdd5ffe9e256dae6", + "0xebc47cf7c407ecbecc58be11ed65b86abb22c5796465284e82e21d6a56cf3c9", + "0x6902571020750248ab97c02b6904676d5089580685132e678091ffdb187ba9b", + "0xb1712731527d21bc3112bc0bf04c3732c3900a33a7793653276623b77c5eab6", + "0x29df1424a6665a1ea4091843ce4e454ae908b4f957e995b1bf15c22daf36110", + "0xeaadf9b753f9d36a62d13478f29b9001ad90a8b608645415bffcf9573dc6313", + "0xbc2036d6c37d70a209438011278caa343785a124632cbc9900a3405ee47e679", + "0x126a8621cfd8ea29c8bd876198a735fa0b4a688bff421ea845d6a3f4b864135", + "0x8d6938b41ea17bc1631f64aae769eed4a884f42be56bd6eb637fd0540cd106f", + "0x81743db9950e3c86b1ea395f02e4cb8ef587a82bb5103dbd463b0a0aee117e", + "0x5bda6b85565f33af82da866aba19d50b532ecdcc0b13a912cefd1f0275b796a", + "0xbd361d8788f3e70647eeaa81b58514c8abfa17d30e1dc73935692de722cdf58", + "0xc8acd806ded3d3c65cd53b8ddc3795ccd510b5d4b51f1c45062593c557a22a1", + "0xc106c141a8bf93e10a4dad58ecc770716b808c8307fcad1446c9441b8d3c34", + "0x10e70bbbe55f41d2a2a2059d274e872f0692bc76ac9427e94d564314e3feb1a3", + "0x402c9caf49b011df35a2f85a33d09125404819514fec06592dc6d2269143161", + "0xaa0fd518e78630963ec8f197001c4b94b965cd7a4a54bb84ef318745fc5b429", + "0x494b7a48837b9e3e33bf3142bf5da65fc56ca86511c5ec3b448bb1aaa6f2384", + "0x428b197814dfff2e55b2ae63c789b7177065e386f22fa9d32364da64ff4bfe1", + "0x535c387302546bf18fb8364014843ee1a5e05ad827547c4e80fc469c597d0d8", + "0xb11a857a2f5b6b9df449f657e07cf096afb7ba7b9a19abf90d05fb90a685129", + "0x8b4cefb2e49b2f656dd022b7a849adfea2e5e642e654b6d14bcd3e0d322bfac", + "0x122c5f9dd4543e7afb56475ab0599515fe96f787298a2c36014e0de3b1d92aa1", + "0x11f167c08c3875c5e23daff432fb047bfec0796bee00bf4b8f71d2ae814f09ec", + "0x6008213547cd7e5bc815d5c75bf6c0046520d903d565e389bf934ab124eb984", + "0xb23151c06db661574912f1a0aad4a5eb614eacdedf0bd4a08afa0ae8379f2b0", + "0x12475173e34d0e07fe42acaa0ef2b5340ee9819d1db6e9b6c55a71fd4f2aadf4", + "0x88f7bb3f6ee117e2a1531ec5373c00c61f946f7bbaa1f62b40247a730f76104", + "0x11f2e0c3b2785e84164d80f7480056c0e37e9487694d503eb41def103b7d4562", + "0xe415831436652fcc01d874e9f4973f83f7df4fe0c27c16a9d51e682b3aa2ebb", + "0x424d49dfce154f9fee11333beadd1d0ffb0060281e41d6cac63addce7d68184", + "0x4c10e8992597b8f060dabe78352681a67675f79ffb77a741d5205faa0006bda", + "0xe99c1b60f47be69876c240f5eaf8962cdf87b728ea8259dcf8bdbff3fb2457b", + "0x10a84c99c075eb8380d1ed5562e4825b6c916ad476288fd6b88ccf306682f190", + "0x1169d356b68c9417f722c5c1c475b76b9034e66a42114a43ac79fd0afcde6faf", + "0x8c34727d77de74c21f6ab09043129e2509d3e4006a64fd6a0d044b5afc97f9c", + "0x1238766d4a7c298040f1ea0fa469ac73025eb056f92b273db5dfaaf23c25b95f", + "0xf0eaec7444d96d59baa7d4850fb391a45c5280498e25c93b9721be0118d0d39", + "0x1cde6de927bde70612c3a97ad997ad5ceb959621b4d5b3884a87652497009f2", + "0x8d6c59f6c78b0e05848c4733226e9bf4617e369b56323eea192d5314a4857c1", + "0xc747d77fad56e6d0cad8194e7d10f3bc79b3d7b6e79ff91dd39d1320d6771f", + "0xf1962ab6ef67c53d58fdd786e9edfbec26b6af0dfdb63a64fef7a22879d7e0e", + "0x30bbf36dd2322fd440649b2bb99215fcb86ad658498f392416d220a8bfb0972", + "0x574f51e75d8d477fe23acc794994352d2564bf6e6250bf61a97ab0076887390", + "0xf99a6cac43ccb4efe84a98b676a0651075ecc87ec8a28ba20c217823b3bd7ac", + "0xed8d85de76cc3c2d98464b630bd23379d71df43163b5c4d083641e292d7c573", + "0x107929cfb628c79497ae2353e84d3e3af3a942f4fec16681f2f5b0c6d8a6de7b" +}; + +static const std::string mds_matrix_4[] = { + "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", + "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0xe18c62f1c09d33621564644db5a9ceff68a255f84a1260d23e534ae1f30aeb1", "0x7abc2072ac39fe3f98c0ab44a26f296d024d513916dbfb687fec3edabdbf108", "0x11b747efecccc6f597f587486a04df0371e4a0b2da2b45bc254c646a75d48dc", "0x1755b5949306573b5a1b39438d81748893eeb171354e6dfc4fff4d6bae1df27" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 37; +int alpha_8 = 11; + +static const std::string rounds_constants_8[] = { + "0x4aeaeae2a2a83065831c545169faea253bbedbb128f9c949d660f61d956f659", + "0x10a204ba5daa59306012c3b234c455df5e99171b268db13c1b385fe20f917ff9", + "0x6fde49e651096a9d382f67d096f82703d80451a381ff969af8a70e952242300", + "0x104db2f23a079c968c584b0859141d6d1fd104ed34ba45e9f4142be2341d74c8", + "0x11dfb910a3bc3ffa14ac53aad61cc245ad100b09115eb92db8672c7e450be6be", + "0x5b41fac30d182aabc7404539b4fe6c08f8b72995712eea0d7a6c17cd7cd5fbc", + "0x5ffa25fb68dac97c857a88fe880d6abb8217172957dc22dccfaec1fddc19b84", + "0xf4c0c53238ae2acbc59634b3fc3b182484924473cf9701e365a3f606999f766", + "0x74c223c5ee6ddcc31be2cdbf799c3694721d9375e3adbc3655c94ea9897fa57", + "0xa7a8e530b7623ca309bfb5e843e2de4e1071a654f7ebcdd7374d6f5355e86d4", + "0x5ac17c256c36e1ec81445d96e7a5b1c905464a5ff47a4522ee00b55ae386937", + "0x63d3acf8c819425c38216a259baadfd395b6e6132662a8e09daa353d59ab250", + "0xf136ad04c5d947302a09f8deb7f37787c2b48b5874491e4d30fc523f84d5d79", + "0xeba57427387266821333be0a0a39abf9c1267006c0434f5d2e0bdab096ccf6e", + "0xaf23b5209db2d296f31d5ebda1fb578480e23c311bc4b5aeede548637bce564", + "0xf077129d7ca057d8027b5b4cfc4ea03e3ca179b2644d1c619c27f5242d98f34", + "0x8375dad44f949b906b2a5278c9c3deb65019197eb7c8900be0181e725b5b088", + "0xb97c4c47023528b4c5848df960947da8af582e561af182f2b8a5d0b87bd1c9b", + "0x1095ec44b07be88385a242b555d241e0e18c0ab992f160c7503de853de0f78b4", + "0x302b93e24a358e08f0ce49089f100a3f23ae30ebc88165a846caad09376b14e", + "0x2343f313f46f3d10e66a2df33cc612d1e6e24a0ee9561747fdf25692f00df1c", + "0x7d688dc065df607ddf6f327e4d51959f2df300bd5043b159f991656a7cda92f", + "0x1ff304f8e1beec45199f74ad5613df442dc15860de956fe9dad55c32f0b92b9", + "0x44c6f74e4156e183fdde811855ea4582fdd56977c44ec4ba5d5c6803b7b581e", + "0x420309e98601b1798d67c9afe52ea95dc15033a0fe6d48d14ff8762355017f4", + "0x33a1f1fee262aa9bff3bad96681e197e8ca1f6bf664f7a1760d94d61c70ac3d", + "0x1283bf4f5c1a841a82cf563e808a870b0f33e5a1d3fb4fa1f0462167b242ebec", + "0x54f3323f459d0351ebd977fe865a118ddecacdc18cab22b4ad9125e4d2301ee", + "0x91675be91dd28fc2044c8a0028e28bfde618e7e60e42cf42008e131ecc25bb", + "0xbd228ef6da438b55ebc0e88d12aa3118976f98557b207be196344bbf8bdfda1", + "0xb86bd9dafeb9aebf7ecd3909a43e425dce0a50293d79e2bbe5cc67e2733ff1b", + "0x4fa9973e93a139cd7b427b276de8b6694ed1b2691b6622d5e9b3dfdad7ab90b", + "0x80566db899b153983c454822d34f7edcdb3f4cd85db88e6bbb42e2e34ee7e11", + "0xd61b37612795a7a4451bab37447f2f445f4f898667a2fef9e3e56021fc615c7", + "0x10f195503102959c566bf8ebaedccdcce78e564faaf9f947eb997afd18bf0cee", + "0xf1a914b538dde74a7722f2a9908f57f40ce187dab1957646404335b26b3b957", + "0xc4b2b5570fa37fb16c27c0db113af50d1783615b12dfbe6588d03a0556e61ca", + "0x73262cb7243eb7aa1c6079584e20d38129a4e6f7de2e272e03a75b991e5490", + "0x8409c931b6bb53822920e1a4dc3331d3f856641f7c8e638c084f8d7a334718a", + "0x6407cbd06bdbd92a0f0c0b319b59b09360c63ae15aa6d64f73a08120d51d165", + "0xa701f0b27603d0d4dc1642e3b4cd2d9108e4d937c5248c6a285b55cb142f1fb", + "0x7c4e5e22c42aee9d72969ecfd468b45c18f85d7345de15deeb264939b779ef1", + "0x540527474261fa6366d9fa7e6abae0be909bcfde36a0de9d1826d002d413c0a", + "0x461c15f75e74a100b18feae846d93ec44d60d9492ab11022238b7f610bf4bb6", + "0xf73a13d3ab466de2be928c3858e7ece3d16f7b3bcf3a6dfa3ca231fed2b55fb", + "0x3a5ea745484de1c7a238e7f1f4b7a14f1adcced9be4db54d86b7a3e7a6d8de4", + "0xc9541fbde3f6cb8df65523b217394ce84de50d8fb40dfd2d5ccf25283a64445", + "0x100d145bc613cf01dd9f16423c112f06f753e444a1773110a3062c0498ebc8bd", + "0x1f9748730a951f60e950ff84327c41dc2982440071d7a6ae9c944d876a324e7", + "0xfc517372420f33da8ea01aed55ef9bd976c54160ca02f494b317120bfd7c4fb", + "0xfa543f0016aea2e77bebe722c81e547baab76a15af748bec3ae3e2959f5b905", + "0x10138d4f10df9493fb09b6a54c663253703f09180593c3a34cdd981192681de9", + "0xdc04f43aabce0cfe188e71c01b29325fdd000f6d29f80e880cd1f6667eefc82", + "0x3cdea0df4ff61e88562ef2a51d8d54ab296fba6f9a0bd40bb88a08a65bb5b26", + "0xb52d63bbded755d9b29771405182a6a0622cbed85529cb79327419509b0562", + "0xd44797045da98095dcc19eedd3e0ce7fbfac0975ff3f18edd00463470ec206d", + "0x119c03a6dd05bd7666849ba8c5e34c93c5be2b13ab767fc7e7a7a852a0504d58", + "0xa2560414ce284d858e594c804a94a4328925fb487695a20d7a3727f1c821d11", + "0x893af6faa83f903fbae57a6ba6dbd2187cc43ab4f078a045b7e6c459ebc172b", + "0x3085430162a43b7f7996837bb63c093d22ea5d5317e77efd6bb59f2ca9c558", + "0x9d0bf5af89d482446576fbb24dfd6509f0492457382e04c36a91ffe14c3beeb", + "0x6aedb3f42a8381e8ac5236f6866a0fa88de1ec4525400bd6f44a95ebab29146", + "0x1265b9ac3d59a157e25d521ef2a804ef4bc0223754a427a9d72523816113608", + "0x7952487c9acc567427eec6e430907471325c1dbec52a9c10f32cae4d4b6ada0", + "0x12177c52df8385a1c4a076270db89d71a0326ffc0bc346a94a16eaf86bdd7f74", + "0x1079774c3c53d0f7cf728eaf6bbcb712f4ac2a7275a54e4af6cdffdfd4bc5a76", + "0x3c4bfa9c485876f595e4e1317fc9d68cc87aefe544045b90b9618e9bb8da64d", + "0x928274b1684d5f5e90494008fb8d736cd6e6624424aa9dc6898876772bbfaaa", + "0x105e21f8a26822bae8c9807858ba9d31b7d1eecc03c24b6cda2b437cfb36456a", + "0x104b69b3c7dfaa0c1ad1847d2daedd36cd022c1b0428fcd02705891f5f9377", + "0x630a44f27852feff04af7ff20cf105964d654dc1124f09ac9f4f64fa6793e98", + "0xb762bdf2b8452e86534fb6dbe807e55aaef80e27a4869497220cb35228f6c7b", + "0xa46cb7e0a9eb9266313dbe75ec3389e512e49e28ff9d9475bfd8cb44841f7d9", + "0x6e78a96197e7704b86579dfa99715e6d5aa93386e99658599f47ba10c3bf68f", + "0x7c645da48714caee515ba6d0b6e969eeb87855cd5564f1c0d70cfab016416e7", + "0xee02c68326a3a9e5bf354bc733f8a1287aa805916734dbabbcfa6cd2f6811d6", + "0x85f5290fccc802250482aa92deb43c4a8ebed98a0aca7689544e33d9708bb00", + "0x679c50fbc25771ad8d8b487760a9306e58a9f2d232fb9e404b149bb5966cab6", + "0xde1d5266f58da4f5ce9b9ce78bf477ec6a302d49041adb0d031e552ab70152c", + "0x165c7dbeba889e8e58e73d64464a9ec148f1a24d40d1cece79c8c98eec4e6e4", + "0xc11fdbe24b2d81b83c2ed6bb986e06a6c4e2e0ba9f6212bf1636b7d6365d879", + "0xa9991fc09a4d88688b65af519bf120ef3d9f07340474b25de8b6441a697d5e3", + "0x110c1bddf9089069f51ea965ab10c2222c0296f0eea73fa25a5b0013f2b068b1", + "0x726a603ad6faaefe57fdde304b096154bd1393093c971fd3ace1ce9aeb0b35a", + "0x378c052218c8fc29f627017583ecff4786c6126498c39b7ebad74b1015a2cf4", + "0x7ca8c0d3ccf7f64be55f2766aab66a132844ca4b1925e630a76074df50a7426", + "0xabc5421b73ad76aae08c02daf429477225891d861f0f12b0bf8a3c635ecc3fc", + "0xb4cf030d5344a092346af791b0cfb2306a3e6dac87b2310f24649ef9af241b0", + "0x2545dd52bd0378cff968470b05eeb18ac328c8a4b12c1963db4a779309d660a", + "0x11e6c4a3a57295e85db502120c656b481281e93a66bf627a01498305e05edae7", + "0xa03c4261b38da367ff427a7f8a4cca789dd4dc3783ebbbe3b1f12ec3f2b2ba5", + "0xfe1bacb3787105e2937fad8c6fc59ad290b2950eb7774275d2b9faefa2087d3", + "0xaf887487aa11803fe6e65a2e942e9b311f8fa43e739d61fd23b7c28fd63107b", + "0xb1201df51d6912879bd389094ac3ebbbc32b6e2059269a474c603a536b9bea6", + "0x4ec7c86ad7aaa8eb11c11fb3df3d51cc5b7c4a0a4bc4ec7004d2f05970989f5", + "0xa2ab64f8c4901fd4f0d0de460cff65fc0167b9fbf2a777ae066531e0e608c9b", + "0xc136fc32bc5d5caffc15c579920dda8aaaf28ee6b0d31e070d4bd445006f584", + "0x90d84e1ca4a79996c82372e3a77691e10b3e32282549dc0b037648de38ea2e0", + "0x127ef9e1247dff86c98a7e284e4d83ce6bc1127afc9123e40a56f78d51bd9598", + "0xf02e0fe897234e7e991f743f84b1c49fd030119cd9e41572a5d9c09890e6190", + "0x45688fa5af2d6cdf7d0e4c268f7e3b086281e1ce720eed179feb0cb2d7fc7e8" +}; + +static const std::string mds_matrix_8[] = { + "0x29e44b7c30905439406e0fbe04d4fe90bae19142fffffee54d67fffffffffef", "0x1299e48025fd253d4fcd1245b6ff2fe0f1af4f1b4fffffe8186d7fffffffffe9", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", + "0xd4bda322bbb9a9d16d81575512c0fee7257f50f6ffffff27d1c7ffffffffff3", "0xa9c149bf483154071e9f9a0cba63fe4feaeb417bfffffeb36a1ffffffffffec", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0x29e44b7c30905439406e0fbe04d4fe90bae19142fffffee54d67fffffffffef", "0x1299e48025fd253d4fcd1245b6ff2fe0f1af4f1b4fffffe8186d7fffffffffe9", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", + "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xd4bda322bbb9a9d16d81575512c0fee7257f50f6ffffff27d1c7ffffffffff3", "0xa9c149bf483154071e9f9a0cba63fe4feaeb417bfffffeb36a1ffffffffffec", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", + "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", "0x29e44b7c30905439406e0fbe04d4fe90bae19142fffffee54d67fffffffffef", "0x1299e48025fd253d4fcd1245b6ff2fe0f1af4f1b4fffffe8186d7fffffffffe9", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", + "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd4bda322bbb9a9d16d81575512c0fee7257f50f6ffffff27d1c7ffffffffff3", "0xa9c149bf483154071e9f9a0cba63fe4feaeb417bfffffeb36a1ffffffffffec", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0x2a70526fd20c5501c7a7e6832e98ff93fabad05effffffacda87ffffffffffb", "0xaa4d50b2e9ad54cfa5d970d1e427ff532ac48097ffffff7af73fffffffffff8", "0x12a2a4ef6014e549d840afb2099b6ff125ace30d0ffffff4913f7ffffffffff5", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0x29e44b7c30905439406e0fbe04d4fe90bae19142fffffee54d67fffffffffef", "0x1299e48025fd253d4fcd1245b6ff2fe0f1af4f1b4fffffe8186d7fffffffffe9", + "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xd549aa165d35aa99f4bb2e1a3c84ffea65589012ffffffef5ee7fffffffffff", "0xffb9fc862f41ff9bbc63149d6b1dff7e60136071ffffff9c396fffffffffffa", "0x54e0a4dfa418aa038f4fcd065d31ff27f575a0bdffffff59b50fffffffffff6", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0x7fdcfe4317a0ffcdde318a4eb58effbf3009b038ffffffce1cb7ffffffffffd", "0xd4bda322bbb9a9d16d81575512c0fee7257f50f6ffffff27d1c7ffffffffff3", "0xa9c149bf483154071e9f9a0cba63fe4feaeb417bfffffeb36a1ffffffffffec" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0xbe0cc778f95d8cd1eddfe345279a7493778af7bb7279d83bddb084e583d5d5b", "0x93ca3f5f1eab5290433e3dd1c6ae8a824d1a61e7fb85aa8394ac32bbf53068c", "0x7e80c63d770f54286e0405d2b54810c1816360c29d901bbc112c60143af0725", "0x8c5a991c5e004694b1b0f9712a3092f9de5d8540ec982d655dc317fbfa59445", "0xabe7733d240e9038469561a0c879ac510a6e48f56b3ccfe7720f016bd06746", "0xd6fe1a8cdaf826abfd895f9fbdee81c60d8769d1f36026066fc094be5aa488f", "0x9d13152a98a799e18e7647487041c99d21f3e5af1528c0be576ea14ab4b1e67", "0x103bf0491bc8437ba6392deab8fca3b103f5a4dc0526288d558820b22a576856" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_bls12_377 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_381_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_381_poseidon2.h index d9ae7200e..19ea4ce57 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_381_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/bls12_381_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef BLS12_381_POSEIDON2_H - #define BLS12_381_POSEIDON2_H +#define BLS12_381_POSEIDON2_H - #include +#include namespace poseidon2_constants_bls12_381 { @@ -11,467 +11,491 @@ namespace poseidon2_constants_bls12_381 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 56; - int alpha_2 = 5; - - static const std::string rounds_constants_2[] = { - "0x6267f5556c88257324c1c8b00d5871b2eba13cc39d72aa10dde6b69bc44c41c7", - "0x30347723511438a085118166c68bf0c4f4ab5c10a2c55adb5cf87cc9e030f60f", - "0x10db856965e40038eb6427303181e7b7439f1a051aa4630c26cf86d0a0451a4b", - "0x5a3d2dcd541e4faaae7eb143eec847a0f652b6dc1b92e3f39ec23c808b3a5d63", - "0x3b07f0ff7edcf93b1dd0487bc9fab1c6905f9ceee38dcce83efeb3a320398526", - "0x40c73c524b9fd0fab63128175befe07b5c63ccdde9ca10e1a37205c9607fdf8a", - "0x3a933861cf23752376d94dbb24b0f3c61630787928875c07672b68abfb9191e0", - "0x71cc165e208570b2d5ef81db84e3c5e714ea4edfb36fc7fb11ef65a64b2d9755", - "0x6c0dc9eb332b5d968bec8ad68fe24ce34087ea54093f153618434475bce402f8", - "0xaf5bafd335dae5c86967b11d5dcefb986a54c9d60d35eb06dc7a3fd779b3906", - "0x6e12847918f030f2626c150ab69e4be0f13d202ae1f8bc87ea74323e93372e3b", - "0x5565d40e21d059a26db241ca125d9316283eadf144b1318e604e253eeae1fe9a", - "0x608e01b42d3dca09fed9b54eadaaba3e4ce6aefe92b0dc954a0fa4683a9678f2", - "0x16bbe434b24f94e2c40ed1f4f9bd7d17e5be96c3aec15579b35fd80f0f80de9e", - "0xd1be811a8e73220cab01ce981d475522c3d7dd9e2716c3a2cf4ddd541546890", - "0x5997a3affb18f942868b86f8ee10a68966e90bac7bbd8c65ede7e6e5ef1f6320", - "0x4d92e86d270041061eec80278079fca771499dea5ccdc99682a953bb3a038b8e", - "0x616c8c5ce232b9314f694fc6a968446ea9daf7a4079ce1a75fcc950741d680bb", - "0x677e31e7846d9131bdc350eaf11a8ff918dd258ddd800444424afab34dfdfe3d", - "0x4e7d7f85aefc110b233525ee3e53851aee7d3241e2a132585e0e25005eee0b0e", - "0x6a8b4539488b7dddc48c3a226dbda313f906e106f844196d55013d321244f13", - "0x5091517b6a85783108999f8e6bda3c793bef3f2e9589641d260bdfde8bdef00d", - "0xd2703e5b30f54d7f414e901802d54f8c14cd6355415df6e0f063d16bef9c43a", - "0x56f69096811148eb38eec143d32565c077b3d1a4a4351f2b458f43b1659d4495", - "0x622d94d38d1ded428afd062008c5709b43a678f6ba518ec56383e8ffba473504", - "0x2730c607bba7333723a4a44577819b7db82a24574f6d13eee4c856c1ca3de9c7", - "0x1ac5f59256c5004dc1043c53b23800a3fbab53eb1a83f551056f227b514b9f6", - "0x790b92523c973f1c95b94937afbb5796d89481e7a56328b44bab5ba81ae42f3", - "0x1d63b59d97bc269d13964fb3e8771d0acc749bc83eb2f0372484e266142bb8c0", - "0x1a52d04e5f14a3a05f7a01262df9e68c77fdf7e2bfb56c8b252d2140efdf0914", - "0x5aa9b3b808812b284857e8622843a8717fa5cb49b217017f31d79e8d0f963fc0", - "0x6a3d18fdbeb1d77ec1304539b00e6188786dbbc4435269b4c6281367f42656e3", - "0x4743e860df269a85dd76fb99dbe9d840eb669dc859754b3f74805e57ba288b00", - "0x6c32cac3946825f80a434c5ab397fc1a1c6a9bdfaab53175d4cf3d29ddb6cbc6", - "0x333b0eea5da7ed1e3959d16280a361aa77dd24ecbfb28e1b2583ac4e9894305c", - "0x3b503fc333b795ccc0c5bb3ae26b077dc3742cb745ec8821648c5ce7ebd9df18", - "0x4fa5853188d9f728a17532d94bee6fb28fee510380a5d50927c6c5b1ce283444", - "0x5d2ed8a6603a905bac490ebfb9e6c18f0bc9da1bbc2173291b18de6b6186118f", - "0x2d830a53584c5556264852f075c78f7f9eb068016ae88af9cda933d6ae52eca7", - "0x250f4d6780ad29ae60e55f135b9ac80ccc7c81e3add37db276c26f1a2b1b86e", - "0x6e3e9595f59220599e23e830728d4a0c4d62515ec1ed10b72446cf4df5b4c308", - "0x2cd3314555d6faf23ee90cdb884f1c4697ebe98e3a450a624c4d896233b93cd5", - "0x584a408d0f370543b8413fee70a060a394e561f504d8679f7bece4bf222e4108", - "0x499cd53437b9fcbf7479c00fcc21295759074ce9bd1bb1fbd3460237aef4759e", - "0x56a9b567bd0646effd0608d74d537991136098d9a06af6cb3ff8f010efb57578", - "0x6a5fae2b00d968b931441b374e27ba4d03b306bd602d48731677169e75a67e8c", - "0x2e1cc28e390e64aa1d60edb99c0aeda7c8c32bdb01ba11abbad5026b46eccb27", - "0x2d4820000675df7c276beac408fe2e851e734a7008ae09bbcb3c96c70024f71b", - "0xc2fe101a2b52b538b902c6b2dc992cb266f7636e05b0c068385b5fa19e97142", - "0x209b790b78c0e7927c6a178ef2f00b8687fc7bd4f21a9e02578551535002bc95", - "0x2dd0926cf56bbaaec6491513d08a9983f94a910852a7b4ea4bd4222b93e14c10", - "0x4316b39dd7d65b1bb575198104d409b169236a7ade371f7ab176fcbae75a5f0d", - "0x540276d61041b91f6ea3068ec260a9338b6e3da15d934e648c24f35aee04e535", - "0x37af612900b839977b146324c84772c58a4ccc0f6494cc054571827e74bfd2d3", - "0x2af00c93d59ed14c9911e5cb3781d772371e83228e4267bbce11d065c1955338", - "0x62b48779b0cf7ff2c10fd9b91a6ff7b7a99f935e961a5a94aa38f9d4f71c8b4c", - "0x540bf5bbe01f28563bcbe11a2ce346d8231a2cdd0fe07641f9fa89e5c21978e3", - "0x232b6c847a6d23912cb10ecbe50b53491f67f71e9b87a4a30446f2218017874b", - "0xab34adbe77b8f1e57a370e4fd626071eea74b3f0b66644a629efaa0e96456c0", - "0x1a83e43ef118c90046b1bdbeab8dd5cdcab632807c2cd0dc9147cbc5b7084be8", - "0x1ec6fa41b41b672d9005468720918130b642567462a3d557a595d4dc6c56f2f9", - "0x1f81a153199a751a111b8f5212cfc5bf82aacf0287d03e1864f8e5713fe4a17", - "0x2617307587a675f4ecd73a54a7b206162d751cabf3d9fd007bcca4de2c6f0649", - "0x1647be94c515178c7974a245624b642bb1ae6e2d4e1682087e362d7f98bc953f", - "0x6e690b956e00b9e339dec49d675586f661f9b081ee3fa7696d73977658aa6fea", - "0x660b85bc22de06d476c47bf084ad436f59874f1d630c0f5c91fbef51d5e738c5", - "0x32bf3d451b69dde075fc370eaa8c1b77b5c0bc2aab1c7b46da7ef9d1840b0419", - "0x73924b40beaa9c1ce4074c2154d1af4d658c09395a568b99b2fbcc3b5685e810", - "0x17cbb3ee0adcb9d977e96e9152b36042925244fdd0aa184c7a89a58a2dc40097", - "0x29d76a821e3220775c552f6b5977ab94956e52b8dac36ef88ace050d553766a3", - "0x62b1a6c06ab26881a1fe57eceac56b5aec0b96da7211557f4e27ec24296d7db6", - "0xdfc474151e5c605a693a51ae8227cc0a99fdc4524fc2810c6eda9035d04334d"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 56; - int alpha_3 = 5; - - static const std::string rounds_constants_3[] = { - "0x6f007a551156b3a449e44936b7c093644a0ed33f33eaccc628e942e836c1a875", - "0x360d7470611e473d353f628f76d110f34e71162f31003b7057538c2596426303", - "0x4b5fec3aa073df44019091f007a44ca996484965f7036dce3e9d0977edcdc0f6", - "0x67cf1868af6396c0b84cce715e539f849e06cd1c383ac5b06100c76bcc973a11", - "0x555db4d1dced819f5d3de70fde83f1c7d3e8c98968e516a23a771a5c9c8257aa", - "0x2bab94d7ae222d135dc3c6c5febfaa314908ac2f12ebe06fbdb74213bf63188b", - "0x66f44be5296682c4fa7882799d6dd049b6d7d2c950ccf98cf2e50d6d1ebb77c2", - "0x150c93fef652fb1c2bf03e1a29aa871fef77e7d736766c5d0939d92753cc5dc8", - "0x3270661e68928b3a955d55db56dc57c103cc0a60141e894e14259dce537782b2", - "0x73f116f04122e25a0b7afe4e2057299b407c370f2b5a1ccce9fb9ffc345afb3", - "0x409fda22558cfe4d3dd8dce24f69e76f8c2aaeb1dd0f09d65e654c71f32aa23f", - "0x2a32ec5c4ee5b1837affd09c1f53f5fd55c9cd2061ae93ca8ebad76fc71554d8", - "0x5848ebeb5923e92555b7124fffba5d6bd571c6f984195eb9cfd3a3e8eb55b1d4", - "0x270326ee039df19e651e2cfc740628ca634d24fc6e2559f22d8ccbe292efeead", - "0x27c6642ac633bc66dc100fe7fcfa54918af895bce012f182a068fc37c182e274", - "0x1bdfd8b01401c70ad27f57396989129d710e1fb6ab976a459ca18682e26d7ff9", - "0x491b9ba6983bcf9f05fe4794adb44a30879bf8289662e1f57d90f672414e8a4a", - "0x162a14c62f9a89b814b9d6a9c84dd678f4f6fb3f9054d373c832d824261a35ea", - "0x2d193e0f76de586b2af6f79e3127feeaac0a1fc71e2cf0c0f79824667b5b6bec", - "0x46efd8a9a262d6d8fdc9ca5c04b0982f24ddcc6e9863885a6a732a3906a07b95", - "0x509717e0c200e3c92d8dca2973b3db45f0788294351ad07ae75cbb780693a798", - "0x7299b28464a8c94fb9d4df61380f39c0dca9c2c014118789e227252820f01bfc", - "0x44ca3cc4a85d73b81696ef1104e674f4feff82984990ff85d0bf58dc8a4aa94", - "0x1cbaf2b371dac6a81d0453416d3e235cb8d9e2d4f314f46f6198785f0cd6b9af", - "0x1d5b2777692c205b0e6c49d061b6b5f4293c4ab038fdbbdc343e07610f3fede5", - "0x56ae7c7a5293bdc23e85e1698c81c77f8ad88c4b33a5780437ad047c6edb59ba", - "0x2e9bdbba3dd34bffaa30535bdd749a7e06a9adb0c1e6f962f60e971b8d73b04f", - "0x2de11886b18011ca8bd5bae36969299fde40fbe26d047b05035a13661f22418b", - "0x2e07de1780b8a70d0d5b4a3f1841dcd82ab9395c449be947bc998884ba96a721", - "0xf69f1854d20ca0cbbdb63dbd52dad16250440a99d6b8af3825e4c2bb74925ca", - "0x5dc987318e6e59c1afb87b655dd58cc1d22e513a05838cd4585d04b135b957ca", - "0x48b725758571c9df6c01dc639a85f07297696b1bb678633a29dc91de95ef53f6", - "0x5e565e08c0821099256b56490eaee1d573afd10bb6d17d13ca4e5c611b2a3718", - "0x2eb1b25417fe17670d135dc639fb09a46ce5113507f96de9816c059422dc705e", - "0x115cd0a0643cfb988c24cb44c3fab48aff36c661d26cc42db8b1bdf4953bd82c", - "0x26ca293f7b2c462d066d7378b999868bbb57ddf14e0f958ade801612311d04cd", - "0x4147400d8e1aaccf311a6b5b762011ab3e45326e4d4b9de26992816b99c528ac", - "0x6b0db7dccc4ba1b268f6bdcc4d372848d4a72976c268ea30519a2f73e6db4d55", - "0x17bf1b93c4c7e01a2a830aa162412cd90f160bf9f71e967ff5209d14b24820ca", - "0x4b431cd9efedbc94cf1eca6f9e9c1839d0e66a8bffa8c8464cac81a39d3cf8f1", - "0x35b41a7ac4f3c571a24f8456369c85dfe03c0354bd8cfd3805c86f2e7dc293c5", - "0x3b1480080523c439435927994849bea964e14d3beb2dddde72ac156af435d09e", - "0x2cc6810031dc1b0d4950856dc907d57508e286442a2d3eb2271618d874b14c6d", - "0x6f4141c8401c5a395ba6790efd71c70c04afea06c3c92826bcabdd5cb5477d51", - "0x25bdbbeda1bde8c1059618e2afd2ef999e517aa93b78341d91f318c09f0cb566", - "0x392a4a8758e06ee8b95f33c25dde8ac02a5ed0a27b61926cc6313487073f7f7b", - "0x272a55878a08442b9aa6111f4de009485e6a6fd15db89365e7bbcef02eb5866c", - "0x631ec1d6d28dd9e824ee89a30730aef7ab463acfc9d184b355aa05fd6938eab5", - "0x4eb6fda10fd0fbde02c7449bfbddc35bcd8225e7e5c3833a0818a100409dc6f2", - "0x2d5b308b0cf02cdfefa13c4e60e26239a6ebba011694dd129b925b3c5b21e0e2", - "0x16549fc6af2f3b72dd5d293d72e2e5f244dff42f18b46c56ef38c57c311673ac", - "0x42332677ff359c5e8db836d9f5fb54822e39bd5e22340bb9ba975ba1a92be382", - "0x49d7d2c0b449e5179bc5ccc3b44c6075d9849b5610465f09ea725ddc97723a94", - "0x64c20fb90d7a003831757cc4c6226f6e4985fc9ecb416b9f684ca0351d967904", - "0x59cff40de83b52b41bc443d7979510d771c940b9758ca820fe73b5c8d5580934", - "0x53db2731730c39b04edd875fe3b7c882808285cdbc621d7af4f80dd53ebb71b0", - "0x1b10bb7a82afce39fa69c3a2ad52f76d76398265344203119b7126d9b46860df", - "0x561b6012d666bfe179c4dd7f84cdd1531596d3aac7c5700ceb319f91046a63c9", - "0xf1e7505ebd91d2fc79c2df7dc98a3bed1b36968ba0405c090d27f6a00b7dfc8", - "0x2f313faf0d3f6187537a7497a3b43f46797fd6e3f18eb1caff457756b819bb20", - "0x3a5cbb6de450b481fa3ca61c0ed15bc55cad11ebf0f7ceb8f0bc3e732ecb26f6", - "0x681d93411bf8ce63f6716aefbd0e24506454c0348ee38fabeb264702714ccf94", - "0x5178e940f50004312646b436727f0e80a7b8f2e9ee1fdc677c4831a7672777fb", - "0x3dab54bc9bef688dd92086e253b439d651baa6e20f892b62865527cbca915982", - "0x4b3ce75311218f9ae905f84eaa5b2b3818448bbf3972e1aad69de321009015d0", - "0x6dbfb42b979884de280d31670123f744c24b33b410fefd4368045acf2b71ae3", - "0x68d6b4608aae810c6f039ea1973a63eb8d2de72e3d2c9eca7fc32d22f18b9d3", - "0x4c5c254589a92a36084a57d3b1d964278acc7e4fe8f69f2955954f27a79cebef", - "0x6cbac5e1700984ebc32da15b4bb9683faabab55f67ccc4f71d9560b3475a77eb", - "0x4603c403bbfa9a17738a5c6278eaab1c37ec30b0737aa2409fc4898069eb983c", - "0x6894e7e22b2c1d5c70a712a6345ae6b192a9c833a9234c31c56aacd16bc2f100", - "0x5be2cbbc44053ad08afa4d1eabc7f3d231eea799b93f226e905b7d4d65c58ebb", - "0x58e55f287b453a9808624a8c2a353d528da0f7e713a5c6d0d7711e47063fa611", - "0x366ebfafa3ad381c0ee258c9b8fdfccdb868a7d7e1f1f69a2b5dfcc5572555df", - "0x45766ab728968c642f90d97ccf5504ddc10518a819ebbcc4d09c3f5d784d67ce", - "0x39678f65512f1ee404db3024f41d3f567ef66d89d044d022e6bc229e95bc76b1", - "0x463aed1d2f1f955e3078be5bf7bfc46fc0eb8c51551906a8868f18ffae30cf4f", - "0x21668f016a8063c0d58b7750a3bc2fe1cf82c25f99dc01a4e534c88fe53d85fe", - "0x39d00994a8a5046a1bc749363e98a768e34dea56439fe1954bef429bc5331608", - "0x4d7f5dcd78ece9a933984de32c0b48fac2bba91f261996b8e9d1021773bd07cc"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 56; - int alpha_4 = 5; - - static const std::string rounds_constants_4[] = { - "0x1a3bdcbfc11dabfb6ed0dd5f5a9b38191488bce9eecd811c10f9378b32db8c61", - "0x52b733e857912fdd2248dc9638dd79b1ce18b285b27792238b44c2b23c0f5d5f", - "0x47d6df02d73e6c78ced550ec8df1a459ac41f318d8b904a37652b581b2b766b8", - "0x11ec284726dddcf3cbb2b81862c9cd95e9de81ce0317302e1ef432d59b913388", - "0x19e21d749905904f3e10cd57f7817c2564c06ec1b1e229def2129e79a7a77738", - "0x6eeecf4c83e1ec164217f3c00956d83c3bd845bee2d86b263cf3bf89a345e5e1", - "0x10d5808ab47295f7a950dc72f968398b9c67426a217811b9bd7e97f2a261992f", - "0x25d334fbadcbfd26449c4ce1472f961f7d401a3ddf40a70af5c10ac9176d151b", - "0x3ef8a46ec07ee551ecba60b1601cbf6e3664418331a254729b7c6a5c3d13a6c6", - "0x30d373e298c09d2a6efe661d708fcfa6163dc61ae1eb103d98cf88c63e482125", - "0x18769839949b2dda9ef3f111acd86e10250ffad4c4c4263ea970e4f4726cfad7", - "0x2c941286d1534ff3be3a66f9dd59833e65b1fa67db23511f7b4b2ae3b3d66bc9", - "0x8b6d9c90b4139ea70497ac8a22b30fb9b76b8ceabf70449d282b57d98c60ddd", - "0x3a8a2dd917222a71ca678b5c0a803a43c62de2f2c9fe37931b5b2a017fe64638", - "0x2dc17308abd0e731b3cffafd296cc3e6e2403dc563baa1c797a68da9754dd207", - "0x1d04e542f54431c23f9d1812392a0c87203144e343c459d3ee640b04e203be6c", - "0x500760e2ef6bf463fdecbf7b47f4adaa8214c797e59359439d63169e1cdb9dfb", - "0x61f36faac1c12d756dcc3b5491f2b22565409a4e952b8f8e726ee126c0e1c0e6", - "0x49e72db524a48243849fea068e58d0c078b0c738cd482a2e2160602657456ccb", - "0x4a74677fff94821e97b20b86063c36d35c6a2908c0a19a9f130edde9c8ceb6b5", - "0x62d27fd5080b44a436e13066ce1c80ddef2af086c2a4806bd99fa02de9726ded", - "0x15a26c92fc51dd285a61c2c1379f6731377aeb29c62696aa6a9c109c2991f200", - "0x1db900a5e9b2685be9f8f02498123ac71bd7bfa40b6853ab527a8d2512b9aefb", - "0x6ff755d237742498e0b78829cd8358bdb831e96fef08eb192b7e334123080afa", - "0x1595447e5b94a64c8b3681f57068e19ee3696440ef785e35123886311f48cd1e", - "0x2b0eabc08eef3abae3304cbb2efc67e7b437bd96b6f7d175daed6da5a2144e8b", - "0x3a345ee8e715f3226e52838652219202efb4e6d4f057f904d69d3fbd781e39f5", - "0x49eb2a07b5da81b57b7aa4fab19e691f9a684baef4cfb5afb6f46d23cbf1a9cd", - "0x3051663ef7de7674506f2c873409725363849564815b8bd291f00b9c60b4daf0", - "0x41a632a7bc167f67ca9c3825021a05b13f81f814ee101d37716e12efec3121f", - "0x6a5ae006b70bfebc1a485eed2c078654dc0f10514e8c739ca2a7019f42444ce5", - "0xf3dba730b64dda2bc2eaa50ede0fcaa86a37c74c3a17be97a9d969fca21fb37", - "0x6d6c02004f2a4cbb965f9e73799041fafb49f61aee66232f45ae09972af08e86", - "0x60391f436a32fdb0eeba8578313579c04c48c126f4eb6a0c49e249ff1c1fbf4a", - "0x570a30710a42539d4440ce9a2cc7d9ac102409a188960d0fbd249fc4352bf3e5", - "0x35cb6ce55352599332471ad8be46ddc0cf598e0e36b8a8fa5fae6f26277b318e", - "0x48a8116b254b171052251f353c93ca3816734e4e0baeea10b4269bbab9a2be55", - "0x126258211a4bb2035121c7ca129eae719d4ddfefa99921a8befb7a160e0f845f", - "0x5bf6985473bc5500f140844f5b66cea85815772cce03596eda60e6c7dcb4ebbd", - "0x5af46d3dd02261d893c418582188d328a8a84ff8f6ac6c1997d3aaadf64220d9", - "0x5e3c84925609016da58df82c1f2b51590e3b91e5502dca2eba13d8354916ddbe", - "0x410e6fb4390379a8b726cfb22a9eaab7232bc4b60eaddb629a4aacfc7dcdbfcf", - "0x2ca5debb9de1c4bbfa0204543dd9757241611cd28b5eac2d7f37baa293fa2618", - "0x4a1554023154a99b4572572ccd5d89fa8745c117a2a85e5786ef6ef39410d611", - "0x2ca75fb22881b238b6c96da6b908f922da8b54f909237051775c64fec8d5920c", - "0x546ea8ad3dffe14c4c96e4d6d8c43c644212fb663486165b34cb26ddd717f341", - "0x6b168ee87f2c532efdb378116dfe462f632a18eccf1e9bcfc740d35e535b2735", - "0x4cf917a780b850292f44502b80865d3664d75213f89e8ae5861dbcb52aa95e76", - "0x2e8dfe9046d8b951532466bdf1b62571b85e551b34c8bbfb1ccd3216271b73d", - "0x4a34d2abd01f09f743cc56a3f87febd60ae5d88e224918d840656da973d9252e", - "0xa3fad26c6318d471fa376fbaf02d341e41e687db6f3da88266de21c7157e940", - "0x131c9df7176eadb9af3a14f0f53a9b87196ef60bbb89b3630142ff8d9d69137b", - "0x5753682a8120106b42241c86deee879263d81fe8e3423e01f567316d9524647e", - "0x5ed9725af6a91090027acfc12100733a9dea89771048aa2dfe40daea9546645b", - "0x2c7b7a87f31ebd2464be9f211d41719b453939d53ff7be07a2cc21741d48b467", - "0x118159eb07353fef60e9733077cc82f92a6e2bd361c88d8122e9a292217757e0", - "0x5b4626e787d4a4b00ba4693fd7900ecaa19624be9f2fee6b9c3b538d4f896b8a", - "0x18cad22ae06bb0e8d043f7928477219e4d38ac544ce81c4c685267089e4c7003", - "0x511149594758e789b440ce534b52b6c508ae1881669d1fa4a7e551ef84e4dc4", - "0x428b8532efa194a7f5cbf4c296786346ddfcfe8f2bab26f25321f5d984dfc307", - "0xfd035cc129e91eac66d841e2864989d1ff4853662166143535603bf9460621", - "0x2c167565114475412c76f0df1961eaca9deb17622c9fb6f5ac8a89a29f42df69", - "0x10cac3ff02125419ac84ff80295589d1124a1e65a94e8d9b63a411317c7f5728", - "0x7213c2f17aec536d0a5196e877d1626a63d7db5b4e3bd77327eb3617b932aee7", - "0x1b86ee2e45fbcd59fa43edee6630dda5cb3b894eb4701eff5fd53967abad2666", - "0xb941850091bd16875f408f183fb93d250c538e5ee1e8979e960b5b499b2f070", - "0x31f75d53bdd5ac603c252925148a74fa5f3bf5d9ffabe64c6e932be904204ec", - "0x55296a48dd399c65798cdbda11e89f26f998f2d33cf328e87a1c364e05be492b", - "0x191175ec337e64a48785a083559176168bcea3db2822630c48f1d497d03e1e35", - "0x33200b518e6b1a1e96ba214cad18929e7f5b4e3336e522c5fa1febf69c0818c6", - "0x2f989e24f97dc06c075bb53404e3eaaae32a1b6d89d9e09acdeee65712aa4216", - "0xde4b77163f1572bbaa325f48bde7a429b6b0f803ade45a0e72cd2bdbd84680c", - "0x6af270d408f492402b7271432b6c443abbd1f0e220888d73f47498d59044d7cc", - "0x3d5b5310e7b6be63be8f12594ecd68108f4b3f6266683b13178d0c80d8530c2f", - "0x5f69d748d06e22916088bd21fb472334ddbe5223ff494b6c0dcdf62db69d43ac", - "0x6c1fd7dbb3298da86dfe5d0435b26e0a91fe6ad6aa25b9407d5da544e6b9cd27", - "0x37172dd49bf14ebca52e1c31b60f31de8213644e330bcf2cc59684606e62537d", - "0x509cf829b68e58861c3d6bce6046ac1b6e9c065378fe9556348c0c1814808e20", - "0x529d5dd132f5cb4b71994ae6b330b7944f0fd8ba319582d2414b9b10768b7448", - "0x5d251391abee228833dbd24be99d163ba9f8c92a2cf73a4e1f8a87e9c4ca97ba", - "0x1abe1d77226f2eff6f1a6bfc6c8d9e00dde1da9d67858e6984e53bc2aceba535", - "0x4ca74ba72baea6d84fa8f2a05e387a1c41a5a1b2f1a479fb11bbf9d5e09bd01a", - "0x232bfa6a3120224814967315ebf3d8c88b2eb0ea8c20c79ce854f90aec7a9b91", - "0x109f5bd722c8cf28ab6a3852970bcb665f398a8dc9d331958dc291d49a1ba9b4", - "0x4a181a5de6c79a05c02533350ab51deee24b8f5b9154c5cf09ba5e25862ae176", - "0x6e063b99c16028df94b1eb719164ae8c8336894791516ca2c37c5a1a394bb0d7", - "0x6bbd2d3a643d301d25a8cf156542165abee3039068fecf501e9d39f313ca2a87", - "0x4690fe1be7c7b8c10c81e63f5e508fe93853c61f0435f81eabc9997fa3b99f3"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x7564ad691bf01c8601d68757a561d224f00f313ada673ab83e6255fb4fd5b3e", - "0x6184e3be38549f7c0850cd069b32f6decbfde312dd4b8c18349b1b3776a6eaa5", - "0x419289088178ad742be6f78425c0156b6546a18fd338f0169937dea46cfb64d3", - "0x3244cdec173b71a4659e2529b499362dac10cb2fd17562860c8bb9d0fd45b788"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 57; - int alpha_8 = 5; - - static const std::string rounds_constants_8[] = { - "0x53ada42ebdbe3750f185d8aed927c2a339b1023dfde196b58aea362b1458208b", - "0x52a4bd5eaee58d29bfe574cafd97f987b1da709987e3d009ae971b0c627edad6", - "0x3b7abfefc73e31a012cebfd0420df327dd6cf8bb1a94aded25e40cb1d97ae623", - "0x18f6087444787b863f51d5f92722674e3440a076d35b3827ae2a34e2349fe613", - "0x1f6c10016b4ca694f41014517b6fae4134912bdd35b66c1c61a40023f362f7e3", - "0x37f5dd623b97256aa92ba9838b52e6b951481779f841cf5b158b52b264e19542", - "0x3bcb78486b25ea78993bdcc3ac524daa00ccb29bace59b43147a6cd34e90ea9d", - "0x42f7f2057893b0118ba72dee0390745595018499c07080263525fbee179f453f", - "0x1ebff9e98d8913caea56fcfbde1fa0e28e7c88a6fd26ed1caacb2167ac01d46b", - "0x50bc0b19ec65ae49190380dac906851effc5ded598dfc3a6dff9d193e28caa92", - "0x173542f5c5f705e8c07eebce465ec04075911da44ffeba6135da9b9908661651", - "0x104f0e4495d78b0988796d5099b0814c068357681e1f68df2e7589eab107bc18", - "0x3aa82015f9de71497b0d3ab99e353f15fd90297226b3b0a721ef4637c3266da6", - "0x218a066557035447f5f65c9ca1f6591b2e89836299bebb6434a4dc795df2575e", - "0x4629ccf1af64824871ea33c70b354c6da36f8fd52c3e2377c7bf9ae7f3e9c30c", - "0x4eb2718149318548c4f70554ea54d9e86c4fe4b5fe84dc4093b1369060a39d98", - "0x4ef417e3aeededf50ebc47a5a8e2b571f3acbae751b3c263ee26c7cc25545b5b", - "0x5662913ab2c59dc3413a934f86805c7442b258adeb728c3edb61a5c762945b84", - "0x12e9df9b98795bd66de91037d43a8480cde436b30a5ed77be71f9d6674d7d445", - "0x4927f30e0d987d23605c7cb4d903a3825bdc6ac7d08cecec1607621cbea26b47", - "0x9388b6f741eeafbfc7cc4479778c2ea0013e98b33b767d117c0bd780bc6d7eb", - "0x653915b04769ba57e58e29a163da6105c18897fe0c43754fcdf4275d0a89fcc2", - "0x32aeaef7bcb8b97f927022113baffac5515ab9ec7f6e56c94924a787ca3b1043", - "0x14d39fe74d6c0ce57ba40de0dacae628428f0b3021ac71e47856eba4ba1068b5", - "0x65dacaec232936d47c3441c960736cfa3fdbe13e2599263ebdd5453cf716dbbd", - "0x30838e97b66df6a39cdcda903a9c7f2834cba1f11c5a18a1a25ae1a851cd7cc5", - "0x2ba21920ed4441cca37a95beff2c1dbabc66c089fab42787feb9c7d63f563db4", - "0x48e82727bd3946dc067719d5387e7d8d8b96d150708c6007fade6ae7d8bb97f7", - "0x72beb7592e1a8b5ffb67f9127f7eead42ae5c9565629b44aec7ee8064664b581", - "0x152c4c7e8f09d7d288077304f9e6f23d7be63746f73a6b486d66debd68be87b", - "0x7658150e9fa7bafea32db94237a985857f11e7179d0d1665f5500eee99a6bbd", - "0x625e07f82a451842d18236aeda5ea8848405c54eb2bc2e9c721715d89e60e00", - "0x6e8e2fef1424c978db61ab5307c57f5ae977cc0f992978a079898b818df71c38", - "0x3bf1dcb8edb1778b295861f3f44653974369aadb6dc7a657ecf1e9b9f9975d0d", - "0x224b5e5260d5a374a52d205dc4cf2f6ddd2e268c19d4d8c23a9a83ddd95f3b56", - "0x258ba50efbf08421f9d84439e7198cf6d6d744c322496cbee7b0fad515483ce5", - "0x57a9861d98e4f0c7f48a1c0f78b8c254db8f9023da33c0ebd80e6a2fac37a9ab", - "0x6b4a81edff2101a784940a5d94d4997e1a7064e7d11cb30c8d44fc17fce5c7de", - "0x646b6fe0fc67d8eb957fc7f5c71bb2eb49deb4d800f869f4a851d48452837f80", - "0x72d1470e483ec6a6dba9515903f930b8913878c4d61f75264cb78bd6eb3897d5", - "0xeb84e097a3c154e3edcad691467aa2833cd6e2c034fc67c4aaddea3e612c0e4", - "0x16726722e28b6834cf52a476e2c85a7796db36654e163d98a90ca5c9c5ec5cf4", - "0x603a8ce41cd89892de62f80c2a69bf7c525ce2c9d73e179a40335573dafb5344", - "0x6d29a4353cb4ce51421f99e98cf3cfea5df6cb84fda5972de3507926e1ce8517", - "0xb4bcf8b8440ddfcd96960ad3a942f08ee530594a22ba68902ac5cdb09dcb004", - "0x57f898067bf97291642fc3f277c72aff1815dbdafaa153dd3f4dac4cfef65c4b", - "0x21f7a5a0c323149d5ece7d787c5fffc64e3539ee2a9d0636bdee1fd4fc743195", - "0x252bdc65bc46bae728b14a2cd124f9d89fca1d094a13938d5368bcbcfb61af24", - "0x49e04438484178086f10025d4dd075129db6ee0543de3cd6260f005cbd1cfd12", - "0x284070bc321a19aac8f72293ef5ee4047a25905571aa0fc0c92a99fb9aae502d", - "0x432b6f998822a8bc1863d18966f0257e4ca02860d48b5da94b54c44e50148e9e", - "0x2250a97daf4a6ab7e7ed38d562e45e557c6537095d5e82d8f8770c5606cc3723", - "0x2190b0a04860c1754bfaea7c6656754719019afda4db1c2bdcc02e7077cb8fe4", - "0x1ca5242b5b822ce4e547ef1044c25fa8e4e8ab34740ee80934bb783dfcd8ff00", - "0x13ef424fbfa8f57f530b7472049e399b52d243ce631f46ab53e83896cccd1753", - "0x313b6724e1ef1a2f8313faf995b286ca6c4e2935c938eda423799ad1ca4f074a", - "0x71d6f906d7670070ed88307456824180c88df4d6c5c430ecde2d401468317dde", - "0x5da276ba589d6ae24ac895bf495c021a5db46841aa15592ca792418c610392df", - "0x5522c5df7aad8e48c28ff2409728ecbff493cde8ba22627834b472bd5f7e6159", - "0x39fd68c744782320742384c631da42657f76ad1fbb4b31cd39f9b99871a658a9", - "0x7073f7f19a99e127202010143d73eb9c607b8a472d08eef5028c014296aef92", - "0xc9b173245a88129f945616b7753804a79a923a9486099cbc68eeab1a18a3ecd", - "0xbc470541a2d0d36132b8c062b988a7a7fc617a194763d1df0d185870d435214", - "0x14cef28cefade54ab09245615dcd4812f5838cb7e53cc3994db36597a839f598", - "0x673b6489cf57eee2649fad4ed7917c77c01a510091db44cb0631ddee2970fda0", - "0x1adf80dd643887e745ceb8f8a7482eba2fa9e3b2a9d78c04e34faf05edac21fd", - "0x3421bebfd00f6d9984f8ae8713583cf904bc1cc931d9f2207e46f316bee5575b", - "0x3377ebbc99869b1130415a8b6ef6828a091bbc962b770679ba2533b859b269bb", - "0x531c3189cd8061e25c7b2880a75b5cf54a38eaffbe16a6bb8c03072177edb17a", - "0x1de23e2b6a76564e456ec0ee314dd1137cb721458c6aea42e68db34f7bee4987", - "0x3c63febcc1037470db1fefde11feafa09f6b93d1bd7f4ab69421204c7b909742", - "0x27f9a7845ff4c11b37eafac24e732e279f871513b7e505964a44962f261079d1", - "0x131e543c8cc3d66c79e2d34b339edb4e8de104f16222108cedf5ede0bc2a259c", - "0x4903aacba7d57fbd9f8d5eba89a65e69c6dc17d00e0689ff78a853ebf2045260", - "0x62c6809bc54290477c60ba3344b68e73079d2acf142f6fe1647bf77f7a9ecc0b", - "0x1e88401ee384c7074e4cf262ce0fad617fac21c3179b13bfb9b9ae28b76b2ed9", - "0x80a8905ec7191f9e1fdaca749100b1eaa03948e2ba109f9b235258574cbc103", - "0x220515bc8e5f1b4b0e074e27f73c02b1fa4a4bab6623eab03681186a26a96dd7", - "0x21d170c9860f7b318902d6e3e7892cd11d1d4a77f6f9d1bbc000f710686be1ef", - "0xab7fc35aa93f80a4ed6787d9b121f34c2914515940f6d8ccbf44a1dc3d5e66f", - "0x920c263adbf43e70433816817a1a36526eba5e26e81a596abc53cbfd4e10c9d", - "0x6263f1b033c09db0a316ee60ebd770795ea8910483248156918ae1f50a203de5", - "0x61aea53c82e80114591feaf47fd76539eccaebeb7898f3861826c064b69442aa", - "0x442d65617945bc65cb2c687fccac2e731a78cf925d848e9a26a5896c7cf7d6c2", - "0x4045127d05c3cb34d005bcc59af6e7bf514c50e8287638f2af91309b1bb566b9", - "0x21248b251f2613ad1e0037db0f662e480ba376a59211d53c0d4005b10ed07a72", - "0x610b8e020b302c1e75de560c266e89758490a2852c7376e76999cbc2ecd4dfea", - "0x4ce82f499dabebd5f5864d7b0545264a332c7bec6bcb8505e38cc6cc87940208", - "0x323b2e2f2ccdb4fa2b7e0aa8ffe80fec5ebb2748371b1ee7367f9403a3017a45", - "0x4ee2adaefeb04dd7d8d567bbc11022fb1ed7be60dddb7c1090bc2c2eaa20b3c2", - "0x49df280184ea12aa38e1b7835016037fbe2214dbfffbed63b3afb3587fc4a2f8", - "0x742c9cd494e1f349b5cdda1354407d15528cdc5b149d52178bd749d11a6a62e", - "0x4c3088160d362a2d49baee41a920d11d4a4fb1230b51923e3e8bc2931b3b1c14", - "0x4146884271f8fddf477d774c4ea7e590a904858958cffbf2ff759727c6f4307f", - "0x35852bcb36414611bd9416003e36e2fda46639647b009f20a1571fb62255c06a", - "0x71380a2e9af86d10d3c853206f27affed5c8bbf04209265ec53dc16c3097cd6e", - "0x316825bc6a3d33bc4574a2bc080b267e9f9032cdba13b392f3cef5651b7bd73b", - "0x39ee257a7ab11b83ca2f84b4c3d2a43b9979593a3baf7fff31a1582463c9cd4", - "0x3a7d9e3631877361748eaded828a1226a8fad1d9a26b904bb7672c5a1098b010", - "0x8b2dde1aa612b89c9634b1984823f331515c10cbe93da28d579b4ad02950083", - "0x286dbe8166b75b79b9382fe5e03d6a8e89e3e14a0d868222534c1840da654262", - "0x5cd2d752b980033b428a3c8428e7c04c13b016659a9db1680ff0a8250be4345c", - "0x664175d23039d55ca0721aafa919aa2d9e58f7a6585056e72f7861cb5c68df51", - "0x17422f285fe185e8409bf4e808013694982a6b828e25b9d026fa94099d8c7f7", - "0x4126fedd4ce3edd708f5504a7fb80d4568974d8efd2522fa777a205b59939d76", - "0x362d386157a988e327180aea82fed73187fc9bb4317c8065074a1cefe3d29120", - "0x5f9b6f0a37e1f10579bb8fc18c0e2f1a9accbb709f555d931d81939baf21a843", - "0x451b11c73a54b552b6772e686b9f372c3a88057e3862538fe4fc93f3bca45220", - "0x6dc7c344510f5dbca0bc1c8a43faae5562cdcef2195d3a98cd1cc0b80937ddef", - "0x1acf4fa571f2dfa559eaa2ed75617022b7926b7e38969c3c404cb6b40a55c8d4", - "0x601692f0671f9a0e5b645b81f6659fcbbec95700c6c49cc26551d006e2e2abc2", - "0x2c418cde54947690050586e9fb648d979a04117c6a985951ac99d3a056091e03", - "0x1099ebe36b8a483ff9160c7e49cf27d1275f35638f60d15c251d004bdf0be43c", - "0x705ac07ef6e6f30e8587ddf3097181f1d6a821978343818ad66d0b2203e44990", - "0x376f4d399472844d9823bc00f9d9ec7251273dc1f085c6aad969986f791ced02", - "0x60dfac12ac5884c13e13677413285279d5f7b5dd0602ae87f028979005ea5c68", - "0x41478c307faeb9fa78ca4fd7779f00688c7b7f77092f28fccd5a0263727ce5c4", - "0x3d7640dc7ad95c1a5fe3bff9b6dd9f66d27bf6bc99d17ee167feeb09c4b77d9e", - "0x427c360b99fe9d869528cf4e8abba951dea32b5b9b6fea4e3f39d9e715cd573d", - "0x4e0fe9315cc9434a08a87aef6d65df043f8961650226f1cbe26bf55dd7ac2b76", - "0x69a03bbfabd2a06359ad8c748bc99ec36cc1e2726940915317f15a813be413a0"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x1118b610c2544efa26b70d9d60ca6ca362afcfff12436cf3b0f8a3ec5895d9eb", - "0x5ba288c5197e71745a8fde16aca575e379dcc19f21042d8b9375e478f809325c", - "0x79a987d87d7c80d5f4a3b4018517c50f5067ecb516f6bd14d79eabaa8349e63", - "0x4c6497b0b99e1f1af4ec0322dc38869b2dfb79db3ab5fa68936cc8b6025aad20", - "0x483b5c5071e90c98bd353556453f04113442f29a1c4c236b4ca31890136bee4e", - "0x3ef76c8bae0aa755dde594d8ec22b157f913323e5b29bbd0652e4b74973ac8fa", - "0x91767b280c59a58a39f293bfc22ae944cb921c2efa240262b5b66312724f20c", - "0x45ef82a5684137e5fc9613e0581cb65b5ad3d43470eacf0f060e1711c4c57624"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_bls12_381 +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 56; +int alpha_2 = 5; + +static const std::string rounds_constants_2[] = { + "0x715f0382563ca6b715c8726b7e3ff77e5f648e40318422744fa900f3616d90fe", + "0x4519d87de1854d248d7e56eac2ec5d448581b74a008200dd665eded9a152beed", + "0x689d9ba29c9684aa157e459055d99081e87bfa6cab5a5eff6f5922834454e4f9", + "0x5f151182e74111a7ac2c93cb722ffdbf03fb0f8d79a17de539ee7dbea285d883", + "0x3ea46c565d7a61d89516d61b38b883a8a051a0e8b975cf4ba324c311afce44ca", + "0x43982ffaf38707def26586d21346697d3f293e134c4a699435c828fc19c54d85", + "0x57a57a951762887ee10a3e9cbde0d1b17bd8ea7634fe79dc4ec93a5e3e7b576e", + "0x5ec05df0c6055942c2daf32f107eee862ccd0105715fa19d885d315b47726694", + "0x6da17dd48d05254a2367320c5ae2b31410514461752c2be4061f278db1f88d56", + "0x6a599ec68c16bcfd39f6971fcd28be0848b1f19305412b95668f3c4603025797", + "0x5e43e0d0f01b06b70795ad03108710079d0a11586c66ebe2d32ebd0169cf5309", + "0x4ca3367ca868d99ffdfb48f8cf2659ae54408e267eecf8151dd5bad211a8940b", + "0x152bc0864708a5b98802008278343e7ddd95bfa09a9842b21d97b2e6cb72f4d0", + "0x22316d7e820d02df70e58634b34342f24a8b41b6efbd8fab565500ea50c272d3", + "0x9a961f64b4025f11859549230caa177c8f190640aa1a6409afbd6fc8b5160c", + "0x4e034f7a56c2f4fd670970ab78be8d613a424ae1db504c8df253ce3706327cfc", + "0x728adb9dea2b683b77150e5d146cf74d65a9f42ee1b200c38337231aa7359bad", + "0x877a2bebaf5080205dd5c8adf705b540bc53d5f60688b83011e11f9759fdcb3", + "0x6198647676cced466899dd878f412bf1315b72bfd7e8934f993b44fcfd74b56", + "0x27da3fe7e09e51e00154290a873d10c8c432cad6ed842b3b81c374bf3b63ac7a", + "0xe57fd1cb06f623fe4fe1f09e0b6894c18784416f80fd259365a1eb1ecee74dc", + "0x2e30d12869f7ce6c7ed44ca291df12a0c54a865b43228f0f054231bfc514ea1d", + "0x50de86245e33b1eaf8ab178effee1ed0dce5e22e39966ab2eb2b1ce9b5b6f7fb", + "0x43d8dceb42a2144edd750a9405b7b666a13bfca1d2b6ee0e96e115e2ccd3f5a7", + "0x369c56a148835b78f7c1f83f23d6fe293e310b92336adf80388c1c10bd1075e2", + "0x43298285e52627484f0cf90acb52cbfdbc02274e44836ab521c59956512cd02e", + "0x14b371a3713eb1fbb94ed5c97e0edf11f4eb284fb59042f1e7b1fce47040c996", + "0x495e5d6d644bd76abe3f76a37d129cdf4bf5737fb09d6cb7cde31813666b521e", + "0x5e1a1a4206645a9d85e7c58d96b322002ede033e4cda14b53b6d87c934d267b5", + "0x35f2e4deb8ea915527dd6ce9287bb875eec805360ba1fe9185fd6a3757bc06b7", + "0x42677d4c2fd7dbf2b6786315075524390270d712a7035a82596c5675fb399edb", + "0x3fcff69c410e58cd43ea1d61e92ce4d7ba44db1cdcb95d8912fef8ade19209f6", + "0x129f4c41b9f094098ff8f522019d29356ad7c51ae490ce0cbebeb661cd938c20", + "0x527ab7a20df6691f3faff2a8dd4f4ea7640608c52c2b7a936122c1a72f847161", + "0x52baf8d742289181ddd03d912da8fcc754f908e995bc635426c0446cb951a7ee", + "0x22f0b63bf49bb8cce6b711f716329b8ebdde8ef643d49e94d54e43f4df74d4f8", + "0x576f917a25969bce2842aafaf37388e9431af66e7099df59e7b46a8ba2a35c16", + "0x509c9a3a57114666f3f1ac5f2456b5ef5d689ff2e393f52372cdb9b4844fc85b", + "0x6718deb4dabc424af6734f3f6820dd6952dabde274c3e11719699e1575fa6d7c", + "0x4715afd7776b3c53b01c483f83409c1575e9526bbb47d68e1887c9d88ccd6deb", + "0x3a28c7816b66cd2ee557cfb562e40e78a62e5498f9048a6e2c183a961fd050c3", + "0x436f6c62ef83210eb7063c01e7717bb59671c3309a8d445f4f4ce094e781b297", + "0x36869c13976d4fdfecfa44aa22a27c5e4996c1bc8e0b96ce5bd96f6f1dded094", + "0x6c7dd61f2a137804b6b518c2ea6fc5c79a6459a62c5d1b094c9388b12d1801ff", + "0xb44a855b8ab291d7896ff677cae9c7162c390b80360e4a830af0a7facc3057f", + "0x5910ef99c06ac25dc2d0ad292c48fb1b65c986af84e9ccf56cafb7dab24d63c0", + "0x6dbacaddd59f21d235a7ca201322070cc30424b58c20ea3ee2ae19994d51c2c7", + "0x3087eae5200a728d53f847d4f9d6c084775bd345ef79b29948f62481a6491658", + "0x3e9a4ba71b5e4f0b7d093a70cf621d3d72b8022323d15a584fb8b7316a3ffad", + "0x4324abcb509281661545a1b0bf907df13bb687488532e5b89f51d9f8fa9124eb", + "0x3452c98ba9c7a2fd41ea36bc68942fcf93fce86a393e604777c551de8ce87f70", + "0x45cc350c187d6b3b08fa5f4f904ee88e119add022524ad5ecea49044efaa0a79", + "0x404911964e4503bbd5314cc60a9b44e32a58e368ae24045989d622a64d51cab9", + "0x24e2ae64f7897705f2e61e5fb706d3ea506099e05b432fef03edf2ffb8e39d3e", + "0x2296ff17497d91733b3570deeb1b0fa132bbcc7735736d709fad45303674472d", + "0x40ad1756f02347a722326f2445c839addd774c1ce5fec087aaab90f381ed0caf", + "0x4f4422cebdae9ddfe7f3ffbc96c3a0a5d9dc21238052427c07514bcfde07db87", + "0x15fcbaf05ae16e9f34cce731b75fc3ee606b3a9e52e467cb3c0f0bc3b37b275", + "0xe6b900bc59fb7bb9044af64ca41ec003b514e9d6cab9b75a32c41083bf06313", + "0x55d08bbd29cd7ca9b676887e97b2e5d5b5c7898d33c35b4ea9d584528d6a0ddb", + "0x4df422702f1883816cd574ab55a8727d7ec5688e491996c9ce0df5edf078a489", + "0x304e204da2c140ff2f6e48a9bc52cf12fb0882dcebc64d8969613dfb7d8d315f", + "0x2960c64b1fe6e564c587f90647adea1912f7b1608c6fee14fe9adf972f0071d2", + "0x37fb9a151778ece17ecd72ac4415d827b8ab20132e9fcc22d1de3aa4ba8be07e", + "0x55914ba0b4829332934bff86608348f45c004992ce305c70c03f68ea469820a7", + "0x2fb818f9862d211afe6cbc80e5e90196c3f54261a4b65e1cb3f8371e7ce858ce", + "0x506a167e59fe24c00e182b9d7da8f073bc793dd16a25c86739e9e0c6265c5514", + "0x6fcca97e752a279cf27b8ee9400c6467add76ec53b2602a656e200d60c7024e7", + "0x4e99a6f58a3a0c66aefeb397b4920476f5706df96655ce4c2f80e6081cdf349f", + "0x46510d640c5920c753dd2501311a21483720a2c07278faabb53c5694332ff6bf", + "0x6f3c46b350205876aa221af749c84ced2521d31e5df469113d1bb175947f68a1", + "0x3e8821b8993acd49aeefc6f78150f918497f959aa7b9c7a77bbc4462b7bec45d" +}; + +static const std::string mds_matrix_2[] = { + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 56; +int alpha_3 = 5; + +static const std::string rounds_constants_3[] = { + "0x3c60ddfe849bb8ae12d18fb8f33857dca05825238fd9d4fd923a4b89b973bacd", + "0x5aa2b1ad6e856224adb2ea865a78489b69d5d55768c4c2911d863688fd31c514", + "0x6b89e5d66f4f45b6e9d18ed2b5e4e4419585d02c73ef3cf60c8cffda676a4436", + "0x47eaf6a6deadf10b5fee218837f2d57ea766fc39af830dd5e85a1d5d2b83265b", + "0x2aed06206e95a0b6c4c1f3782349328fe338075716848d902f55a182d9b3d626", + "0x6ea4c2bf0f6d43de3ad35b4605f8f3b9f489083ebc31e4a903d343b374c7971a", + "0x661ab3707cbbe1f35e867c1331fe81cb218e466f1d82b0a8146bffc92385560c", + "0x2282f4348b139b010caa46bc3175ec3985f170183828e2f640a07b187b41df76", + "0x1e2d819cbdf6fd8e229c4821beff97ec7a1b9f75def80e334866775c11b75af2", + "0x735f0821f3c2498d4c120cd2a0599b29eda5708f24a3013e5e4a92477daad087", + "0x4e3468499b48d25d47117a4bcf6a2442faf5435ecd68f59d9b2a18b2f65f7874", + "0x6ae1cdb077a9703e6cd0c05d5f441aa3e7df486c52a2af00ffdbe4d876f7c143", + "0x51141232562c0445991829c8085ca587b33838e5c21288eb935808982e632f99", + "0x36d37db4f8ab61a4c652c65b04d8d0e3a0ae904fd943ea95336deff0833fdb9c", + "0x507ef692a19267f4e0232655a9f04c8d3e7fb02e3abfdde583e00921417f649b", + "0x19b2775fa12bbf42042089d0cbb1e734c9d3597c1a01e7fbd88d157f82b9bab9", + "0xa067e63a2402c3da23d471e36a4567ca68e6ad7db39dab610fe200963534d4b", + "0x50c6bc3682f00da8d59b3619d6d85f623c7546d915380b0c5e1b14cdb5710666", + "0xbe6696e7cb31afff8f2c317dedf063eb1643242be3b451b793c418c93ec3f09", + "0x42ca25651e670866ed8302544713e2527d12badd22857d3b441ea3f9c3451a9a", + "0x2a16255b854599c1d353788c8a986208723283baf26d5e536f6dbd8f307de09", + "0x5f4abb8205e6fe75e83e303ad601164cdcd27b8e5144eec7f07ba7f3ffee20d3", + "0x34ec914bc018eeb45b6c3f45b8750bcea32611d0beb446a8fdf5b760e1eac92e", + "0x52abfa94c7485661857da17144522f71184ddfe8066858f9fb6401f466a8dd37", + "0x4b183c4e8985089f7be784af07b18ba02a896cc39d6c08a197be1e10cb61f49", + "0x5a423018b6375ea732365f5591de18df3ab90bc9ba8b5e6282d68e6deb35d027", + "0x40cb069d0bc6f3d0b1157f1f1092bcf866ff7568cbfa386b2f434f73bd16c0e3", + "0x10803ab3d7a7f64d2468e23da63754607ffc8aa0a9d08d25fa7a3d7c8756e122", + "0x6a02fd24d0162319edd6011fae35fa0158539378f83490dc3dffe6c2fc7b23bd", + "0x21e99fcbd7430d166ede715b2ec05031b2dc5f1890e21b844e3e0aa496b81fa5", + "0x4eecdd99ddcc150e8caf59a22c458ecbc9ecf44d98f174d641064416dd5d7416", + "0x34d901d937d0294236bbf41f0fc7d0852608ef6691eae94fba2c511a99779ee5", + "0x2e0b0436326cf3262344a4ebc96e5b52076a0bbb4a9e9974f05ecd7e4941489a", + "0x642e928f2eab4a42092e5b7aca17c623bdea3bbb69aee8b262a1f4c104f4d14", + "0x63cfbec777020cf65c4f8923d2ac95b485fb811dd5a46f589e74daae1871ae6b", + "0x67d331dcc5935cb9f552c15608ac795dcdc540ceb7e2ed93fd3276681950dffa", + "0x30b7bf713c666bc0408aecab1284ee4286c24d8224e1a216c4a5c157e09f794d", + "0x37c322df899a40e858829bb89dd8736d7db43bad07f9155f11b7ee8e32c80e74", + "0x73221225f6189cf206e86077adeb3d61e7ba75cc571dd2c3e8b819a25994629", + "0x11ee5d9aef78aa6157d571c6111476fb51fe7d920f36920bbbcae9653d42d18f", + "0x2ada539dd7aa07f5621aea83ed0bc168f77f999bdcc7b1fb4ca673ce14c18e65", + "0x10afac5dece001f9826d12f5576076c080ee57200ee095f0d191649985ad39e9", + "0x5ed0df067db65a0d7f1e42758b55bbf16855724d3d3ade17e6bf382f39a7eb9c", + "0x2de9161edcc92ddaf0925f1f15fa91d588bcacbac2cd33d49ed8439b5c1a3856", + "0x395796c10bda9e24f377a8cb7152cd96c60ba94625483c0d6dc6473b7614f61b", + "0x37a0d7c83bef4b3da41b6eef24999192e61d6b1fb3d098d3452df28f5d7e1697", + "0x148600ea168e069c4cccb9623d5ed392fd6e843317ebec59eb883b13bf61948a", + "0x49c2f2c0fe392bb6cae45f5e4e84e8114f6b0c0b4da0147b002b8e4964837d85", + "0x5a2ae633f0931f4a3323e73f0c0444b18a31301c1ded3888561570b03fdd9a46", + "0x36b8a69ad88009e59d04eb07247a9919fca6b6da461d7ca013139c4d5a430940", + "0x197501b2312d20541a56768501be0cbe2def0b49b47c5d03f63aa665374fa5b7", + "0xb0f1daac452550ef48eb8be4011b47dbaac5df5291df99f565dc89c1d67ae34", + "0x145891040ab593dbaa1fefb3c90d26400f3f390162fe03966d13bcd472a28fa3", + "0x16a6cb76c5c39c5861b923081b154bbfb5502f181034b6e49a4da3c66b8cd816", + "0x5e8be8871f576bc8248d05a4eb028990d8144a6f38677b229a0a74749a2cfa0e", + "0x2258d701d0886e25cca18608c61173b7752abbe89de33f7f66704d4aad594f8e", + "0x4320da5c59e826281f4c6223a7779c2850eca01654790c3c0f90cec977db2706", + "0x555e7076ae914e616d958d0060e822abb182769f5137c305b9e68075f4c9e654", + "0x308be86a0c665bb373b6c7ce9add66f57d16c6ce21e8daccaae2b7c8589e5ac1", + "0x28dccc9e231a1ce29b0e747f915fb894f787cb6fb6cfccedcb769eef4b13a395", + "0x37a6a2f4c30178cbd8a13600de2f1eb4abd4141f0118c549086844fc32602098", + "0x5869a40c93289b38791d9f4bcf4e9a12fa663543096f11bfd2fd6331dd72fa63", + "0x5a4eee732e5ee8614b99dfc4e44b429fec363b7dd0782203a6de4e9e35fa03c6", + "0x2dbec6a1e15ae581459dd6e55e8e1aaab1e9e5d8283bcc4efe6ed7fd68e17a8b", + "0xc5eab12f73b840efaf40289cd21706f3f02e00e0d662f413907c2696b88a550", + "0x6da576d94bc6d78daa25b65b37f733b7bfd0d11f70a42a2f71c3174ca3f2cfd8", + "0x69daac00a9fa50fc36bee5e5402ad4146439eacac9d0cf28e813b4dcc47f3695", + "0x361883d68dd996c2019fde9bb4b08495737f28f82af42868f71e0ad1d7b0aab", + "0x6b765970caca889870cebeb6c0b0b71638d1935ec01ee2ae2902b1a6e096e692", + "0x413eb940350f9aa9210654f8e6c8f5f3b101e13c4dfc35f12aec8b6eb2373f97", + "0x38b90925e114782e3388037554cfb69d7693de667ea5a4f766da887bcf6254aa", + "0x2e17224c79970a1d14626e2f87cdc936dddeaab781089f8c34bf3ac86232859", + "0x54a5cb233b53fac73bbf627b45f4d6a2b38581b6e4cf8c80098328047df3f881", + "0x58bec3ee8bdfb33fe4a253edcf43ffbaac51d49285384caf229b985bc74093e", + "0x3dd4c1e1728bcd5834c4bfb522e462dcdada1706b49bf947c50a8c75718e65d5", + "0x425336cc06a888397f93a3f70c7580fbb297f1b7c6f721905629f49c4e845b7", + "0x2540fb39809b2c3ef8298779a93c276ca73b850fd6d6168b54ff159b0c599f77", + "0x52d1c572c19168dcb8fc48ffcc5602e005213548f46e3c9efef7dbada360c4f5", + "0x3c680d4e15bc10c878f559cd9e3aab74fecdf7d55b1167e6ccf8bc5adbde182d", + "0x57d80bf47d3acd9990b6f52bc509d197769168405fbe4987a48948cc89ff5510" +}; + +static const std::string mds_matrix_3[] = { + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 56; +int alpha_4 = 5; + +static const std::string rounds_constants_4[] = { + "0x6828c75269f361bd131361fc11a531a5aa06e039f2a66dc450230dea8747d23", + "0x59bbcf17856e2dbcfab7b91d15f0af783d0032b4e142199f10483c4fa999c9f6", + "0x6cddadf411dbd9936e5263366a37f27d4b72d1adbcc359c55bf4a0f28f8a6fd3", + "0x711799af3e51f52bb87ffa8fce3fa7628d1eb63204d478bb594ad8a12bf9c9bd", + "0x6841e7c79e3ab5dd4d2c2fd70faa063fb8e12a2d95c2abb7b8ab644502dac7cd", + "0x39bcdbcbeba60f5d3c1632ec5d87e0dcbf0ba42dd73468cd9f1299ab390187a", + "0x28d6378f2cb3ee3094859364e660deb810c46c9d0c6912da7875798ce7875807", + "0x53edd8b853b62b011e6c7bee3a814dc7995f9477cc199cd1868b069dfe4f19c1", + "0x13a22d0e936ab2515c063324c79f2c62758de501d0bd2f04b6762f03c1b42141", + "0x2880f2d8a289153f6f65fd38780ae8df29df29b7992d658ee5920d1de6d4ecd4", + "0x832047747753014d72d79ea192c3b5972e46929617070ea1c5d3c64fce50a1e", + "0x63f20711efd10c84e3d788820cf24c22806d97da1303ca41393048fe7cb29439", + "0xed873620186d16033055027f78f601e8eb9022472642985f30664e81a233a38", + "0x8becf5826cec1343583f2f5b7fdb5b6cea0b44c7649ad31b211d663d75f33db", + "0x2f449d84bb22abb402e19acc42eb973383f8c4145f6b1352d2aaee14efe4320", + "0x70356fd068d5afab70af95c2844491579696923beb6074afd33871d278acacb3", + "0x72f2e689cb5fd13f7bda98b15e4e3da81a9382f81d12f2267a46fada52cf7cdd", + "0x1d8e18f62c2a3c3f8ffa0e2ba5ee5633c8ae05a0931d3ca1cc565c492f3ba20", + "0x534af4c40d6fb0540fa2fba06260d7c9422b61b44d8281f825e4458d4d7e56ff", + "0xb2babc9751ce5a6c6274d62ee1009f466115f5a4e74c7267c0f1173cb548e9d", + "0x5037fb5b51b0814e1c527e1586379f6495937320bea412aedb27e5d1f2188f60", + "0x38a6a205288851d4ae3a220024fefa7c1dfd9dbb46a37a581ba9bb9c379d8595", + "0x296a5c9789457c7180b26f87ccd9416eb20a5e897e3df6221cadac113247de2a", + "0x408179d38112eee6677054131757995e00ba6f918e81c61a2fcf92f2c4d3bd74", + "0x1521565b5172bfca94970afb787f01a93500a9c7cde9a744a3ea3fb209bfa102", + "0x439fc4888740c84a311428a6c38ee7d99493adb6e354a51c6dc8369e29573dd", + "0x1fe8c0af3e11eea0bacc5d55b14cc455462c1daec9f56ab4d4aeebcc963f9809", + "0x56a54a7770c0e76c2ff7753b5f02cf32523382074f54ca2367ba8be184309065", + "0x33d79bb36dd3e831afdcd7e9ba195dbc98b6d588fa45f040ee1376100a8fc416", + "0x14687a8d4a8e4aca2c08ea62e4b7148d8cd1962eb2f8e57d164c2c5e6d2df26f", + "0x4328381aad81184303749b81cdfe00ab68da967a1b22f1be44b257a2ad1a8f24", + "0x69eed8969a93de9d736bf93f00fab1943cc5cc452e857cf98f92875610ef48d8", + "0x6b62ba91c8d9546e5404fc811a0f601735f02716b5af66ccd0e64980455ad6d", + "0x1801439530c92b72db3dc3b9e4b81378d26598fceb6da9a1214a890e95e8744c", + "0x353dd7d95055e05620827de44de000f490897a1648c7912a101587ed88e63ee8", + "0x18f8e850eea578ea707e161d697058094df742aae743c542972f5f2e3e585b7f", + "0x2d00f3443a8ec8b28a5c6f500210baaf77db6fe8e5b3913cfa60c3587813916b", + "0x85f00cbedc42717805b8831e15d7c52ac711d67be66ece633bcdcdbbeda45a5", + "0x6ef1eb35e2bb64df2a7ee8ac9fa1767d02e878e02b37193af40b88899cec8e73", + "0x3f0236ba2b7ad21b5d4717902288e629a0c3b0f27a01e9a6a14992591e2a5d5b", + "0x5bb5ab9dcd34ab910d6a965b04d94cc86fd920f91bba54ea6227351f3a41ee6", + "0x494c0abcb89bb60262dd1e9430df4ce7192b874e9d88b92b145826bbe806b46a", + "0x67266ca58cd09eaa47c8b0389cc3476625637ad80874361a26339160d0fb8900", + "0x17e486461ef1215aef30524ca5de08cba584d5d6f9f5bb2acc18911d96b37f7b", + "0x13fd0f417f847c1d23510d924c5ff7bac8b27ad7cd5902b5b9a149b027e9f312", + "0x6711583231151c9cd9b5f266ceb3d6557dd197e7d746d79686cceab1c59c59e3", + "0x6b73f0ac429985aa4afa6811776e79f73feb5a2f0ef4410b9a2e983f897301e6", + "0x40248ef064340e8de829c21046f1da4e7c758c3299a12aad8e8e9123b027eeab", + "0x55a6390d1fa741c4f22d83bd9722a055044f7401de499f72131b94963b2944cd", + "0x20e91727640e13341316a7698d05c5c82129af1b8d1134488ef18feb31884d8d", + "0x10a1657433058b173f971a7c7128bb2cf7ec5b5ff0927d62392c4f9bbff9478", + "0x212e1c5965d0fb2ca4a78c503e332732994618d8feb7bd8747b7633c838a4a6a", + "0x6909f322590e793501cb29b01e374579e01e8fca504561600f04a2e02c88f7ad", + "0x10145bd7dc4816f5a688f3212cb3d5770dcca4dba426aae334a0de00db4fd354", + "0x171b2d14a25327bae7d8aae3cd08952ae665d8c9f9fd46e53693f8882c865ac3", + "0x1fafd577daebfe80d7a96a8b9ba64bd086ef863125c4cf80e47235881e34f4c2", + "0x57d76ad29bb6a65ac22952bd52d79de350f10283aef23128f07d0c2d121c2ca6", + "0x32f8252c26012e17888627c9f65a1f542683530f2f98b6c7c58ec8b3468edd4a", + "0x3d9a53e8e33f1b70dc832fef4cff32a0f2103552847891aaca9dfd6bbe3baf57", + "0x14ebff485f441ec7b7a290296f429073d01b22dee6384eb170a5e8d0b155dcf0", + "0x388573860269783be65570f4811603a39199751f0b50321f8fb98979715b4192", + "0x6fe14d07d528c622f0618157a0d88e4189c3387bab98e4912f922c4c3a01a16a", + "0x2665a845c424cec1624894468f4bb4397628506ea2e5459e305757d1c1b1707b", + "0x4e984d2d7d2504ebd249fa106371fc40c843b26c6911b3b955b63effc1f25881", + "0x6847f7699ec3d5e45a2ccbcb538297c7b6920c4b32aa6c2d846f7489aa793a61", + "0x705eb993b54d0ac79e40daddec3bc9496108991adc9b0973a040a9e8274bdc0", + "0x17dd30117a74ba3dd0fe9af28a57dcdc2355d754060138f3187378ee95a8b063", + "0xa3dafeb0bc0f08fae704f13779f2c0d5793c4b069042f16790576307e728513", + "0x68367db80df7e77e2cfb239f4381acbcc3ff596a904bbfe98780ce81577083bd", + "0x3fe1a78a73624799bd870bd0112110f6a2cc6c20c90d8007c22a74db6a11f09", + "0x5bf919c6a21a2fb4214ba8abfa12275b93a479efa2a702b29093dfd54b07faa", + "0x5f8fd162106b637984b88ada43f84d2eb94ed76086937d500371a75d649cd434", + "0x1667a3861748df53cb0ca77722764c6a099f646c85c606f64c8ceab76387e32f", + "0x1831bce8be74711cf1a4160c216588b3faff0f5c6d05bd0c7eac694bf9d969c0", + "0x4c4cb92cbef8bddea785743eca3298bb585105d5112593beff4fba92fd7bed1a", + "0x4b2deda08b7e7f95287dd76fb62aed3ad5622ab2b43dee875eab90b91fea2e87", + "0x3520b2b6587a595fb8334111942bb19cea63e9f85bf96dbba8a338c33445cf41", + "0x2a5a5c461243cc94f85f1845a8ae8c177e12a679c545bc0ee707b60a49cbf6e3", + "0x261f5bec7508e5bf1ed0867e5c44886a80b76be9346260b6366f8d8ba3bfa915", + "0x382a28c54a62acf9b843e7332a3ed4c42250b9af7268445d9551cc890afeb21f", + "0x4c5496a3f326c5755dc2a5db6ae6d028ae5dfa1fbe4644f01283bf7eea6b8b3c", + "0xed2db0b92fafa256a844ae043b30eecbe14477ab500c592d9580e85ad0aa3", + "0x551f1fab1cbed0ee0bea39363da5ac4660447bc85cc5b06bb1efba2069dc5bb6", + "0xb6710fd061ac48bafa7f6ce4ea4ea79e15af84f3fc77b387445f16a9b000660", + "0x189427b4b84fb298982dbe3df86868465b87f29b486dd03cd90155e09d4b708d", + "0x72ce52884fbb4674865ee59beffe8318a32a68c44b3006648e8bc61e1e6937cd", + "0x62157bd11d5acd369043ca530219f57b24385ebd20a1aa794beef2935e213c20", + "0x73aadf8e104953c1b24700e436e722a24e286fdf5305dfb28f9f6d0488f88f4f" +}; + +static const std::string mds_matrix_4[] = { + "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", + "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0x54a08f7bd25ca481c4045932e0c9a66f2cf18484285a4ea251d0180d50e8dd43", "0x5f75759f1c6e997d7a57ab6de32e2a71fc383dc1edbb2a0c27da3197a695f197", "0x4d0a51d5147b02542676c5df940ce386efbb1cc5609459fdd6bc86c537c82e48", "0x4430c8f2069b79f87102441529591ac452c249fbde7211548a970a6c8694ac37" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 57; +int alpha_8 = 5; + +static const std::string rounds_constants_8[] = { + "0x2a4d136165ee65a0baa117569e768d0d66d9359e9e1a73273fa3f4a480edf139", + "0x718295136c5d6c0e789424862339ed9c07ed6fc036ac6bcd58d45e90a5e9ad8f", + "0x460ba4aa2c1615b22f5116f6b3eaf693fb14a9af4516cd463cdc1efd0dfe57c5", + "0x650c6753e881657e059abeb958d46b799d67d9f6bd0e460f79c884cf55c1350a", + "0x3c9c0ee25983ff77be38d3c0f5c6a942ba5c6143de896415caa1f0dc689444dd", + "0x638b639f21df4ed0349fafe92d42e1c39ca53b7bacb79a27f43f92381d7a1810", + "0x35e0336204972bb75fc36e857a9c2e4f2b0ae2daae4b08856840b5972e1019ae", + "0x387f47d864348c2d93305eac96048f32a54ac106b5bdfb50e40c4827855130db", + "0x4637cd12d4417823c7100612e12e52331a0bae2b1cfff722202515af54387990", + "0x40d7e4b09b3231374b32afaedf494085cd6dd86415ad54ebe590fa8e8f0706c5", + "0x6cb4c8d66d9d3a366dc1534c84f0477d3f995cd349d5a76e29c8b58fd7cfac3a", + "0x179d8de35d47817f950495ef70a82fc1214ec5dcbfadcbdd4f043c2fc2d6dbe", + "0x25fc0110f8c9fc2d95adf9b3a5e1ab871f5ac14a90d6f9e4278619b56a155d5a", + "0x16459962a443e2ab813c79d260f3d0d0f08fdb55bb1dbd9332c1cb3b348870c4", + "0x2a2010991085aa472455cc0aa0a1bd6ef1c41c5071f047512b2555bbcbfde2b1", + "0x4d28bdb3cf054bc1904918c6e51ffafe0610b29282ed6651b9e4705355a65d14", + "0x57a2f4e8459f05a9347c0295bafd21ccb983e74197241312315b2b3d4829f275", + "0x32b16b1266b3e0bb9bd35a9f76f2ec57d776239530a6ee1fe7702395e313f23c", + "0x6d61d8b2598477cba75d2304e71bcc347319d55e9c1be0f6dea0fb83db6e5cf3", + "0x1e14aee597fa8b8fed387499664228b1837d473c63b5953141be7b09ca51e09c", + "0x5482215f910e3519c84a27847bad6158fa22cb84d90ef47c47f1a7abc0247120", + "0x6c4b0a8f7f4692380d1e684bb37dbcfe7bdd5f300e8b28ad2edf101d62f5c066", + "0x345dae323a3818e3c8c84500b45e7cfb85d9ebe1537296f1298267ed7bc61a71", + "0x5316d5c9bdbfa22508fdd72a4f8742beada0c0819431581cd069c71cd364620a", + "0x5d1586f5c7f3683a3c8dd439baf43ffd4c0454034c29af22ac8c09cbab6f4908", + "0x2f86b9af13a36383bf24f0e747fe288d70629eb707ad24d712345e1c7f743f70", + "0x5cee917156827f3aeaf5f4e3f0db67768105b8707eb6b16bf385349f19acd8c4", + "0x63bb77264854318a088eeed3778f638cd5d2c4cd2f05c272cd271684bfd9f679", + "0x70145f28c495394e929004bc6e07929fbb73036c7946d66537a82e8613e4acd0", + "0x28924a5356af3d9790f625b8dd25f9c6fc6f51246ea7a6d17aaf52560f5c9111", + "0x540de6d96013ad1c4e1bbb2f798599265f4b84827fd26b871d1713f801179296", + "0x4233358d44308e21e42cac7f638a87bf604a405e8bc74e37547d5ffd7a86e67", + "0x125ca2f323ae44f5150cbd04bbe23448f333eb892c45c2236e1282a8bc54c922", + "0x46fd588c869c0f3b8feef095c5afa509c5b3746ce106cbe16cebed65aa9cc168", + "0x723c19bbdaa3f870de40d0172d1599399abd8d8484089fed0d529e8a32fe8736", + "0x14a94e7438ee80819a6a13747fabdc5d6f0c4fe8ce282e5f28b10192a7fab08c", + "0x5b1452ec89aa1a2e0c76974ffb9cc124313502f270abcb8eef06e62aa1a2611d", + "0x1cf351c5746abaa736d3e44c54ea0e2f2a7c3d522056564f7270b06f48004d0a", + "0x16942cdfc9abc0de484d61024ab57b5fd7036331b046ecc21e341d4d6205e460", + "0x51e7cbfa3f1f08722febdd01fdfdcdfbea3a7973330b5fe14faad7032d4ff983", + "0x1435122c0e36bdfac8c1aaddc69f16861db1e000876ad2943ad74aa62875ecbe", + "0x44b94a70e38ed73e2c386fefb1ab4e58b9805da9a4621f90517ef95d83bb1a53", + "0x980cc4da66dd48249c79796d2ae1034a344beb012033fca0b8458ac0285c6d6", + "0xb456ba54702fa9125d78f3582718f65958071e42dc5d3396aacec10d4818bf0", + "0x1a734cf8d6cfb4d7291074f47425e87b775566f20e710d1c16be0fee43557467", + "0x37635070f2986f07988bd5b62cc9201c6c146250905083c792c13dd54fe7f2f5", + "0x3f0b84a427276427cb6ef48b9f99b56dde5e4073d0af8e8ed9ab632a5d3faf1c", + "0x40028efffeb99080b80d881d86144205aa926f15635a56b0e72517baf85cedce", + "0x42b98721b827f50a711428bbb6a7801c6150aabae9dffa396cfa1ca32cc8502e", + "0xb93eb1db6351c4bf2d3489e633dc8d62b3f860fab0eea014dac24197fad314d", + "0x588e2fd949c7d1d4561dc00319c1f6945ea10cd12274b1b24906752a1c975e60", + "0xa43172d6486d4239750907b6efc4c2c2440257c1a7b386ab6770b9f799894ed", + "0x3958de92583bfadc573bc624e512ccd50be3877c68e29ff63bfbe63feb1c99c6", + "0xd1866b8faa62cf18b63a67f45c17308c5b9d3af9c7ea844ac0f7361980991cf", + "0x3a6057b42159af16d9b1db0d83bf48d94457eb9b831bf7eb62556d2bd2af2686", + "0x271756b452b02b72fdd4287525ffc9a7a57deddedb7006a254b3d9df21afe726", + "0xf02b07ddde0e45125274a6218d0e38eeb5421a55bab44c67d8ab7764b490ba8", + "0x32fcfd6e27e13bd455b9b01f0a0915da694a083425b1f01f3fecc914faec7e82", + "0x200ac0db3f1a9a524534ac99ff681be7518a218a6e583ce8a01983148293014d", + "0x15cfcdd434a6e05c5241ecd07691303f8b8cc6688f071d9fb4ecc0c2d9b78fc", + "0x1e61ef8c615b67cff39e7f322228411b05fa58703a7e12d497460a977e3bbca2", + "0x14b331c0821e05109e1afba13e70a60f0426a64f66e50f116fee359624aede62", + "0x2a7e73896fbf780dd4774235b0485af06a72b20381dbd6238c630fb1f5abd4e8", + "0xa845f036e891c2d70343e05728ae6a9856764e123c7bd3fc384757ffaa61ef6", + "0x2c51c789acb0997c38412e9c75fb43ce77d7ea3357cb26580e7fa85c582c6a6a", + "0x57dd41659bdc02f8d1bfdf45d101abd4f7b8418d40f3b35239ed78dd0b860e0b", + "0x9def38354237d0116d7297e3285c44f8803859d25f9b8837eadb152ca447456", + "0x12dc29e57d910ae8c83d2a671dea0be88efe73bbb0f464dc6a63d6ce9ad8e322", + "0x2f3c87ede1b1a18708ff3510e0a327d461ac1046015333ae1a046a1376168b1a", + "0x3fc07ee185079afa982236117c31bf31b1f4a423df099ec5a1b7ac837cb343f9", + "0x7362025b2571e7efe2ba1cad21367f41fdae764fdf552f9a6dddc8edfb421e82", + "0xf29d75edc6ea6fb456af77b8b467b2143d3217186dacb6904e9abd3ff475bf9", + "0x888f114f18bfc726b44f6c1f47cc12d65906560dab1aa2c419013117176814e", + "0x5e05a28a5b7d1812732e772b59efcb71d47f694f1e7e1e33db6d12c79ac48c58", + "0x68d657c5d918747ac940fc9e4a2d6aee080bb51abfebd20d915df62c41dd8d3c", + "0x4ae8a234e24a9b43ed97824824f4952b73f6fab21643fd8281de516a30a9a0ab", + "0x8295720f073b430c19e9fd7de6f820a1ec7922c4d8db8bfa9af15c076a19c71", + "0x2dbc5c1b7527e9e57a14b25a5b43d8d119e6d28312260220b89c384072c05868", + "0x3a0c8f567020a4e2aa47cd066345f52b96e5c64647157c33a151e37b49c30209", + "0x6f08d3c55da0a711b44fc5fa12a1b36ece9cf83f9c505bfc7b265dcff94d993a", + "0x6cb9de947dddce257af218e0d690dbe2039aa2a18dece09743fa0095496917b2", + "0x169a1f628671c1e934a5bc8df1f670de4fbccbe830fbc470915c884346a5dc84", + "0xc86a5ef990389c9ce83c844f8607e3525ee20091c531675ad0e750c01685dc7", + "0x580b18984cccacbe1aff47b6fe23fbd5057a1bedc7e4f0699b95e27e28ff66f3", + "0x2c765660d35fb419fc64a2f2caa38a51c6a9fcb22c5e14db3e4109cbaaabdb15", + "0x219b2853459ef143516ac5b4373d1069b3673698e0a8b5a440c678a3543ebb0", + "0x6bca3c39d9c68380de7288070ea3fca94c56860cb1cf1f37b3727c929329af3", + "0x6657d7280914245f81db422e02e89efe62c32a2fabdc05dc1af5002bec752a92", + "0x5335aa3b62af3ce434f08a92284a1b9257812848f1ce29fa9c99129e566b24f5", + "0x4d9f091d7c4afc510433b7d3a5f09a3792b4f57e113bc0f74a314f37e3dd324a", + "0x2198468a71dd637f6f16c7cc598eedbbe46c6c0b2b42884f695ab2054a549e8", + "0x2142163a50fbe085aaff91893d912170e760d0abbadf27ea3afa678facadeb11", + "0x1f014ecfc59aa626bfbe9ee440d36241a5a829d9244e5c330d7e02052c204da", + "0x2ef652a5065bcf6761a211bd3254eaf86fbfa27f40b2c5da2e635c6abed2ca3b", + "0x174fcfb46d5ee5e5d205f4906893165eb0a41ff15c3176be44cb7592e46087e3", + "0x2d80dc1f45e18378d6e90c2bb7fad3b7c2d57d8d90eff85777495331344a7f34", + "0x5ec066c09f82a1286b62092506b1550c5c895c7079050d5f3934682fc4ec8cf9", + "0x736ebc1cf5d6059b2afcb1362b305983d11bb8d8de5a5a0df56a38e424890677", + "0x51627b25f3d35cd54344e823b7b5c296f41af6fcdf32511b4e74d1954e20a16c", + "0x17bfe80f3ed23d16b6f80aebac599d72c04a18eb69d582543fa05d15e3f2863f", + "0x287cc711e5deb5d854e23b299814cbc89e722c22ea3371a63629a3c5d63e1bab", + "0x474103b19297acd3f1ac2e11a04bd6b7e1926a4e70ecdb90092cc29776f8b4ab", + "0x6eed7827633ddd4200927fc72db6bea2f025de2525c04a0ecd1cf50a3c65024f", + "0x19e8f3a1eae343de50ca47ae815b418cb0a12fb71389be472d3e98aea84c40", + "0x6b6b42bcf03a06607b249adb0e0c76f6fe1c6a6b96524a54ef5a0caacc222632", + "0x31b51e1ed213b6aaa0e59ff0e88e0a89ee20d06110dd679964fa50723d15c9a7", + "0x69d54d5d3398e93d4a661668817a67a2c554445fbd7442c82457324232e8389f", + "0x4aa9cbadc35e6141c988c1498caa948d5a74283bf69909ac299cfeb8835bfa1f", + "0x183e67b528486ad2a4d017768f03a66dcb325911d0fc461fd88140e282db28bf", + "0x384d6ff785b913475e4659ef70981fc56a626baea2e0faa64d3a2f57dbd0ba70", + "0x3436d0aba8b03fb1cb01a52af5daf330e63ac40f883f6ed8a98eb74f7c8c7b6c", + "0x254f75720e27fe8f8c17ddf68dca7b7db213ab90280a6c7c9c6f5a04bb27b441", + "0x4967d2be062064b51037326811284f0b0f28d4a4c5754860b1c34a6195334dd7", + "0x242358d42940f5abb4d6a5b9f22f6ce026925b1aa8a1313dd08c1169a576259f", + "0x6d4e4c9aaa8665a51dc664cd1260ea5d0c44bf63f0456594a97ba1480b3d311b", + "0x64966ad62f4cf739fd129e1c5808ae2e2df5b2e570a20de7f511ae6eb25aebbd", + "0x2abdef8a9705c76705226d98a9c65c45bb2fddc21a25bab2ba3e93fc6c9821cc", + "0x24a631d4359502b685351e4d7632e26d5da397bcf201bdc1ce54def7746e30e5", + "0x57aef5d30228d237b691f5f6af3afd27e8bdb56a6bcd067f685a4b356633a264", + "0x4d8f3ca8935856c63c992ef42244975d411a0b4eee4db79b4bf55c31eb8d3991", + "0x4eb89667d482f8d96fe7e3a237fa6fea266739b504d47c9347904cb8472359e" +}; + +static const std::string mds_matrix_8[] = { + "0x4c9cf6d363b9de5cc83b7a7960bb7c566d9f3df00120c0b0000000afffffff5", "0x351332208fc5a8c4ff9c57876f8457b017e363d300189c0f0000000efffffff1", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", + "0x6092c566b31415be66313fbfb2f13fd56212dfe8000d200800000007fffffff8", "0x1cee80c6e300a3556610079782c807babf5eabd90015540d0000000cfffffff3", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0x4c9cf6d363b9de5cc83b7a7960bb7c566d9f3df00120c0b0000000afffffff5", "0x351332208fc5a8c4ff9c57876f8457b017e363d300189c0f0000000efffffff1", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", + "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x6092c566b31415be66313fbfb2f13fd56212dfe8000d200800000007fffffff8", "0x1cee80c6e300a3556610079782c807babf5eabd90015540d0000000cfffffff3", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", + "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", "0x4c9cf6d363b9de5cc83b7a7960bb7c566d9f3df00120c0b0000000afffffff5", "0x351332208fc5a8c4ff9c57876f8457b017e363d300189c0f0000000efffffff1", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", + "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x6092c566b31415be66313fbfb2f13fd56212dfe8000d200800000007fffffff8", "0x1cee80c6e300a3556610079782c807babf5eabd90015540d0000000cfffffff3", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x24370a0683278827665277e7e31a77f004c713f70004ec0300000002fffffffd", "0x3c5bbb602fec8d96ffdec7d7cfd6c7e55d4bcbf10008340500000004fffffffb", "0x54806cb9dcb19306996b17c7bc9317dab5d083eb000b7c0700000006fffffff9", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0x4c9cf6d363b9de5cc83b7a7960bb7c566d9f3df00120c0b0000000afffffff5", "0x351332208fc5a8c4ff9c57876f8457b017e363d300189c0f0000000efffffff1", + "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0xc1258acd66282b7ccc627f7f65e27faac425bfd0001a40100000000ffffffff", "0x304962b3598a0adf33189fdfd9789feab1096ff40006900400000003fffffffc", "0x486e140d064f104ecca4efcfc634efe0098e27ee0009d80600000005fffffffa", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x1824b159acc5056f998c4fefecbc4ff55884b7fa0003480200000001fffffffe", "0x6092c566b31415be66313fbfb2f13fd56212dfe8000d200800000007fffffff8", "0x1cee80c6e300a3556610079782c807babf5eabd90015540d0000000cfffffff3" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x48ddceaa6d982d4b03f97047ea0d861468074657bf1fff872d8f242e3b422dc9", "0x551b45decf49035e1ccee5edae7dfbef4e0861e3e021f512802010ea359f282f", "0x1dabaf8a09c6a01622ca4ab19e8645ccae350536f0e18acd71b3bca35d540dac", "0x67e56c2d2f204a320edc13bbdd49cbd65da55d6528516d284646e221388e0a7d", "0x4079e7e367dc7ca570e60c4c41bd91a89876ddeaaf863c42aabe5ac57e20a7a2", "0x34e2ec255f101195bee8504a2c9f80e8c56566ad93478dd1e168e7ef1f87d9e0", "0x5a573b584d2986960e52bf96974ad9d2b2776dbf1544ca5e3785774f5e429f37", "0x1bf81281e6716e45904701690f3617cf8d3ad71284e0728885a2bafa958d9fb5" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_bls12_381 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/bn254_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/bn254_poseidon2.h index 006eb17f4..464449f6f 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/bn254_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/bn254_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef BN254_POSEIDON2_H - #define BN254_POSEIDON2_H +#define BN254_POSEIDON2_H - #include +#include namespace poseidon2_constants_bn254 { @@ -11,467 +11,491 @@ namespace poseidon2_constants_bn254 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 56; - int alpha_2 = 5; - - static const std::string rounds_constants_2[] = { - "0x9c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a7", - "0xc0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81", - "0x1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30", - "0x27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f", - "0x1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03", - "0x2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d3", - "0xb66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0", - "0x12ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e21", - "0x252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9", - "0x179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f1", - "0x2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91", - "0x1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b05", - "0x255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56", - "0x28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd9", - "0x28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043", - "0x2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c9", - "0x7abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9", - "0x230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c", - "0x1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9", - "0x2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc", - "0x1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8", - "0x2e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e", - "0x1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e", - "0x1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f582", - "0x283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7", - "0x1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc", - "0x216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd", - "0x2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f94788", - "0x16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43", - "0x175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc5", - "0xc7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32", - "0x1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d", - "0xccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f", - "0x14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e796", - "0x962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052", - "0x1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d", - "0x10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b", - "0x57e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d", - "0x287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee", - "0x21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d", - "0x1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3", - "0x268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c1", - "0xe17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6", - "0x4d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af40", - "0xddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e", - "0x2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b", - "0x1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9", - "0x21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b0", - "0x379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b", - "0x2d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c35049", - "0x123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6", - "0xbe29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec1", - "0x1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a", - "0x1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e", - "0x12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212", - "0xfc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba", - "0x1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762", - "0xebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d3", - "0x2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1", - "0x1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf", - "0x2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f", - "0x23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c060", - "0x5872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7", - "0x1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a7", - "0x19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376", - "0x15bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f", - "0x2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1", - "0xb069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc", - "0x304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429", - "0x15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc", - "0xab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6", - "0xe32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 56; - int alpha_3 = 5; - - static const std::string rounds_constants_3[] = { - "0x1d066a255517b7fd8bddd3a93f7804ef7f8fcde48bb4c37a59a09a1a97052816", - "0x29daefb55f6f2dc6ac3f089cebcc6120b7c6fef31367b68eb7238547d32c1610", - "0x1f2cb1624a78ee001ecbd88ad959d7012572d76f08ec5c4f9e8b7ad7b0b4e1d1", - "0xaad2e79f15735f2bd77c0ed3d14aa27b11f092a53bbc6e1db0672ded84f31e5", - "0x2252624f8617738cd6f661dd4094375f37028a98f1dece66091ccf1595b43f28", - "0x1a24913a928b38485a65a84a291da1ff91c20626524b2b87d49f4f2c9018d735", - "0x22fc468f1759b74d7bfc427b5f11ebb10a41515ddff497b14fd6dae1508fc47a", - "0x1059ca787f1f89ed9cd026e9c9ca107ae61956ff0b4121d5efd65515617f6e4d", - "0x2be9473358461d8f61f3536d877de982123011f0bf6f155a45cbbfae8b981ce", - "0xec96c8e32962d462778a749c82ed623aba9b669ac5b8736a1ff3a441a5084a4", - "0x292f906e073677405442d9553c45fa3f5a47a7cdb8c99f9648fb2e4d814df57e", - "0x274982444157b86726c11b9a0f5e39a5cc611160a394ea460c63f0b2ffe5657e", - "0x1a1d063e54b1e764b63e1855bff015b8cedd192f47308731499573f23597d4b5", - "0x26abc66f3fdf8e68839d10956259063708235dccc1aa3793b91b002c5b257c37", - "0xc7c64a9d887385381a578cfed5aed370754427aabca92a70b3c2b12ff4d7be8", - "0x1cf5998769e9fab79e17f0b6d08b2d1eba2ebac30dc386b0edd383831354b495", - "0xf5e3a8566be31b7564ca60461e9e08b19828764a9669bc17aba0b97e66b0109", - "0x18df6a9d19ea90d895e60e4db0794a01f359a53a180b7d4b42bf3d7a531c976e", - "0x4f7bf2c5c0538ac6e4b782c3c6e601ad0ea1d3a3b9d25ef4e324055fa3123dc", - "0x29c76ce22255206e3c40058523748531e770c0584aa2328ce55d54628b89ebe6", - "0x198d425a45b78e85c053659ab4347f5d65b1b8e9c6108dbe00e0e945dbc5ff15", - "0x25ee27ab6296cd5e6af3cc79c598a1daa7ff7f6878b3c49d49d3a9a90c3fdf74", - "0x138ea8e0af41a1e024561001c0b6eb1505845d7d0c55b1b2c0f88687a96d1381", - "0x306197fb3fab671ef6e7c2cba2eefd0e42851b5b9811f2ca4013370a01d95687", - "0x1a0c7d52dc32a4432b66f0b4894d4f1a21db7565e5b4250486419eaf00e8f620", - "0x2b46b418de80915f3ff86a8e5c8bdfccebfbe5f55163cd6caa52997da2c54a9f", - "0x12d3e0dc0085873701f8b777b9673af9613a1af5db48e05bfb46e312b5829f64", - "0x263390cf74dc3a8870f5002ed21d089ffb2bf768230f648dba338a5cb19b3a1f", - "0xa14f33a5fe668a60ac884b4ca607ad0f8abb5af40f96f1d7d543db52b003dcd", - "0x28ead9c586513eab1a5e86509d68b2da27be3a4f01171a1dd847df829bc683b9", - "0x1c6ab1c328c3c6430972031f1bdb2ac9888f0ea1abe71cffea16cda6e1a7416c", - "0x1fc7e71bc0b819792b2500239f7f8de04f6decd608cb98a932346015c5b42c94", - "0x3e107eb3a42b2ece380e0d860298f17c0c1e197c952650ee6dd85b93a0ddaa8", - "0x2d354a251f381a4669c0d52bf88b772c46452ca57c08697f454505f6941d78cd", - "0x94af88ab05d94baf687ef14bc566d1c522551d61606eda3d14b4606826f794b", - "0x19705b783bf3d2dc19bcaeabf02f8ca5e1ab5b6f2e3195a9d52b2d249d1396f7", - "0x9bf4acc3a8bce3f1fcc33fee54fc5b28723b16b7d740a3e60cef6852271200e", - "0x1803f8200db6013c50f83c0c8fab62843413732f301f7058543a073f3f3b5e4e", - "0xf80afb5046244de30595b160b8d1f38bf6fb02d4454c0add41f7fef2faf3e5c", - "0x126ee1f8504f15c3d77f0088c1cfc964abcfcf643f4a6fea7dc3f98219529d78", - "0x23c203d10cfcc60f69bfb3d919552ca10ffb4ee63175ddf8ef86f991d7d0a591", - "0x2a2ae15d8b143709ec0d09705fa3a6303dec1ee4eec2cf747c5a339f7744fb94", - "0x7b60dee586ed6ef47e5c381ab6343ecc3d3b3006cb461bbb6b5d89081970b2b", - "0x27316b559be3edfd885d95c494c1ae3d8a98a320baa7d152132cfe583c9311bd", - "0x1d5c49ba157c32b8d8937cb2d3f84311ef834cc2a743ed662f5f9af0c0342e76", - "0x2f8b124e78163b2f332774e0b850b5ec09c01bf6979938f67c24bd5940968488", - "0x1e6843a5457416b6dc5b7aa09a9ce21b1d4cba6554e51d84665f75260113b3d5", - "0x11cdf00a35f650c55fca25c9929c8ad9a68daf9ac6a189ab1f5bc79f21641d4b", - "0x21632de3d3bbc5e42ef36e588158d6d4608b2815c77355b7e82b5b9b7eb560bc", - "0xde625758452efbd97b27025fbd245e0255ae48ef2a329e449d7b5c51c18498a", - "0x2ad253c053e75213e2febfd4d976cc01dd9e1e1c6f0fb6b09b09546ba0838098", - "0x1d6b169ed63872dc6ec7681ec39b3be93dd49cdd13c813b7d35702e38d60b077", - "0x1660b740a143664bb9127c4941b67fed0be3ea70a24d5568c3a54e706cfef7fe", - "0x65a92d1de81f34114f4ca2deef76e0ceacdddb12cf879096a29f10376ccbfe", - "0x1f11f065202535987367f823da7d672c353ebe2ccbc4869bcf30d50a5871040d", - "0x26596f5c5dd5a5d1b437ce7b14a2c3dd3bd1d1a39b6759ba110852d17df0693e", - "0x16f49bc727e45a2f7bf3056efcf8b6d38539c4163a5f1e706743db15af91860f", - "0x1abe1deb45b3e3119954175efb331bf4568feaf7ea8b3dc5e1a4e7438dd39e5f", - "0xe426ccab66984d1d8993a74ca548b779f5db92aaec5f102020d34aea15fba59", - "0xe7c30c2e2e8957f4933bd1942053f1f0071684b902d534fa841924303f6a6c6", - "0x812a017ca92cf0a1622708fc7edff1d6166ded6e3528ead4c76e1f31d3fc69d", - "0x21a5ade3df2bc1b5bba949d1db96040068afe5026edd7a9c2e276b47cf010d54", - "0x1f3035463816c84ad711bf1a058c6c6bd101945f50e5afe72b1a5233f8749ce", - "0xb115572f038c0e2028c2aafc2d06a5e8bf2f9398dbd0fdf4dcaa82b0f0c1c8b", - "0x1c38ec0b99b62fd4f0ef255543f50d2e27fc24db42bc910a3460613b6ef59e2f", - "0x1c89c6d9666272e8425c3ff1f4ac737b2f5d314606a297d4b1d0b254d880c53e", - "0x3326e643580356bf6d44008ae4c042a21ad4880097a5eb38b71e2311bb88f8f", - "0x268076b0054fb73f67cee9ea0e51e3ad50f27a6434b5dceb5bdde2299910a4c9", - "0x1acd63c67fbc9ab1626ed93491bda32e5da18ea9d8e4f10178d04aa6f8747ad0", - "0x19f8a5d670e8ab66c4e3144be58ef6901bf93375e2323ec3ca8c86cd2a28b5a5", - "0x1c0dc443519ad7a86efa40d2df10a011068193ea51f6c92ae1cfbb5f7b9b6893", - "0x14b39e7aa4068dbe50fe7190e421dc19fbeab33cb4f6a2c4180e4c3224987d3d", - "0x1d449b71bd826ec58f28c63ea6c561b7b820fc519f01f021afb1e35e28b0795e", - "0x1ea2c9a89baaddbb60fa97fe60fe9d8e89de141689d1252276524dc0a9e987fc", - "0x478d66d43535a8cb57e9c1c3d6a2bd7591f9a46a0e9c058134d5cefdb3c7ff1", - "0x19272db71eece6a6f608f3b2717f9cd2662e26ad86c400b21cde5e4a7b00bebe", - "0x14226537335cab33c749c746f09208abb2dd1bd66a87ef75039be846af134166", - "0x1fd6af15956294f9dfe38c0d976a088b21c21e4a1c2e823f912f44961f9a9ce", - "0x18e5abedd626ec307bca190b8b2cab1aaee2e62ed229ba5a5ad8518d4e5f2a57", - "0xfc1bbceba0590f5abbdffa6d3b35e3297c021a3a409926d0e2d54dc1c84fda6"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 56; - int alpha_4 = 5; - - static const std::string rounds_constants_4[] = { - "0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5", - "0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6", - "0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa", - "0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8", - "0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902", - "0xe35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e", - "0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996", - "0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e", - "0xc009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738", - "0x11f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06", - "0xed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549", - "0x4dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b", - "0xa3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8", - "0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f", - "0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1", - "0xa1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447", - "0xc6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf", - "0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811", - "0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75", - "0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5", - "0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0", - "0x11003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574", - "0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c", - "0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5", - "0xc246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d", - "0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b", - "0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85", - "0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb", - "0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c", - "0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08", - "0x64760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59", - "0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87", - "0xe070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c", - "0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb", - "0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b", - "0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db", - "0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926", - "0x62100eb485db06269655cf186a68532985275428450359adc99cec6960711b8", - "0x761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b", - "0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d", - "0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a", - "0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b", - "0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0", - "0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5", - "0x70dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9", - "0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da", - "0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729", - "0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa", - "0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf", - "0x94975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e", - "0x4d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65", - "0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187", - "0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3", - "0x3fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0", - "0xb7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64", - "0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a", - "0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f", - "0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d", - "0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f", - "0x832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173", - "0x2f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16", - "0xe2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705", - "0x493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a", - "0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9", - "0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16", - "0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0", - "0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5", - "0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505", - "0x44cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d", - "0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025", - "0x2fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355", - "0xef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac", - "0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38", - "0xa76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5", - "0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c", - "0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f", - "0xc817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a", - "0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96", - "0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce", - "0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959", - "0x5ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b", - "0xf0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4", - "0x558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf", - "0x9d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455", - "0x328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335", - "0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b", - "0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df", - "0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e8", - "0xc28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740c", - "0x544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac16", - "0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428c"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 57; - int alpha_8 = 5; - - static const std::string rounds_constants_8[] = { - "0xdad22d08a6b8d81d4a5ffc34b9677a7c5254c85e953551f9eba9a0a97590c10", - "0x3cfc441111f1bab6e75957b9f0274e92d17aefc2d8da460435dfaf259bd1039", - "0x27c6d1b8a2e2ce670376cd2970192a2a08e4290883f6ca49e7976c6c447d6392", - "0x28f2882b9abfda8efc2d121da0c871d2d5313a53c67d0407eef4e93ee23e6c2d", - "0xa3943390fe4939fa2e931e18094c7c93aa107ced2bfaefcfe5e613a3f1262d5", - "0x2a8f37d8da8f2319e188f8909007408b57fba3555bb784c1ad6c7b0755805456", - "0xcef8658e33f20c39649528f353ef5d03198c75683f8493534add693a4ff4f0f", - "0x1cdc2a6f0f0e7c6c62ee1c0cad4fd11363a48db7095171faaf9a7b6e01c3e52b", - "0xa2e681a2db19c8d1cfb0c28f0b7b3d9830d35fca8c0b076b4e64328060139d6", - "0x16f013cd703be7de16b4361ce5c67cc2997f858e8a808885da67fbafd30d2717", - "0x29af57131c9cf548be669fe76c675e6d90bee17a76cccf4ddc5d35f9a936ebb8", - "0x21807b1ec6258bb155ed159da90b815dee119eae8138b1bdf950111bf5205b3b", - "0x7c00db8c50a8c860fbcb8ebd234a54350bdbcb8747891a4e5adab1c4abc6909", - "0x22bc08fc054d08a3dbb6094396d0de373a4c33205c49a1254cf25ebec1747765", - "0x2dad58bdf3e24c78f21146de084d9b8afad58956fedce67d43f7d375a813bb2e", - "0x292cee6bc19a64dc5a8a74036e676e238f60b4577db86213ced417906f1d6e91", - "0x27d655ae125928ad6b48bba54593b74ca0c23002b32a0a9ef375939a22387a8c", - "0xe0e2e781fe9ac0a97f0d961c7b359a415d1ead41c99eccee90e56b68fbfa2a8", - "0x13fec23e678d1c9943b6daed8ed8212289116ab96344ded7ced8aac2f09f1672", - "0x27550dd21647e37fc31640684e02cb07810669b1c1545443fd58204b2cde73c2", - "0x1de6d5f356a92c48c7b9f6aa45c8a6216e0a6adbc799c0bec242054674cb8f09", - "0x14c5347c4580363f74c885d1fbb378c61d953e490892b10baf84f6e1f3a3f39d", - "0x27f2768023c4df7952ca0d967f14034e98c4ca76973ae1cddfccd212cbd78683", - "0x1f4f499fc4853f7e189ad6d2269c467f77e15bbd28963c516b4fbf1ba7b88f95", - "0xd62ba9a8de3b97c72a5425a97a7f027fbad23f299ff46bafa12dcffb0e72bf1", - "0x22b649ae468f20c7cbfb435d932ba9ba4be14ea40c0c54e6bec970ab4c513f04", - "0x3a1aae439e47e7e14186d5513da5e263e063a3da6d042c16e55cab2e81a8e95", - "0x25c7eee1fce422600f5b1e78323f2e99cceee803f62763217eadbd046c1e0e6c", - "0x1c66258f103a955274ed71de56169bba34ff6aea97a2c32b98805dc3b011a383", - "0x29403b00757a647671a3691094aef420ad830f95743d45894d6d7f40aa356e4b", - "0x13496363ef5f7d0e91fd1319fd5dc0269c5190d05d8a0ad28a3ce0638a133e0e", - "0x1c6a4586c15c4638a1686921d7c204e2b6e1a88c1fc49dcfb87ded2a1ed7edc5", - "0xda23df12d0bf47bb92f15ee189386c20f552d0bc66ae492b92d69556b2fe75a", - "0x155be88bc5ddf8e0c6c741286cdd5ddd559279a455b9bbb61d5a0b004e545d5e", - "0x553fbb5b32db860e0bb12cef3aab4e0dbbdb1ea8704d335a18fa8b4df112c36", - "0x12f6a3a61a3139221cb5875cf455b942580c00942499932dfcacf6f75cb80ad6", - "0x2faf9e95457781b3c61de8a1faadda67f76f52bb81255fac8819bcc104071e05", - "0x1c7639cb68d3cfa69f3d795d1a1dd4eba176d0c29701e7b677ea0750b4ccd1db", - "0xd9d85a46281f81502fbcfb430f4d08ab504c502d2feae2ab4a26d87bebea0dd", - "0xa9b7074ea11d9931cf4af16952f398777aaa36413df14cedc101c7693812d3", - "0x7fab349ddb7d62a5edc0b6a62b300715634e5dccab808d8fa6ae62b406705a3", - "0x11f8f3afbd6fe6bda7d055a536ab3de9c40c8155b31d397f63ef21ac974cf52d", - "0x7c569f8f49899805d22a1930883968a3cf058993e0adfd06da437ae50e830", - "0x15dfb18bf1b6087c0e638f2189a7b34534549ffe8fca5afccf7e528a3338cc92", - "0x2140caa062d2fa72722ad48fb71bbc9f534043dab90dfa24b96664eaa2f0ac6a", - "0x11c06fe4e5398d4704271b84e6023b07b189dd1d2023dd599b33defe4251b715", - "0x775f90bae5f8f8157eb73bbc7ae69b74d44761cf0df3b4666eeb2860878c0df", - "0x225befb64b758b837a4305e104d5e510d893653559d8768dc79325ff89d6b9f", - "0x201a730245d9227f1232cc02f486c18cfa1fba40665ed3d1bbbdcd19b03cac4f", - "0x128b63b12a6647f80c686aaab15b0563c1a33f475dc18caa434ab64f1e290acb", - "0xa34ce8153d4e2e1158de05d276530cf3c749c16c7e09f3b671a973b0efb0839", - "0x2809c5d323665513c8c4a96ea4dc08e3aba43699bca1198f2b559915082495ce", - "0x23b929e7d71fe425f36f32975e9a68bbf83c16622678f061ed78a0c9ce318be3", - "0x1ca1a93d02ae448ab773f95c6b88c0d01f89c0c3d25ad625042771dd5a7e74a9", - "0x3c7381ccdfd209a8cba5627a058c33f472b24d2b1a55d9dd47f60dc7b474e7e", - "0xbe1a29bb668a25eaedffccef6c01c90688229e8fc4be9812e371d4d61c3015", - "0x2c821bfbd5c415fc076fc83895edab9e5256ee826946a865b8c82f0189af4626", - "0xb8ff5b252182f6a15cff90144c1e7ac1678739882c90fe46d0a29db7a0cba77", - "0x1c0e94b15306baf1b017623888b8d4c5402ee81fd213c4a5e42f52729deb7d5c", - "0x2031deb0f13ce17a5b44edbacf5a0410e23348c2c7657383a8ffdeb5c5ca1cd4", - "0xe34d14f44e8eb98ac078ec90eb718c3034249fbaeb13d24f3d5b6a4002018ac", - "0x2a10f1b76f8b1cc429820030c58b3d23ebfb775a43b07928b9868891c2cb4cca", - "0x535bf4f7fb763f981d2c0c7ecd2237a461ac385e2235fb35222b512f1dbd1b7", - "0x12ccb3fbffeff74fb7ce3b9943f609dc0d7fe34e3b5e6b199628e86d5576cc18", - "0x1f44cd78220a2e66be6c9eb3bcffc498a47f22c3eb476591cf456d518e3e126c", - "0x1d60e9e3444a748b8c22d7d10e825c536290b723fcdfa046436353d6f9abc073", - "0x5a3ccc67bd014ef2544927f9b96ff58e348954e40af67861ab88d78ff4b6688", - "0x1be5b195896e9ec23b9d3eb898734c385272ed64bdcb236223f5a3436986dc6d", - "0x1d6427dd07a0b46a8ebacaa82e8c04de8e7e94a18849c9275b8b4827a873cdab", - "0x2f09a403f946b692704fe4d5ae69625441c93a7f93dcb4f8f7d337baa735ad9a", - "0x1807540511593488e084b7297b6ff67b748c71731b6ca64aa8d3823e81f41b37", - "0xf1daab7a702ac80d108b24845bda04b732f3564ebe57392e470380199522e1d", - "0x1797d0f72bf0b47a45ceaf82df261439bc5e3b0ae55cf1069733d5a0b51765ca", - "0x2adbb9b4003631c5e3d02ce959930c75d4d25281c86febc61dfdf35e00cfbdad", - "0x1347ad87393ef928d2800fa2a548328ef9bddf5646da79d507d2f2055db335d6", - "0x15658e02d31e2c200dadf6a985652eccd30cb959168cde7b74c7239539d2df1e", - "0x1f00dc28bced12a74c3ce687dd3fa996d6f8bb29bc60cda4f3aed191a6fe8d0", - "0x154ebcc230244b68b9a8f51a56ff0541a92ea2cbb3e77b263cb03a8bd89491f7", - "0x1f65f74b523a8c875885378e93d1946c7a3f810e2eecdea94b80c4f741ea6cf9", - "0x2504a559a4bd23ed689acc9b6cb4062479a6b29692e2b8cce40058daf0505778", - "0x24496d9926e4e565ef860e52396a2935689c87ca99abd046bc279ce1bfc43206", - "0x2c9ccd22b143f4d8d483846d1960e7144a5c9354ea48cd1a71bdc82fbb929838", - "0x2b9bd02e1b064a8db321a1cd212a7a6dc47274f6eb5fcfa4f17d6f690dddf8c4", - "0xb21f0004118382f32fe441fbf36c0a38ae41873ae42d3b6ea5f0c6816e00472", - "0x10756efb491852587059f3e48b605a3bebabaab0a1ee5ff1758eb30623b7602c", - "0x127574a38823886d1f4841b540e29d67efe35aa8b3c685f969b6bc6cbab5064a", - "0x24751d620ed2a3db4382265b8c33b666b85beae7aa87f38e28bd2f8d637ff9d0", - "0x2e3d7208892e8a92e887fccccfe04d8d0fe994bc443641a9fc76c43da02f453d", - "0x11c3f6719071e6810699be20e1b1858b9ed00d8166bf15434cd5e43507b9d62b", - "0xb86112693a4e7f3ac4eadfcc3f04d24a7afe51a87f82d4a435ad27f30aa2f9", - "0x1a77348400a87f0180e294286a7a06c857f590e8ed17eed7a6b4cc1ca5a97929", - "0x207feb0ffff2e419bc967dd544abbdd2dcc601316f49957f2319c9a04f56157d", - "0xdf4aac4e6483265aa3fc462835a90380bc84004fc46d1a85e61baed3196ba48", - "0x2f2df3db6ed0e27d3151201dfe7f57fc2e5ccc69c2458535dbdbb5d88aeabb4f", - "0x2f51811c3568dbae396f86838c5c8b1bbf9b5bcb2ce98542e289184b95f74b7e", - "0x1198ec466dc8c3f55b048369eac0490e835928891325d4cf4461da1d22230219", - "0x19036827eb0714a1ee4fdd653d8667df192402e290dfdfc39bf005fdfa86c043", - "0x978d774018c29f2818df365312371ce4082a6c8c52d2a965516b76436349069", - "0x231ed2d94767eb9ace111af9317b233fee037214e3f6d7e366a5812c8fd1dce5", - "0xfbd8502ceba8ab93eb04d1db535d25f4c3be8acac4e8e0467b9d606653456c2", - "0x20e9fac35dda464e436a4d2eae4cdd5b52c9b712d5b4bfa43334463f8478d4bb", - "0x15ba9fc4b175278a12a5ab39ee0121b06dd09b923bdedb69a26182821445ba00", - "0xc3c9aec9048b10a06d062675b63417a1ae8704f2918382466bf575e22a654d3", - "0x2795a46eb4c79595a9de2191c524f0aaf92f764153b23c357ed50bf3a91cddf0", - "0x10ab7893c4253d861276ea30f229eb86b90c69985fb6dde4aa50e24828caa81a", - "0x2d4509d8159af62c44503f64fc01e953e90c6dced8ba75c58df2aa090a5fd359", - "0x157946957f4feb94eae09b9a6c272204d107ea7b0e31b67524a6c9ee7f04e7b9", - "0x30464efe02b65b862f9a0b59fea6d6934b393e65cdc3d29ae67a751a0d0f136a", - "0x965b3a2d05666d38ffcdac4e5ed020c742ba41d760e70f74dcd8f8b1324c901", - "0x24531c784663d57639928f0a8f152038a779eebbd70f6585dacc971668ebec55", - "0x2202070df8f85b79bf7debf24a9cc0f2cf30370f26a9372e01718dae7cb6171d", - "0x8282fc0baa2e9eb76167b9ab2405db9c78f1f37b168be6435d5385a806e745a", - "0x178c3d6e47cd33e5570311ec8ad8dbca0dbf54aadd1393738d898384c57795e7", - "0x12ad905f9d82f33643b1fefb90dcefffeb818d1ec3f4fc3d6857203eff5ed1ea", - "0x229682c9e4165b6ed1a2870c14a1c8bb7b1c7d3b52f42ce0228b85480666b4c4", - "0x25190d853744dc11d155de5e479640302a333d47cf18dbf1ff241ce42c88d4c9", - "0xdb47fadc76bf4fd8dcfe26908fe48ab42d399da939ac1f167ca8600cfbe7bc", - "0x2ba5e88adcbe025760f2c8654935f0557d14c6d4125a838f312f2ba439e2e94c", - "0x1376bbae85699dcc294f850c858b4b370e51ff3139bc3e0a1e52eb58d08ca41b", - "0x1333fda1e3d58e0747f5c7361d5075526933ea283eee2ac37b6042c6083b6a42", - "0x28bfc4dc9594e9add687744b79f4feb979e2143d742d4e4d1d5bb64bb799a02a"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x5bffb5e301d8c468c35e24eb2165b6b71725fb7ac9a48efe5ce041bdb05676e", - "0x2aa7a81812688343fc6d78073312996d75f4c5505db0ed22af5ec0df7888cdc8", - "0x2f5856fd71dab60d78cc3af15a89c1e4d61ba189849a4cea10acc1dd228faf01", - "0x12299a260999ac95d271e184968cda40bd4358877a6dcf43d779251fffa61349", - "0x1443aad4693d692a62a8e21f03d5643a123f0c8783a3d27c275f9d01089685fc", - "0x21561b0204a44488082e31472f5885a3adc179bb278233aedc4b316369ec9938", - "0xc7cc2afa53f9898f30a69b294a4e24f6b2176e1ae0ca49b021792d55e34e97e", - "0x2dd221096053de389fae88e7caa5c43ab55e22aeb758ee130d1246c1dff47b54"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_bn254 +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 56; +int alpha_2 = 5; + +static const std::string rounds_constants_2[] = { + "0xcaf5348630c772ade6a247fe1145110e707bde2e4d81aab3b538eb46d62b29a", + "0x1f7c9fbbebe99ae35899e7b18758e5fbe21ea97ccdee90a90858bf6dda0c853c", + "0x2682b4b446c5e1e69b334980801a0aa10ea497170476fba2b6f28ec07be621bf", + "0x1d5d95643554c21418e2e7ffeb5f6f4d01019f94cfc97e2d83a62801ebf31061", + "0x2bb2c2c9a85a6b6c8e2b31dce26beda0a9a165fcf60f3dc6499bd60dbce75fe7", + "0x17db10153c265d2cdd21d6d621df5a5dce401e3c98c897286938bdc693b7c52b", + "0x20d538d6b597f350a45d314ef26ae558a1a302eed6df48d2d65ee4f3b456704c", + "0x2acd36b9727e404ab7371e52398b561be8139e9dab4c996ae8cc05dd8f996803", + "0x22144ec0cee8b117f2bed3b5de6ff8e3760b8c99bebbbdb682176cc044154f80", + "0xeb4781e89f47b0fbe5aecb40df89d9fdab518e587861f131b46a1324ce7a313", + "0x2494dc810b9f8753f74b746522e976cbd37c6eab00caf19dfe48ff32fdd4d3b3", + "0x29a6c7d0b45e04c7e8661848bb8396e2921ff90f3c92cd0fdc0be7d58061076d", + "0xa465077433ba93c4b753441808a1380f0dfab01e08f413e0ad4a9c5cb612f61", + "0xbac5efb1e37dca52f44d6e6396b05c3035a6cac283cc8f24b44cb2a522a8d59", + "0x124446e66ee06b619613e5d44fd0ac85056de975ba348091bd975187b545d1ce", + "0x279012b311129fa37f263ee710b436a9841431c5acfc00bdcfa67c8b2e5e2446", + "0xf6cbe1fea677afbc004a2eb6f15a6c5b52ec45740ae938acf36822a9d1d78b6", + "0xaf281b3e3b42b0dffdf77d0d9d8a61e0763be3360139605bc3ac02bd86d422a", + "0x1f489fee4a44e60c8a9e2d5167d4a93aa548a5fd09bf0c82548baf5407467786", + "0x2c652b75c6eb2eb17e2a529b2483ba60b28c0495e3b2b6854d0e5d49ea746fb5", + "0x1820c474134d6bfa698df398a8a9ebfdb80357a7bc9df78d896dc2f25859ae8d", + "0x2bbb36604f6d9f689d576b3dda5276159715580fa1a2856ab70b1e436445ea41", + "0x1a0ba0344451775b7d9c49b7129232d540b45a456b29f9ec1290846e542ef533", + "0x23b51253b22066bde69fae6121d4c99aeebf6e2d1e253eeb0ff35778fa8f52a7", + "0x1c1626a23db9e7f20cd67e184ef3c9299ec31a426a4b0970586807a3e9b08575", + "0x2fd942a5587b2a42b3b755c3a8bc2ea9c5c1ccbd246d2803da93e052b8ef0a5d", + "0x19abb07951517e65f73e3f7b4064d4a4805e6737a9d379d795ccbea2bd9b70cc", + "0xd9cc73145aa86e72cc55e576bb4f4a07efc7405e4595800674e873a238c7b6e", + "0x291be40a1f25a0c49940745505d0daba786b2efeddf5290dff1fb4ceb42028d0", + "0x2d49ef64aedbca94c5d4d459e7c1a6d7ab5593abdef98f5c4b579729d06509b1", + "0x16d3b1177011401d36a425afeabe7066eea7f30706c69124b559c683eb0e3d3", + "0x61a705c3649672db7a69bf22df9698d462cefc0c0071cc040dd0da86aa31fe3", + "0x1b812ac2b3e0d85461a5f01797a4a3295a70f850c8f0400bdfbc0d39fef0c6f6", + "0x29d1b57368ab1d4f8a594700e8551296923741d07a5d28a236dd75fc48acb8b7", + "0x1174b023ccc2fcfcb585bb6a6eb3a55bf73db86ccfad297adb0c803f98f5016e", + "0x12031a1fa9a99e1b94de5ec401dfdf5d86e9a765b2daf8afa887c22eca51a0ca", + "0x1dcad090533bdb44d44b64964b92540e3ff480eb066484e667cb907088814696", + "0x10f6449a432b9ded5452012d5297ab310ff0918f060251a2dfe89edcb3de18c9", + "0x7b6968f476c8c2f04f0580ca25a8457839da459ca90bf99a724c25ee7b541fd", + "0x2d4e4b890b0b6a970514eadedbd6214c143306dc6e77ac14c09251c0d9da25c9", + "0x2f48b5a196571bbae5eb8467ce088b05d0caa5060e26cdc20ea6a56838610f50", + "0x186712103fd45d3c04f96fbd80f117518195a80baf8859fb2132ecbaf302a8b2", + "0x17de45a109a4d537fd05c3599cdc5e884004823db272ceb51a689704c41822a6", + "0xd83b474378ca3c14d7da9d9aedbafa8a88b66e9679ce42ce7bf7c68df229826", + "0xc2eb73dad50272ddcf3ba1acc2fe94d1f85febb2e9cd0226c92c06c20100ec0", + "0x2ca8b98748c2781ed4d979db77049790e2c6d3ddeb1919a6c3d547b88cdced9d", + "0x24e2ce99525ae44d53bf0e8b0ccc73989878e1977c75aa062dbc8a0a4d7aa514", + "0x14c265e2174d1dc4ab2ab3eed7ec18061e1c7aaab74d540bfda75f21bfe3be2d", + "0x2c9e35dfc51211efcd629392ac140638c0e7e2d15d209b5ee0c5f8b7aa6941af", + "0x1b7d3addd76c742ec01b5a11eec79153093bf41f358c341efd5d36acd55deee2", + "0x17cfa8d7377024c2ea1f9ab1e7102b643ca4df265e1992e9c0064d083968039b", + "0x1ed44884ee323311919200a4c2920d92e517f1d4e083ae3db71b77b1020d8778", + "0x1bee72a482a2939265c20775f4aa6048dafaabf82be6b900c78ae6ed8b804a6d", + "0x1ae699c47c2c37399ca5d96a1e59ac673920eeecf0daba2ea45898f34ac18376", + "0xc01a04c713fa57478e4619fe0eb957517740b37f4ab0f25bc83039d9467760b", + "0xe68dadc873b19ffa66c8477e0bdb6fbbd799617a87fd013246a3d7cf87cc105", + "0x22fa7f44579b7e26943c458538f8f57af5cc9a80e5a380a07091a531d74df9f3", + "0x2326e02929efc268641465c766e4fab3db38111e4837dcc7142ad01efa825671", + "0x2a9575516f7131e97d14833e2e934ea1fb06f05723d066cc5d1c8b85543eea29", + "0x2fc22c859d4b20e90f9b574706e5ea9293e618746b7ff8b7c4ce2d1821c2184a", + "0x2535bd89abb38555570ed0d2ce0101e7060aa5378242eec4f07fb2ca97388652", + "0x19a398b58eaa545e5c97141e5d59763bf4b01fe989ba61b1f0e92c5d905e3f1d", + "0x95c4c975ddc359dab1bc4ea53fd934a35633357cebd47ab729729e3573ae232", + "0x22d524fe9c20421e7aba026ff9782c8683e13cd9073dcd802a90cf641c06196b", + "0x120376f879547c0d0f779372c0b3376e30751d0217f8ffd2bbf27d965700fd50", + "0x143eb5a61023a07fe9149b4c570421a63284f824b990c55fda0d3403c73c2c20", + "0x1b1cf70941e9603e9b3879c422de7a93a89e82f7b2bfd5059a4cab99fc19bdf2", + "0x12d24e4d439d726b695da1d98981f190c045ff23135be42dba7af0586028d62", + "0x28fc8c11ab9a8b5dc5406c59664a40e2bbab8a4f313d0ae66e7e0d88816bf4e", + "0x1da27e856a55c97a7ebb9c38b382f9e8c7f0f6e368c7d7a197ac3bbc9c2bc993", + "0x61a5cc7cd8fa775e4cc67c96d699c8ab86f8d1e0fe90b34b43ef84778d200e5", + "0x25d661da80ab0dde7662513eb66d5da67c07ac71e3b90b4e88ff9bff8f8b92e4" +}; + +static const std::string mds_matrix_2[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 56; +int alpha_3 = 5; + +static const std::string rounds_constants_3[] = { + "0xb5516ea348d3be802bd01b1b62a42724a3f7c13bd0c74d7f5c8ad7533851213", + "0x10399ddecad1cf819ba187120c9a58535cf36564a7914995568a97f0d229561", + "0x1e2d62f57c79e4deeb33bd2c1f71bcd2747fdd626328cfeda491be7a760082cb", + "0x1849560b4571618a9239261723705354556df3adf3ea9bc48b384a60ea5f5be3", + "0x2f1889d96c9251bd5350bc263e4896c6ced5e02b3ccc35b1b3f4af1b2c17906c", + "0x121411156725cd91b142b9a2e6a8519a29cb0263cc97d1b114b8228dc09e580", + "0x1128204bd499a70a55b8c14a16167def226d8bbce53f96bcd3adcb14748977de", + "0x3001c4447e890c354075faffb26455045e4eae169ad65b8e210ad56d9ff59af7", + "0x18965aa6e8c67e37eae1139013731727cf81d17ec027693e6b4d9122811bf928", + "0x1cf422052527659ba54eaa6c0207d69041ebdd81e1dbc68d9bdc6d2fcc3f4ffa", + "0x1719a36e90fabc14bfb2c972dd067a14932191373d12eb31367de22cf9e54db5", + "0xa3e4dbe750cc7d2c647886cbd57e48d83316a43b9d539d1e4b610fdb9f14a38", + "0x101b079c7da7e05e7ad7e120549ddf2d3e7e70272d4a0806e983340d86f02974", + "0x243eb30d500b867f0b4ab68c0580def21115f34b95de176601e45968cc68e847", + "0x2ddc03ad4fb86c8fe5be8c48746b14cb3580246a25552c5884c0ac487cac5076", + "0x2a392d043c87f1fcf34949d2e2a8badbd3fda4b9b207684451ec39055c84b6be", + "0x233c300bb1464edb7623f1d5c2b16cd1bd7370d6f4d4fcdac7f410f6550acdbd", + "0x227e31579994d8e80b43f11c6f60c8db0c7600c0f8d72089916940e503425aae", + "0x2bd3f373400e2411fd6c1a05793831ec0f6def1bccf539ea82a366cce104a3a7", + "0x2ea057eacdf2ec0b7a959aa51aec25b99cfed39f03d2ff47fa382dc93b20d599", + "0x17f0599470673d611869c1499a65e1f612208dec412c94c299c5203591fd501d", + "0x2b94987f30b055b0695c173e53480f90e13b0d58cae1ca5205782ecc0685cb43", + "0x941703588db2b4e328504603d50c1f4b7db5d9f22c7a87ca6f5c9f8c0bbac8a", + "0x1bb78181320133881f48578f1d00cf3aa32db5c4f1db38054e693d225d5325f2", + "0x1ce2d75bbe985a0741b86770b9559f264ef06338b6b67f6d9df0967950d7e655", + "0x5d506bcfb9dfb4c71c1889fe50dd78285b8bd0ccc44aa69ee1d32504e84c5f1", + "0x13619b5039a5b59cbfe098d7763ae7af2f8e7e71933a6d221819db99e190626c", + "0x1b7efe9c9e2bd790718f2ac1019f76c4dcca9222a4c779dff5eaff5ed55119e8", + "0x52a6f06413f6d3a21666d8817210436dde53a82c6ba06913f29d29e445dcab4", + "0x1162efe232967e78be2de130fd30b64cead72ec2593f43e5daea5ae24d651632", + "0x140de11706ac9a2e47b35a50a6077982b1780b0437fdaeb53cda0422260c38f3", + "0x186335765c1c3a28c4d753b9e0503f3cda01d9bea9ae7b5a7fa457deaeafb9f0", + "0x5c8a988347fd0568af3a9623003a52bdd94075c4509a4eeb77b9df9962591e", + "0x1153f562023952c120cc58e9af54087d3686f09635c748854b84d86a708f948", + "0xffc50b3c1d9ac9fd242e1b7a4b686bf558e120b342d6b65f9cc388b27d42416", + "0xf4a35442d67ecf83144b178451e63b45f60a7420e0562490cc1ac4c773071", + "0x17e2d80d62aabea6ae52d1fd1cdc986d44da49269d27c8ef9a66546dcfd9113f", + "0x4b039632d9ec09cab95bde7ec792210e4068dc1d41ad6b1bff903ff5da8f0cf", + "0x2e8ae13b1bf59e09a0c7ab264a82610c8b25451f7d0067ba4babbe37c9bc500c", + "0x5a239460539c8edb3d3ccf21dda4f367ecc981f1aa09934ac31143d28fdad6c", + "0x10efcc7d2ab75a864ce6ab3c253cadc4a954ee3f718bca1fb3adea0f3cf16779", + "0x355c047fbee1e2dd394cd7b565a2776e2a3e42a071edabf26177cf761fa0886", + "0xc6b3b920e63f6a8018a446e9480b391bb20fbbbde1d53a7803a91eb3bd171cd", + "0x505409192bd90863e04c18abb4d9434ebfc797725b5382ab0a639f3b0ab7c39", + "0x1e33fd1389c0b900cd28e2cabdc0ba378b118ddc42830a20a8897cee5bab11e", + "0x1bbb635d27884c588e3e9a9079167ee3440f0d25a8b2b95ca7746bf833344465", + "0x303a199cd59e5919e9e14f2a154f660402bbda1dd663be769762dc7122ad4bf0", + "0x24da64fb41d7625c1e3b9154f011398c87413078bed1f6185e0e2d1994fb680f", + "0x30efb00e4398ecb1e8ababd4477002253adade8398ae4964ff4817f3b232b00", + "0x2a5bbaa6f45fdf37e6ee628c810d17c2357d1267c557b667dece5c6c25224438", + "0x2eb37f66de6a5524d3ffbad53c32a5ccf5172adcbb72927b4d6821f68a6fc2ee", + "0x2c3ceacc79470c85d957002c1b260eb972715be53b74667e25cad996d97f712", + "0x136d953bd71c1dd932b50cc2fe03ecaad98df4cfddad69e8b910b7ed4d95b1cd", + "0x42d1a24dada2a324272d72afacc2f068cc03b8aa2d10363b4f9a231c610cd29", + "0x2cd6a4261da50d8f010189d7624a0e0d6ed7948e83c642b4692ae9d80a467194", + "0x19bf01161598f64ed1ccbb8852cc2adc835baed20f6a862880468343e6be615b", + "0x2038ae02e7cc755ed0c11e4d58d8a640f8f1a53ced410c230e464780faef10d3", + "0x26a2fb9609e169811d1c05b8d3ee68206c9f925b2b338e5fd2ce0525d34df316", + "0x10691b63e3408368d62c6d95d52f121d874c5cff31022227d3ada9a0e74d132", + "0x2bac3b099fe29ce4b863234b03e970666acddba72b2a4eb7108ece432faa55b5", + "0x58810e583241003769e21b2810d7db09f8747c15487e5d9b9ebe85359021f4c", + "0xa6aa7a013e2ea24e37e62496c780acc1d867100afe02d7b890189dfcbbf54e7", + "0x28fba5d52b1971f317248513b03bf454ef6e09cc2545e4344b4257c88776878d", + "0x27aee6d56ecee7ac4436790293a8a38eb1282a849e56c53e25eb3932f195dcf8", + "0x2b534735720f3e73e2660d81ae74f98bbc5801a325ed549f6a89d0599be7f1c7", + "0x3f4718ca31fb5349a9cd14983f31818f707dfe71244e065c9e8d391d28e3c8a", + "0x1a38fdac044207a77b124015c154d86e1641190ad8d8f91d2879d39ddc4ebd12", + "0x15732a692ab0ac4b0940d44fb52101d149ca2699c5192183ce5c4b37a33a7fd1", + "0x4a13b57c263aaf4d7b189cc906ad2c206354b430da0a47263a36cb72b9d2cd5", + "0x23884713cd42cfbe6fd78556c38b0cba1290a658c2f220547ef9c27bf19cd38", + "0x241dcc74b12894cce171ac291135373fbddab44f7791732d86f9fab225f25cc7", + "0x1d615b0af3090c141fa752bf0952d05fc3c277b400430d4174c8f84a914616ad", + "0xfcd06c14f3f0ffadd06bbcc925bb26ece850eb008a3ef5cca2b2a7d4768b90d", + "0x24d3a73121fe61c5e59139203c4bf934c3a6feef4ed0b7656ad79d73d0250651", + "0x2facb9cf911af6b59dc30a1c03aabad7995b229873d5d223c12fabf1bc283da3", + "0x1ab43c112cdd3a6a7adfd366146ba0bb1eaec878e0d3c2dce5e2c530296d8362", + "0xba6612092de8c047acaf2dd32fc4e0f528076e0ea3666b5037c7678b2924ade", + "0x57e58360e5af05d659a3f1133fa67689866b4783438bf72899f31e9b082cf15", + "0x22cb82b4c1e2084c0d28ef18928ddcd46db5869abb64c90327eb196a362c4173", + "0x25b006b932b1b269fbbbfa31e29eed713856f5002bf6bed7798c08a983ea1240" +}; + +static const std::string mds_matrix_3[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 56; +int alpha_4 = 5; + +static const std::string rounds_constants_4[] = { + "0x20e06a1fb9f7ec1cc0526abb89f67335f247686c157fa5d7b229a0dff332e94a", + "0x4b079838521e11972d0bea926f6999ab2b7b09d558e4237f76840ef357a205a", + "0x1d90e06ccbbaf4a3088546df647feea085ffdb7c51c0dc775aac8aa06f860031", + "0x1b5aec29aa988af3e5216d53f732a8b2dd4ee5d594e170778542bc4d377cd796", + "0xbc042b1a4f71473db223731827b593e05e350c6352cea8ce5a6b961d3b092df", + "0xd4674790be63978bb6f6590b6ce802e21e4dd3902ecb8815feca29399790fa", + "0x23857956df822c81d0845d8ab4ef15b1716bf355e72f831bfd2620aa7ba86f7b", + "0x214ae3f4d81afef5f0d0419249ab54c99a6c35730cf581ed7dad463367b0656d", + "0x20d360dad77d389faef22f32ad517659b7bc91fae9f05996439d803ff3b55b0a", + "0x17d55344dcf4d7d64e68c00a216f8065d6225a1e7c81202ada0954c3eb3b3da1", + "0x1808d61e7caac3ccb2982107d2c5e828609d2b25813cb6d85d76785f369c77c9", + "0x1d123429e0e6354786d241f408e80acd4bc124ae801e31e1964d672366691d35", + "0x1cd41af73515f257496a97f7bb2eb36bab6a43cedda866d8c0f062bced3b440e", + "0xd1485d94bb1a52ff30abdd2b99ce4afbeedf57425eca82bbb999598e11adbc8", + "0x2d5899dd2ce36370ed07cd44a3318578b6cc30dc77350d0756d5a0ddaf128152", + "0x1caba61845bb677f70cecb620e0cb59a52bc11cd86de0c1a1ce1e0db89f5c238", + "0x281b99a0ed49f7356e581de4723f4d21f9e18fa740ff090b39fa96ef4060960b", + "0x2f4b11cb5cc66eb63ef0bdd81cec3ba3d53b46e1f86b41a2d538e942f12ae310", + "0x1151c0d1a7ed54b58d55e862bdf2721ed6db7af3c280bcedbed72fc5316d2d27", + "0xed67655a240b075ccf224f3df6579be02fb6db2b0363729e59f47177479ffba", + "0x1f649bf42dcf6a23a7b22621d267a0c8dba8e7d1a2b6931f60256c5e3d8f6d99", + "0x151ac9346eb1f7ba56647c88a546993e81e8852a077f4d325b0c44ff93a30c91", + "0x13de4ebbf62ac96212cc7c400f122c5f47c5652c54c14c0ab1c7e710b17a2d91", + "0x905567028e3fc015fe4452a2af4f10dce69aff3be9ea95c07cd82e9acb6fa27", + "0x265c14df8cac2c56b81c23f43933e304a3933f92c5abb364d3a5b4346ccac3ea", + "0x10a2304063de483c39eea52e1fc3f2ec572c9d15ece307af2c78d1df5cd07aab", + "0x141bfb9e7bdfa6046c4b94b7ec565aa38534f9a47e0b9ceaba8b13dd189df6a5", + "0x183b4fa29afc07e10776b6f71d789de901306c948c2b0a5a71ac9df249fdd308", + "0x14215b4d29ed4e851e96ad282120825659970c1a60a3419d19ddd13c8ae8a43", + "0x304e98247b5bc2535ebfa0d1975f705cb81f64905b27b8532d549e6f01911ff6", + "0x2b4767931510bdd14eb8c37ee0b521bf0da5fad940b1894a6b12ad25c00c7087", + "0x16562e6943ace96a4def14f8546094519186be5afa8e230b56f8deb6b7ae8989", + "0x153a3a51689a8c5e263f5b28baad71d3da0a28fa24bceaef9fa9e25b8f976dbb", + "0x2c4b0d5420cad17341eacf9dc9076504823d80ce79f856431c8cb2e21a862095", + "0x2eedb41b10d4b42d9749a3fc15a6fdc0ab5cc474ce9fa04de30368f29330e90d", + "0x4060d622289e7f022caff4ab4a37748356bfd40f1ee9e20f569a11f182a3df3", + "0x2aaad63a53363d88691bbedcf151d758d4394554cea2b8f14728156fecfacdce", + "0x2e4a27b0c7dba4f44587fbc7a5837ef4b1cc74127bf6d71ece91ecb840bbc91d", + "0xafe8add187f2704a7011cf810f15d8afcc051511343f984a9fb894e1f76cf0d", + "0x988909b45e7b8115fbd2472d7f6a0d6456cbf02346eab27f9d300a02a35e8b6", + "0x1c35d5ffabafdff9aded92ed513d2a781c98217a4ad4968fe1ab9cb025e0fe62", + "0x217c766e0df58da26d966c1f1b375c9ea8a4b8aa8e87bc44267ba492b5a51c82", + "0x14b3460d10dcc735622ca22b857d3c3526106e12af2e645775d452a4c0dac22b", + "0x1904f56335b4872e9a11478c17146ff104612143055482bbe917cbe16c288907", + "0x1203294e05e2d205f28b0f924b383ab2d1c90678e36d3a0ad8781015020ee04d", + "0x1b455fcd157cf7c0641d8ad72763ea7b4758b0247198b727a3588354eb54c1ea", + "0x227c78db6a75256573134f10ce252c9172744f4cc7d3e69872a52d89b08c0744", + "0x13a906fd0dfb8e19b765365fcc33eef12606d52aaf67cd06e1a1cdb6fd31c267", + "0x1857db92198bdc98a76bb15eae79d8ae715a66a94ce29db8cbf0d75f74904922", + "0x2de062467fad21e4ad954c214af88d13f2ca27f9b0cfbd841110806816c4497f", + "0x2fc08ea645147718e46615553cd78197d30d6fdd6bbd779250c04fb2e295d63b", + "0x1f303978a2d36b215ad08b82409856e19d6f233f3911831c8946f2c92c6ea62f", + "0x1ecaf5767ac0fe1a7c934cb18fb7c500c19473f50a5b1d666e8a2ceb992c6f2e", + "0x19e85cbaa4285b8daacfb78f8b908496203bd1e245407f422b0ee1fb9f2e877b", + "0x2d062668976b5bfe099456d0c98d969fdfdb5e96659d8375e4d57b6bd3993713", + "0x2eee11e500b4b6d7326726431676b881fbafed0b4737359aa56e92a405636290", + "0x12c96deca5d48f899663bedff4910cfd9f429a55a5b06c891df5f81c63056571", + "0x15ba1795f4a5d257bbaac608e7d7fb6d074830b114f0483be6e67e8f0e4ffeb7", + "0x304734755ce15482427eb8a7dd10f101d2a7ad368239d8bae5ced9f74510d071", + "0x2baa9e3f0ff0db9dc26527deb2245f9383bb5949b0b2dfe648af12c6c9a9768a", + "0x2db7b5a4b3fde86bac82c9d4407b612265ed5edcc7fafa07583f1d62d39d45d7", + "0x2221a57010772cf005a8c7c160468c6468c242891e1da4a36be5524aec911a04", + "0x29fba231e9b9048dc72f774756016cd2ada532d4e74af10677454d84811543f4", + "0x199f9b5141982ba4d0131225ff7eccde49098f1ad984a7837ba6fd30526411ec", + "0x224179dbd918f980c6fde5257408bc9134370128d8848a136d0dff1d8a0776bf", + "0x2c4009bd372f0ce2785fd0c1cf9d968367b3db19cee14115e7ededf7ff507daf", + "0x236ce4e0b103dbacf1284eed484dd137993837953c130737c7de178382b3bc3e", + "0x99e861f2b11ccbc93dd6ea22cadd27890f1723419906e1419a31335451125e0", + "0xcc5e8cd3c5b9f7927c04d1bb48d7c80667c859268e76fb1fd19fcd63a6a3ec3", + "0x129d816727832a5d24c599002155fe37c8ed2ade925f7412925e761a9919f730", + "0x266b6542e92580f402f446a41bbdcba9e9ae9d4147722dd9efe93167cfc96ff0", + "0x63fdbf713f3cf4d7b014856b2bd09455fb6d1a21f55b74c1c77d6a26be61340", + "0x186ef70b0e362e96b649a52baacc2c0b190fc140e0f2d1bf17057ff1be9d88ef", + "0x29323488f394be8f5d5b6dac1207af161f133aff92bc4314f681a1418f4a53d1", + "0xc7f6110794c035966775fe8488db7db5ced2fcc6a56743bb8b1985ddbe971e1", + "0xfcbc3d4d370a6ff9a75215a0443afe041ed110a6db1670cb940389457d91afc", + "0x21f366e22e9f8a63aa264b051d750927f76a942643c974806a2388ac6edfc22b", + "0x1c34f80aaf142240635f12a1ed65a459c1892f96dd3f20c324c6e34e2d6ad86b", + "0x80727434d53497ccbe07ad86c0a8351d5d68785ca748e5ae41f97d2a7015ff1", + "0x3695c3a0eadae341dfe81797b5cc2ed46c3fc84b21521eb9b8347a4ac65dd7a", + "0x9cf7dac2b8558080d7a7b282fb9596c6e268eee3ee6fa4eb8cc8a34b65ae3cc", + "0x2bf3571a8892d3b8fadc41fed49d155dff6c19452bbc96261bf720da2ad6b155", + "0x16496ee028f31231d0fb43fc1d9d385129dd973fb9d7dcc584988d74422087d", + "0x2d27bde168642a06a8e62786e7b02cf29de080b26a0cb5a3d18df8728acb9d29", + "0x13da1298fa6af7917e3dd3cc1fb6f375c170ceaf76ef5c39a27b1eb7578c138e", + "0x2a447a3982c2a1c4f8b901a86cb64aa5301a8d38b38cfb2bb5ba705ed47061bc", + "0x2a5a2e81e384feca09ee278212945c43f124c8fa49d679a5a0bcbcfe0ccec567", + "0x7f6364c7706d7cccdf183fe3bf3cadb691d5cbdbaf16216d8a8947d62ff02f6" +}; + +static const std::string mds_matrix_4[] = { + "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", + "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0xf855c2a824642ab8c0f572c1bdf33c6051432f13a7e21c349527e3ef2d80f1c", "0x1fcdaf442b3665b7d0d4b3cbd5d7bb105505c14597dd78a24d4e34215a6c7bd9", "0x1c5461cac586f5d57e0deee8854471b146d7cfb9c2d5852df25231f619e38be4", "0xd931afcb9b13280a123327d407296c5b25a508385306f1897fd1e4b02a61bef" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 57; +int alpha_8 = 5; + +static const std::string rounds_constants_8[] = { + "0x13ce4aa20bb5682ecbbc8160170b936ec01533b36603b18a9ff9eb35fbfa5789", + "0x1487aa2a7fbc4b64c00f15ecc8cc0c56526dc3b57ad0db88d9c75576fd97e262", + "0x215f0600af706a67c9cb8cd02ce0c1133842653aab04a4a39dd24180883adf1", + "0x1d20113c474860dd2f518cc2bb88cc57abfd9fed65f469483b82c4524d95aca6", + "0x2e88659e1bfe9e6949728aae932b2115e73c23a01528ef4207430d66adc569f3", + "0x11aaee8b9e9b20b3ec41bb7bbccd88eed2032a6888eb6afc306ba434d4c868ac", + "0x14e9362594f20aa44fbf2b4ab187e668c3d530f51828a1294dcaa267c141c9c2", + "0x1e868f64a335c2ca3c2d48a130dc527f322c7f6c30e939c98c54f661e9231aae", + "0x1a3b37ca8f3631d720ad286454f600683fc6dff0f3ad2181b684c9c7b1763285", + "0x818921c32157dffeddf2aa77c3a4c4ad35ae10fbfe9e03f0226f3742bb7bebc", + "0x292ca5efb10038fcfa9ddcbed49da933decd30b7ccd912ad798ce9b2e0a3909d", + "0x5caf381d3d8cf3cfac1bf2d696cab9aaf972680b571c8f8a8ee1297b1681ed", + "0x290ba49f1eb29a4cdd0bb3d229ee5f85e084e68b69c28f7f87b9a76d61103b88", + "0x1c5392619452aec2aca14fd945ff0a469dafad2949651e8d817ee76922e9cf78", + "0x62a137d8cb89739a53c9156c6e7134ec006d6157dbb180b4af40639894c8dca", + "0x565973bcf6b2c780c9407ecad92d47ce2a9a6e196794a86597eed650fba9de3", + "0x24e4fb8a4cb1b453cfbf6b0cc1aff2e4dc5a51b61a4b61d1a4e7ffbc80e51950", + "0x2efc60dcb9161c5bc64034b8c30ffbc344e192bfae28cb3b808893c09c94ddee", + "0x183f8c75ae0535c2367259b85485fc916cbb071228f97be3d36845d1020a4c69", + "0x2a74d1ab0c4647f568fbf54fa4fa55e139c6e086bca7c0d4b6a7fe0e3bd8529", + "0x1bbeb38cbae1557ca55cf9ebb958e7fef3cf6236993253f24da3a2d33fe643ae", + "0x1ca13a2653b0be2e4ff7190ee9fba41385565829f9fcae88a2465bf63f59e82f", + "0x287e62d603e9909b4949740caf566e55ea55131d5bb537c353f7020e7c80cbed", + "0x18ab773328c93cce218651343d102c1bf8b38a670d21992746b27eacbd74dccc", + "0x183aa35cc31641935751ce7008eff8659f7a2e969a987a1c5db7c4bb2008f8bd", + "0xc8e2b7a66ada3af19cd76bac937999b6fa7a17c4c82c0382a03e97f52f994fc", + "0x2674ceb78eb234cc51886bf1edf2c00e7dd1127216020a2b4f5ec94bcb76c1b8", + "0x54a79ddf68a2b60f6435e027e49df909f3c1a5f1170f65f574089f27ec5b98f", + "0x159c0ebc5737a4477ceae55fa755eb85ac91ca0227cec9e5b0df35bfca9f217b", + "0x2b720ffc7865ec8da44368d32906b68bf50d0218a33b3c3b7b218ef925e04a1e", + "0x23db85629c1036810dfaab7069c6c55e4409c88d1c01f0a1dc69d033ba6d488d", + "0x1454a2a6e6d2294051e101b935134cdcce5fa7b69da82bd062a9c3868293e3d8", + "0x7097b6617fcb6f6d6b1344c7a625c8b0d832ccf01e97142a3ee2fc233b2940", + "0x6490825e5a0735836a0ad5988edf39e646d828fba0bc17fd87da5f6bb17e2db", + "0x10fcbd3d4927606fc090a12646f36922c575a8d80dbbdfc72326ce5c0a4b51cc", + "0xeb4238575c1e2718856921512bac47b089995641824132fda0dd5b66231d84f", + "0x4495748ae2f0a7755d58017c29f82cafb262d021cf74667abc8af74242e304f", + "0x14ff47dd56b7b4754694d8f6c2de94baafe31a1716767c87ee57fa6612f5e6c1", + "0x8703e4b5301e0f8ef93ae9d63393533d41d91a96b04d7b285ef0a5f1187d03f", + "0x1d4fe6b8cc85b0fda541d5291ac22d565fa87f434385536216a35c154b1e4157", + "0x1d55b25d47c55c3ccac47786716efbfcb2a4981a5dd4fc55906b0c057fcc1af3", + "0x1355acb63916929690694595d139091dd48f08962aa94eabdcd583a61dfe7033", + "0x264db7c430d9a5b1c558c19435d65f29dfbbea1b0daa2343b75bd73dfa597b22", + "0x110ffcbf3ce56a9b17eb3865b561dce7d6cc5893c247d7b576d960e4d1c5385e", + "0x1fe98525d82fa05b9fb22427015a1d9566d636f16fbef2696b8a939d8a1e36be", + "0xd9bfc1e4c56b623f40a76c0849fd782116801775fc2bca6840586c194b1d520", + "0x20d47cad7a3893c35cb7320f6f995c3c6753b5c2ef3dcb74997129587d664682", + "0x2d3946b92d2cdf108779f01db93f409180961bcf2dd7354513b2019109cbefb6", + "0x19feec87d742893b191b65abe71fcccbc6cf708ce1c8f0d28df770b31a3e4c28", + "0xdcb65d19c938bf0c85d0ec348178a953cd0c4d6d5bd9fb1660222cfebe1671", + "0xe0e3e2d00c43ee48c1313d37353ab319798b3d220dd6298f589aaa5e330a300", + "0x230ab5a9836b7265eeb3be546ec2a3090db9222ca70372eca4d7e1bf6995a0a3", + "0xc650a6012d64024f52790a2daae283cc6f72e5c55c814613b6ab566c5d5a1c6", + "0x706464d7439881fa7c03e60b1835834abd6af1688e09a530a253e10acf4a80b", + "0x1ad740165bd4831fdcc51b0a4d6c5f0112169613642762460419c8ad107e1966", + "0x1085872a794b6213e2612b112286384ca7fc37b3b8b49350bb93816a81ed067c", + "0x24844c20cc4489446aedcfa4bc26cb354d21255365d59a4a018f1efca636b225", + "0x21321c42585c6a7854b44b2311581c2ad85e6650a9dc0d7b38c2d7e4263ae3c", + "0x2b72dbc3c472490d120fce3d10636de295d354bdbff6ca87b8ec33093f9eda4f", + "0x5ef3397c575237dc9531d7fb1418ccde821fdc70035de945d20d1c3b9ad72ba", + "0x6b5d8f506a39d2fc46095f9850351eff6e64a527ce191fe250b94e1715e2739", + "0x706d81e90c1bd260a3b2d12eed55579c5a51132433594aebeae1514e330c8d2", + "0x215fc45e5a8ab09137a1b873c7dde3aeb35ef8c4cb1766514eb1a630e2e07806", + "0x110ae0e4fd9baa77f67c03bc0b0b2e0d92e125ac7248c52c130c2ff63f0f6a2c", + "0x2604df5dd4c185976f2e8cde92d6a5899eb0e1f07f4d9273717148c87a83f60f", + "0x2fa3b1b76269458ac73d8ea3a42cb2c89958a44b42c5d73b1c4dea38c19c1293", + "0xce48601e1957a9ace48a509de548c625756f0b7bb10f680141c9ade0664fb52", + "0x157c204f99df3c27725f7d177b5563890a23ec4115356a068c13987159af2873", + "0x22207a2de85aed48055d57f6ef81a1fe4b61337be69a41b74d800596c4eef3df", + "0xc7722d536310fecf35513f35d5d56c902d6b1a513697d3631eba6d77c4279ac", + "0x127605fb85ec2b60df06453de944cd73cf764442c8f58033827ac2671a8c0f41", + "0x249532a3b64134875a14beef31ea4fe3ecbf82adfa2dd39f0b77e1f0d88145d1", + "0x27f7d4b2d04d6328bc5329bf24d5f0e0d697f43da201245f698fbefd6bfc773e", + "0x2f8d61a7e3d5b2e62bd623f280e043debe1c2bc3b74b612a61c3c13e95c2f211", + "0xbf5a34dcf6d091a9c40cc0e892f3db8d1141414afbb1bc4bc30e4fe10cfdf66", + "0x24b67bb3867f27ce211c89ebe31473763b3a3e1fa457064dd30972ef9166fc3b", + "0x1b378b2b3ed1f7e723f7faec12899224409a8cc749a608f2422a99eb0d6d1f5d", + "0xc9687c4a6726467db66c3f8ee5e8d9dc0c910f3ad637714e3b3ec1c5b151c5b", + "0xf8c89812c9c40adb5c85d310876fd043fd011ae8b64434c046694a70c87c211", + "0xc6a1174a8c28c9e9d4f2037f5e5bc6c674d2b9d95c243a0682c95cbeff4cea3", + "0x1594b3ec7593ae2362284e158fadb9f93ab97deb119cc34f969728c918d4c116", + "0x904a4d076fda81cb2779cfd8d76e2bc0a58adaf7df39e0fdc8f18196179c638", + "0x83c323c7240be376a194aea7526ddb33cd6f509f9ee53ff75b701cff701ab99", + "0x17ea35f7e9ed10df9ee93c2e43f26e9b893ff97fcff31c1e9029802c810be2bb", + "0x145393ecceac4f10aa19d64c047f4c69c3cf4de35f5b38bf338dfbbab4d7a702", + "0x1dd0c2a1c83451934de7fd85af681ccad7fc661334f2a430d0600004ddcd2b0", + "0x21fc0759d3680465390a6aec8ce037ea84a1a27f67b8a51726f58b49a61a3590", + "0x2e553c47efd22f7e9ccd0bf73854462103a400fc8663283aecca75817e74b229", + "0x155f072383833b6ce5adef929157f53816a3242a34c300ae6b579ca34ff6481e", + "0x275e18f0ed700f4c3452aa10b21882be5b47633c7db8728df6b153fff1e0ff9a", + "0x10fd53c5232d433a391692005993e25d2e973784987c139b9eb876db3487b225", + "0x1da4bc5625b774d26dad7bcc57127c8a4d2d71cc533c5d8b75b7ac45e99817cb", + "0x14ce35a95dd84db3a8a778daaa9efc5c96c4192de004e14a6ab4fd2fb9942563", + "0x6d7642f60cfa67e0e08e264bf60dd0f86535d9ba31fdaa17ad6052d03a44f34", + "0x124f7b5cf899417bfc1fd95ef2a6cdf94017a85d38be4277a3d934d556dcacd7", + "0x15ab829c0d3f2c7f094d7721a77a2879b3a5b91113ad8810bf24341ceb26c88b", + "0x2d821f32a4f609d37b8d46990ffe1147a6f2573983af8c2452ba90bcec5c7aec", + "0x1a8212350f9d7a271b7770233ab1e10d4a01e24be3392f93c13e139a5cae3c35", + "0x21c65d1cb58c22e3f0cdab8435ba181ad5086fc3589fd38c207db786de088d38", + "0xb91425ed126874f0f0479bb605df07d4fa91d448c90c93d9baa2aad4fc51979", + "0x22274f9adfea76c398a2317751f2d8b144ef66c29a4c4604afba2e29ce6914c", + "0x19c708d1de92a028b517631d8dd2ff3b1c1d4f34d8d8a4eabcd2255ef20c75ce", + "0x65f84efd603a159ba7d9c46bc8b1d0e7711833e8c74192e98fa73dcf350637c", + "0x1de222c97c12ad9333ba19c5a1c42b9519ad5db3f4f4869ab891ce482b70a196", + "0x100f5064912d823ad1d5699ecf6091eba6fdceca05690b960e04033714b504f2", + "0xaa26b274dfdad6ff3729b8edd385c42691b3470bf76d5d0a1993c3ac95e9318", + "0x11be9119dfc34818bd842e682c49e1d7a06c21b4670a3881bee2c9d1ed0d0094", + "0x2a462618f13c18c1afcd0213e722533ef7724f22a18d1c9061a6ca628483bbae", + "0x6cabdeaca862a8c5e99476d28ce3e4beee4adb545f9196e6517a8c081f84c", + "0x1f10cdb4dd21948d34c2b723c53dfd7ef61545182a29bd337f7d0289ebc4e31e", + "0x1a10686c3a33494665d24b6e2840bf9f43350e2ac6b0da86dc16c478d37f3466", + "0x2b96ceb2083600ed734d45c4af06091c37b97da5e14ad777e3e825d2d6bd5156", + "0x2002ecac2bd209ff18cb3efbe650f489659aa6001eb01e77799c831c2f609918", + "0x19abbebd705642f686fef596aa6523c05dd987c6e42832beadd92930466b9a9e", + "0x23e1ee9009e06bc38de6871848f2d44b6aff6d602d23001db20565d16174ab48", + "0x1810301670202e0d002337386a238c3222ee1f04c7018e589e3e3279522a956", + "0xc168169d6f6c72d684a45aa5f51b5bd8eb4f713d459a00808d76b64c26763d9", + "0xd8084833047e57a2f9e03025dd6de658bbe2b586ecc600be56059aa878319f1", + "0x18365aa1d2d65576dea3e16cb588e14c9e51ce45d043442cd2c0baee1da76cb", + "0xf4f338d1f6c998cc613f5a4cde2ff6a634b8b396ddb32e95f38e9474da89269", + "0x17f8c029e0c2d33718fec3ef4074168f312d1e7cac38da8f514ce4fc3088bac8" +}; + +static const std::string mds_matrix_8[] = { + "0xae8042a907adde1a3ec75bb6c6e8344f55d3451d195489f8d86877ccffffff3", "0x18f27bec2a82bd110a5b192ae4e7c9732c59aae770f615c93a1cbb991fffffee", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", + "0x1c14ef83340fbe5eccdd46def0f28c5c6df8ed2b3ec19a53592c68389ffffff6", "0x2a1f6744ce179d8e334bea4e696bd28aa4f563c0de22677d05c29c54effffff1", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0xae8042a907adde1a3ec75bb6c6e8344f55d3451d195489f8d86877ccffffff3", "0x18f27bec2a82bd110a5b192ae4e7c9732c59aae770f615c93a1cbb991fffffee", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", + "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1c14ef83340fbe5eccdd46def0f28c5c6df8ed2b3ec19a53592c68389ffffff6", "0x2a1f6744ce179d8e334bea4e696bd28aa4f563c0de22677d05c29c54effffff1", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", + "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", "0xae8042a907adde1a3ec75bb6c6e8344f55d3451d195489f8d86877ccffffff3", "0x18f27bec2a82bd110a5b192ae4e7c9732c59aae770f615c93a1cbb991fffffee", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", + "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x1c14ef83340fbe5eccdd46def0f28c5c6df8ed2b3ec19a53592c68389ffffff6", "0x2a1f6744ce179d8e334bea4e696bd28aa4f563c0de22677d05c29c54effffff1", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0x2ed314a75c6b1f82d70f2edc7b7bf6e88764472692d3ae4c345a1f442ffffffd", "0x1da6294eb8d63f05ae1e5db8f6f7edd10ec88e4d25a75c9868b43e885ffffffa", "0xc793df615415e88852d8c957273e4b9962cd573b87b0ae49d0e5dcc8ffffff7", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0xae8042a907adde1a3ec75bb6c6e8344f55d3451d195489f8d86877ccffffff3", "0x18f27bec2a82bd110a5b192ae4e7c9732c59aae770f615c93a1cbb991fffffee", + "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xf9bb18d1ece5fd647afba497e7ea7a2d7cc17b786468f6ebc1e0a6c0fffffff", "0xe0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb", "0x2d41dadbd7a49edbf5ce180275769573e694a604abedec0724d248f46ffffff9", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1f37631a3d9cbfac8f5f7492fcfd4f45af982f6f0c8d1edd783c14d81ffffffe", "0x1c14ef83340fbe5eccdd46def0f28c5c6df8ed2b3ec19a53592c68389ffffff6", "0x2a1f6744ce179d8e334bea4e696bd28aa4f563c0de22677d05c29c54effffff1" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x15f7d5370b5d7c59c4548863bd4c2942e73a7b014e3a71c9fdbc9054aa881a18", "0x14e025699df737ee9281abb59627710a0dcc60b677730f0a30e2614dd6c82041", "0x15c897346e0c3156285753834d32512636842e9a4ef3068712979a9bb61590b4", "0x14981113846cac8947309ec4d5b6c119740cdff3ef52f018a80c33a22b9f86d8", "0xf9595af5ca13b60d5ab9b04ebe5c973fd3cc357d60875ad6886243ab91a52e1", "0x2d7150a97f611d386fe235a3db9c29e212a6d86d294ddf85aed7c13a3c38a53c", "0x8f2993acfdad8ddf4fa25faf8f63b4e3316bc547942a8ad3d125f4fd5599f80", "0x2ec8c986f7b6a211607ad6841deb343a24df72f0009c817c04168f61b6ec72f8" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_bn254 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/bw6_761_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/bw6_761_poseidon2.h index 71af86a01..e20aebf67 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/bw6_761_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/bw6_761_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef BW6_761_POSEIDON2_H - #define BW6_761_POSEIDON2_H +#define BW6_761_POSEIDON2_H - #include +#include namespace poseidon2_constants_bw6_761 { @@ -11,467 +11,491 @@ namespace poseidon2_constants_bw6_761 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 56; - int alpha_2 = 5; - - static const std::string rounds_constants_2[] = { - "0x220a0adef4959539547c65abc32e7212b0d9a8c43eb7db8a60d977846e875f185c607f22f6f3682c2f2dd325ff5bb5", - "0x10ac66becb5a53079112a77bf83c1a372e71508e8862639bf4d90de860c642752c31448e6e8e71023bbe495629c469a", - "0x17e20f5c7d5c9addef08962122efde34f3a8113731f3e0a3d9e61083fc4a7dc9b0b62a1c1dba2c7a4548330216ebd7f", - "0x50f2e673065f77d5d5a93b7b4aaa0d67e68b5321858f31aaaf8634508fab663198743f1f2207fd367e1803037f8cfa", - "0x5861fb23e38eb32761f4e73439a2deafaec3a9da05b9a906b75f37a1a46ed8a026d76fcc5190e29fce1419ea1ce461", - "0x5e3cf20d57769b07b2a28f94bd7c0c2389c110744ddc8bae1a87ba4631355ab8439889deb1d5f5a1c3df4d46fcfa26", - "0xcb67dc610bb3ca2baceaebb75248af246774678c6b8901f3385301ab194ffdc03296c332e164168a8f01a4e5755987", - "0x1a48e0626493925a2e89a3f5de4ef1f73996e7e67d1aad119fd6777285fd15a1a4d2ba2ed7561e7ed20f3e8b0fc0f5e", - "0x651ebb9acbaebb46e227df5b21e077f106ff95ec7a366aba470149acf8977f70dd0dc09f9d9bb1f0b7a386cade4cef", - "0x1685f36c379c39cb53789525dfdd7dff2800df8e94b27b42c719af74c9253ee9689cb40516b01e6afe4c71f8a9ea0e9", - "0xa4fc7de9a4c29639d66b0586dfd75b3205bb8949bc41d6e2c2566bea2f8dcc72203dc51fb0599244e5ade5402b4802", - "0x5921f0107f9df39bc7a9243bd43fec3b36eb5c9caa2f68d6effd4291e8bd8c661989c9ae3f4edf3c26efa57cbf7aef", - "0x68755a2fc4c66da57788162eaa85f308bfbe71259facfbf82ff6fc6560fb933b33feb9b3511c565790f85b2da67ee8", - "0x4df9f3410f24c323b76de56ca373089bba79173c00ed7c5c601837e8118372b2a776161c5e103ceaf6e81866d8808f", - "0x1f5f84bd8dcc113a4e319cd11a3bc5a76a91127b9a70560205897b08e680ac008172d9ea0abb7c3b9837a3f918d9f8", - "0xd5e400483c0ce421e6dc2e7afb7e3333b069aed9621b8476b8d6424fb0bf66d167009c0b25a535ef557d20fe7e13d4", - "0x1636bc7e3d7c62315e5736e0666b6336f701381d2239c77783e2832a647bf1e983b47f3e96a55e7c53e1d670dbd1c0d", - "0x797fcb4e22653ad78d78de0bda0adb1c3b01fcfff0b9adade12a7dee262eb1d35bbe24a9d8d917aaa14a33145d4284", - "0x5bdcbb80237eae5f5c2ee4e3d77365b8c682780d4c41a396f7e100812ea5cee4a4ed0438857f2584052b4cb158c361", - "0xd21765a80c100b2c1de4fc3534f17783c912f7024958ab53346457cebac187b029af832372ffbfe2473ba4f495779a", - "0x5176d87dc3b68f3480322902fbe0948a8d9d189724dad2d79884ccc2d39fe61874fadda90bf91df0ba2935738973f9", - "0x87df946b1d6d19d0d4706131745d5708e62a69affebbcdd60c8f5c98ae497837c33aa61b8abd2241440d3baf3a6f88", - "0x5e1670162f9f3975582774893c7928a0657b9a40e915d5ab5f1947fe078845dfd3e1b4749962f9809b517c205b4471", - "0x166bdb05bbe395397f415096529b5fd3247912a07f9934d314be2d6746360dfc73f99f916d0da7f8ad2ab679c8f7352", - "0x9f84dc543d84dec17bbba07e3f597d38dadf3d4444481bc6c453a771b0000c4dc86f74ba5718d8cea222c43195773", - "0x285fd400751457d0af3917b08a45032e6cab84efa3fa97ac88b83a9f04d3c6ba05504e58835f1df94dfdccb99fbec8", - "0xad94882e7453362cbe445c970e674c644669ec63a4a7b233b2fddebcd4fc6acdf71c2727bd1ede7d49324af9cb68f8", - "0xc804f43eb0649d75729b17872ec3c6b2833bbe5978d7bb8a54f1e519728a40b65c76eca52ce1e0c1a64fda1c34178", - "0x10fb626c97a85e094499cfd49586e48c5d2759886e64751f1e27884f7b4bc01c5cdb1e6b8b2a29b821bb653e93d38f9", - "0xa3a47a4f3c07f5b867a47cf0d990f2678550ecf99673c735ee5018b99c9522740211b64fa6f54455b72eef8ed4afdf", - "0x751f58b80441ee59ced31ff968ec61266edae918a1559113eba3c3f19437a873274b7a4bb1f73f4f955d8b0b0a1bca", - "0x13a843b9707ca79788fc51373686175bab36a94a62bca473380ec2a2c6037785f1bd622569144294848b07fbba1f502", - "0x126c7da3b0b55cdce16a0a3b9b0539438f27f148970ce0575b53f8f30c15b823d55db1448d3d62fd3d9850c536c5853", - "0x5425b12ce8106d0939bcc3ffa1abc3ff2a3dad4ca27932e9247933076294e8fdd2f77ad4b3731811945ebd32be855", - "0x239473243e3d66db657c734e9ee99c3ce74b67b266b4c496581f978c69e9d8f3f253a37025ee787d40b9bb63e31d59", - "0xd5e375d1eb25008faac5c050ee9eb08938c348c971bfe5372434dbd330bd88de215108f7ea72e7387220fbe148e950", - "0x113f76c237c5cc27dd84a0ae406fd898b2ab68e0c83064acd8e4a79011312b6b6ccb396fb198bb6fa8617d35d21c5fd", - "0x1a351d4e5dfe9c1652d544e64bf99562d6682903b59b172c405d4d44effadc1e7e72f9ca80dd6596744645a745acea9", - "0xe3e92c81c82751871fa482a3287107bad6889f75eb5b40a7fc57b69d764d8cafb2a067c3e14cfff1d7b92b500bf93e", - "0x18dd4baaf007d8d5841c78dc08f5c1b0468b74e8a29df14d7c86b57fe2cac1d3718f5380d80a6c32d2c33cfaacbc050", - "0x1076ee29a14d0b674d644dfe1a2f4b76a0ee4014df2b6a42fbaa3e88fe2463b7e047f10e372e6beff433d1a09b6c384", - "0xb3c39b69f8aeb6ad708b819d8afd0869297b113ae88248f986d90fcee9bbe64d1191739c3e84e026d716868dd350f1", - "0x15257be0544b76d0b3fbbd22d2f5848af69b98c36d017e333be1bbec914f4ae9dd9fdae5c7bd61bb29d62eed89573fe", - "0x172401bd1fa1d1b96289dbd385d50b3b4c7b614e7427c49c4d3d5811e1214d388083748ded69cfb77f61b8044905f6d", - "0x66b649800a75fc762dca87aac31e851aa22f6ffd531a55a886f0b995dc064cdf1e49c3a32e7471bcf64db5b02e76e3", - "0x193a6728ebafc82f73dde21dd03cd8d0833d5f7de4df8f2326c5ff26f276539ca6d32522f9049f4e5e6db7fcc9752af", - "0x6cfa1a4e1470f940fb1c52d91d269e68ed9f3c4e245aee261bbc6290252a1a8f0a51cb1e29da326278b7bc424f1e85", - "0x1672fd20d16dff1e04de01e0f441e6c191e01f53bd6d431d592418d691dbbf181b52a5c1543d160d027d4eac76e68d3", - "0x2d94b03a811d8fef67b94267ddaf12b4c8b2657c6654f50b204dcd65cc27d35672f6a13ebe655ee8205f26ec03e866", - "0x73ef80a70e37901fabf4d127b24c6e9d5088d4a94a8eb4878324efad9f3aca4d79592eadaf8a627d01886af9224a97", - "0x140e40336d021ed222f86024d528b2853757fe7eaa19a2d0a24fa11ea5ce4572ac2fafb670ef2e777919cfa1066ec46", - "0x2175e2de5988b7cbf76a7a00d3d5809e37419cf11dbad6f0c518f1a7f1cf0ff4fce9c7de80174454c94800237ff612", - "0x4cecf233df3b974d27633fc3b9370303217a2fafd0aef9e7071eae49cdc15ecdd3ef31e701c7b38b46f5fe65eb6d2b", - "0xc89ac99bb5e4efff6e196f464bfa4fd698e46dacc1a10b5b9fe0e34ec9fd2c0ff5d39a0f549f2bac37a9b0b55b10e4", - "0xf95f82726f6bcb75a9174e28eb7e05456d8d40a26257c69171f92367fce904eb4ec8b7957345b0558c8c0803abe74d", - "0xc10fdb0388e073d2d03276cdc685775b201a98c42f8f1201f5403781c59ef9204c158136bfea19809953e9dd4f1bde", - "0xd919dfd016807ed8e464f0749086a0e5d36a7e8db5c536fc73a74abd8da938cd90490cbe6adf69372bb4f79e48400c", - "0xfac42b1d5067aa7256b9f517dc7c6e7fc3867aa64fd6e8183d4e610efd1fd1f393d217b183666d5a5b0ccd429c65a5", - "0xd945f3962b471ffb6791a8481a6161b5c6d3805624bc083d1414469ccff4e4c1eae912b4a77112cf38524d3397a770", - "0xa92f08cdef67bba56a8a1f76b7591fa03460958ad494b4ae5bf0378ab4de64e7b34f86748ea1e52374d475a9ffada3", - "0x110a73e17594a0d884f269f0d145cadc0da4b84268e43a09ff2ca86987662cc1793763544829d03d4af3cc78fbf1c5a", - "0x7f4ef3021c6bd8a66bba17a88d70ecb47f27cb7c8b284a0c57a82912223bfa1188fb2fbd1a892df8541a261e4a3437", - "0x83df71ba1434f11ca8459be1bd92d3234c6191500e8147bd96bd86c68e868eaa4b0af0649ba2fca2b7514436b45665", - "0x4ddf0c632921479e22d47dca94d31c4780c977bac42021e159838ae308c15ad394afb3f84d25ec63f8598df2d96742", - "0x1497cfd9cfcd47bb2dcc84da7dd999b03dac07e4b58e2b092d59f62229b9c740fb361e3cee690edcc39e1a5b2dd4bd5", - "0x173f07e2e2261fde9814c14b4687f55346bc365a955ab37834ebcb497c71a313cf2d6aac4a960e2a49b07736a56bb9e", - "0x1a305dbafe17fd1bbd08db9876f331684c47887e221d2ab444109d15fc67e8a7ee79440530da07615220f24574d37e9", - "0x13c7e8baa837b141b4ab21f3e4a0c95574803646edade8860f19fc6fb1c7f4694c70b1f05e99a298ffb34e48ce9324", - "0x1146cc708959e767b31a3693908b9b83fbbd82079c7c449a106faff51c69967c8a7e31f7af69d1575d6f8b7d3e48b94", - "0x14ff55ad6c91499da456dee9d32182d7f2b24e8162366d07a28ed5b8b26f8c83f3a7059f4a430155e30fc990df70431", - "0x20943f2f0f9c6bff2e1cdd22cdb3ee582d893b2580ba9f576c2e35dd2f7fedd5457041d30ae0a64184182e1d7dd7e7", - "0x5b4514b7661e018e32a6e3dc09d9e69cf46f2cc479a6c3337355055f932bb421594d34e247eb66f93ff5e7cd41f74e"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 56; - int alpha_3 = 5; - - static const std::string rounds_constants_3[] = { - "0x16459e35fcfa367c842dc40935289915332895c129d33092d67d51dcec53339306b10c3028b4d30837d4be092d18e00", - "0x42961a4abc7f2153d90ecf30b28d0a261923b8a7c2aae0f384011dd4c3a1a5d5ccdfd93dc4b4ebb42a254b393b35e8", - "0x5ac3740171af59dc84ded78a820f3330c3cb601c98aa988290ba3108e1760f023a37d7d314bb1c7c4833b72bb87eea", - "0x3676cb278806e554ea391b1bd8467469a0a24d27677c98f649ea186d5688327a350a3f3f82ffb9d0fb6e3abc5fb13c", - "0x5f2e02a78f4749d36ccf25b9ddab118faa6a5a4b0f2b67c6ef51f324bc73296ee9cd8c2965cdb23a090c2f548bb5b", - "0x4710fe15114968a6b52adbbe0647e2e262a234b113c90851e12725c5359a5e73dc82458a1ef4197eeb6e8dda45ead3", - "0x1d2139ebc03b9bc221028fefeadc5d2f5e956fdb132e5149fd0a9813095dee22ac50c2487b19704d4d106ac9aa8a04", - "0x11fe71562c43aad9ee87bd0801a31bebc87918d62b418fde73bab6d049281a92e312da58d2477a8b641baa82495da55", - "0xe40f436fc2ea368a264e77bdd67e91aafbd6a07cb19296024a91f2d8238158af7245e970d0cc9d53a0230d5ea3dc8a", - "0x542261caf5a1b80438c57d6f9b9d9f3ec6a6d2a6bd41b7c52fa83bb418234210146a5c1cd2c4f43fcb6f0a577dc3bf", - "0xec3a88501cd491f138cc7ba8353c76ebafa98e0e7eb078645966ad7297f3ea094f6e33204edfb28b59ce05b1a16545", - "0x7faeea9a70a690084edec781f124f7b63326018fcbcabe7add257b73bea0765ca4c90143d0515cfa50a65a6bfd5a1d", - "0x15dcfade3ad79af97df317b940379d5017c75ad5ef61cce697906a015abb43ca66f40c3c45fb82b1817fc14d5bf1e04", - "0xc9e0f0d2b7a3cb61210c053f0ce944976874109258e5242299be04be5d1ef8c77fc661f5a9d0e4d73c665f4a85453c", - "0x109d04dd6f6ccc60adf4bf344f51f643ec966699ed85f50cc49644047eb3f73535ed78a460d8930dce47b0e9f0fd1cb", - "0x103320d680bed0591e6781c5e60c1911a7cb320cdb4b956b21e84fcfe7629bbe711c1b9e830e508b7da919385ca152c", - "0x14f92aedc1ac6f5f2c60f3d3414968476622450223f539c0c0632a019112ff624c8e393dc2aa46494b24d930984c92c", - "0x125b9c470d1348b3abae361f5ed91c6465023e1c7e0f04e7c3fe2433e7aa024be588f7497dd799c9f907fe688322bce", - "0xc2bebdf2a8fe5b39014caded5a7f13b73eed4d65d39f625b34c2084044bb1a8a38851800d5786c893080b6b7a8ead8", - "0x4fd6b043299233bc05ea62dfa62fabc6a0d484fc0abc9f7c57f0100e714fdfc1083f41663dcb05c7ea3abe0f28aba5", - "0x175a6d77b91e73b0c0b7dd0db981acc389f2536c90b5822465bf5f92bd7b07abdd41e5782a6295b3fb239db158462f", - "0xe6e1ddf39975cf03c734aad4ede267b0fee3661a2c9052a09bfd1da968553346bd83103266b581e1e5d9953c76d8d1", - "0x1e25a02e69d56a211360de67657e7a7ad51bcbdbfec40c098ae7e8f2ad03d5f6e617ae9542fd6e447b5a3628cd78a3", - "0x17c1b790b0decc48ead7478671268f2b9d857aa924bc40dac7c1585e0e6b56ac0f2e42853db579b6eed415f692f6e74", - "0xb0b361ec80b76eff08f0b3bde72e2ebf6d4cd9aeebd89c973801add45e8c821f1bf6976698abe21291a87d7f534a87", - "0x19823469cb641e8e5e07b829d50b35268ca76d904bb78165cbdbb10749f9dcb8b48dd0c803c573605c305c3d9789f56", - "0x15554cc0360127dbe921408be780605df99993a3656204728b9aca02a92e52fd0547ba9e97d49076541663f0e753ac3", - "0xf4e05e0459724b4d529511c7a80a70fb3ce41e006c3566ffc600d2107d0551cb27df7b7ddfdfc0e5cec721d7024756", - "0x151f0b5a2cbbecc7eacba2fdf8453656d59f22cd9250672e721305f65f780949d90a792f9aae069f34e39d0c0017b4c", - "0x1d643280b92326c9d49e69fac19ce26b1fea06186549260a69a705fb742e7074557d7d1311c94c3cfcc11cea03b3b2", - "0xed62ded450bffc9c29cbbcd97cb18117c7a4fae7f9e51af8674e8b58b3f8b3c60c31b5a1650647f4fb3e8b333ab605", - "0x10dcbdfccd3200080979e2cba40af372468552aa3f841d5d1899516b364d029a08b0523569417268efcbf1fbff39e4c", - "0x194110a9e370f729b4b8adac6326a4a42a21d098a7eb915196982ba77c6ac130b546e2a9d7f062ad2d9d78835fd30ba", - "0xde014216ae467845d80688e7c7d0407d64514c440145659731b32807b1755cadcfa244679021c2fee603e3278d5bfe", - "0xb9affcdccf98a270afa8d6c0ceb2a5daf7a6f3635cd1a58a5302ddfb92ea73e0b3535d43737504acff013f746ee2fb", - "0x10283a1ae280cbfbcb7caf74a10548f117a3385602a787d35228ed522408d7b984777af097e6633ee5eacc53e93a67b", - "0x18353dcd95803a42e6321d512fdad80e34f79cd5ccf515916e1fdb76b8cf908e74c7ad04170b5cdb55c4ae3e8f0b172", - "0x1a20f82d9a2a487b620ed8867bc7114ed7c0caae292b815f33f1a2029e1f8f2ff4f29dccf13c18bebed43b25497d6fa", - "0x135c404e2292375b81950f9c0a190cc2be3f1d6a86af25c42bdf864400886070bc795c425e64b54394c9bf352debfa", - "0x7f470f89b1d8520405c54a5adef1f17e1910ea2489e374861a1d316919eabb5b40e9d59b26a0b4ea63d968b496e847", - "0x13f889c7abaeccaf936e8ea44ff78f436b1c0f9d3760f9506e1c3f52e65e8959533d4e2e972f6adb1fdc3b9344ad30", - "0xfd4360e2abd64890882c0bc0ae86c0674ef2138f97894cfea71429a4b43b9a1bf37b21fe0b05d295a2205ae160bf09", - "0x17571dc54da246f6c1445ce7707a298afe87819bf8bec34e6588d4445a746185074909bcddaf53a7b368b6c0be43f95", - "0x1858e8640c6065200800cd45d3c2612d1cd83a5293cd3a13b1ec3aac2842e309da9147cbac91c4375f8be238970d415", - "0x2b23a3d7936791eeddd92c2beaa4900243dc97a7fe8b4f4f122b8cd164948f311d95390c29252fce2bb09549eda17", - "0x19ff76e961c2a237a81a79a0f3c80175ee1a1b8e56206c9593acaf38bd895ce16e4e7ede6e3b0d2c7606f3672a7b4e5", - "0x4edbdd43012e07fc982cf0f04751592f9dd93a54cb0174e591dca8d3d23b53765c9cfcad1869bca93b82d56d6f37c5", - "0x19471825d6bed9a0848bec63e67b907b768bb5b0e785a0279ae20fa1742f0ee9a1f2bb50713fcdbb4748ca06ff35ed4", - "0x11a5154a97529ca98c3dfafd777964e12de131ffb7e1c00c49fd397fd38e053368b681322bf06e6bbdeab06c1a1e4d0", - "0xd7047afcb04d3004e7c04f832a277ba62304e1129201726cd6e96396032936abae2d6bb5e1d082296077cffd6551bd", - "0x1737457e802f067c5b49c2d8ef0a1c857cf29434b44eeb6fba82b6c867be72e84055e14ed27ae865a2919cc3b8ebaf2", - "0x178d6c929f4f23050f6d150f881ae9eba77ab3e548be3aa90cf02031f76b3c080fa3e796a6d1d3f742fce4ee01b5199", - "0x895f29871ddde6959cac27e8b83487ea4bfa587fea7a1aa36515572fb1b1a90df2b899a09cf0bbcbb205984d50fc29", - "0xdc04efbdd8fe171b0f3dc2d1da7eb25751a852efccb2bb656117fd6c5f047ca97da6b73beed8eda9424ced85ead39", - "0x164b7272b1bec3899910cfbfa8c8765d5f4036825229534cf851e7d8c5d2429ac4187fd34bdc1cb454bef040b50a96e", - "0xe271159113145a92a7e6f75a0686fe4df92902f82fe410a88c7ed37d5743f91cc08a9fd287e01ecf6c46e4814ea11b", - "0x8344bcce247d041886fdb9dfcb9c68993d372fde7fd32e68ce80312bc2bcb660a91fa8cabf43c2910373d017d78e0c", - "0x17474ccdfa018d45fd335a273016fa16521c181816290a3c3482359e4199964d282b556e78cdb04dae6f00aa7efa31d", - "0x89b0909955e662766e156f5408adb45919c18e0840bae25f74c17023e9e975407c42f636eda1753e2e00ccadad010f", - "0x15383416209f71d2873db672647776726bbd6d6c405d4bed6c0caf4a1a4bd63c0d111358a390f3e72a369949751bccf", - "0x15e5f2d6db3c6a6401d53b2a5730e04246e631047212b4bfdd130ca0a97a37500b58df332b202e4cace6a4ff13eb02a", - "0x185c90601a4f63501317e2ee6e201cd0e1e1699491cb8f5dc4df3ece66f0c117a5f9642dc2a8c533ec724877ed05603", - "0x50644cded2aef8bec8e42e3c411825b4cb1d1074e0e791f23ae13d5c7c6f8244967530a89eaabedc681382715339a4", - "0x1608478a8f2c4cbc73e654337f9b7603c627f3d7cea1d18d593f739175cb9e4a7e571aa0643866c42b7e9a9f628e5f4", - "0xd7aafb34e694e8fabda1b7046a40cb0867b0ca1e794903b88ebbb8d1e0c0e19393ef46465095e3c7b82770870e0efc", - "0x15fca17f560acaaa7b74110ab181b21f10b112a72dce34463db360f2f257e47ac6ad40a255f6e1f1b1d28f507930ec6", - "0x371e1c7c6bd6c16ac36cebd6f09a829886e7b3d0c4ce37de787cfe1f08e86a2337e5782be1daacca510baffeb1954d", - "0xd188e4d326d9631dde3abf830b3334c531b7846d7454664ad678310b82e38fc1b28b867f46d4ceae62070fdb80ac95", - "0xc0397c7518760a331dd0af7e266492fcf7c4e3bfbce675a2124294ca2b8e14f97cfafa0775f7769f09d9721768fbd", - "0x120863e28d9b5130be764fe304d097d4f1b514a926723ded5677603e21cbbcd1af2e5cf1b9543133260e1936cf2d58e", - "0xd7bddd1eb9485bcaf94485860a3008b269349af45b384ed0cfc45394982b8f91a1d018f5c595967ab0230f707f8de8", - "0xa0dd891ff61513a98df9948c7bb34a569e3844bbb7ae3cf4134490d5b03287ba8c006983068ea5776d16245685f5ef", - "0x115d8efce7dab96a27d2b7e683d3b2c462c21162398f7c8b39148625834a285629f27c94705d2292fef17aa1297c772", - "0xc3d63f12929bebfe71a4ab1f66020dc4ee935cce5441ee06b4c13f4682c1b3948755b453a0be1c0bb2d8eb63695609", - "0x1364c1de26dfb376df800fb143202c3d40b4b4e539e0a581844a8c7b8566d1611545489bbf2abc8f26ef6a7f1658baa", - "0x104189233432b4eb0c7172d2444e75b8595451431910df9e30ff45560dd919157295c869f8e9a098d4ebd37d80068b1", - "0x86850157d615f14a6e0650cb657de51259a2ce243eb666f6c76b5a706fa744c0d745a696f7e190b9e51fa9d2580e3e", - "0x11f0f91f56088b8f4165dad3f59ad5ee60c9b8abc07478296a69d8b13ab4653d9a5b014c7a5c98b4d8139a776376051", - "0xfd9ca346fd063f6d40802bbab5dfa594e23c49a70ffaed3ae716afb03b7d581efc4c6b82f91b3b0e158f358434c3b0", - "0x40c8119d7ea08092b3dc8d1670b96f5be14d00cea342338f4016015d08de90129cdece1890f072b355ab5c40fd4c3f"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 56; - int alpha_4 = 5; - - static const std::string rounds_constants_4[] = { - "0xaf2dbdeed854b38ad69338fd686b68e7492db9725bceb1a5602661729471a3d78c8f96559791518ae8f05850040ae4", - "0x60d91251606f5cda34bc2b46290dedb05a6367a5a8fcc1e14c33657362eea6c3e1abdc1c055a303c5407f4b8212f1d", - "0x41f6a30e7dff034b64a7fd2da3e8c6e26d7ecc564f0d4bbc955be419436cc5b2fa91a9a6dabd9ad375e83770b20ad5", - "0x19d9ee38081cf75169ef74b7e4db1e730e3d1992c027222328b0631fb13789889ea265a20358dea5e00e251e7932bed", - "0xe76237431f4eb5c5fd15959360b1b8d454e1ed73cb52bc3308b042dae7e901f1c31b00543ee385f6d9e1ce51892c14", - "0xd31d3c93fe423812cfb329b2321ddc6cd9c9b96c1868817846af8952aff303d08e80faa92c210a510ee7a5323abd8f", - "0xc28ab3ea3728d85ef46d63d7e1f2a96df6132b1b550df9bde53ffd3471277afe161a4d76bb5cb7056e6e05f3f1e717", - "0x13cdc350b1984093fbcf77475a3ac60644505dd6c057eae6b5d4f9899730ff2c227e782a75cedef00966a9fa41632af", - "0x72c290e8c33f83370245b7cb1cdb9fd079d2553a774f2efdceec15355a0a04c1c9aa5cbc353d0bd7e93217fd15188f", - "0x108b00f5604dce0112e97112f2bf1d2394e11044aa0399dc40da6a2c72fa304e58eae9bc919141b2c7abf98eda9a4ca", - "0x186cbea1d1e07d8b90d1c5a26e675359126b0c1b83cc0d45b29e50d3e3de2c7f58588ab1786cda8789a38aec26e9887", - "0x89f56b4aaee97f8ed3152c45390f3034d6c001122e0c4e87e080352e9831aee832a601517e3fcb78dcc985df37c825", - "0xeda29ed1719da5878ab7a6e5c713d6c4feacfc39b3875dcd61268eb64addcd469e92c8c6612886c2041af5b4334aa8", - "0x14cfec762a0f9fc0bda26f649d2d0c8c2159ea5ad9c8a9f9c9f0b982fc4112e0c600786b6ac9d41e25d137a73f419af", - "0x1a0d460fe2d39c7665766d46c978a895bc7b33b9903086c6a97e1ee18c619aa737b984ffa48023f1cdf2709c64eb32", - "0x16da036b4e308f6b0afad2ecaf41b587e8b652c6566598867195eada3c6eec38f1143966442f12e61bf78ce49feca3f", - "0xfd927fac6f1a6d34e7d41436e93c3c53b3b018e44b3000376de1f0a3389800b464d657e49a9c2d9cbf6a5b1256264f", - "0x8c6beaa25aa8b906000bad7e66921b02ee292ac49a4b34f0311517673fb80bb1da2890827a1493ade2265224d25aae", - "0x340f6b8ca96d64258c91286d9c64780bc8f0decd9cecc52972b0a5604582a90ce45d85127a1d1822f33b6c0405914d", - "0x882d242a21bba1087624ef55e25eda2c00ce8f51051ea4a1cbb840a195160ab03e96b7bd788da40f446e79b165e5ce", - "0x21fbe9a72d7a036ec96ba74bada2c25f9a283002da5e67f05c14c74662ae01ae12a7a3b2662b2d3beb33ea71ace2ed", - "0xbf6216bffd8f3c6818d703c64bf3ef79a599f98bafe2e54f0a5c78c37b9aeea9ac07d72f949fbcecf317be55ca883a", - "0xacc06d890770074fd2d86b0c247d5c6417146d0cf3ef169ef1bfac3fcf3dbea4b27d7ba2492bec06ca31830b01bf37", - "0x13d728b620c4344d0ae9c041e1c5017d82f3d69b6e91e2186645b2fc5fdf2c8c98ca0b9c22261fbe4ece66d686dd4c7", - "0x12c720d9730913b48257020d8a0f6ab4276d07d9ad85083b30043dce88784dfdf39fc4c9bc959b0acf958bae039ba3b", - "0x648e8e51ba0d0066a20ffb560b2a597519c2eb4eba73f3bff62a6cf20587aebb63018dc4075e75713348fb78ba636f", - "0x17010553a76e15c14397c898334a05fa81175fd22bba00459cb0c32980ee2d77057e733f4fb92d24fce7e4f1cdc06ff", - "0x103894f79376fe1ff37cdce31f6ad7597974f38174877d0a2f517950fa5f423e5c5353527fdfa35b7e493352e0f46ef", - "0x1349e51a4dfe5cf0966293568ba9b4999b08db8f5c6a8927b381e5e716f4c6733d8508bb04f17de9b6cf77ca6f0530c", - "0xc5ee1ccfb6939063cf2b43acf37c49176ee4cf5c739d71950ffeaf76b08dff4677042a16462cb2858b87d41ce8d016", - "0x7579dbbcd18e71c94b8c6d494f92b2520a8477184be78786eaff5ef062dbbf605577143df8380f54df0ba0fc67a202", - "0x131fa837c16d30bc51159d81771a5c4e139679358fb4e3baa09eb28dfd1202f745ccb3932e79f0f62b2ed6ef22489cd", - "0x15f04d217084477c898ae05cbe2e6759b24d93f8ab142cce8b72ad0c8e7db00755a2d681458d0187c11d9fc614543ab", - "0x771d36600c438ddbabe353947f470bf8c6713e5671c45536d1ba389e2b396e4d8c486c76a801e89858ba42d2398f09", - "0xa1d03dc6f62ee38d57ba4fef8ec971840b313aaa1b515c4b5884a5b8ec04f30700af1ac422e148fd58e22825d8c410", - "0x9b51d24d2dd73889c0e807e654f94ae999b640d3b1dc9f38a25396a7757d1a05d36f418ceb41dc8ce6987561ce2481", - "0xfb67d24d8a547a677085d035c01bc96d2e78630bf99cd0210822cab7db048702c8b5f4aa07eeb5ed3020a0066f0234", - "0x12003dcd079892602179dc3546ec2f2b71d8a5436e644171049d24340ba36ef6e5d4711fab8a75cbd4f8b479dbba5e7", - "0x956c226edce03d747ac53e0986d364b19a884836ab2a63ca4cbf1e485d6c0979b968018d2ea7794f999cdbbf9d49df", - "0x1981eb8c30d33a9ee2b52dfce030dcf358d5e47303ef4fdca38e4c57141d7da47bed61ca120aebe91660590ca0428a7", - "0x5891bbf09a67c25c2e95a682aec4dd8f2bcb742bd1cc807dddbd0307ff95243fd0c0ea549ee5629f592ff8e0deefae", - "0x14e5e5df026cf04889e56586c287b1b32fa84bc856876c652a4d8726539f4d96a3b2d58f02ed57a584bf3cb8641582b", - "0x105bf9f01b6f41bce48c9813a62b7e08faf2fafa9b40f3805318d59ad17fe345b15d07567ebb3139d296809347cc0b", - "0x54e6534b837f47667bd2a7bd0a18692af882c71cee54b43582f71dbddc1926cbdbb734e9d2bcf3d91cfa67cd3e8eb8", - "0x43c56f0becd042a2321cc951fd661812374cbdf94a1a69d561193672f622b2ec5e2b22fac705c541b62869b3f9d67b", - "0x7debf84e5d8508452f6dd3feee8d54df33cc1afbca3ef76250f77aeaae709cb4e12b2147d38d3b9de991b7e63af9bb", - "0x5fa3f8ee1df0e894338337c4818dcb798a9409718f6e77e1980b51d842322c1f4b853ebe131140e7e1850448212ab6", - "0x183725a7e4c9a1bf8cc045fd21f9635ba667d034a1fb7a2e92bcb62b83a22e9baf072963e2dc77b7040baf94d9017cd", - "0x13a58ec3d60d9747f7755291bbc1f4fc0b9f729e920b747a511f0318540b8db279147737965c15eadce6a5f8e3dadea", - "0x61e753c4cb9e94de235c140d6e3cf86bc73b23c75a9b4916f344a5129ca711e34ad5c6395897ab62ad4d18d93146dd", - "0x17a7c121514127231e20347900389c1f9530c1d0e28eb6aca6c9afe18461cae0111043f41c10ebf1676a5ce92374101", - "0x194128a29d1a4bd66c77da56765e26ae346e3fbe9e6590318d1e5c44e732ddc4b64f946389739d3e0f4d6383f3bc9d7", - "0x117c8ce83934f36101e92a98ad1444dac575c4c6b22a6db1ee77e854dbe49bc9b17ebb91eebdab253da5591dd2a4119", - "0xc988b0ff3c149e158f66324afde392450340ed127ce878b343fe14fb2ff565e55cf38a6311a47d42c16af0f6b77f6c", - "0xac1114645f611398a1273d3fba00067a969f830abc7f985a7fed3bd2382d0d0a2d7a1edaac3b14545846a57e6133fe", - "0x5f8a63bc8462fcddb1cd86d2c647b4ff415140c0490e6dd8568cadf205445f3c481fbc39e2c8cb7b56874e576f019f", - "0x13f4ab363f6357cdb5256e7f846a9a77875bafe5fc02559a3aa90368b27ca1592c5a9b98f84136bfc9b727a34dcef1d", - "0x119af6545487b8aab3c247722585b73eea243c58179f6eddc7e5f2c71faa15c4fe4f11770ff9d9d046331d5c9570a1", - "0x3821c8ddf092eacaff01b5a6f93d6e17d76b43ea193d59a268387d8220d14bf2fe2cba0ff1b5d059eb248c508deb4e", - "0x5fe5f16d419a2066ea1aa082f1344cc7f83574c57c27af4ab34eedc2e5369102da8e3715b460cdadd8f7cd135a330", - "0x146f881bb35e11dbf6364b279402467efb8dc32f55a5ed1289be1030c479695d72f2acfa88c9bc67fb63c105a004928", - "0xfae38f134d930e2b1d839850f41e5e20678c5b7fecb26cf1de64d1c3b17881d287f4fba8a4acfb7abda78086073cb7", - "0x14edb1b92c981223acac89514b710cd84e9d5651af5702c6275ba9e9d045901a45321e244805f0c93e9251bc9fcb8c6", - "0x1ab856db2ae85d970d4f348e8634c11651051a8daebd7b17c9e3ed56d895f047a9ef6e8fb7f68bb49d86c1fe06208c8", - "0x77bdcaa3d2622e3e04c5110985185b54530db94db30b7d92be7e37b61be07aee80177d272713d944a8f4eadf4fd498", - "0xb1b77a2bed0b471262aee500fec2ebc9b8316e29667f3f99b9db4b45ad51f364631cd52ad4929e299c1d6a143288f2", - "0x2703feb722fd73d364972a0132e7f553e4d482a7659598e8fb9ed92e527a6f192ef48feb3cc482a5e74761781c037b", - "0x17dcbbf25a092c89f1f8cd9f95cd74dba1d90e5369bae9e5a972815f1cb255ec3fba8eafd0ba86f95f369a00a2ae6cb", - "0x3de864fd94b62863821229db3cc8a51233f5fa913ecf0038fcf9658b44472d84561c63795434804c63505a3769282b", - "0x200414997a384438c3c4cd8993e7542ebf6a9c2ff939acd963dc505f854c842d6b0b4567bd66bdea1bbb365d2d0239", - "0x16b9120ff94b8a079355b6a37b457016a7e3049afc9c47c620408e628ed2f35ca9dec0fdc6713aed8735e0f45a1b0f3", - "0x18bc99cbaf49de7f46dc16dcc92ae4363d0bab42b0c67e62903b4659ec198841a8575fc5cfe3cdecb8667bc20518d9a", - "0x11ab59000b8bc1a82f0e06248122facf7677740982cd34c115af3bff82c144f2cbc72695c87b2e516bfb55ee18f51f9", - "0x6f15fccd05bc48b5e5595a64ba92279ecf602b926008968243a68a45f9ba3945d16bc7e9297a7cc2714a44acb0d89a", - "0xf357a5f258806b5f1764d5098733a5b813ad53cfad5c1d0dfac550ad3d651cff58c8ffb84c84d14d6e091a59ce7518", - "0xc4290640301802fba3965046da1a95ce263c99020827914386f0c181642e3f92547a43328c330901a7e4454d461a3", - "0xc33ca5abea6aaa71acfe2a0f35afe91a71aa763eb8560988e4d242fb27a454a943bd30d101c44fc554edd95ae3aa4b", - "0x11bd3445141b84475a45ea1d5148f99cafced57d7296b65f49d4cbf705cd8c41d2319ef60cc49ff3a04e98d6d607597", - "0x11847f95082143db31f36b06347289d01bff723766e60e17affdaf84639f4a7816d6da7c6db3b8d7affecc3682dab7c", - "0x105bb1d6030308f20f805abcaa8760c5354d85a22a5aa04110da0f81f207a2c3b38b4d27c105e5eea9c1fb486c9a4af", - "0x12c3a26c4b0cdf343c299571ac09ffa4c497274876795fb83f2c6b6af1a35b98d4c9bf9b65ad7b1675115caa15cf949", - "0x9328800e48a30ae9dd3e93da2cb2f21f02521c7796d64ff31e56dc2bf9dc65367f592dcb4e2de0ba30d2a03a4b7121", - "0x169b280c81bf4280881f5a5f19906468f2ac165e66d36732a83a87aba642e5e6076a31a17f5ade562619a4406aec81d", - "0x6ceeb884f10edec757bf3bdf471d10d589af63ce070a22f3dbf8a69e14896948c404dcaef51201854e68e15fbb0f71", - "0x157a55f577db09bea10b673d4d7fec89b49493a8f2b52ae233d960f805fe6a7ea6eb4de2bff3582438d9b894949b4a4", - "0x956b43258513c3c7c71d636bb5561278152a5b8a2f0c6c22f4e997ca95ac682d2da5dc02064da7885232c6388d61ab", - "0x21f6311d56ecffbb92fbb9f27d409c3e83264b0878495b4f622fb2db9db5361a65c444b3f21a63d340fe677c77d80c", - "0x2ad8a3c585e39a167b591462af9a62b663a94b5cc23dd1768d7ceba78eeb33534576cecda9bcafa809bd765e96e65d"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x136cf372704846da70badcb3decf38a0716427a0b322876ae06e3135ae080ea1d5ea713293398b2e56a9f6d8eb64d8", - "0xa7ad2777f0341b4d1c20c2d71dbbb8f60f37ad02d0985bf4f0b25bcd0da68acf6cc5428d8e0c24607656829db1ef98", - "0x110697454712c6a1ba993dde5d0e2fc6903eab458a5d073bb78233f7414c69d9c19d2752506cf11fba16bfb09abba7b", - "0x4212dbbf9ba6e53b1a17c72dcba32dcfe6e89a547a395b0f2ccc6e182a0ae8b529d7e0eadb17e868972e36d2f14336"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 57; - int alpha_8 = 5; - - static const std::string rounds_constants_8[] = { - "0x4b69ae0ea3543e631619325b693c3ae8b42957a47460a69b5f499f86306110477e5b571ded13898282a53d851dd15c", - "0x99420415b1d0891d58989a935a27f0afce78f99ef2a3b03a30c41415927ca0ca0c41583a06a745ed638aaea5554a8b", - "0xbb4ae97f5d45c31a2ae0efa519b23f5293eb6b24596c4bcc24fe7c76bed1b9057df3c69fc8b92adf5281bc4b30495f", - "0x132ce5451482706437ecb0f16b132e92aa3e1e5d02b5c25b42f6178680033bdadc1fc98c4feaf9601e579713076c378", - "0x139e188692b12dc16755a27e209b978f84522fd8e3036294d5b2e1c4c8d1438137325b7a34e6bbf5873db2b9a2f47f2", - "0x5af5e533870cd0be84cdc55a09f3d463feb29bc57dacf318f196cb9161e8d9512dcd12a68c926f5c7f9431a61bb786", - "0x17550ac91856efad6af997bcde62db0cdbc8edf634414f240e582f249d4999f3b2f813747fb2276d1146f243631c8c1", - "0xad54a9417dd14560d7ca97d254c69d46388decf0c048a11c675f9d4127a56da8ebd61a6ef459e6e5f5cac424ded61d", - "0x1aeb5c3ff90d1a6d64251ad75a605ce37a25e180b73ef0690f9ef73eabeaddd33fac4a0951974bd7d02dc7b1c56470", - "0x8ce6e1197ebc499e59bb6dcef32042a4fec89a42844f5aaa080c9e16dd36779b13b732251f748110121bb4c98a6d8d", - "0x828b9f615d4bfd69db74c91e49b2345842d0ded27f7d9a64c686ef09a972069a09283a2e569e029e5f87aa58013cf4", - "0x3d208e5133d8b13b7060af343c63e1a753f4ef98c3b66bc2cf66673bec4c9c92673f523260bd4a6a12b9e96233d257", - "0x8384b2f1beb71ba421cbeee82b5b6d0a50afcf64871d2f5f8043a4f2081b001f66c66d6a4b0ec55e018fa339221832", - "0xb2d13e9d42e92a7d47cacabb23abeb0796320ac9dc90ffe89b53df0f147aa7a73b1eef9578c128e5ccb19c6ec7e383", - "0x17fe3127e704b70ac10a8dbde56a5d95b94d843cb6e361a2b166174820a4f3ff9d55ceee696ede4ff59f109d92531d9", - "0x11e5a6044015e86b4abf159bfb4c8bc0aa856ef879bea2e4a234787a0288fe8fb3004f16b2988be70b935248216ae5a", - "0xb6e3e59d795dfe460bd774d11c749c377b2ab2f632313a7c6a854dbfaad1e54d8bd7228cd14d6274b0aa53d42be1bd", - "0x5426db89d779e72d63eb05f62e13662c8dc8072290c2ea0718aa762fce978faa793430d25d622b9f4d07e32c6f8181", - "0xcd004aa97e96363eb768852cfa3200a820da1ecb454d03a62187a480428d570074031087d77ce734daee4a7439f3dd", - "0x31074b235a3479cf963c4ee942b730d7896df37b5a77d0389d46359b4078334f5f796073278a43fd8a0ec9d1426bbf", - "0x995916f99b6e601490ac6ee457595ae5de6605f7a5171b80f3ffef36fffdb9d829854390dfd1383578ab303e077592", - "0x5fa75f6384b9c67d835070db75a18aff416f2a4b7bfd91b5784a151aae7ddc3fde6a627028fdaa26f753d8ef50c8cf", - "0x17e6dfa4db989922499f93ec7f4c182856e609b2f1284bcda761ec67f6cf7ee918bd8a603c21e32280fcac55da45291", - "0x9811e5c5f664b1dfdb4deb1563563ddfb769cbbe878de2d8335f229cd19330c1db48e0f7dfdcf4bff3b84a3c5d6e9b", - "0x2ae90de4ecba52cf440a0fbb121b2b279c41e6194eb9da305ecd4dfe206c1d35cada41202649aa27b09bd6a9cfa805", - "0x154d4cc9cbc0a0a08f1a31815815384678adea78f6a4ee84307808d704d89b7084f9209436c72287145461ba6897dfc", - "0x1a47dc42b9097167a771c9300d8608aedd8adfe6c74de5fce0eb268390613204f3f2a34e26996af7065b35ce916fbe2", - "0x902486a6a7fa5e471598797a09bb84423b809195d6e171f3b91cf7bd7ae5409303ef95c4e6a48c1b1a559ed40af93f", - "0xac83b81ad4f48be991afb3b41e47a25deb97fcaa045d629b45cae29daf19fdb31e23c37f45bf3a8a09bd3f462da2b", - "0xb0877aa125439cc9cb8483f74e778b4dee8b967f3d82826f45de84ab1d679584cefe9135ac2578d7341f09ae092e06", - "0x9ebb7fc169525a3d75c95db7317473e555b7e6fa521b05bd7afa03796e3f9f03556fdb398547ba61d30b92d9424fe8", - "0x311f50a2c8430002a14e6d1e4e08221a6847f789dea3de7bf2fce9197a45552fabc273504c453953ba901cee8ce2d5", - "0x1049a3475d25dafc2a0fe3a2b2f8e863cc0546456a8c0cd22e90c784268e7e62b81dad277e5208e24cc5c4eaecf7d35", - "0x16c219510a8926de17ee603ef0f2bb581455bd774c4e9ef2d377ff8b74a443ec2ad3052a2713ee77f8d798cdf4acb8", - "0x1963e15f5726967bda8bb6b91b80ac332d1da60ff1dd4f30444e4045414a63c88bda13d2e63c3d7d4620e78e08aecf4", - "0x15a9fd8e756ff8f766d0a4bbb1c14ccac9ac60e050f0fe8c69b9a4745f9492b8d264da3555e68f782a836c636c08564", - "0x173b56088f0d426228e139d8b9714ff8e3f9dd696b63123cc088254a6538ea285879297cd39992e2e2b7babdd3476e5", - "0x151ee79d14a70d39e23baefb74ad1e7a283475f97d5624a1cf7e03cffc26cb50cafce0c166a42e9fcd60cc2ee734ffa", - "0x423613bb91a8f8b8c35fcc0e2b50f8c9a39f60e62319df2e64b6efed69aa14037030c5aa668ec80a0bb855cf6ccb9c", - "0x174706d77bef15fa6f58b3719a2a90937cfe9f855941e708346d0880e136da834d763bf3b427883ab1a283e1f00e45e", - "0x99a94e1a5be7b73e5b8d8c1b6efba17bd406bdb53cd21de12de9b9442f4ce3dffd3f0e164fb8b668333cb2027eb1be", - "0x188bbf73c4e25f85572c8c603001a4682e29a4d897287551daca8c3bb8b7b6556985983eac9dc6cfca4856993321aaf", - "0xcc969cd50b8bb54091023f3063963fcbe71072bdc3b07a8cd297c25bbef5fcd20dd6dfedd45525bf563006c8daec27", - "0x89f7d50d23e077fff6b086cda17268e54999875990e9e3e972ae57a8d6cf9c5adae4ee3db8c410773e6256bd70aa68", - "0x124c639a5e04b6d85e5b949dd66d51e4ef8e592db4157c2e034f17cbe8c9562f571c58c861250611605ae37af7bea49", - "0x166c79267aa91cea5ad2c5fe01c14e0b51ba356aec9213b30ffc1317062ae6aced4ed86ec38a4c1a817f57fa704d55c", - "0xff4d848216a807526b78c8bcf49d4b4a3ece5eb51f08d53d29a4e8d76d4292845eb2e29ee3d65ef03a35673ae7bfc0", - "0xf83d088ded07beebbac37be1b2d1b8c35599ee1e2d50ff6393fce3b79aa9a488363eaa4c745730377111d710573038", - "0x140d6c381ad4b0978e987a124b3a08086533e81f30961a6156e0c36efa255e0e02ecba413f6f0345b637536357dfd02", - "0xc09465d3d35ddaf0a99d03ed614d4488bcb397179482eb3a070f2a637ae1dd77fe053cd9e0da3d8f508a087b956564", - "0xbf809736a281bd68cd059bed59a8e4020f11580a9acc393023c5b16c26518f17c131f74d2abb9fe058035151890fe7", - "0x88b0a48cf1dfa38cbb1783d7abfe3e8f7b0e65a2caa17a38d952de3bc69e44832b0e071ffb7a0b12629d4e5749cd40", - "0x1758d4e14e81df7775b4c98aa24eb7d99ab5f79425a45ddcf8585d91cb9f0dfce1e80ba60157b08b5b80b485b8ce668", - "0x3674e371bb3dd719a780505d9fcd1d3542f151e94172ec4e1cda904dd941e0df7da6fcfeb9128d9c1ab971deaf8bf5", - "0x300aa8b2ba2dbce74ba5de405eef2a401b32a3d3452a6352098610ec1b468341bb3abe4e33e5984575733ca7da8d97", - "0x1645e2d74a1854ed5b1e59689b1045608bd82e945621aea3a4fb791bd65818ce901078474250345f9aa0ba7040a46b6", - "0x24750ab110db6193456be6104397952454ba5fedc88c10c5ae931b497d808eabdf319c9f0520e45f6151daeead9ac9", - "0xacbfc37386cd098d5491ce25c248c9890e0a083a5dfd305f93d7bb11272467fe25842d336c59c6a70b230dc2d3cb93", - "0x8c2a6447540c3784943fcce442ebfd02045ca098fb0eb3ec959789a7d7fc3bf39ecddc36df6a496912183477dfc9df", - "0x17c51d95c57d455d01c192f3d17d0818308d5489b4009d0bb6dc73b3303e800c989d143157eabb6675f8fdddad33008", - "0x3a5a7bc776e6443815c59b2fd9716b00e994c790563f22c89ead2704baa9cf5520090370888806f52ad1a7a146d45a", - "0xa8d57c53e3093660a9dd68ae9e8747024c308b0af09b375e40fa4006a0a314f69d063db8733a1df6e846df0d0f5927", - "0xa865d076916de6b45adcff4a6e78575c7d55c55ee9b38fbb3032a2ee832ab4f3b4f617bc29ce1ae5837fcd524195be", - "0xdd57b67b095004d29cb3a27bf86310ee02c36782f4c4151cb0168f2f18e77b0ebb8a55f9ea00da222746e988ab5769", - "0x6927254ede31537098fff0b07a13e44df45fade23c82d1a1e06e85b99c7480178d25c1dda7c42738190f00c17aa3cf", - "0x1e7c498b01f32a86ac89ad9c153d4b0e11c89214df81831066320ca4628b8b38c695711afe5dde84b5a2164c4b7fe0", - "0xb5078007d9eb6e1f34c9e4b9efa18e5e763a220499d8b6efae82ebfb215edb0ddd93c6e17d254c347af76ceb1f82de", - "0xf0d56b4f0be3884c75e93ae3cbbd2536577b788c40ce826c88f24dd94d72b42b1f59c58e4ada331576860e796ff991", - "0x894014a9b85f4e04fa584f6a18f562077244dd824ad9c78ec1f7b1e87928a74757f1acb89813090d685aeae62bd3dc", - "0x3745cb1365d25b950cddf7085ba100e03149450681e996b1fb54d91f39fbc601902d5852ad70b7ec7ee3f5ac530f1", - "0xbb921aab804546c969a59773ad4dea1df83c6de356973c396077994ce40aabf05cf872700908dc39512d4b675e00c7", - "0x976e3b281a2e81f3a143c767de84ede5a6e7663f84f5e253f80daffb2ce85d473fba8b8859e56c734080eb0503a25f", - "0x75e844dbc2e3d0f38d131c3657c49c1497e2aa4ca0c41c882f4c8edc02ea80d12bfe673dd78d71590898ffe017b654", - "0x11afe465e5901b7281891174904c40bc8d281b0aca9454609c6f108e0161ceb3bf23ab4be6c7483d60998a287ce5953", - "0x8727d09d20d2ca70ac8296f8b05382e4a1fd82b2d21ca46737c951c7d3743dd19ebc02165881b584c2b23a3580cbf0", - "0x8be651c4727671c77f3cf96415400c6161ebb255ad05b029a70667d82c33699d278bb233f04c6487edd125212145a4", - "0x317a792db76f1cb4ca0cc9b61f5fe270cb093fd486b923795a25bc892965ddcf3132f7481f857b83fc4bc5b5cbd3e5", - "0x35df97ed63743287534716b9bfb1b2220f730b57f2a606c48a4b608ae1e507336cd4682be4c0cc3178d9fd68a7cf79", - "0x1a893562a0e30e713648a914ba67382df8e9ca5641fe104802c75e792401b93a6164602d488af1b37a5ed9a46605cb8", - "0x5cb9440589794670f30581f4033e54d55d4db76aba7955015528a1153514489cae043895d9adf3d9f8b42cd4d3b9d5", - "0x159b02836a1cff16248e91c965369f05c25d6ffc94a749892f806a67a58833e7679263749000b0af58488a7cbe1c63f", - "0x1204e768620edcbc14ce71979736c030eaf7a42ce28901ff4f0e703c2ca531d69def03dd0328a129ca9d8a7ca80b7b0", - "0x18f072531d066b85a40f53e982a0d119eabb61c4349cdaaba8361a7cfa487e5366c968cb3890a081a1d13322ae21989", - "0x195e324b8abd97e3dd845dad3cf87a6bfbe4cdf923bdd55109522683c6c18a598227bcfce7250581aa35d10c415163b", - "0x410a7bfbfc2b01a360cfdba23bca71d2f892b927b73625c27f9de1d38e6f5413b1740dd890f8874c369881be599084", - "0x2c7f0dc742b0c66bf454fb24296883288fdb0d89a02d14d9130991180408d4e7826023a0ea6e847833ee947e961b04", - "0xd53afe53a04e5aa995523340bd61576128e753b90bf01ed00a09d2207486400334f9d6eef8027075d841ffa7acf062", - "0x1650c58de06bf24ec98ddc636f5f011ca6bad5dc67635f7d3d0635544fffa0fecf988348528951c8b7c37f9fca6797f", - "0x4177c6e5462cebcb7d7dd96a054127dae8784881a988357c6f2a5e599cee56e5331385e630a56905ec06f7f802dcd7", - "0x979eb089173fee3199cad4990f7c56669524074eaf6422fb4e2bcb3c87928c8fe0af4cbe1b18de6dcf42cf36ae72dd", - "0xb7c847bd32fb88b1dc45462abe84faf133c3bd7d8bb2855079af7033560edf00dda35d4c80439ca90440d8ccb7a05b", - "0x3c47be509c257f90d598a1f687155ee935afcd9f7240925899ee60f102b780ebbf5c88a4f66e15d0cc7e4ce629ad16", - "0x5955989a7ca39cf481a26d421db6f83e397fef7ccf613d4246b08326386587590591dc9f7c48502f78c02fdc0cb51b", - "0x1518de0cbe7c41c5ddaea6e0007a276a86c256712240cb66318b8398217410b827d44b29e63dc6a6e0515ff290885b7", - "0x43ca48e99952bf2637ee1253e968e45dbeed3c05184ae32ee29598116b4bdb228445c7cb872edaa95035e8d19de47e", - "0x3d5caf27c4909a5e8bba656323d050ceca0d7439d29cf0d37e016f8e6090138b6c646c03469090afea10d9c3518395", - "0x7a532fc76a51db0cda14de706d5eece4fcf0f88dc1f6aee2535289ed335981f9494d2b886f3a0ecb2d76ad51b9517b", - "0x153b0dbd41111d9f72b239a4bdfb3a7aaa700e9a41634f4309dbb33daec80c2ee30424d652a5c1bc6e0a8c2277bb789", - "0x13889d8ab3e35309720f7eca90d5afb882e59bf646a0e4891eeb555ccb033965889c50f114e4c9b3e16ea955552ad18", - "0xf56c09a3b8c0b8a5699e40e716838909727bf76dd17e1446e63ac80e6050ae5db15122b5750aed07fecfdb68b757fe", - "0x57d2bc746f2e0d666e90a1a82d3d584797144c9f3ecf25932ab0ab5f4b2ae053f4869dc755ba3ce59cb93aec226da3", - "0x45870c27b7f75257abfbc0a4ec2d2197779d46ecfaccc6c43134d180e88b886744823979dd748c9b4f5a9471d77b5e", - "0x48202087479cd745d37f66e4103cbc8c5289115632f39de4508c950e6222d2e4afc830ea90d7a5a1797f116c3ad3b2", - "0x174f50da4065b8c4a8f1f57f4b0af239232cd0b96b7138a66c8acd47afc20760b1c791b05133331b8d13d667b7b3b73", - "0xeb88cd586cb8aef62e7d2587e07fcf24ee0f18106db186dbc2f11f7cd98fe6afc5d2c8d78acdb88e1ddd5660813ad", - "0x11dccd5858696509d6e2ed50c6eaab2d1c2b7260a3bfd9b69f0dd48d814fe9faa0870382ed4a47e3e49f9b0ab1ce930", - "0x31fae5424f4ba5841234727ddd6192804b6a04e41f8987656fa27859ec124fe28987b999032d0ca1b4783d1fd3c275", - "0xe10cb099e239e18a5e50afe9d9ac158ed816328e3908ff14eeef3a81473cd3e3c6e09318d4ddc41e79cb9d931c7628", - "0x989c82bc870582194d57c17475864d8b21ce11a899064b62231728c67f8c9cc1f9b2994cd6880d52193ef192ffeb81", - "0x10eddeeb9e25477ef87e26fc7a6c6d9434713f32ed0eec3cb0e360497e78752ff5cf40b0b0e6094f8a8979abad1f8f3", - "0xab67cd6505188c58d607e545d488bc2c17982e9b6d2b88c8c324d037359b7f3d019a7cbb706cae84bb2cdf32d40bf8", - "0x11c4786ca9c133224220c54f1cf2df0b0f71d6756426bdc8c45826d1d0c2ea384562b729a305990395e633e95ac55a5", - "0x13bd9fea302907009fdcd985525ec64f97f724b32702554dcace64d85001d82a8ebaa78036ac34b3599f34eb9a66009", - "0x19702a442ef2e199a861c6d778e936b0680b4a42796e8ce8cd0c0df29533bf89a523c4821d20af5e5ab541ad389afa8", - "0x161d7c824fc9fd5ebc05b8eec1119e13a6fe8ff391d69722ef53561fdbd0566db5f1a56bdacda44814c11f55c37d730", - "0xe15cb328232cb54bbfbaf2633ff9521d50e8bdda5fed3854408fdedccf225131b9a8fc4461c25a852d5851b3be426d", - "0x1c497fc5143ebc43a353ed7060810c6f36ebff103f14ae52bda4dd67785c897016bbe296a7289e70e440c499e2901", - "0x1a981a84519feac010da092541b250266148dada55d9a747d6a5324c3c8e01d50535ce2f683c83a8da5aa2a0c0c9966", - "0xd432d7618f801aabb3dfb21965a0da30bc8b58045eacf15b09f62e49d7f6776a94497a316fe1f31b2a808d33f143e4", - "0x4e313a733b09931307204351131b58c2de261e21ed683be89d066141227c6ab0474de8338ee36b00d5e3cca8385039", - "0x1abcaff54065d2c05f6eab83fbfdcc300dda8487794af5a3bb6fd03b2349268dd065b509fe7b4a8c562f3d9781a9dfc"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x12fa808923e5fcbd3c5a24835ad01e8a4d38856366956b0be918de41788258785099ebca55289502eba09d243a72903", - "0x960471946b6d281935c4d1e9a4d5ea110af0e7ffb688b568d4ff0d5b2ed19beaba709e6e41110fc3bd638a807ee67a", - "0x39db9d1ce85c0dbd66fce0a5459085719f3ecd3a3eaedb434f54148e154f99011310119b656348bea1a5815db3b675", - "0xb3ad6c615ee6c84953152d2491d36a5e00863891c11ebe88387364a7631a40d684debf2024bc10e4a478e3f3c29239", - "0x55fdd68dbd26f60d90df1844cf1a36ea1234e2ca99535bf9c4c5de165246f5050a98cdc138fc2f245cec99cdf5f678", - "0x1753f94fc15ac965db052a2cc7473541bd0208f41007448e39e8d91860f45601f6635704684093df40644d3b2cac36b", - "0x23034333ec552e619cfba19c479c56042b693771c8d18ec8839a21501f6dbdc37711629cbb2a786146697d8a5f8bd4", - "0x21b60c45de8f3b5e7013883021dd7cd6f6f57419e177543d649ef06aa23452de58001105163662cb08afdadd4c09a5"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_bw6_761 +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 56; +int alpha_2 = 5; + +static const std::string rounds_constants_2[] = { + "0x19dd43ce8a4c1f13c34cc20b011ba115136b93709b6b14236343a6eb04864b07132192f07aebee60f6d2814b9e1d48f", + "0xfaf4438a623eb171726445ff3f4171b5323c389f454ffbc1490e9e2dff2cef3bf845d9d22b63b31dc7731e6f1827df", + "0x596226a88881749566538f066e8eaf51c5faf73b1ca4e6bc9523829c699efcf51009799bf5ab766ef4c0f19879a8a0", + "0x11a0256370b0a9c1bf68353c5cc639b899927090c8c9565cf43b59c0c69413f07cf640968358724e904218781007c29", + "0x77a3b34edf65a0123ee6638ea383c2cf640c9a496c8006d2b9489a9c900f2d8b71af3c7ae3dfa7946a4dabe099ff59", + "0x19d5c7829caa89ad30850938fc1e06f931f0b60b608e2a572de73a648591d37d790300de63e12ea2f93d73a05db2e53", + "0xb095c47bef20a578886a170f3d92af756b9da928900aab5b0d1430787567e91bd3eecf6bc845080f11d45d1a240da5", + "0xe4df1df5379f94d5737abbd9a8928d77f8a0dcc66949ef7467464f595aab0b346ab8aabc4bd39263891e038590761d", + "0x44f2dfc842d41bdc6a830b602d2eece0c69d2b90390f2bd0fac2234ace4095ebdd2637cb57e8d16a810f48e5058294", + "0x4bc722680ef6044f276975d6fe5e897550bf8f57aa9a7e7eba468c625c7bab432bde70f4b595404cfa2ecb26acb784", + "0x1f9ac9df08f8eecd88680ce3235661cc13a693219b721bbcebad66377fa07880a655ab8527f774d419e33728e74381", + "0xace28f625fbe531b6f755641be5c9861df1da1a0797183e3693d78e19b56a90951b1738c125904a0d8d41180afccf7", + "0x1ac684fb18ff1e1bcaa982739a4542ca0760cf846491cc58953a7d4e8ddbae6157d7c0da758c1f55d0a47dfd46c10c5", + "0x1af670b044e8b2049fad288c2b037380fc65e31a90229b79861c51c698559241b14e0b432389c13a52cab8ade22165", + "0x1305b872938545c245b0e929ad00fe6c22006a29a35ea675d1580bff6e45754b27d6b8685833c6f5c30ace1d4621e64", + "0xa44a554ba69681371843b17b63d60f71b00c00ee780292f0f07faf6e66b93b005ca117ff3b5cd1f45b164196bfd713", + "0x189fddd576de32146ab8bce4d1e07302660de1afaaf610dfe4ed5fff91d7110bc28c0d515dc8cce9d737475b7bde74", + "0x3e88a599ee993d6707886f85ee55f909bcdfa335b190716f5833a2d65f964b73b5aa1b3853d047151e3044ed25273a", + "0x154ddeba33af6d7ca981f735af449a770f436e16f2d7b64013e24205107bb6913fd06944fe43cbe9724f0bde112259f", + "0xbe6740deef3ceacd169ce46ea8c754c0136b0db5b4da2cacad6c93f336a57078ed93a44a8203bc3f10d18b5b523e41", + "0x11907e6eb63124901bf76af3fa38eb927990104214c1dad6676a1dbebee8ded3136f88da8585e8d5979697afad734cc", + "0xc6d4162bb9c5acb5efe01f588dddd83b0f34d57455264148372e1263a7bd4bd3d81c6f8c12c1ca87bacc56293dee27", + "0x5d9354a75eb064996c3a37f5be0b47c8925b399435f71600319be5785a5b326c064e691e53e6a4934ed82b7572b33c", + "0x150b5d53db0b98263a65477437bf4a5b885f1708b9a1c98bfb08ffd3dbab5247932bb1d99a3f9764d5491743c9d8299", + "0x1a5a7c5860b026eda717ec1f055bdf55ef1a774f893aaa5a44e019cb14abcdc2c01278e9d2711f66da0e20f1976e821", + "0x191cc1081d18763463b18e6444af4d6ca3400ae2fb8962104d6219306346a7ae9413ef1c009d0c8dc12ae42461074e6", + "0xd900023c98cacadac34924477088310205197ceb742a949102677e100f28a0f31697729e68620d8e49567f8787b0f6", + "0xdc2a6336f55c948a4856c5571865f2f03e5a2b9eda9874ac6ae9e7bb8998c291294208ff13e043205e4c90d1ef38b7", + "0xf1a7c3264e72a4ea7c4281b2c88efa4ab0a0186da986fa78354349f38ab45285acfe664414d24caea3f340265001be", + "0x6420fff111b799ce520f7e96f8c75ee054b6f313be3773c46d4cd91dfe570c9f1731461d33e46d14f01cde79746e5d", + "0x23f7cbe86505cbaa9ce7ae6f49c28955876658bd0d1fcc2efde1c489a17054b259a4ff80e27d249caf2511e7cf9a36", + "0x14634855279ddd1c9d7e1a7b88571005fee2fe64de260ddf172c4c0da3ab2add1daefff39dd79fd615e3df8f3a024ce", + "0x22f471855a7db2c865f2e77a96fa68394d3c6ffc60a26a9bb9a5dc486d19a069c95be601c396aa255a0a4d9c67e93f", + "0xbff7e400b4fb23c4ff059bd7e239a419866fbceef9e14fb7895c500eb8490a609774b0e74cc52a94a14e06574f9234", + "0xe93f0125ea903b443df087c0c08b841c112ed62200d5f5079070456c23ca039f860d3e68126c8272f13464b704f04c", + "0x9b8646af1157333961be960d4dd9f8e4ac7831ec41d4669cc462ea71380d94a817b4e04e4120cf29cfd7d73edd2ba2", + "0x65a20a31231a4ec16d584922f6a3ba0082add2c8aa9f4c7fb59f4bd433688333b3216cc02b5b2243dad151da2ccab2", + "0x9b6e457259954c3518044db1c4be86f11529e2a0737d497933ed5da787470582dc5f9349da631994b792cb746144a7", + "0x3af368235e78176fdb9420aa0eafddb3558c7ad163892930c8200d2f53fd335abacd9d04976b10205fc0b4260e7f22", + "0x195c3dc131af2d6ac9d6b41b3a4574c06117f9fd12c3b3c515169f4dd46a9a53d87fafe428d34777d7af24da67129bb", + "0x62148489b5b523a8d169592e9e83c167480c8fe20d355aa02a16f9ce3c3630c5d0228edc77b268ac42ff539d45b7c2", + "0xfb3a4ef39b6735759d92475558d7e9f3ee2b158635c9deccb069b79162cb534c15c93dd77b6745e94bf8d7b7a846a4", + "0xac28d264170b5d53f37ad35687f763eec24707c4ac0abcc7c36ce6e39c392460fdc9df377025f462a2b0e68051d499", + "0x109f9b27014a3b3f4d2944f2c5c97b88141067ecc4617601d4015860f88ef618e463815f7b94e610e6b63dbe7534bf0", + "0x7d085b1dde0b3fab4d7b92dbd987871b1efa140851827bbc8f31dd8a6dd785332a6e86e4c1d2df987a60fc6abed4fe", + "0x11f8defcf15d4f1dcd48e211353add3ebbfedb837639989674cafb6312ae1b63e799ea02ca4ba1910da161aa481f461", + "0x18acd42ecf8da6a3c399d68bef0014756555f77ec7b99aa3578524227a170fbcdf7c3fb519a38018ca188e1b0cd70a8", + "0x10c752acfe261eb58e2b4f81002314412d0b6a178b9200cb62c5493aa2cc8cfdc4e9a078dfb7d16b800430c98bfc3a7", + "0xf7c85b7197c539f251d1df02abba427694fa8c8300e8c55eb3544ccd2848df6fe889c783751a856431715f27c619ef", + "0x717a17c1a62079e9e50929ccf5ac047198c74dfca0186be09140dc5fc31031212ed8ef9889cc2b63089ea10f8cec75", + "0x11d97c7847f679cb99dadb4e6d00ec568897afb8d39fabadce7b5f7312d91f52b89d46e23f4c3b3fe95cbdf6fbef517", + "0x38434408ff42c0e999118bfc274d5786d48d5b67443f4a802dddaab9a9f422f376f5ab803fe5665bed7c79b03be781", + "0x166685586c3b31756ddbdc1adf92610058d16a2ed521d97abde439511b578544c75aba0009a3e981469c4a35808f818", + "0x1ae0df866536188201777e862267ac65446dcaca53e03e3224e5bcecef32e147b54a4150b653cdaf4a1c434352fb290", + "0x4e8dd0b1d134feab07f6e3baadf2eca60803c462163c952ff9c9c54774ad4764243be8a52dcc45f02074eb441a4ca1", + "0x19c3adde3d76bcf216b30660c0ad65bf769e0be3cc8133712d95a29fbc943358a937e6452f6e8cd540c7ecfabae077a", + "0x189e34f71d70667bb8cb05f9244faab77496ac1fcb2ad98af26f7e33ecd894c726a3de4eb794555dd3f35af0861893b", + "0x90cb241dfd3ffbfe636f0859280211888818694d97059d355ef2af15aee4ef71b9d4a45d40c6f89dd569c33243c176", + "0x17dc360eb901fd2ae7b0669866f9adef9aa3c1a9d13e070a36b00bb3b4cb1dbf40663eabb3008bb4e71e84c7260fa8b", + "0xd7288ed76c86f11cf7f5976d09f628754a9dda689438fbab1d22b6e4cd90ed4fb50984e1e418963d5f62f2ca470698", + "0x14d57ce3ddb1916ee336cd2234cf9e670dc0d2870db24405639d35d1cb7ad25fc3eecfd302e9591ade2d92261d5deb", + "0x10cc9377baf69e154d18e376807343d29f7b9b879fdc943cbcd0476208c914f6b52e89f42df7dde0d10f32a47da50e5", + "0x171b44ba8105cf1f5637b1a8a233c776f995e85c5ccbf19ba3afee697e2cf55f00191aa527dd17d06875f983b75095e", + "0x1720da6f5c53feec06262ab5d04c93247a1529d14c1f6243ee3b63de16d3c698971d27971defc04276c7aa06654c442", + "0x97936664c0153dcdff8e19a4e7601f72f91443cd54c4dd97988dc7125c45c7b4e7bd92fff54c33b174e15f44ac0d39", + "0x181967e632004e84a71a7f813459af8073ec7fd2344f41a8416a5aa00123d8113ca7f6701328e62eab5afaa161d6017", + "0x77292b85047d44718e42ceaf5408eb9f853d4461d5b4a7b3c10a3c07d3c6460b0940b5c1f40baf3778f2bc1335d947", + "0x1877defcedc45299a5a96caf7024f51c718f8db7a700b1799de0c9f98671bf55db2a687ef34111f20dae6a8917f77ad", + "0x19523e51a06f14e97edf62df632db3b35914c1d51116a67c4927711367a7c2857f019d250b7d03d42d57b9d980be005", + "0x8c0925074e23e62cecf33d656f032cc37aad460a6f9820763c61b586e153d556806c6bc93b94fc7765ebbdf4eacd8d", + "0x3683d9adc2c63945e9b77d271841056ed5c9c2991db779a06630670fba6d2d4dd0d510cdc5ce4508f1ffb09d2546e", + "0x102171496ea7a475ab570ffd84dea2770825ce657fbf9c10d4af10ca77048d4c50463e430d64683aebdf0bafc729926" +}; + +static const std::string mds_matrix_2[] = { + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 56; +int alpha_3 = 5; + +static const std::string rounds_constants_3[] = { + "0x6fda18f4eed4e6bac275419f80df9b602094303124694bd2fbaf030fffc8f23aab9fffad7d2945d9ea19684ea9d0ac", + "0x13e08b7dd91a20778cb6d08aad1da29033cb066e0a116f3d3e4ef21083df19db27c6ad1ee8d62e744b085b38405f7ca", + "0x19e6e6f7fa4f6ae67d6b19a7b50922c36ec4e84937f7e43ef300ca5e2621d9ef1c5e4f76b57e763a50c00100d727aa9", + "0x7374d3f5d410ee3687cf469c72ff33b52c3ff7a3869c1d1938adc611391f7755e6621c0b04675954e9f68ddd82c126", + "0xf2c04af99e56a1323cdcf5fed3bf5409fb3ac25c97ba2ce3da4da55756b77610b485108805056a7f58426a7953daa2", + "0x354ebe6e53d1394caa80997852dc3eff21f85dd8173a9276ca4a00d41d50cc5b93bdac93e15581a80fce6878cf5a4e", + "0xcaa581448b468862fd4646e6d3b2152f23f5a4d656b255d82a20f323af00613e185d767258b7d869e058df2e89ea1b", + "0x183e84226ddb37dd15c66181e0490d90946480e9960423268d711829140936f0eb098b3a30e5735f76ca0b860be7396", + "0x14506a7230685ae77046d15f83011a9d198acd032703313fa5622b9b1c91a0270775b6f1a85741053b3bc4a987c69db", + "0x15683762a9eb59478e741876b1de952ab4d7af749ac3e0739553358cbca9b9f817e52f57715e41c56a904c327ef5bda", + "0x1acbd0e3316ff84d67b19b1f8319b5aed764c9266913c8605281e4294fbd67af64dbdd1e859b44fa306d4da92429ae1", + "0xe358918d56b8f4a3239a9d624c8ac49d31da5af018e9a5bdf3ed8fde2aeb27045e05ba6097af4dcee8781ac6e7073c", + "0x137e3ab9363c2ab8e11fb7654afe8ed5d5044471b2f90b275a584cfa71d6347ad75b13269d5bb3d005746accf3af047", + "0xd74b943f0bc6afd3908306819b660b7d378450a00db7475da297c3b736895733f24016205e2574f6aa7f6f43df83b", + "0x17b9be92e0658ceef8bf323aa9c1a3f7e0133ebfb541acc209904151ed741630044a03e82cd74b7a296a3806f38a197", + "0xdef246d49bc8c68186e538671693e46b9090ead7c2a193b0545806a66462d4b4e04af280052ef7ccadb1b70373a5d7", + "0x2d3575257c5016a834aaa23d66784363dbc0c11aa61e4fe2421eb3a869ec36102341813f4171ab32ff15dcfd428b86", + "0x16d02426a726d9007ec07d4669a58c52d222295ad98a1954d4f2bdb5db2c839083c862c70099587409e4ca5d84066b9", + "0x9ea28f99ecf81ef45326352d7488fdd3aaf8f07afa3d107b24092b23f24497280ecc950dee36253b23b3a3d54aea31", + "0xb5d9833623a5694731f4cc06028d9924c95f57bd28c1d224a124f7e101501fd431f352a9c798bcbf7d504f5b262fc8", + "0x9c2b2d2029882c08c16f698a6a2ed9c94694f9070462b6711b176fda75ec5bdc007b856e9656c74639443777306bf5", + "0x16f7112f99cd965bd6992dc953496293b4dff12b4229ab07d7eba512bb258c8e6e9949518d8393e1dae79d81186c7c0", + "0xbcdceac3991637fc13658429b42fc836daeee154c68f51fcfc0a8841f04dd151adb082f3b9457858a8fc052001ffc1", + "0x11c24b3089e5602732d3e9322fde14fee0de6f235d9c5e7855ede947e282b9b58578ba9ec160a16d7318fa3a52f94b0", + "0x14a14512616a87fbbfa3cf0c378ba7252e615e29e37dc2222e07da605a7e414c6431aa8bcabda18147880078e29b394", + "0x9c5c3bc208ed1f920f553703a8722dd9b1100ef4af5562c246878591bef93511152437394f793fa2fb356db383ea58", + "0xdf381601605da146a43f603b37ce11b26d3762b4a9827bf7c5f97edd57218c361fb1b4a95fa4f86ea8682503ea8626", + "0x1428d244ccb4ea0ec3ded18b7797244107b513be643b2b754bf063ee9a5e22f31c1c9cdaa97b737dac3479818a51da4", + "0x15ef23668ab3e5d0ea31456f64570771f809f25ece8a5a84a2df4ebb0ee81bbcd734bd41de4d25cca6a1979778df3ac", + "0x1ac69d60ffa7e7e6b1a5267fa85d7a834dd3336203962de34ec7e2e33c8fc3fd10712ee24376ecff8aac36dededc1e6", + "0x45f62eda8034a8c091280d4db8a58ef469e8fb7d4e2aa68eaa66ac8da66544fa19b9de9f0b448c63f9ce0b5c111476", + "0xa076870dbdfc8dc24b8b9c7da3baa518968d9259864075cc0f5ff58187f5bf7afe63988fe312d95b3aeb74afc5f765", + "0x12c26e756f74d320c1ca56024e7bb9e9bc9120625fcd042773cbcbb8790ecbbfaa9e4a51b95abbd2bd6f0e2ec07efdb", + "0xa5001cb8406b8acf1f372c3ecf93cda6d2f5f1ab53ec0fa550b9dd30ecfffd4393f855a16701099b7bfc64dcf4114d", + "0xbec24cda515a220851b5ff6b21b3dd0b94b569db93eee5282e43622b3ab4fc4b760b2d94d8e5f56375fe0a421bf769", + "0x1044613682c837a88a71f04ce66fbaf67c1fef8d6cede22e146a10ba9e64e0680db1e665b71ef6e5f4c4b274b4f4313", + "0x1500ddd7a25308ffc1be030b4edc1f946e77cafb068a10825439301c462200a6dbd5d5bb76bc9b26614db597129549e", + "0x67bea2b6ac5adfb3557955462d5b8a01f0d7b0b38522abc73ddd7db465a8d191198d06083d26c3688ce745e34af4c", + "0xef162b6f01497ff02e37b0645342944c505f2907d720cf711421771c45771130ded6e79c23b46331cd2bd8a9f97fb9", + "0x1019e0f5107de382ad44ab0f2378ffc4a7ca5422de2c35c447d24dbef58dfae375fc824d233a63d78c816ebb11fdd74", + "0x151c269e481fbea6a0b0bebe36f3750011f05bf1e0c8775aa0699376f16d87d73ba19cb8e0af63b889c4373c22372b4", + "0x11c60a8f00d986ffbae073e6744ee8a06414d0a406d358e4d386e101e5e4f7dc03c6e5a6c74e821cfb77c531db5940c", + "0xfc8c2d39490f059cbfcf33861e2ab9066e6751d202c098c9a94b5c2b2fcd95bc4ed9fef8ddad87d81016957157e2b", + "0x10d1e457b3a32e792ec5565da0848e971df2a4caf9ad7975df7ddfe032137ba7c1bfba17c1fb5f760bda1f6a480f2e3", + "0x1835aa03203858a32938a0ea0548d6800b4c83f3b27226f532eb7c8cd56e183c30b4769197da8c0f8e94ee642940f", + "0x52fd8bfd0a418af4a41e6d6a036aaf1f95f25459fe448119b7bd7a5f5f854ef57b3623291066d3c9ff12cd3ccef807", + "0x9c2c1205f437ae14673b41dbb499769e170faddb380a3679b41445dfd3c185564ad287f507a0332bb2d969cf559472", + "0x140a24c552f229feaa0d3b342c086b69f332d4e1b2015566225f7880997af90425976e48ff81e70f8700d56f5300d13", + "0x181f6186aefff624a47a20af6f2ef212dd7954baec777362c4ec72c221aa6587c184b4be2b219d6316bbf4686504c76", + "0x1872f721f9c73296688a6c7312328dc349cbed944a47d41ed72bca3b162761fd54171cdf91eee2ef0db59cae855a05f", + "0x30119f177da0bdca9bb4a6699656914c016bcb30552eb3850c4f3ec839087999c54ca8b251691e7c7c0631e1eb66ed", + "0xf5dfcebb8a675fe458277c847e5125e8855ce1861c20f812599532a00b550fcdc875721b151e2cf851d1a4d249758c", + "0x140238934ed674e9a8d065d9558c9f6d13738aba00b580d4f3dcf98c7d7bca1fcde5a1f494d8816dfc49e278e14782a", + "0x1664b2dbd69b66d79da95a398e5758a87ade5351378d106c6aa8873b2c385b78116d62f8c98bedad48add181c5047e0", + "0xdc69d593367ac123e9e317e47a6877ecff7cd958f0b0d463bc343d1b0fc5b6bff04fb1086062905fd2bd75bc20cc2a", + "0x5cfb0987991d8e08a0d09f05a8e58a6bb890368d42888cbb5037db80617695f6d0462daf7a6963835051552e41f043", + "0x9a62a4ce45eda1f38e1ecf6b197bd6d87a5c0ae99950dc3de3b12e865001c47fe28778b158c81eab8c2db63735aca0", + "0x11262fcd49382b90471fda5201098ef0a0ba49ef88a93d8a315c602b7c6d57ea415bd6a120942cf12aa70f0868a781b", + "0x104ffe7abc3c4eb623ec6be707b24388e8965d555517f9f3bb0f31eaddcd8b2557c9c09440b1aab59a3cc1fd8b11ed5", + "0xde98e492dde4f0495c9224bb0b9a94e2f8111ff3dd9d5fc3e674b304725bb4835bd1e033e3d3dfd5f9bac244b2eee2", + "0x13b92844f093725d48bfe58b81f23ce2a45da67d6a73ad509c4ea87661fbff4a703f6b5c6ac1590276de4c419301924", + "0x12a8b8bf8bb1e2da92048a7f97629dbcb5a03b15604606be7afc15c41f07fa9132fba9b0251d4fd3e6dc1481567bc5", + "0x14da0e7b80d4c65332789803b96981c67cc770e59ad932dd4a0eec687966a42238f723e0938b386cd684541ea2997f9", + "0x7bd1ddddf727550a1d34f91ff36b8470b41cd0890c32061e57769a59122d7e0c8cf12e8945bb5136484b172355454b", + "0x79fd50d4bc4aa03f7a4ebba76eeec406f7758ae47469fc255b653f951da3015e2e725002ccc97877571f9d83216043", + "0x143b820af19e12b6de57cf92318bc389bc31a99e67d841badb1785c235cea723c59a7ae3d77b7eb2f1060ee1863ad17", + "0x3fbaaa6c32d07dde25b4675163709afbe1675f9fd24f1126615a6459ce8a8d2060f97694279fb8567a9f0c9c92fdc4", + "0x214012f46fc743b5eab5419a45aca1f8f1992225297bfb71db243574b5ef1f7ffbc55033cf6f922f216d695595f3ba", + "0x145206a960ef5c7606927678ae9df8c1ba0292bb8d60aa6b2dcfc6ea3efc49a212f42902f39c9772304d5aed3d5aaff", + "0x12d24e340b98230e12635cfb5200df19fa1f5491724671923d0d065b723bf175529ca00d2005107b3484490e1bec86f", + "0xb07cd12363d5e61f60b9a6863d43f17946319ae19570223e8a3645f63ca27a50a4e5cd70bdecd671d5cd68407841c6", + "0x8907884ec42af41002c5654594c6bc620f9d18d243820b4d0e8dded5e1a22f44474fffce981bd97614a16bdd38adef", + "0x116ad4e7b4050dcd0144940c3c7c528bc9107d53582ce99222d689a01e0702e2bb8cd022ad9333ecb24daadb6fdf15d", + "0x1526498453b63e9d6a6a4914bc6a458abd229cc5bc0b86f6ce7fa5b50d3b0f887f51e5f3d7ba6a586345380f4e886fc", + "0xf20a128532e1d8bb3fb6bbae2c82a9e1273ee3439e1d3c70c8bfc934888efc07b5d6ea5728953c6d0e3d342d954386", + "0xb2eeb14e2ee2021d4a736782e1c57c754d2e2fead7c062ee9a20366a64f12c0942349a3c500f1c6785835184cb2b59", + "0xacc8b81d0eacee00728f1cab12698f56dd46341f2edf7355d4cbff65d1659b796086bfeb345d0a2b9f214bdd4849a2", + "0x36b4cea1fb15670ad2d7301062976d7a82181bf0c26b2da31f8def5df0a069c09fb75ac75f0cbb71d407d9b6f9b5b", + "0x1741172d5a7a3b57d5265165a476d44e49f03f16adf45c2b5c59b8a2aff02cefb90ef98c91e22dd878f499eda23f077", + "0xa4365ce6081a13b5fc889af9b3995abcc52514c134e714d89b4c00404e56de2c1f7a7050b23efdfc31b94c8bb360" +}; + +static const std::string mds_matrix_3[] = { + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 56; +int alpha_4 = 5; + +static const std::string rounds_constants_4[] = { + "0x95421ed4cb5b96b80b92c75cbd205145958d8545bc431af1947c166efaf3550be00d65a636ec02c32bdd6d6cd1667c", + "0xdc3cfa5e07a2ea048e07dbbbc9544bc19ef975f92949cdcb1b9fe73ae70c482cca243e8278ce0bdbea5e1c24c89ef5", + "0x14ec84c08c7be5a2773af6acee174fd72f56128f09587c3f7e330fb9c3a47584b0918ce369170e7989d02ec210e220d", + "0x100f9057a4e3b8c4261b2433b71c699052b9642745691ba516314fcfda2008915150d6a4b902c0979ccd41bbe55d045", + "0x112445880b3fd021230f1d228aa0bcd2c247df043df9829de1a82c27b4409d85bc0e5af8cff3b394119acd9c03327f", + "0x1715248a9928525e0c359a57255d44ea6a3049426ad0a4fb15d2601b78bccfedb7bd75648de1711d53e6ca3622cbfe2", + "0x233758bc409b2a4f2e5795ed3978f79ea311320476d35cff901ba68d6b7dbaeb7b58426d02480bba02851a9640107f", + "0x16273bd4fb79012ad181e914157f25c386f320a6c85d4d3c5e4015fcb60f3b16a74a99c92e85515ea537a936e33788b", + "0xe4fdaa034563aa5c663e90c5d1811961a08950e9feea5885d2031c0ba0ad22f98c57a5a7c4b9d6e5947d3b7f940a59", + "0x164cde4a81a0b9da480a9dc6fedb93f61906bead61e3a7d86a9e84789f3713c0e1a8f50f248b215e2a26804ec93156c", + "0x179fdee41aa6dbfcf806f28badb7464ba65f6b03d208dde14b3dc1d7aafed93c87bbc80a8ed6ec8d515bfd8182ae783", + "0x66d8bd23e8f006bba1831e26226df5a5115d52e08416dfbd868b8a365b8b582777e28b958fda9a857e1502978a610", + "0x104044416fd37b074d13b59a9bc87dc371c0d6006ae57bd9fa6e98196a4777dd10ffc639f6531d2705ab99c16135b38", + "0x13eb07962703abe2f165511dbe6c7605892b5fadb9b09c9ba8637bb475c4a8bc63c14d4f28bb40ff73368073497935c", + "0x16e88f4b660944b7567005fab3656605bc1ce780c9aa53d3fb6282026f511af86201b0d3ec23e5d5f3937c54edaa967", + "0x69d23c6f9bb7bcae71260497b761102abff0283a7e2cc142c7c093ea06fe6bafd85d2bfc223be69d038f034a939635", + "0xabb2c0a46411607e21c0e0a80b6088e831d1b4848dd219fd4bb0758112ca5b693b617dc17ad858a20fd7275a5d1798", + "0xcbf12296641f1fc24a7d5c054169ab84b28a5fc2928a54f48daff852a6e815467bc4507dfc51373112472b03fb014e", + "0x17514e827713ecfed6b450d313c28927cd47211ecf7e1159638c07e4d8c7997dd3a9cde4533de2462ef8520426aaf8e", + "0x12a3befcad0f44bd5120e58dbb9654928f3767b6332be9fe22a44535a1cf253d5663adbe64a644a0c9ac7e3936793ad", + "0x185353a1bcde8bc091f41d8f24fa30a688bc579f3ada405ff750b698e5463093e4f1cef67829edfff50bd8eb9a94dfe", + "0xa45e14eccd6d4207222953637c76d4c5981b915907333e7701b8f3e0e03aa78d2aee656b3651fdfe1c67c614607237", + "0x19904db7249852e34d3f079f91ac1904a9988d67ec7c7ebbaa333b611ffb87287839dc482036e63559ba3b9cead71ee", + "0xca2e854ae40d85c34e066bb84379948287d2322e67228865ee9f74c32796ce471a5631d9fe1ffee0e88ff0da5ce7d2", + "0xb9aea1867cfac9cf2932f5d5863ac7f3f7b8d349376f2dc7eaeac04f9f347997c4df83241c432d297cbb279ca2d8b6", + "0x119e9abbfbaf6d5757d6406232eec51e4c010a409457f48c23ff15363955aacfcc85351ffff2c9b4d2f9409463898a6", + "0x6b3a02fd4169032d8dd1dd778733cdfa787ab70943263e531652fda0e7897755c08f7e424d703bf0e221f42590e1cf", + "0x1370aa115881c32f28422c4c419f66ee7afa9543e78239bbcc84f5976da6af69f15b5fa5284be0747d8e46709f16dd7", + "0x171b4578b64eb13c1de31e3edf9ed266fc03496f76499e3b02319caf9266a67225b50e3478ee555c4663e05d33dfddf", + "0x55557e0bccdf345d2db865f206295f10d950fec4fad86f34f8f6e6d029cb98fd90d5584a0eec349a1e34fe3d42be9", + "0x698bd56eda896b8c5d450e32601f719b40130089feb50e9867863dd5e49fc012f75a473d2bc36b70e338a41c3980f2", + "0x320e1009487505e7914e5703ca51401ab9b9eee6eb2624b8ba3914a6adcbff5231fcebd36b49f4dd97115102bbc8e0", + "0x19d0317dff5c925fa8cd0fc908f96cda1173b2639d9081e71876477daa5701a209ba1f5197f3646f031d6ee9547b9cc", + "0x1248442fd5217d725b22a8970c9f6c39cccd4eb96482d70e20beb4a98338769e4c3fb7781be0fead269b54891850298", + "0x26addb785eebaf7c0bb06b4db073eb2f93760fd63c701f2ed7c5f14c789b43b5660bbf3228b0fe25870d1e585fb24f", + "0x17d63c2b66269673d9629f5c7ba79fe92c4998f36cfb4cf2b7e6a53c9c55f266af22540cfb0db9aaad39c16dd2ad903", + "0x828920d98083b928fb7d41cc215efcfb349797e4b2f1a3383fff22ad13bf7115e914fa5fdb01599a08d8e3bf15ccc7", + "0xd26c1fd955db9743ff14154258c7983ebc991f168acad24453da87f2384d094d14e861cba9b08eb6bfe9f4ef6b3d65", + "0x151938323e22922b309fb1b8eb39a7c469217e1958b39b24d184615656a3bf4878c3ba0d6f46456ebc06b3622ed6ec9", + "0x1932864dbec2cb035575395260f98bc56852fe98e9f8e9c839d12116262686837cc30b9e589400f225a76ef2c522b3a", + "0x1051a10f010a559b6bf62c364cc3f95519e05c45ac4a223b0852d3c9b2f74620abaf92ee07fcf659e7c512ef8032bd2", + "0x14597653f70ab2b20e0bc7309e55621b10b4987f7c2db1ad5983a9bfbf793c355d952b046a6e93ce61caf5875749b8d", + "0x1ab4b59f08833cfe0a06c63cddcab64f1df6ba7c6b3c6b6c940524f5ab8c5f8e4e53da214cbfa446e6c1dd73ec64e95", + "0xe3693a696a8f3d69a3fb7aaa0b0e4db6a6187b2b0c052b033086ad5c6cc0210286029e0a93d5db11696a4070fd86db", + "0xf48d544acb2f9ec3e7b2c7a589fde5f5be0b80b68f50ff2a25d6aa654ed42fcc23622b3a2ed84a99d9d60e5f6e288f", + "0x33838cf4866b58561f513e16d1f4e55b6fcd14ccb8d49956aee9861f642aff1a3fcd18bfa841531a649b6cd034794a", + "0x112f88ba9b1b5d48d1b9681d06651feef803984fa26e7387e227f29a59fb03073f8874b77f0e2bce9428ef6b788ab18", + "0xd251c6a6c638ffc4a0bcbb58162871793ffdd58dc4cd75bd0706f777faa08b26676abf708d70f7965f61601b863ef1", + "0x457ff2b94dacbb13598c2d6e52aeaaee934422c584504eb79ff6ce909b75d1e26a1cad1125cec4ce0e1d7e430f79ff", + "0x788ba4afa884abb34211e8304253dc55fd39cd0431da663d73ca755ebf74c0ecc2c9cb4204923363839aa2f2c55df8", + "0x1885bbd811043df0c71edee1443b00c3a252f3d7d4c280c6c278b151d4e87f40b76b84877a5483d29a4ab5f87e85180", + "0xca9609224cc094b0f9c969c19d43c3230b455adc870232fee645e5cc5a6baec4b75dfb10cf1e0e5dd007eb8cfe833d", + "0x21efd73f954999a1fab0c568808383c491790a9e2899e3f4682704bf79219e4dce1255064131c224946c2165ac7ca5", + "0x696e96caa7f1fe532e61ae2291a61ea5f495745496c4f8adea42fc65e55de6e7216a455e140a29ebb36f8c17876d73", + "0x5d5e26b524bbde3f3586fd1eb1c6051faa9b7c15617ff279061644c7767b17ae32dd5bd033fd337c864fe072fc2595", + "0xbbf6648f594a3b5e1421bdd60e26819afd8bf54197b844c0fe2100ccb77a6019b4534c7d66a502ee7ff0490d63a4b9", + "0x8e2237c35ea8df111fcd0caa2836907d9977ad6e04e4eea082b5185fd60e6766889cd9ff330bd0392ccdf924ea15d7", + "0x18e033774e32dc577297b48ae9ee92c401a43ae1549e796805615bd45ad412cd351d5cc28f184b2142c512d71e4e35f", + "0x17735bfecc93292c6ed4c9092970f071cfa763bdb713efa48f0580b53d38fc23f0497de69a544bea5cac76990331525", + "0x7d1c37a3ed15aa7272b92d3147ccee919700aa32368cfb282204e2cfafa6a20769be97439028696471b0a5b20fe011", + "0x197e9937124cb9d130ffc2b1010410a782b4beb0e33675ffa27548628cff4407c9b5cf5583340b306cf069d543a593d", + "0x6c567738c4491a31747f7e30d40a4209202da02914d9bf2455913fa42c9795341ad145cd6cac2bbbcfd5628d4a4ecc", + "0x80b903eff4265cc658eb4eb69f21b2a1bf542f05478fc66aa941bfb75d1d8ca636d6a6631fc2aa780def822b55c12b", + "0x12fa6bc1f3ffbf7e7ef966b3ad5317b8f5aa6cfd1c520a7523dda0fccee4db22779ecf1809544eb7a560e1c7b240fdf", + "0xba461ff5f29a0f47d6adde74759e016958163a24563f2cbf23b82dd75d1e6534214c8181f04f45672435bf61de929f", + "0x40c6d19385d7187ed2aa704d83a2f492822554140cf0ae46d127df6eb0d3eba6d30a08433fb910dd1dae1cf14cb54c", + "0x19ff41c10bda6a4891ca1947659e0cb40180f23119012c8dbca737d3582b55c566e06d78174761c34ee05a44638b670", + "0x8a124a374efe1cea0715225655b8e8f1712ec94294a443445da3f5fdf5bb88914ac5ef8f0c1a284e9fe5891d7e5e06", + "0x58b5a77fc7f454e85997690f2040ad5cd2e9517a0e336f583c378088ec19d8f49b2e0c3f7160211a0815883543c663", + "0x1a7c612b321dce96b8bb4355b56289225efa6b7ea69717a72aa81794e5a0ba8a54a8a21137b2de1ac1e2287175fcf6a", + "0x1079adbd1a584ebad0fcbc89cde94931f3ffe501ac26de55b10c044574d29973e0b44ee92545ac83397bca146bf9759", + "0x12add6cdfbef0f2a6a2a5b7e5ec11a9a9804d4dad3a10c50f8d9727526fca651f1ee66834c2af7d8148cfeaaad96d47", + "0x26852232d65ab2bc9c96b69245ae3ea0b3a8b9b82bde9328c91ee5a58127741aba28e4a73f6d31ba144d17c76a911a", + "0x18b7f17dab12d2ea801a14e402410f6c9871dffac15a15fa65fbcaaa360c415703a35905d88e7f0efada0244b3103bf", + "0x127b1039dfe3d4e6496cff5400463ae244e7a4c5327de7481400ddbe845e316e6cea8aed9ab2fc7f0957a7d97ad5e11", + "0x17222a10fbdcd2fa69f4a5c8d991d72739c1a0a5c17c25ab0d5d70682620b89de46b24a0fc095eecbac625759db15aa", + "0x15b6c96f9fa77aae4768c6094210782a37784262a9d34c2fdfe7a4745c2a6f807d659c0283c63a248f7612fcbe9bb49", + "0x909930cda4fd5906910e9fbd10102e378cc67fb06c04385b2f6ecb7d2f927a57cea0b4ef4242422ac3dd54aeab79f0", + "0xe9e4d6ec5d7403e71a922f0cb01e7a6e14269b64ae39624d2b2caa026f92612e10798d55e1d7cc76b6acbaf2c75050", + "0xd0441192abdbddde092cbe19c0d2b77ea310a5c666827b6ebb0c142d7d077613731f160e45bb087bbba4f1e0f78854", + "0x190089966d7acfd7199f8fd0906ca60478b909b65193402c47f0322d6ad8e75a121a1f1aaa3ec8a6ed3e8535aad2d7a", + "0x160b15e2d2817b0d601cab40b66c2f2a310a1d4dfd892b356074292884786eefa5b9da98c6b43f8754b8baa03ac47ef", + "0x2678fd3e1d16cfbee43b29a35cc6d946ea81113e0a3820e7c31296abcbb791bf6b083f9e0ccdad3cc20d43b8179705", + "0x1a5963756df0276845b38f2361b1f664c49205d1802a89f2dd35a1b3417060c717fc1168dab1eed161094a31358a217", + "0x1939d14052c5634215375175d902c22cdd7a1d6201adb059b949973deb0b0c7cb0ffc657d36f3f2c27c7b55274db834", + "0x5e2b2f594fed69cc28f721b22f8ac94c8191dfcb6cf447d866144a5511e70b6d1676d1fa7f2d9456ea5b89a5c3762e", + "0x164d10b61b7ad5384553f345b8f32bc816ad4b3b102fa0947b879d123554c0b81d4584f43ec8dc70a6745ab7eb63dab", + "0x725ac38a8adc2f73d5aebace6d32715822c519e5602ff79f489a76cee2cdeedbfe7e5c4b02c95dc74475e8a2ccb562" +}; + +static const std::string mds_matrix_4[] = { + "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", + "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0xa16e822553adb18d6e8383739c104da3d84d09e5b11f48511d74ccae3a6bcbacac46ce2ec05d03c23d9ab9477f4aa8", "0xeee700ad0c586f313d9c08bc367b5e748792449af0a707ff3b5b7f35791eb76f08d01e52eb9dc9450efca3f665087b", "0x49d558b8cd5cc4177180db4cef27f5836f28100bbbaed14b6efa0b99c4bc9afa7ab514c8d7c011d9b24fd7c3aa95ef", "0x83b9f989784dcb11a3edf0aa66aebc7c5286d373041a0d98627061f8b0c6746b5f90f856a6ea015f1d7dc9a08ef61a" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 57; +int alpha_8 = 5; + +static const std::string rounds_constants_8[] = { + "0xd41d759ae152c3e0389399d2e8864b3c45a6cc2a4810453dc2924d1351432ebacc51e47f87147a3c3719a09eaae5d6", + "0x16422113089a41320eaefb9a9dd2ef9b74235eab46adb7d6b4adb25f5f6612e2c09d445b7f9787b6b2fdf5a5db8caf9", + "0x10007856dfd83e0c1f71e5b1df052f07c127d9f3059b6fce1333ea1659b491314d60bf33c6ca77d7b6e73c810f4af7", + "0x19753b95054f0fcfe649899e7db1fad88d52a3ab74e18a96c3b1bc994a5609689b52689b11a9c6b0375161ed1f24b1c", + "0x14d0b8b532c1f138c99b2ee9874e6381d31f9b4b21c7b4a301d4ed203717001a4ac34c6a5caf4e2c016c39cb21e45d6", + "0x10763c75bdd9c6c9cdb46d16840f53164e8bf8c99a1b5a33dc49fefc60f79dc703432bc59279193e499a8fcc4210eae", + "0xf3d4625492b39e227b1dfa7d7ab5bf352aa4b9dc38bf71ed11646f5e336c89ac79eefa765b47735a5e5e0a1ad697d9", + "0x13627415acd584e6dc60e9757617bbeecaa1d2f3c9a69ff40b024380aa5dab9a1429593a9f5b31592b77913736769d", + "0xed543f0f3d13f0397bf5705fa0fbb24194bdcfc4fa12024badf32b4941251ba9d1ac8f3da79708657a0d5d8e89a279", + "0x913102ae05cd01392757df46a9a84333d13402a8a869e48a7c857419fd581dd7a157d652e1741002a4ec4b4c69734e", + "0x6c5bd1e5ea6a7e033df0454148c9f33d1b3d0116b36f14a542bf814ff004f24d35d60baf98ecf8a1e4a1c85620a822", + "0x1945622e2315313cc41684c5c2379c1270ce300513f4bb68ddeeadf9d8cbf86f369792be50ee81b301bc95eabe2169d", + "0xcaca8dde4d912a9532209c0e87a1393bcdd767365ef882d8540b767091eeab453f310055e64ee10389ab809e3c9f1a", + "0x14ffff2fdf74d4b429d385bd8b1ebda22fde80bb6a2c0c46af4fd3da6c4d71372b535e1e472b6a61cb5786f3b4e5e19", + "0x4c56b3acee85926c56f932c35b9ab1fd5c985fc7ceeb3da1bcf4093ccbe4ba160405e634b5eb0ba691944b73c127b0", + "0xc818cb3096e9a750044adf216822ec116b42028cfe12ccbee4669f9af831f112d70ff7888f5c608d73805658701bd0", + "0x10d632e473c0211ae5b4ba0e8794c7dbd4e86d8ced6791bc655d5ca52a75a6c9659e7c83ac995c41dfcf02b032679b1", + "0x5ad12caabd01f6eba983f447273802566e8d59375ecf2ad406b8f2dc36ee476f7bf9d9328c2f4354df8f89badb8594", + "0xd51e3463ae41b5c4ccefd964d709c7236301b9910a3568773b5368e044a5b5e17c48a8af9a4c1de32f2ef0cbfff964", + "0xef51a99c4bf04435cbc892fa51e6b9c1a75099a98c9fb294c135143cb5d6e54686c110cb990f2902d219784c2149f0", + "0x6fd249a68b14c1af2b6bc5006bff6d9ac57eea9c3e66f06de0048cba576dbf14bf911714ff95fb44fffd6369c7684d", + "0x16f4a2c93f00e66023d068d859fb41aba862595fb8b20d53b7c58c98e18b7a8e82d1f129440fe69968d3c56bf0fe055", + "0x16f19d02a1e5d3ab8dcb10e10f5c1322a270f4b68227383d64e8d80009e7b936d06f181fc65285b2810cea689a26eb9", + "0x8d89c1e6a8246e95edfa400efc48d3677188321a7a75894cc2a11145c52ea28795b2be6004af5fc9c5ab3dea52b345", + "0xab881b5e97358d545703b8ed9a6ba7dd97a65f3f68cf82e50a2f84a607425fb7568f0c7c1efc0f23fc78276bc83ede", + "0x2e942190acebdf67bd3699ffc62e66f595c39086f26c2def62a2dd1116bf80dbc03aa7f7ef23555bda45f6f7a55a40", + "0x132a1d3f56599d20409c4cc51c1b011d41dffdc9f477250a63d33c0e858d7c11962f5a5780406ce37ca521fb39c1330", + "0x7f3cfe6f75038ab2af4b8bec9e9c3a529ef95aac13277fbb8d4e633404e353695be302b92360cd38310645d4e8e8d4", + "0x1540b5fe7189ea3bca891e0d0a67b74aff9b6139d4d6748759adb6669f1595c8238bbbefbb2e24f0f0c61189fbb8cc5", + "0x183c3b7686cbe11fc8c4ae8655fa80ef4867caeac8c54473916528c08fd4536191c5de915b995c6e0217b467c1a9602", + "0x29ce82c2c9a229551bfa371b791bb528bcbeb5972ab838e72016864ed43d2f90d8c8f16744c439053d58333fe7bca4", + "0x19698c2b591668720752017c17776d7e84d9d44e7ac563608eabf3f96684705bbb1601ac79c024ff88707b486a81430", + "0x176fafa9876588ace2905e97039d536b647e8a74ad5ada6f53afa6e95579c5e98f81e796bf7af98b83e6a0a11052d90", + "0xa33fe8a33cd95d2bf3c7ce6d03b577d06da4f22dea20b6c22c437bdcd6404ebfeacdf6b315989957c8c3454936cb21", + "0x11734c4c9934d7f6157568916ead83bbfc32f1de5ea5a266784c6f570bb563aaf3e2f9f054846561a74c06226a10825", + "0x1319d05aa67655c55ef99a5bd7ac59764a2d626e78b6ecc07f40c9e4cce2c4eb9ce1597dc3f7dd6d663933f19650eee", + "0x2b81ec392501724657453c0a23912d17a0dfd4168752453625c206311498f5a4648239043c11d3323519bb0012dc6", + "0x5f4d18d2fbaef6c940f69351dbc6f92ac405e21c8c43c5ad2129749165596cd3f00a8d18f1140511875151103860bf", + "0xd2fa1ad0bce2501b7ee9f4236b747bfe6cda46e642adff1aa1c73b952acb5a0bccb534f54a73d2cb1e7a89a0e3d989", + "0x1a19c66406d4da30d3cd8cc2ba92b8d6f7b4d0e666434976137d69b5d6c04ee7f2b067084385b407af7c4790e22dee9", + "0x18e8663f366a97d8bbfc485f0a96b3705a7616b34df64ca6c5c1f2fa75b16a0e202783f3d099213e96499c5820681b1", + "0x2ee90a0db901d820477a3e0d104789b706597913179cb62febf05e8a8467a4783bea3603be4166c327a1de5018654f", + "0x1806905d1e067117b9f571cf369706794e6318bc538060bfeb849fda12547f7b7203955fa879363ee0cc78fa8528987", + "0x28924e21e25e0fefbe92ac181a4429be038ff0a5c5c3ab45de5ee016689946173184c55b1aa0a44ab8eadc8a8024b4", + "0x256bbd861751dd59ea910ec23966374eb9abc2cacd128a0c9e3540c3f17ef731be1f8966d3e6539f68cd729a139430", + "0x89b18d8f8227ee9a2611d0d4db556fee4dc06dfab237950ba10e2d68ef9c3f5b74a547a120d5944c5c6a6c31a50b95", + "0x340ab1e84e88e5c927a8b2e339d2cf3313c4e73b2acd88ddd25c90606fc1833ed78adf229442708ee7e8e8f3f21672", + "0xfd9fd20dd9f88fdd2e8a88a99ff315eb20c3ea80d21c5c92c8da5bed410704264cff6e01a5d49182cf51ceb35d3539", + "0x1ae05c7c7774e9ff03b297218649080a4b26e61970c6eb2bed906fb29442094171bde3a0ff3c0a426fa1f97c1627f5c", + "0x12f73111f3736fee95c0b3137465b79aea2d1728f24c34e00eec7381afcbcf67abfc3288c17c4a9ae1ccbaa51f25c22", + "0xa927053482df0962d197af0837e5f78c54c25abd91a585dfe5569a03cac15c153d429f1ddfda8f0a12602fd2b0ba41", + "0x16a96136bd43f6b70d5e1e1e31184ff98b1203d3e3e67d62485dbd23b44101222b89b0b5180960344b03680fd5a41aa", + "0x12ace3606490cee93d43b194ccf6bce762ab61fee6bd46fc99b7a0d6ccbb80339fd8c91a9401dd0d26cb2ecd6fe4a1b", + "0x7434a68fcd3ce77398a6111adf8599c23ce89a5b20b7bc519a4321532b900ab3ff62707aeca7b83dbcbf27232d855e", + "0x7e7f5ab6fb9e7bddb7daa22da98399004544ebaa8313bbe0e33fc0aa57fa7829f4723d5a576fa933dca90dd9a4893c", + "0x111dad454a984a6249b4c5f917b6d9e0b151cd1489c5b0f519fb1949dba6ee3c445c98e70d56e4fde26b7cbfc7d5477", + "0x1ad0e78008a901006d85d481996a4a3d32dea0b8a3d7932232502720ad639cd479525a94005384812fe7e0cb14e62cc", + "0x47b69f72f2508f2f3703954cea044c21baa7bbcaaeb77efe0ef34881f9e83862a80e1e9ea2ccc1b0ceba230a051ab3", + "0x87803269b60acf22fcd3f0104695256c76d1026d2a87438db55f74985e1f0c803de30fe117c36057fd450ab811fd94", + "0x9de53834cd3ee2b39fc771a7a5209d9bd59105de15de15669f21cf489f735e2c0a55d7fb1c3825df0ac1619b3babbc", + "0x11e018e2735a01de719f33aa49c80dab71362e46b16b5aaac2ee46299dba07b265b004854c284d795c5d065bcc615f7", + "0x195609d84e2cb9231b059f667622aa68bbdf48755eb3125c1c1812d0c6053784989907e8dad380b1d547ef231d37d1d", + "0x148d0d1110a5869a21e546c4e7089001b499e3cf4418209853244b185372cfc009e2830cf2a4d106ac68bbac3cdf187", + "0xc6f18c13db1f338c9bae284ebc4031a18b95d7b8cb370969764cb9102818c6271341385c836a37a83fe798e0b89b5f", + "0x7fe39ec0c9ac5faaa43a9127a976ee7676d39752368f0d35bfc975cc226772647fe713e58da1342b999c3cf154c6d5", + "0x4538daf92b9090eb76d81b0fced0ad231c9dfede9398cf313838cf2dd3e08acc1f38793f6dc13c75cc79231f996bb2", + "0xec1d982856d1efceeb61f26b124438a2eb6224b771e5551d44efe6544f8d7049278036f73cb0f92a1dfd814c3b35bf", + "0xa97d2891b62d6b0b398738bdf4c7e09915fef896ab5edba2d1362962bf1d7d3d4fa8ee53d218f9bcf2fb340138c075", + "0x122008abdee00b5335e485685cdbcbcbc434de86e4976c654c158630ebb792de050f6df76be89e7e98a43a861d85973", + "0x1a7871ab8179831ce1bdcb2701696ca3760d66b6f03afc51538533010f3843bf28377137cf865048e1bbfb5a152918f", + "0xffa3c2a7d576c740abab848211f2d839104b4cb6ffc33d23b399bcadb5e0c91bea2306eb3f24c509bf7185c872aae9", + "0x927433bd668d69b76acffe9cc81aec7825f07f0752551e6d31db27878a93ef09c3da03e659d5d9d826706feabfac7b", + "0x24c011680e0752af2b2ced70f947edf4ad6c4d1e9b193b0bd1e44c06a07069edc4456b4d7cef7c8e1c6759a92de86f", + "0x4407607e19563ba79e3f24d0bae4df4f2a7cc9a77ffdb72c56df3bcb903e16880799b6ec9ec3c2eba8df0282fed35f", + "0xd331ff74b5f516ffb1b08a22d5353417f363bf757b067923eb11263bd15c0d6ac19c5ab9a4059c2c21a0d5db8811b2", + "0x170cb8a1f275514e60074f3819dd0e1fce529eef2a67a4c43413b5c058514dd3a6cf208c3e56716139525d4b8086b1e", + "0x121d8e44b854271f1193954bd93220a471cc294218e8ca82ae4ed53b0e84ca9d89bb3dc655ef57d094e2b65eacede7f", + "0xd8a586901435b878d313c0e917325caddf36c4f27c3b3b37c5883c4170aa62a8fbcd7a2e71f000c677eb626d8e75ed", + "0xe00bb923056e7e96d593c8dccf35dbc52e0d02050b9ebe9dd0042b839e2343af1692c270d561c40701b299c76ca176", + "0xe730b2b369dd484f866500b6564812f998a5c881122c1252de1fb112e4e3e2b88ad4f745724856ab4d1b818ca13e72", + "0xc1656f6b6d590bf15f318940bb4e1c89640df187173997afc1a9f5acfadc0218a521e12276aa7f3ece967e9d6e72b4", + "0x11a5afcdf73136ccb8a6b9b95f13c9032cb0094f8b77c5558aee81e5ebb3121ed512f5a3bbaec494ee52ec1bda6ee19", + "0xc6ee4adbad28e6cdb71e9c8fc603a6da0ef63878110f25476505cb20d0f1fd88b0f0651f05e0e0bd8e5b7e1796919a", + "0x19f1d5da58910cc39b8e3af6763d9c51eda5ff9c9c62cbb7210dad8055c29021fcc959e1d01876590dbcba11652e611", + "0x5306aaf76de8e61d9140e9ee4f46f692921d75187a34ff0149ddd66fe88b2e06119815bc0600901c49c6e44b89c0d4", + "0x916bb705b6bbc850ff0f663cb9f11b2eb001a4d196f0943c52dc04761e587c6b48ec91ceb4ff8558668b798f475c6e", + "0x9747635fd6dc12b3007bb154826857ac90083a95dd461277b0eebb65d21fc8087fe570612f83a67a2fac76794bfdee", + "0x6a2696989afa6803ee7f469ad5b981568a2bb726720edf5389bc925641df708ed3badf0042385f454bf018a9ce774e", + "0xe3dff6983a19f666517032ff12b7899f8a73105bacee15d5a93b0af2913db026d006b8ef0ece2a4c881aeea7fd4354", + "0x1a4ad65c63cab65a69fbee0d3804871c66356d9dfe824e5bff19629aa7beb7ad0193a4c07c289bab361414f59c88b6b", + "0x3ee57b64004f7af4746e6260b65e8d52a0f7d5ea4fbbb9e5eb9be594280b6b8d9ca052784306c13e51755ceae44ebb", + "0x170b48d6d65de18dea47cff5a769bde8878f2b6361f83308151e33e63d411fe04cec61ee78b5c2b2428bea9bd9f2141", + "0xd6b733872a795f8df4de6e4c66634a90ecf414ac2fd3b810279882d63b997e00c02d6145e22ecaf3367e124296fbd1", + "0x1a48da956b534a1460498149308e2bb94ea5f719937666cdd3202e8fdc1791e92dbb2ce68099cfeed8775ec79dfaecf", + "0x147d9d0a35cc0e272dab56d4f4e29cfb1e195b9cdd26c6448c0306664349ac3d6cc13b728da1da478602a24c9ab589e", + "0xed7995326d10d638373a5e788b0e46492b684cfa61f3dab43c77cdd297309286e21af0d3202ddb82b0eb77e5981a8d", + "0x1a53380b1eb7409f4c78eb197a70c661fd486af1a70c0c73e5a9757758aef9b45f017fadcc38b7f9ee2fc61b348b6fe", + "0xb476dd40c141d0d4663478aff9f21a46bc7d473a957de524c44df4ef07ac22ff81a6a7720eb06488a6ac881b700bc", + "0xd055eec1b1c93d6a9febb4d2232250da3aa3c1ef8565740aff9863f3572c4a32579512768644dfc7f94d3632392dc5", + "0x1a1954aa83dcabfa8f6feeb0da6b74c7dedb59bba784e589fe08b24d5e4614993c8f93325ca827ea5063faf0a2e704", + "0x12d81e135a11e3aaedbd0e0609cc2979dab4d37a4f80fddd8efc76aabe3314445dfc350f945c17dbba1a31ba9573c2f", + "0x3998dd81cd332a9fd5c17808878787e0a48124b4d035c7da14164d67a916f154dfced4cb26915e7254a0ea2601b745", + "0x4e1ebd24943a47de1c36e57f022730cfbee40ff5ccef1bd5a52b09087d2d4cc979c698b6e815c54fd2cc37b1cf2a4b", + "0x3300b6a674368956adc95f6a746ba1bc8fdd3aef2fa6450efac92d7eba62d663b633d3822fc8de351eecda00123a9c", + "0x15d194442e9d17b56f2de15f7817d0f7a60b11b73aa4a4ee85268ce87eeb0ca63d662f2d8e68754847ea214072018c2", + "0x10d1554d1e0eb3e8d0b4e7efed8691f8bb76ba3f9eb737a6fe7b5d7bdc556ce45ecee62da3a4661dd4c94cbe3f931fe", + "0x17d87372ccba6e5a9be363d16738141ebae2be696692b8e8b13be11e989e7d247fcee6a7d69429c71d173feb402b32c", + "0x12d121c4891b9aa2d6f2ab390994dab2f0a89852f7b158901c5e79c6251c8b9fc647424f54d3e72f0ac5a857e487b1e", + "0x13979c4d9da32ee9017d1dfdcfbf0cb6f161108c12e47ba62cfa4bfacc76da8855809cc3cf30c2fdd5c8a82fbe06f57", + "0x9da052114ee22f8fbb05479021c871866dcfbbff2b014f43ebb4df9e12f941b4c0dc2c3d6b18dc0cb2cc1296386af6", + "0x140c562bafd63450144ce77897d3fcd75316d702c6bd7000879d22221a0bfb4206763068bacf4ed906c56fa0a1991b5", + "0x99a4998fbad749c4b2ea3170ed460baf16975522ad9c992b0fba8c22603a1cbd437025466d05ef06210b849a8c057", + "0x153f03c3464819d8952e46159c0d9f108dd2fe0581a342f5624bce6c8777172cb5c7b780d82ef5d80a02d4f59cc14fe", + "0x1689ac962da50ca83e30dcabd70e23987666603df08e74ea6fc6b2586a14d38c309ccb1076a6cef29d140cc5ae1cc2d", + "0x8e9c8ebc67836ba7f39a44573c423fc43b59a1643090a484f48ca8e57058a37e2a9c63f03d9db32b9268c6586e7816", + "0xe28e2faf8029a4f62098e7dc7ad85b0ffd326a8b477c2234a1900eab91660e0da0ca32d73baa4d3fb2ee2b5c225438", + "0x185924f31325ce540f75187a43a420d9dc94842ae28450e86d5cd96707f6a56f0e4b60135ea8e6fb90b94489eddf772", + "0x166a5bd0c32cb816ea5d1699b67d33f4ddaa0f56c6307749b38570a6055892aa6a1cf85c3fc3fe8c4225005be9ea782", + "0x1740c63f3042819cf3e6d0146e15f7696a95dc607013d19718086f9b0aacfb4a5e426ddc52a1afcfd210ba5509c74ed", + "0x287c4d8af3aab2bc82b745f250cd337e803a8f485d1d42e8c3fd5cd865833144e202b026dee3a9360205f735c7ed3f", + "0x16b756d8b2ce937735b1a88019129779a33459c34e19205eb794ffc998eebc443b2fe3d5e67e1c03fa2533f96472b3" +}; + +static const std::string mds_matrix_8[] = { + "0x1837efcfa8845e97b76c0bb5511da75e080a28ef57828d9ab8ac7f30199e7ff0282fe11effffffa489fbffffffffff5", "0x11c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff0", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", + "0xdff3892a1267bf07eccc3c2e546cec14c65674f7624ff7e9718c5275ac77ff3099b89a4ffffffb52b13ffffffffff7", "0x78d02ab339132928c5af7a0f2dfec4921814b5f298ee2c4eb0a163d37e0ffebd60e6455ffffff8b9857ffffffffff2", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x1837efcfa8845e97b76c0bb5511da75e080a28ef57828d9ab8ac7f30199e7ff0282fe11effffffa489fbffffffffff5", "0x11c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff0", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", + "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xdff3892a1267bf07eccc3c2e546cec14c65674f7624ff7e9718c5275ac77ff3099b89a4ffffffb52b13ffffffffff7", "0x78d02ab339132928c5af7a0f2dfec4921814b5f298ee2c4eb0a163d37e0ffebd60e6455ffffff8b9857ffffffffff2", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", + "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", "0x1837efcfa8845e97b76c0bb5511da75e080a28ef57828d9ab8ac7f30199e7ff0282fe11effffffa489fbffffffffff5", "0x11c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff0", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", + "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xdff3892a1267bf07eccc3c2e546cec14c65674f7624ff7e9718c5275ac77ff3099b89a4ffffffb52b13ffffffffff7", "0x78d02ab339132928c5af7a0f2dfec4921814b5f298ee2c4eb0a163d37e0ffebd60e6455ffffff8b9857ffffffffff2", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0xf5512db8b0cd3fad4eeebeba1c244eb1977226fd20c552a325d970d1e427ffbadde8336ffffffe70e5bffffffffffd", "0x198dca18926ab6a20d8e33de0d991d87d51be40fb369e34653f15115dd197ff8cc72dab0ffffffd66d43ffffffffffb", "0x8e2dcf41d778a9ce27d1fc9af5b6272ee93067f85763870864ee822fb5bfff47a515de7ffffffbd7b9fffffffffff8", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0x1837efcfa8845e97b76c0bb5511da75e080a28ef57828d9ab8ac7f30199e7ff0282fe11effffffa489fbffffffffff5", "0x11c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff0", + "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x51c5b9e83aef1539c4fa3f935eb6c4e5dd260cff0aec70e10c9dd045f6b7ffe8f4a2bbcfffffff7af73fffffffffff", "0x14716e7a0ebbc54e713e8fe4d7adb1397749833fc2bb1c38432774117dadfffa3d28aef3ffffffdebdcfffffffffffc", "0x3c6815599c89949462d7bd0796ff62490c0a5af94c7716275850b1e9bf07ff5eb07322affffffc5cc2bffffffffff9", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xa38b73d075de2a7389f47f26bd6d89cbba4c19fe15d8e1c2193ba08bed6fffd1e945779ffffffef5ee7ffffffffffe", "0xdff3892a1267bf07eccc3c2e546cec14c65674f7624ff7e9718c5275ac77ff3099b89a4ffffffb52b13ffffffffff7", "0x78d02ab339132928c5af7a0f2dfec4921814b5f298ee2c4eb0a163d37e0ffebd60e6455ffffff8b9857ffffffffff2" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0xcd91762480294b3a0421397f02165a7e64ef34213beaf9190d7c098f0cfbc70eb648ffc482f9ab828d031490d4d4d4", "0x12e6b8de90502c2c94e92915da5e4a868503f8fb4d9e9215f5bc394478a8156f652c80fca3266154fb49b166dccf3e", "0xc10a417d5bc084e0197c74912f5cd1017e23a2836139deeb613faeb86c175612e82a5ee3de5514067c83c7176817c8", "0xc6113e82a4afc2df2aa20b05f37dac0c138eac8fb34d5f9701592bb12435655448af6a363e7e0c56bbc8069964d49f", "0x670b99f672eacd00de45eb1b1646a497c78e7a92b67a31e6317fcb0c788068a0bfbd6646873295e652d6e8563fc480", "0x63bf1ec9b989b97bec00ac0744f81021832d23514399be2e9dbd5eabaf198c94c2bb2888f0e692f4ddf29666ecd1d5", "0x103c0efaf308cda65809f8addc7f4de879ed058bbf5693afcb385ef0faa488af8ef718c352ba9c33929634de1509bed", "0x141fb2fc22d20f147b1225695ee5b78746e0f4faf30646c149699d307c6f7d9972a0ebe4d0136fc00062a449c5e114" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_bw6_761 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/grumpkin_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/grumpkin_poseidon2.h index 19bcda0dc..cda67dccb 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/grumpkin_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/grumpkin_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef GRUMPKIN_POSEIDON2_H - #define GRUMPKIN_POSEIDON2_H +#define GRUMPKIN_POSEIDON2_H - #include +#include namespace poseidon2_constants_grumpkin { @@ -11,467 +11,491 @@ namespace poseidon2_constants_grumpkin { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 56; - int alpha_2 = 5; - - static const std::string rounds_constants_2[] = { - "0x9c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a7", - "0xc0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81", - "0x1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30", - "0x27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f", - "0x1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03", - "0x2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d3", - "0xb66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0", - "0x12ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e21", - "0x252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9", - "0x179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f1", - "0x2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91", - "0x1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b05", - "0x255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56", - "0x28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd9", - "0x28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043", - "0x2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c9", - "0x7abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9", - "0x230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c", - "0x1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9", - "0x2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc", - "0x1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8", - "0x2e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e", - "0x1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e", - "0x1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f582", - "0x283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7", - "0x1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc", - "0x216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd", - "0x2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f94788", - "0x16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43", - "0x175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc5", - "0xc7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32", - "0x1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d", - "0xccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f", - "0x14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e796", - "0x962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052", - "0x1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d", - "0x10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b", - "0x57e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d", - "0x287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee", - "0x21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d", - "0x1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3", - "0x268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c1", - "0xe17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6", - "0x4d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af40", - "0xddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e", - "0x2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b", - "0x1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9", - "0x21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b0", - "0x379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b", - "0x2d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c35049", - "0x123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6", - "0xbe29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec1", - "0x1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a", - "0x1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e", - "0x12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212", - "0xfc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba", - "0x1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762", - "0xebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d3", - "0x2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1", - "0x1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf", - "0x2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f", - "0x23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c060", - "0x5872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7", - "0x1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a7", - "0x19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376", - "0x15bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f", - "0x2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1", - "0xb069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc", - "0x304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429", - "0x15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc", - "0xab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6", - "0xe32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 56; - int alpha_3 = 5; - - static const std::string rounds_constants_3[] = { - "0x1d066a255517b7fd8bddd3a93f7804ef7f8fcde48bb4c37a59a09a1a97052816", - "0x29daefb55f6f2dc6ac3f089cebcc6120b7c6fef31367b68eb7238547d32c1610", - "0x1f2cb1624a78ee001ecbd88ad959d7012572d76f08ec5c4f9e8b7ad7b0b4e1d1", - "0xaad2e79f15735f2bd77c0ed3d14aa27b11f092a53bbc6e1db0672ded84f31e5", - "0x2252624f8617738cd6f661dd4094375f37028a98f1dece66091ccf1595b43f28", - "0x1a24913a928b38485a65a84a291da1ff91c20626524b2b87d49f4f2c9018d735", - "0x22fc468f1759b74d7bfc427b5f11ebb10a41515ddff497b14fd6dae1508fc47a", - "0x1059ca787f1f89ed9cd026e9c9ca107ae61956ff0b4121d5efd65515617f6e4d", - "0x2be9473358461d8f61f3536d877de982123011f0bf6f155a45cbbfae8b981ce", - "0xec96c8e32962d462778a749c82ed623aba9b669ac5b8736a1ff3a441a5084a4", - "0x292f906e073677405442d9553c45fa3f5a47a7cdb8c99f9648fb2e4d814df57e", - "0x274982444157b86726c11b9a0f5e39a5cc611160a394ea460c63f0b2ffe5657e", - "0x1a1d063e54b1e764b63e1855bff015b8cedd192f47308731499573f23597d4b5", - "0x26abc66f3fdf8e68839d10956259063708235dccc1aa3793b91b002c5b257c37", - "0xc7c64a9d887385381a578cfed5aed370754427aabca92a70b3c2b12ff4d7be8", - "0x1cf5998769e9fab79e17f0b6d08b2d1eba2ebac30dc386b0edd383831354b495", - "0xf5e3a8566be31b7564ca60461e9e08b19828764a9669bc17aba0b97e66b0109", - "0x18df6a9d19ea90d895e60e4db0794a01f359a53a180b7d4b42bf3d7a531c976e", - "0x4f7bf2c5c0538ac6e4b782c3c6e601ad0ea1d3a3b9d25ef4e324055fa3123dc", - "0x29c76ce22255206e3c40058523748531e770c0584aa2328ce55d54628b89ebe6", - "0x198d425a45b78e85c053659ab4347f5d65b1b8e9c6108dbe00e0e945dbc5ff15", - "0x25ee27ab6296cd5e6af3cc79c598a1daa7ff7f6878b3c49d49d3a9a90c3fdf74", - "0x138ea8e0af41a1e024561001c0b6eb1505845d7d0c55b1b2c0f88687a96d1381", - "0x306197fb3fab671ef6e7c2cba2eefd0e42851b5b9811f2ca4013370a01d95687", - "0x1a0c7d52dc32a4432b66f0b4894d4f1a21db7565e5b4250486419eaf00e8f620", - "0x2b46b418de80915f3ff86a8e5c8bdfccebfbe5f55163cd6caa52997da2c54a9f", - "0x12d3e0dc0085873701f8b777b9673af9613a1af5db48e05bfb46e312b5829f64", - "0x263390cf74dc3a8870f5002ed21d089ffb2bf768230f648dba338a5cb19b3a1f", - "0xa14f33a5fe668a60ac884b4ca607ad0f8abb5af40f96f1d7d543db52b003dcd", - "0x28ead9c586513eab1a5e86509d68b2da27be3a4f01171a1dd847df829bc683b9", - "0x1c6ab1c328c3c6430972031f1bdb2ac9888f0ea1abe71cffea16cda6e1a7416c", - "0x1fc7e71bc0b819792b2500239f7f8de04f6decd608cb98a932346015c5b42c94", - "0x3e107eb3a42b2ece380e0d860298f17c0c1e197c952650ee6dd85b93a0ddaa8", - "0x2d354a251f381a4669c0d52bf88b772c46452ca57c08697f454505f6941d78cd", - "0x94af88ab05d94baf687ef14bc566d1c522551d61606eda3d14b4606826f794b", - "0x19705b783bf3d2dc19bcaeabf02f8ca5e1ab5b6f2e3195a9d52b2d249d1396f7", - "0x9bf4acc3a8bce3f1fcc33fee54fc5b28723b16b7d740a3e60cef6852271200e", - "0x1803f8200db6013c50f83c0c8fab62843413732f301f7058543a073f3f3b5e4e", - "0xf80afb5046244de30595b160b8d1f38bf6fb02d4454c0add41f7fef2faf3e5c", - "0x126ee1f8504f15c3d77f0088c1cfc964abcfcf643f4a6fea7dc3f98219529d78", - "0x23c203d10cfcc60f69bfb3d919552ca10ffb4ee63175ddf8ef86f991d7d0a591", - "0x2a2ae15d8b143709ec0d09705fa3a6303dec1ee4eec2cf747c5a339f7744fb94", - "0x7b60dee586ed6ef47e5c381ab6343ecc3d3b3006cb461bbb6b5d89081970b2b", - "0x27316b559be3edfd885d95c494c1ae3d8a98a320baa7d152132cfe583c9311bd", - "0x1d5c49ba157c32b8d8937cb2d3f84311ef834cc2a743ed662f5f9af0c0342e76", - "0x2f8b124e78163b2f332774e0b850b5ec09c01bf6979938f67c24bd5940968488", - "0x1e6843a5457416b6dc5b7aa09a9ce21b1d4cba6554e51d84665f75260113b3d5", - "0x11cdf00a35f650c55fca25c9929c8ad9a68daf9ac6a189ab1f5bc79f21641d4b", - "0x21632de3d3bbc5e42ef36e588158d6d4608b2815c77355b7e82b5b9b7eb560bc", - "0xde625758452efbd97b27025fbd245e0255ae48ef2a329e449d7b5c51c18498a", - "0x2ad253c053e75213e2febfd4d976cc01dd9e1e1c6f0fb6b09b09546ba0838098", - "0x1d6b169ed63872dc6ec7681ec39b3be93dd49cdd13c813b7d35702e38d60b077", - "0x1660b740a143664bb9127c4941b67fed0be3ea70a24d5568c3a54e706cfef7fe", - "0x65a92d1de81f34114f4ca2deef76e0ceacdddb12cf879096a29f10376ccbfe", - "0x1f11f065202535987367f823da7d672c353ebe2ccbc4869bcf30d50a5871040d", - "0x26596f5c5dd5a5d1b437ce7b14a2c3dd3bd1d1a39b6759ba110852d17df0693e", - "0x16f49bc727e45a2f7bf3056efcf8b6d38539c4163a5f1e706743db15af91860f", - "0x1abe1deb45b3e3119954175efb331bf4568feaf7ea8b3dc5e1a4e7438dd39e5f", - "0xe426ccab66984d1d8993a74ca548b779f5db92aaec5f102020d34aea15fba59", - "0xe7c30c2e2e8957f4933bd1942053f1f0071684b902d534fa841924303f6a6c6", - "0x812a017ca92cf0a1622708fc7edff1d6166ded6e3528ead4c76e1f31d3fc69d", - "0x21a5ade3df2bc1b5bba949d1db96040068afe5026edd7a9c2e276b47cf010d54", - "0x1f3035463816c84ad711bf1a058c6c6bd101945f50e5afe72b1a5233f8749ce", - "0xb115572f038c0e2028c2aafc2d06a5e8bf2f9398dbd0fdf4dcaa82b0f0c1c8b", - "0x1c38ec0b99b62fd4f0ef255543f50d2e27fc24db42bc910a3460613b6ef59e2f", - "0x1c89c6d9666272e8425c3ff1f4ac737b2f5d314606a297d4b1d0b254d880c53e", - "0x3326e643580356bf6d44008ae4c042a21ad4880097a5eb38b71e2311bb88f8f", - "0x268076b0054fb73f67cee9ea0e51e3ad50f27a6434b5dceb5bdde2299910a4c9", - "0x1acd63c67fbc9ab1626ed93491bda32e5da18ea9d8e4f10178d04aa6f8747ad0", - "0x19f8a5d670e8ab66c4e3144be58ef6901bf93375e2323ec3ca8c86cd2a28b5a5", - "0x1c0dc443519ad7a86efa40d2df10a011068193ea51f6c92ae1cfbb5f7b9b6893", - "0x14b39e7aa4068dbe50fe7190e421dc19fbeab33cb4f6a2c4180e4c3224987d3d", - "0x1d449b71bd826ec58f28c63ea6c561b7b820fc519f01f021afb1e35e28b0795e", - "0x1ea2c9a89baaddbb60fa97fe60fe9d8e89de141689d1252276524dc0a9e987fc", - "0x478d66d43535a8cb57e9c1c3d6a2bd7591f9a46a0e9c058134d5cefdb3c7ff1", - "0x19272db71eece6a6f608f3b2717f9cd2662e26ad86c400b21cde5e4a7b00bebe", - "0x14226537335cab33c749c746f09208abb2dd1bd66a87ef75039be846af134166", - "0x1fd6af15956294f9dfe38c0d976a088b21c21e4a1c2e823f912f44961f9a9ce", - "0x18e5abedd626ec307bca190b8b2cab1aaee2e62ed229ba5a5ad8518d4e5f2a57", - "0xfc1bbceba0590f5abbdffa6d3b35e3297c021a3a409926d0e2d54dc1c84fda6"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 56; - int alpha_4 = 5; - - static const std::string rounds_constants_4[] = { - "0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5", - "0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6", - "0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa", - "0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8", - "0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902", - "0xe35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e", - "0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996", - "0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e", - "0xc009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738", - "0x11f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06", - "0xed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549", - "0x4dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b", - "0xa3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8", - "0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f", - "0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1", - "0xa1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447", - "0xc6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf", - "0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811", - "0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75", - "0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5", - "0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0", - "0x11003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574", - "0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c", - "0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5", - "0xc246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d", - "0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b", - "0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85", - "0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb", - "0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c", - "0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08", - "0x64760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59", - "0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87", - "0xe070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c", - "0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb", - "0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b", - "0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db", - "0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926", - "0x62100eb485db06269655cf186a68532985275428450359adc99cec6960711b8", - "0x761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b", - "0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d", - "0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a", - "0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b", - "0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0", - "0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5", - "0x70dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9", - "0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da", - "0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729", - "0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa", - "0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf", - "0x94975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e", - "0x4d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65", - "0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187", - "0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3", - "0x3fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0", - "0xb7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64", - "0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a", - "0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f", - "0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d", - "0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f", - "0x832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173", - "0x2f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16", - "0xe2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705", - "0x493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a", - "0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9", - "0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16", - "0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0", - "0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5", - "0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505", - "0x44cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d", - "0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025", - "0x2fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355", - "0xef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac", - "0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38", - "0xa76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5", - "0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c", - "0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f", - "0xc817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a", - "0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96", - "0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce", - "0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959", - "0x5ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b", - "0xf0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4", - "0x558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf", - "0x9d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455", - "0x328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335", - "0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b", - "0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df", - "0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x2ef1e0fad9f08e87a3bb5e47d7e33538ca964d2b7d1083d4fb0225035bd3f8db", - "0x226c9b1af95babcf17b2b1f57c7310179c1803dec5ae8f0a1779ed36c817ae2a", - "0x14bce3549cc3db7428126b4c3a15ae0ff8148c89f13fb35d35734eb5d4ad0def", - "0x2debff156e276bb5742c3373f2635b48b8e923d301f372f8e550cfd4034212c7"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 57; - int alpha_8 = 5; - - static const std::string rounds_constants_8[] = { - "0xdad22d08a6b8d81d4a5ffc34b9677a7c5254c85e953551f9eba9a0a97590c10", - "0x3cfc441111f1bab6e75957b9f0274e92d17aefc2d8da460435dfaf259bd1039", - "0x27c6d1b8a2e2ce670376cd2970192a2a08e4290883f6ca49e7976c6c447d6392", - "0x28f2882b9abfda8efc2d121da0c871d2d5313a53c67d0407eef4e93ee23e6c2d", - "0xa3943390fe4939fa2e931e18094c7c93aa107ced2bfaefcfe5e613a3f1262d5", - "0x2a8f37d8da8f2319e188f8909007408b57fba3555bb784c1ad6c7b0755805456", - "0xcef8658e33f20c39649528f353ef5d03198c75683f8493534add693a4ff4f0f", - "0x1cdc2a6f0f0e7c6c62ee1c0cad4fd11363a48db7095171faaf9a7b6e01c3e52b", - "0xa2e681a2db19c8d1cfb0c28f0b7b3d9830d35fca8c0b076b4e64328060139d6", - "0x16f013cd703be7de16b4361ce5c67cc2997f858e8a808885da67fbafd30d2717", - "0x29af57131c9cf548be669fe76c675e6d90bee17a76cccf4ddc5d35f9a936ebb8", - "0x21807b1ec6258bb155ed159da90b815dee119eae8138b1bdf950111bf5205b3b", - "0x7c00db8c50a8c860fbcb8ebd234a54350bdbcb8747891a4e5adab1c4abc6909", - "0x22bc08fc054d08a3dbb6094396d0de373a4c33205c49a1254cf25ebec1747765", - "0x2dad58bdf3e24c78f21146de084d9b8afad58956fedce67d43f7d375a813bb2e", - "0x292cee6bc19a64dc5a8a74036e676e238f60b4577db86213ced417906f1d6e91", - "0x27d655ae125928ad6b48bba54593b74ca0c23002b32a0a9ef375939a22387a8c", - "0xe0e2e781fe9ac0a97f0d961c7b359a415d1ead41c99eccee90e56b68fbfa2a8", - "0x13fec23e678d1c9943b6daed8ed8212289116ab96344ded7ced8aac2f09f1672", - "0x27550dd21647e37fc31640684e02cb07810669b1c1545443fd58204b2cde73c2", - "0x1de6d5f356a92c48c7b9f6aa45c8a6216e0a6adbc799c0bec242054674cb8f09", - "0x14c5347c4580363f74c885d1fbb378c61d953e490892b10baf84f6e1f3a3f39d", - "0x27f2768023c4df7952ca0d967f14034e98c4ca76973ae1cddfccd212cbd78683", - "0x1f4f499fc4853f7e189ad6d2269c467f77e15bbd28963c516b4fbf1ba7b88f95", - "0xd62ba9a8de3b97c72a5425a97a7f027fbad23f299ff46bafa12dcffb0e72bf1", - "0x22b649ae468f20c7cbfb435d932ba9ba4be14ea40c0c54e6bec970ab4c513f04", - "0x3a1aae439e47e7e14186d5513da5e263e063a3da6d042c16e55cab2e81a8e95", - "0x25c7eee1fce422600f5b1e78323f2e99cceee803f62763217eadbd046c1e0e6c", - "0x1c66258f103a955274ed71de56169bba34ff6aea97a2c32b98805dc3b011a383", - "0x29403b00757a647671a3691094aef420ad830f95743d45894d6d7f40aa356e4b", - "0x13496363ef5f7d0e91fd1319fd5dc0269c5190d05d8a0ad28a3ce0638a133e0e", - "0x1c6a4586c15c4638a1686921d7c204e2b6e1a88c1fc49dcfb87ded2a1ed7edc5", - "0xda23df12d0bf47bb92f15ee189386c20f552d0bc66ae492b92d69556b2fe75a", - "0x155be88bc5ddf8e0c6c741286cdd5ddd559279a455b9bbb61d5a0b004e545d5e", - "0x553fbb5b32db860e0bb12cef3aab4e0dbbdb1ea8704d335a18fa8b4df112c36", - "0x12f6a3a61a3139221cb5875cf455b942580c00942499932dfcacf6f75cb80ad6", - "0x2faf9e95457781b3c61de8a1faadda67f76f52bb81255fac8819bcc104071e05", - "0x1c7639cb68d3cfa69f3d795d1a1dd4eba176d0c29701e7b677ea0750b4ccd1db", - "0xd9d85a46281f81502fbcfb430f4d08ab504c502d2feae2ab4a26d87bebea0dd", - "0xa9b7074ea11d9931cf4af16952f398777aaa36413df14cedc101c7693812d3", - "0x7fab349ddb7d62a5edc0b6a62b300715634e5dccab808d8fa6ae62b406705a3", - "0x11f8f3afbd6fe6bda7d055a536ab3de9c40c8155b31d397f63ef21ac974cf52d", - "0x7c569f8f49899805d22a1930883968a3cf058993e0adfd06da437ae50e830", - "0x15dfb18bf1b6087c0e638f2189a7b34534549ffe8fca5afccf7e528a3338cc92", - "0x2140caa062d2fa72722ad48fb71bbc9f534043dab90dfa24b96664eaa2f0ac6a", - "0x11c06fe4e5398d4704271b84e6023b07b189dd1d2023dd599b33defe4251b715", - "0x775f90bae5f8f8157eb73bbc7ae69b74d44761cf0df3b4666eeb2860878c0df", - "0x225befb64b758b837a4305e104d5e510d893653559d8768dc79325ff89d6b9f", - "0x201a730245d9227f1232cc02f486c18cfa1fba40665ed3d1bbbdcd19b03cac4f", - "0x128b63b12a6647f80c686aaab15b0563c1a33f475dc18caa434ab64f1e290acb", - "0xa34ce8153d4e2e1158de05d276530cf3c749c16c7e09f3b671a973b0efb0839", - "0x2809c5d323665513c8c4a96ea4dc08e3aba43699bca1198f2b559915082495ce", - "0x23b929e7d71fe425f36f32975e9a68bbf83c16622678f061ed78a0c9ce318be3", - "0x1ca1a93d02ae448ab773f95c6b88c0d01f89c0c3d25ad625042771dd5a7e74a9", - "0x3c7381ccdfd209a8cba5627a058c33f472b24d2b1a55d9dd47f60dc7b474e7e", - "0xbe1a29bb668a25eaedffccef6c01c90688229e8fc4be9812e371d4d61c3015", - "0x2c821bfbd5c415fc076fc83895edab9e5256ee826946a865b8c82f0189af4626", - "0xb8ff5b252182f6a15cff90144c1e7ac1678739882c90fe46d0a29db7a0cba77", - "0x1c0e94b15306baf1b017623888b8d4c5402ee81fd213c4a5e42f52729deb7d5c", - "0x2031deb0f13ce17a5b44edbacf5a0410e23348c2c7657383a8ffdeb5c5ca1cd4", - "0xe34d14f44e8eb98ac078ec90eb718c3034249fbaeb13d24f3d5b6a4002018ac", - "0x2a10f1b76f8b1cc429820030c58b3d23ebfb775a43b07928b9868891c2cb4cca", - "0x535bf4f7fb763f981d2c0c7ecd2237a461ac385e2235fb35222b512f1dbd1b7", - "0x12ccb3fbffeff74fb7ce3b9943f609dc0d7fe34e3b5e6b199628e86d5576cc18", - "0x1f44cd78220a2e66be6c9eb3bcffc498a47f22c3eb476591cf456d518e3e126c", - "0x1d60e9e3444a748b8c22d7d10e825c536290b723fcdfa046436353d6f9abc073", - "0x5a3ccc67bd014ef2544927f9b96ff58e348954e40af67861ab88d78ff4b6688", - "0x1be5b195896e9ec23b9d3eb898734c385272ed64bdcb236223f5a3436986dc6d", - "0x1d6427dd07a0b46a8ebacaa82e8c04de8e7e94a18849c9275b8b4827a873cdab", - "0x2f09a403f946b692704fe4d5ae69625441c93a7f93dcb4f8f7d337baa735ad9a", - "0x1807540511593488e084b7297b6ff67b748c71731b6ca64aa8d3823e81f41b37", - "0xf1daab7a702ac80d108b24845bda04b732f3564ebe57392e470380199522e1d", - "0x1797d0f72bf0b47a45ceaf82df261439bc5e3b0ae55cf1069733d5a0b51765ca", - "0x2adbb9b4003631c5e3d02ce959930c75d4d25281c86febc61dfdf35e00cfbdad", - "0x1347ad87393ef928d2800fa2a548328ef9bddf5646da79d507d2f2055db335d6", - "0x15658e02d31e2c200dadf6a985652eccd30cb959168cde7b74c7239539d2df1e", - "0x1f00dc28bced12a74c3ce687dd3fa996d6f8bb29bc60cda4f3aed191a6fe8d0", - "0x154ebcc230244b68b9a8f51a56ff0541a92ea2cbb3e77b263cb03a8bd89491f7", - "0x1f65f74b523a8c875885378e93d1946c7a3f810e2eecdea94b80c4f741ea6cf9", - "0x2504a559a4bd23ed689acc9b6cb4062479a6b29692e2b8cce40058daf0505778", - "0x24496d9926e4e565ef860e52396a2935689c87ca99abd046bc279ce1bfc43206", - "0x2c9ccd22b143f4d8d483846d1960e7144a5c9354ea48cd1a71bdc82fbb929838", - "0x2b9bd02e1b064a8db321a1cd212a7a6dc47274f6eb5fcfa4f17d6f690dddf8c4", - "0xb21f0004118382f32fe441fbf36c0a38ae41873ae42d3b6ea5f0c6816e00472", - "0x10756efb491852587059f3e48b605a3bebabaab0a1ee5ff1758eb30623b7602c", - "0x127574a38823886d1f4841b540e29d67efe35aa8b3c685f969b6bc6cbab5064a", - "0x24751d620ed2a3db4382265b8c33b666b85beae7aa87f38e28bd2f8d637ff9d0", - "0x2e3d7208892e8a92e887fccccfe04d8d0fe994bc443641a9fc76c43da02f453d", - "0x11c3f6719071e6810699be20e1b1858b9ed00d8166bf15434cd5e43507b9d62b", - "0xb86112693a4e7f3ac4eadfcc3f04d24a7afe51a87f82d4a435ad27f30aa2f9", - "0x1a77348400a87f0180e294286a7a06c857f590e8ed17eed7a6b4cc1ca5a97929", - "0x207feb0ffff2e419bc967dd544abbdd2dcc601316f49957f2319c9a04f56157d", - "0xdf4aac4e6483265aa3fc462835a90380bc84004fc46d1a85e61baed3196ba48", - "0x2f2df3db6ed0e27d3151201dfe7f57fc2e5ccc69c2458535dbdbb5d88aeabb4f", - "0x2f51811c3568dbae396f86838c5c8b1bbf9b5bcb2ce98542e289184b95f74b7e", - "0x1198ec466dc8c3f55b048369eac0490e835928891325d4cf4461da1d22230219", - "0x19036827eb0714a1ee4fdd653d8667df192402e290dfdfc39bf005fdfa86c043", - "0x978d774018c29f2818df365312371ce4082a6c8c52d2a965516b76436349069", - "0x231ed2d94767eb9ace111af9317b233fee037214e3f6d7e366a5812c8fd1dce5", - "0xfbd8502ceba8ab93eb04d1db535d25f4c3be8acac4e8e0467b9d606653456c2", - "0x20e9fac35dda464e436a4d2eae4cdd5b52c9b712d5b4bfa43334463f8478d4bb", - "0x15ba9fc4b175278a12a5ab39ee0121b06dd09b923bdedb69a26182821445ba00", - "0xc3c9aec9048b10a06d062675b63417a1ae8704f2918382466bf575e22a654d3", - "0x2795a46eb4c79595a9de2191c524f0aaf92f764153b23c357ed50bf3a91cddf0", - "0x10ab7893c4253d861276ea30f229eb86b90c69985fb6dde4aa50e24828caa81a", - "0x2d4509d8159af62c44503f64fc01e953e90c6dced8ba75c58df2aa090a5fd359", - "0x157946957f4feb94eae09b9a6c272204d107ea7b0e31b67524a6c9ee7f04e7b9", - "0x30464efe02b65b862f9a0b59fea6d6934b393e65cdc3d29ae67a751a0d0f136a", - "0x965b3a2d05666d38ffcdac4e5ed020c742ba41d760e70f74dcd8f8b1324c901", - "0x24531c784663d57639928f0a8f152038a779eebbd70f6585dacc971668ebec55", - "0x2202070df8f85b79bf7debf24a9cc0f2cf30370f26a9372e01718dae7cb6171d", - "0x8282fc0baa2e9eb76167b9ab2405db9c78f1f37b168be6435d5385a806e745a", - "0x178c3d6e47cd33e5570311ec8ad8dbca0dbf54aadd1393738d898384c57795e7", - "0x12ad905f9d82f33643b1fefb90dcefffeb818d1ec3f4fc3d6857203eff5ed1ea", - "0x229682c9e4165b6ed1a2870c14a1c8bb7b1c7d3b52f42ce0228b85480666b4c4", - "0x25190d853744dc11d155de5e479640302a333d47cf18dbf1ff241ce42c88d4c9", - "0xdb47fadc76bf4fd8dcfe26908fe48ab42d399da939ac1f167ca8600cfbe7bc", - "0x2ba5e88adcbe025760f2c8654935f0557d14c6d4125a838f312f2ba439e2e94c", - "0x1376bbae85699dcc294f850c858b4b370e51ff3139bc3e0a1e52eb58d08ca41b", - "0x1333fda1e3d58e0747f5c7361d5075526933ea283eee2ac37b6042c6083b6a42", - "0x28bfc4dc9594e9add687744b79f4feb979e2143d742d4e4d1d5bb64bb799a02a"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x723ccf7c498015cd549cef6743238a58ade9af4415735b42e828554fbcf71f2", - "0x968a83486ce526883ed90ef5613f8d1f00c07f0af7413483eed10646cf5dc32", - "0xe3d17c07b227916d604413558736db2f8c94ae727a833dd0ba482b72fec4825", - "0x1958661d97d79fd7cdf32600b8032aabebc99019a95ee1638d504e04b84cac6", - "0x4156d00fd8f3b0abda3325467fc057733ac6c7d3c954b39fc88df5c3e3a69de", - "0xd14327670e665314608c5732f5bd203e826355def37d1c092bcde4cff19fdb4", - "0x2c6ccd298468819ce4a397e73f1175f579321054b837f51e12970f5e96a0f951", - "0x1a9331b5aacc657f86808efeb512d53eb0ab5b571b6ec7a7ca829d2645517209"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_grumpkin +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 56; +int alpha_2 = 5; + +static const std::string rounds_constants_2[] = { + "0x2d121e5b72e98f9b26e35d89cc246b767dc392f99d431c161b933f17f4b62e6c", + "0x55892a209b0551626a0508a79f2ceb72f1866101b96d31c3c1f782361b2b131", + "0x2585e9d13bc632b95872c3af1129dd09863407335aa0362234963ae7a34ba1b8", + "0x12e762346782ac5b3811165686f38802de5a17c8a7172cc9a14f614da57abc33", + "0x17b1ef4cd092d93cfc6fce5b31a56603354ecfcc6b9472ee6c22f4d56bc00d56", + "0x1c61e07ef0358a36ae4fdcd5decb3670215656a59bca5b1c8d2c0cb480a4ea78", + "0xef98f38173de626e3320e72f14c89ff186023ec6faa0ff2d8c260b890c6a43c", + "0x3b94c7e008aec412856810d5cc80e1a0c1dc810d0212338485c7b40bb923652", + "0x1d718bf36e283da0e35475fc9fd03868d0e4d3d545d147f0930c65865074e6ba", + "0x24126cb075964763d310298aab44b9cc2daf077965d7a54c62d7c196a9e6fa3", + "0x47aee06e2b7f4ed33a644d0b9c2193b6b492fb3a2ccc88ba35886d78be74d45", + "0x17544b547916175761ef5786ef37c9a9eaaf4cd63d8d6733c38e5bae7946852d", + "0xec5641327cc95a84e0ef492160dae1c146b7c780fc213229669a37743945285", + "0x9e449cce1fc1c55a4d22183e31b5036df734de4494d5435a3a1530ecb79d29a", + "0x978fde8fe6be60ecc2941fed1f47baf96ac6fb30b18decf2972f6f646dcd8c3", + "0x94edc37eda48de955b27225d876cbcaaf8e0e29f304a8d606a55b896e873a6f", + "0x197ce769f505e635aa0c9d31e924b480c57a5c43857904d906e0d1c3464f2336", + "0x2834d9bb8813e413b47266b51e6571c2d28954903110ef52d0600e804864fa6c", + "0x2efbb4e5ccb6c1f64e1a0306a1661c654fb3ff8ed782fe860c69e1f26c6f7030", + "0x2ffff87e5f6daeecf0c26dcd9904f0bb9340bcda9f47212afb2b9ae03887306e", + "0x71715f6c09d6aceb22801b5d203373d71def327f9344836ab1c4e9cf16c6a0d", + "0x231f8ee643bb6aec7b69cfbfa57377b47d0065043419696960e924965592f365", + "0x2ce74830c47891ca7b54dcac65e638236791097cab0f99b56bbd16cd11e67ee6", + "0x4269aa0168ba056cc1baf50a17d695507e19b4e35a0642fefad58fbd1c255c4", + "0xee542de8bea3dd40121986fb91fed4f7286155949de3269aecacf0aa3830ccc", + "0x211b6f7564ae10b5b03cdd17735e6a0077716267af245b24b7510518963c8ca6", + "0x25a33072ecf4b2ba1ae606d234ce1b1de79042ae78d6c31608dc24649cb3c195", + "0x265780190b8ded42c47662d84d2cf5c887775f9876b9f07f62235b40a3e44", + "0x227d73bf5602c0f9d833840c2ee1af4e978f5a2131a3f0278726495204db1b46", + "0x1bdac6e2a6bc07bfa5d41f0b188628b060391896adc017bf314d97f86e75b7d1", + "0x14d9df2d47da87d906707d2f5206e834d346d2014bdd6b6df573334b4cf4eb09", + "0x11c57264f2dcaebb4283a781c0adc83de39826c9b8daf81c09be4e2ac2d5ef4c", + "0x2b2c437283a6a4b90a3d07de4774524d15ddc7e71560b85b21fba69e92511489", + "0x19ea97240389276a0b402e612220cc904a436985d2caa3a7a3c3f8eb30faead1", + "0x1975499032cb96ac8d98f3d31eed475806ee1f5cf2758d88fc42c050aa466ab3", + "0xbcd14768cf7dcd6135d66e6264e516f71fe4f9a5c1cbc45782e955c7856c8f0", + "0x1f4af8d266632b632bff51b6fdbf66382bac03210860608334b64bfbc0eecd65", + "0x251137743124a92ca3012b47fbce63dff966674b58d27f7cbbc3e4091f57d2ad", + "0x1ef5e6e72bffc61a46083f80988ad056b22d84d57b6119127f558726137e9096", + "0x2f2bd1e53a2923cc764a99179da24f6c7e4c345894821586006ed4d0c85af92", + "0x15bd560629c2b851b4fa8cba448dfdc48e534a6edd2f4103d8ca2c613e6c2f96", + "0x5e13b6888209ea7dc9a22309d3ab9c12acbf6135376dff639987d6b74c248ee", + "0x24fee8c32393b828957e5119982e6f04d1472109c262aa53bc6b0db331f8e296", + "0x8716860bf11ada681302ce96170cfe59af12b9fc01f6fbec0a4359b1cec45f5", + "0x2e8d311d133e4d154fd79c1ee45be62176cf4ff35656f1a4bba43a1097b90321", + "0x54ebc5e9d618ea8d9cd57c81a9ae27d9b7595b4bd0a3696938b17bcb7b6e216", + "0x1119133b58ae6cc407352df18802e30e46b115efd9ddbf6f84561bcf21b4a52c", + "0x222cf69e4ab85772e053eb7aee81d4aaa74e3fd1f5a110993f9fd52d2b5662ef", + "0x1b756094acc5f63d6fbb4fb9c0c6297422e1a04d62b2bb4ca55eec260b5e53a7", + "0x211aca016c69d9ff94e9f5ecb5a4c49f51e4f9c3893daf3c02397eef56959a20", + "0xafd0730344714c562a2275f906dbd7b5aba07c6675534d71f82a445e5f57c48", + "0x1afec6631e46975c8b4ddb17fd9bb9f31170d74338bb99aadbac72c6480e9af4", + "0x16ae2f1653ce004532cac922ce99fcaaf8dd49175a61adbba1f1dc9f2d007dc2", + "0x19ec6163b89dfc26d9f35e1c38f5efa18f9b0dd66852c69ec4307b31882c5e50", + "0x1f405e23a0456708d51a80617c435e8115f7c14afbc41970e0adf354f616b43a", + "0xed2cd0cac1b40324c07380384cb8d90723d9f93ac7b50f370bde275082048d3", + "0x5dfbd5d6b56610e5f3bfe5b2daeae85dc219ee698117abd1ac15826a7c58e92", + "0x115899941f8d6c0c9154a816382fa2fea1fef0c6abccc2a3d7888e67beddd9a9", + "0x78ddc3d42786277f229ed3e4c11565a76074edc0d60e14a00055f144cc1fdfd", + "0x22d24b84bb334636d7746180cb5453cf4fde47ff34542985bab51ccdde0fb91c", + "0x2aae8a6de3f0756d0804703a2ec4254c6e17d5d970f04d74c7a6d3760d000e4b", + "0x1867a426092ce54c34a34d02bef3f30a16ab65f59b47222edca7fd06c6b26d56", + "0x1c204359462f488d172b5f3f63403495f38814844c96c62008f28615994786b", + "0xed979120a15876b016bae8b4f23d0323561ce781dd0d3d4bd326a0de317618f", + "0x1bdd0d0426512631c74a4d571d2d3ebc7208d5b9a56640b0473423ce85a208b4", + "0x44f68212634702429cf99f1cd87ee2572909456e967fbb50b0c1d6fe6c5d360", + "0x814e3c893ebdc6ca925d1dc3bc2d426dc0b58329a6030f4cfd74abe5255ab27", + "0x229cd089a0d7cacc59faf3dff7c081ab31698b2d9215776f8a4568651f74de79", + "0x2646a116b3027c4b2d7a8495968376650321893115abc6896d08023a1ba1f765", + "0xa64ca3b2116caf5a1a35bea139e43e385d82c666af4e3b384840e038870dd13", + "0xf50a7d5c0cd08f45c4d42a7f8184df41b42d28ed856b9230d505330eb5500f3", + "0x1932b09a007479e549393ec52ed68e4093cbd88e2dfa2812b83c7f3872c30a17" +}; + +static const std::string mds_matrix_2[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 56; +int alpha_3 = 5; + +static const std::string rounds_constants_3[] = { + "0x1502d570c6562c6b1c3352df2e3573bf30a64a9e8c0b079118a20fbcb5a24c2", + "0x167abf38b498fd9dcac6ba7dcf40224f0291d840c3fb9371f1873745819a4548", + "0x10f018211d9864913d276ebc9625be3ead44f46feb79ed726bf220daba181141", + "0x20414817ad499aad4feaebf7f26a7ca28161ddb4b69a10362064967da086f3f7", + "0x3722ea87b1805b6cb0d7dfd144fd1d458e02a7790d50272a2f0f25f01a5cd48", + "0x111f0718b67e0ac0fc68e98f50e34ac9108007f89b0f7f7f0541971740b50406", + "0x13d6a76050bbc8ea48f6d624d9e9121a8552a727669bb12e519d244f355eb8ae", + "0x13fadba1a7d4a87645c97ad260462d40625f3db0fbf5443d35819863e7f65b8", + "0x1f74036f1fd032282041d46c343fe9ce0f145a1ac90ca0f803c2f3d1bef331fd", + "0x1ba0d87e7239056e84867e219c731f388dfff32de955a24d617c2ab1d30a8522", + "0x218ea6d251b1217c06bf9bf63acb7f69088e6a56b34eb9944ef0d17e41de3257", + "0x20da09128aff42e6b64aa32af6c3ac66c8b9a6ff55edf8e86dbbcf1a694ca5fb", + "0x162c5fa294e24bff09916ee3b3174d6a3083096fd4eea9a590467112b9d09423", + "0x288d03a625792a7052e4aad38cc37ef1d8c33bc91739fa111ec978a392bf7009", + "0x2de866a50e0dfc93086a4d0b1e0c496b1caa0a43a617d6f19befda867131966c", + "0xb6cf48e60781256cd82b622febd210aeddce0e60a3420754444f2c15ab06035", + "0x2e798b5a1a7bc757f006dfc3c72cb1cb87cc4606678bb185bb927ec096733dc", + "0x186a83afd9f2983b3fe8833d2bf9c95353a909d5baca68287be4650eb3a7a90b", + "0x11538894bca49fd2c6082507ad0c63addd6cc91dfe5ac235df524a7bac18ae09", + "0xca437f7175f2d2c6da733e93040f4e94354741483a442a1264ee2a266426140", + "0x6d9bf52d4c683bc27c2aa2d1c08f69e3f7adf083fcb0e72a085654d3906ad4f", + "0xe8d14e39b934cf421fe783445c70deb908945a7f40372606e7d69b47c3585d3", + "0x1c1d3c0d866fb9318dce2691dce371a35fdeb4d48f99e717b1857d1afa16d94a", + "0xeed19dff0526f2f7c5ecc1d14ce5992bf7c5daa4d88d2a6ff73e809334d79bc", + "0x291eb11bb1a8999bbd5a5334771c954770a4a8cb30ed023fd6b9eb6092845437", + "0x16dd717f2343bc029b6dd4f11317bb493d58bee193afaa95efd278cd2ff525ce", + "0x2fb8f9b19f1bcf172052a7882b5814826f7ca5db3db06450af4a181a22a30fa4", + "0xfe45980ff4a7e92bf7c1bbcc6c91bc9720c890316c544a040805dbcfcf76fc8", + "0x2ecd010e54a007ada77902fb06b8589cd2bc9edd6a71a4958314eb1c025baa43", + "0xbfde15793c534c207f26dfbcd57cfad01ec104a00e0afa544def9758d51f7be", + "0x35157b3ae4e78b8eb32c0f2361a41197c553bf810fbc8db6c7b8f6a4345e75", + "0xb57f1a6422b845a9e31e8530e7ac6dabcf3e885b60c1a2d6d3ff08843dfecd5", + "0x1dfbddea625b28b772444c7ab5c5563c58b7e648fab9cf33437a9aa6641ca92f", + "0x1387198482b4d3f5c6628da312d1afaea7dfbddc6f58ad8070af99297f6c9e69", + "0x836734a2111081b43a55c16be4f302a3dd693825126752a70648b5495a24d", + "0xb5c03680c42dd4d87f491896c7e433dc1c85047b1567c806803759024fd1e41", + "0x22a7c4037c6a549d346ccb6dff44f03c0983e11efed948e4fadd1342bdd7612e", + "0x241da8f37b1ff87f44bb8bb1ec50b59cf76f98d62b205ebbe91908fe4b99f0a1", + "0xdac76594ed727c7e8fb53b12388c28632b016c26f7b260b0f138372c6ecfdc7", + "0x2e456adf5d790067a365c89a5b6a9d90a85c5f0d7d7884b0b14e327ee2bcc883", + "0x1fa7dee7f17c5f8593b4ee9aaacecf5952d3fa9435724b67d875830bbc72706a", + "0x282a8e09619fc8c371f7325ba0a08141ef90f355b188f50b5ab935e607c573b3", + "0xb7d91f32b16c1b3548ed24851ee6d17d51c9007eadfcd1bd77f42000e0a835c", + "0x1ab9480de6a0a917822969f071055c766c2552ba0955bf4b2f0b4626709f8321", + "0x24a3614b60068b85476f18d38c70e529c1ee48e4d7ce597b87f2652d04a35cdd", + "0x260fdd24b4543f7d7030e09e5353f018c5c0ce54cd05cb49c498ba4a29600bf4", + "0x15e645c10a2b992d4127d253e426dcd28aaeea372e50b7783a5318265a5dcd99", + "0x197e2fe3a227f8c9801ba7371b704a6fe8098ab9ccffd50e1a48990760528a75", + "0x188219503a5996961dc0324e3e08ac6c234f32bb631fc17ce9fd4471ba098260", + "0xb1221f5824ecb41cacd7f13c31bb6e3f3ceb0a2852e6025bda0caedf7cbf4fe", + "0x2d43c15e98ba42d630f39ae17016892b28843d6f98d5936b49f7dae92d1c4ec9", + "0x26f749d475624c0e65cd9be4a387a09e8dc9ac4565b23e74b0bf2fc87081d265", + "0x9367fa5292715015c2a96f5848d7b8a334c5b6952162d89b3acdd482b30fabf", + "0x1851a0b3c1a98a2a7edca2380f51d01489bfd889e1b27dea9ce1213df7aaef31", + "0x2c211374462fd3fa1157fdbfbc893c55cd77fbc09bdf0b4a71dc1ba879ffae66", + "0x82657a3c44a5e0e42132775b2084100067c7225a3021d9f3016de5bef44ef1a", + "0x15616ecbc93584fbe4a5b6c7c9ea1391018ae949d526d42af5b14388af046dd6", + "0x2926e61a53bee88784e64c945df345263c02696bcdb23871392a3807ef92c30f", + "0x117e63941d180a7a93c84f9ec00abc898168f3bee13ea8c4eee4a6620e20566a", + "0x2f4f567ca4312b2c46034b2efaec0537c89002e0d907a41b295126ccf84681e2", + "0x2dbd2630ebd37f9aeeea6147a8daa6935370f6b68374c6e6bcdfb1ee449fbec7", + "0x8bf700741bc9626dfbc0750d1782551d9d63f78156d32546b7e7516ec51603c", + "0x1a1623325e5cbfcae9bf81e7c0e8d7663ddc56804f19a92d99fb20b0ead2c5d7", + "0xda6ea2539e078ca7baee50a9357fe8229f100bccf732ae377458252fb6f0cc9", + "0x1eca30fd9047aeaab7e8af9b6a0a391110f49f2a4ae2353e0f90434ab871cae2", + "0x496186f4cd1870b10f5af559f07b96bb494329fed151009e18da5fb883de143", + "0x5870973dbc2d5233ff2395e8a58a4afac58a280bed15cf5d4df32b89a0c0310", + "0x57ee2f3977df7a718de8844843551c6361a06895fc0ba4b1e35125ee4f21a2a", + "0x14dfd0eda15633dff6056ac269407eecc1afa88be4434dbce97ecceced611673", + "0x27e1d62bfa4458b41f19584509117f2c7ee58f35d92a49c3890cb6ab02a65352", + "0x92dea1337234fff266f177d50bb0e72bd59aad3e1e58cd9c5fbbc4ad44c9ef5", + "0x24689c4637445b8e6deda694121885694c5e2edd6211cf8cf1bbf0a500395b42", + "0x2449481c1875727832b03ba5c2dd7ae9a879d8ee1f9d9d19a3f8656692c44e0f", + "0xf53923d4dfb457cff0ed3f0bed91fb48cd6436811237a9beab30048ff169569", + "0x6d1836ebabdf9476a4a9b0b73f07036af1ebcf965d691e6717a549500c06945", + "0xe2bfa007499111879dbda725928bc543a8da7dd91ff94abeedc2fa320bbd68d", + "0xc7de8c96d2b61d1253932bad71c4d3491a4dd6dd61bff02b0250bc39d53a694", + "0x154af7a1f0e24ee4bcc1b52a8451eeacd9237f903ee0142da68c25c71c5348e3", + "0x2595cb4884e6e30328b9d8d6253e7c1484cd1d6360e2763af182d48ebe251c61", + "0x6700876268b3ec5beb0d5cfe46557685236932f7306115a6107e3687d0a786a" +}; + +static const std::string mds_matrix_3[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 56; +int alpha_4 = 5; + +static const std::string rounds_constants_4[] = { + "0x2db58b792da347e5a229b4af94e6511535f3c4660ec7d30168090643cb366b7b", + "0xf88b2987e2dd38b90b43b6e6fb199ffe07e743070fd2b35a5ab6d2563945c23", + "0x963ddbbe15b61a1e643e6d0189381b7157d8dad5b84f7e6d3a8eea811af9230", + "0x118e5811a72858fa34679534b286564e4f8f2fbfd7cd43f6318d0557ddc80c61", + "0x29849772b4edc2413c9bf304a259bad72090e5e5e7ae338c613f908d7499b00c", + "0x32b52f308fa98c1eee3c68c9b950c3145760da195f7095102a0b41b15a2bd71", + "0x11e2db878f29e9c5e2ca650c83f8bc027f5af00c770cb22b9ebf04acb2943c60", + "0x23a5fafe06ac3908668f2f559244ccf9965a47e2e6058379f45f7294f30643d2", + "0x8d1ea781ede3553643cf036b46477c416fc4af2119f02426a6748f02b0b19a7", + "0x5ea1f2bf1c924f2bd82fb46d4715f867813e562316df64c609fe1f9eb8da7de", + "0x28177c6185560a7c4d55c5dd9f9d55aa66203143143222f34d73cfc82729b3f8", + "0x2ef239282b5315f33dba1575994c0c9b1fb80b0e23bf9cdf83f3fbf24daba017", + "0x73a5512842f01b9513e7a9fe9e0ff568b12233f8ae77cb231d664a81cee3aee", + "0xa70ed5c8b667f7e9142c05720f8b73ab0e813ec582557d85b8f9c00aac2bc2b", + "0x7817d9498c4cead96a12ccb885b72a8525042fcbcacb020e5ff3121c3c86e1", + "0x1b80150a716d6bb010bd5e9f44475051635b0a5bd2b2f5812b241d8be211e007", + "0x1af15a8adb4bc387f2dd5064e5cde8ce78503c87910e85eace9659eebb93af3f", + "0x2109db9f0331e97c4f1b2a58b57347314918b637b0b6514f743665fd7f7dfe77", + "0x795a356e581bcb64d00ba29596202f39b9fcb282a1becf13c9c17936f957bc0", + "0x1aadcf9f5973efa3a60a1eb1fa1cf31939035b9910c2df95c5b4eccf228394a3", + "0x2d05a02cc2ce2797dc3888702b240e64ddc3c68fcc5e16be5d999a513200337b", + "0x5718b2397df1fa3ca6fa3cf438286a3d5919fa97440e3db71bc7ed1d2fbef1d", + "0x12c4df589c0f30ba1ef55465560039b22719d339080ddba7f09bcb819360894a", + "0x18cd4b047593ac5fe382b63f141c71810727a81fa3785c62bf0d52e2960f48d3", + "0x2147a778f6f5c44757f469b14ce50e19718abbbad39a385833317469bbac1bf2", + "0x1af0eddc089e721f536ce58cb7b8be7f7b8b86ce0036262734d45cc1d2e8deb9", + "0x1f06c71b9f203958d02c937a319990d51775f2d7f8879387675b6f9be32bb54a", + "0x260312e62ba382a0968b1fa51f7106c9b94dcb08fe83b449ccc2e41af982fc56", + "0x1ebf66ab1dfb58943cc462518176462ff55bf65747f2371b1eb04e0a94917626", + "0x2acbe47f365414a3093673efc042906e30b28b53b6aa4554373e038cd99159f4", + "0x5265daeb61595fc739db490c32947a3aef1894dd7cbed5fb0f99c64db51e10a", + "0x2fd5a0074af9fab7e8db65bc50023bafac741815d9150ae278d1bbfbf95a7ff7", + "0xfa2a7573bd802bf5c21243e3ab6be0f7e7713dcd5a4c576ca0eb44562a353a4", + "0x236feca10449162e7ac5898aece8dbca993e7792275b8b13f36551258ce4f76d", + "0x1594708ab5c6d1183aec5792e2475b1e21ec775328f633a6fb00eec71dafb80f", + "0x1bcb2a6c38667e60f6cec3b5f4053977532b4910f54daaf746b0dd9074eca4ec", + "0x516db83ed16c4c0097aeafb89d077eee082b7b5e159a57d94c45a6e52d16660", + "0x16d6e28c981c912af824e31373186061260414a857b38a014f0c3bc06ccb2d83", + "0x118e6898133e3a19549db72e84977530ecfba62fba60a6dcf91ccba97cd5a231", + "0x7f5a2b8886f53be6c110d499186a119d514676ef7c5e0e5036e04a04a76f278", + "0x6740d212376f72d8f4271cf5448f225e0e9995dc3134403bf1022eecde50625", + "0x1d02f4e23eb851b4684dc038b94b7461301426f12dd3946de3fb5b7d72cabcb6", + "0x2e9ac8c39a4433d79f9acab082934dde85e9b086054987d3904261e8799fe1f4", + "0x1896d9f64d51826b8621cc784bb9185d1527d69e5c3ff7e0e9e493229fa25088", + "0x25684078ff5914b8aed1e046fd254503b104e7a5a20ea1a3f3255ac65aa25ef2", + "0x2af4cec1acd91ff2f49abf0554529889dfb4fe5395b4d403ed79c54c05194cc2", + "0x6a284c32c0883e5ad96848cd74c75b6eb29a3085fc69eff6cd470325b404db0", + "0x494ae7409eb7ba843c1fb4dd8f76a41cac0844fc52e3d1bc419bcb15ee528ab", + "0x2f64d6bd4344bc116d0b1fe45ee7b8229ada279ee2085c75e36f06e49ba13c2b", + "0x17d4575c01da23d5c98d42aade3a0e5890c14c3d6cb7151843bbc3ff30722b2d", + "0x8c49efc4930387683337ec9e531dc5adba4323bb694402ce0fe58cefc62bc4e", + "0x4766cf93c2f3129241a479848c848d2c3f95522238f3cea4a3b894f531dfa29", + "0x283c44e3868a76b0ab0ec3f268b0400d1adb2670829f2146049cee47513b1fe7", + "0x25c633259831439397ad38c3a95f1ee843d1f8f4f9f67b4c053ec4a80501e9f9", + "0x2db21bb9e475c44e7d8b324cfbdb5d5f89506d26a9ed6cecd139db274fcef296", + "0xc79996a68e9d7326c38df3020ea91b5b502cb0c33c951089bb3bf76c59dfbe3", + "0xd0250007007b78cdde0461150143ebc6c1e5ab9d74078956cc584ea4a5f8604", + "0x1d81742ddd17639e6535fb11e13450e0bd501d2be80b634cac4feb6282b6cf53", + "0x167b959f10acf38807727443e4b02af3378e14466f3c6041b4c08196327a5402", + "0x159bcf8445316e248c7522d7eeb3cd02fb75ea623ddc891297b3aeb539377126", + "0x149773bb603755ec4b6c9563518caae7f669d2d046cba660047f5bb1e85734f3", + "0x22807893ca8ad71812f60a876133ef838644ecc6ac36f96f132f1c34df0f1b99", + "0x1bc2d2b3c3aeee6b4dd5a92e5ba04e0c8852b73058c0e08dc43624c3abcfccf7", + "0x117ce37c6c03ca1e86db1c697c17bd898e0d1bd7bba596f24bdea30ecd5aaff9", + "0x2d6636636183b45c739ab87c91b797df0c23f2dd23d8a3e76f9199181bf90273", + "0x29e0c878742cc1518c53312f37b5084e7511b03b8c96f1c2db69b741fa042014", + "0x17c3ced2870d44689e6de7ff8dc0cc710458ce463698e14a1524e02a8658e3bc", + "0x7707666ae492722309611f41dc583cdf65e69ffb9c91373fe29c7c5864fee94", + "0x2d15d69d35175f20d306595e17cc6f64d3410285cc2cef545da9e62275bc67f", + "0x54806259dc1c7bcfff2af835e261d9c42166dc0432c4c95e52ff91bef832a86", + "0xa99fbfbe66168557e948f0af6bfeb532acc12dac1ab115875842dc126947640", + "0x2bcc0f4dcdb30e5ac3e734fc70d35dad80e4d3817e8f8dc7cf0e4a0eea29867f", + "0x23e05c1d49a2d25ba415d6a840f9c52435288789d85bb89510b09d51e44bf743", + "0x8ecba3639df5207154e220d58ec4b994ff2576cca3a3aa3f2ea80dfff635927", + "0x19a25559c2f9e312b3ffc1987dd65067dd13bf85d7f1d104d61b1e576558a43", + "0x3757b9be7dcdf2e0fe25a97ba4edf1977c1853409c5a4f17f3447fa3a2bed63", + "0x11769d7ee77c89010e244ebf634dbed228fa0ff1a4af43eccdcaa28a52ec09bd", + "0x21a17528de1a187c5665e655591b9c9f11ca63a9b4defcdf019375f482aa2a53", + "0x2465cdfef4f15b7e7c64e888033881ff8a79e8917bd4dbbd5832d3d3a818f90f", + "0x27598db73d73f6c3cbc2eef5470783f5c7ae02c82ab71c2f3abd3ef4f175d148", + "0x21e2b234f5b5140e120529d5e740db7126564743eff39b7e4c3e539ef1710457", + "0x687de49e299450f767227a65924fb7a893d519c646dc4c99ec0f4a4a7bfdbf5", + "0x8549d04e68ead6fc3a9069322c18bb337a568fe30b88740d3ea7cc38996c941", + "0x13a75a069c6d01c9d81d534065d9fe40df45622753f4dcf2177fadfb1b222e50", + "0x14e6ffcdcb2b2558dc5c5b496dd15b06a63a5f272ffad9f32aa3cb9fc0401fc4", + "0x290f54201f852964086eeef4083017987dbf2c17129208201f2b70080d983b18", + "0x18e5a3dcfcd938912d9818cafd1f8d6f4c82e34d50bd2d754e8fa700dbffa08e", + "0x4e8d2fa7ae1fcfb813bf04ae91e29870bd33dbc39e9e7a3733a2132cdf804cf" +}; + +static const std::string mds_matrix_4[] = { + "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", + "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0x4b359869eae2dca4a1f1a78ec6583860b9946e8092da09d0c369d721d0a413c", "0x14df0795e0d85308e365161aef4df7521a931f5d9e31860c05b53f1404b02956", "0x16e00a8aa357043fb60c7f8062baa7be2a4bba7014186f3acbf816a35157e273", "0x22a977d8649c849e9797f06667bfaa172cfa49a584c709a347a606d6981ff608" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 57; +int alpha_8 = 5; + +static const std::string rounds_constants_8[] = { + "0x8ec656cf3897a24ccc50b44a5213416af0a77566e1f55c0e9f0970362367222", + "0x2f83945b10e01abb51381b106999666f65ec0ffaa0e73aef17a8ab149e95a1ac", + "0x16d4a15e56bb0f1dec311980677cab0e2bcc9c1973b2236411946d28530d12d7", + "0x2e8a5970187cfb5d9b2320027b16ade955077042c9881a1c174c88b8409bb1f0", + "0x325dc189d83d2d1cb0a12f58bb2a624444fd6cea86742adf6f2da4ab7a05213", + "0x15a086b8c33803cfe55e5486ffb81356d9e662f2566b4d781a03cfe39a217d90", + "0x3073b02a3e707065cfb7b58cc69d1a96f3e98adfc56597d4e55cba01cd9d989", + "0x2ea459f9bbf435508353534df95f4df9123c80e12d95fe1f9f71ff52e816d6cf", + "0x35d444b122062b3c5c8f49a27ccc8ff1487c46168b49151fc3f00c85e3c1ede", + "0x9c22e8b33386acf90888a67c0b7e68692833e5d3a5527c39b8a89faae00e2af", + "0x1d98b706c3f58b924387a899d47aa12b037ba159a30934a86c8ee1626e64cc3f", + "0x1a11a9b17beea9e7ce502c5876d821f84f24c8bf8ab731c9dcf89e49e7963542", + "0x53008085577785a67632ce97845136b568d34a38914ad478ffc6e3ca6d0ecea", + "0x3c13241e0afa500041d4f3b01dff05c5b08ae9eeb1fbe3380e4e61e02423dd9", + "0x1abd46e91d4471b82f19f4ea4e605d318fd2d470244b5f850aff99147b2a71b4", + "0x157c8f60017364ade29b48a4b6d772205deddedae8f92a5c8619691c5867e477", + "0x13656e4d4c87bd2bc7da3e13397b75e3326779478daebf65c28db6949859963f", + "0x19f1be5a3caad77c8d2a61946a9c6ac37f05dcf464b84a6e89c79992361ebdc8", + "0x9786adce2fbcb7a5c9a5fc25bb344d34601811b86851e3e838cc456f64fad56", + "0x218446342f8e04bb7a1a76b3b04593d0d90e9a9d56d284a39cb564bdde322cb6", + "0x243c10eba70ac07fc1acfdbdd9e3f24ef37e8a290feded49d95b16b5b957c4bf", + "0x2d0236a130e01cf553508485376f70f9428239d0fe2aecff066a33f020a2bb80", + "0x25fb3848618154840260d1e89f4a15bb5fd8c31d059dfb073829c4d0f419bb29", + "0x189e9cba0746e1d0163abec0c725f39fd5945ec4fff2b3fe5366671d9c913cf5", + "0x13e573b615d0dae0406f81c8349f31c5cb4691665928c42a2a510d8a8f4c710f", + "0xf07e4426c59b3a0b843e25197a98744c25970cd1a8b898d92def78b471420b9", + "0x1f07a080929eeeab0a96f5b48f6337859b6efb1d2e2fbf2c1d4f3a0085da655e", + "0x2bd6b3d6e06066d15af96a8c1da7c559b76f355709ba71ef42881aebb72b58bf", + "0x29af62961505ac17492fa58413c03a9eb8016ce47626c17f6b6d2c77cde1bde", + "0x1d35627d447f89be473a74ce8ae588fed4841711446b6d070db44bdd88e79f7f", + "0x2f4db67833655ab37524cc780c1bbe8bc976d20dcddf243deeff7390a017d2d1", + "0xcd1974d778e64b013e730901a15a5f0872e136e416279f933fe31efc8b9ecdf", + "0x2a3377fd7508997a449c1ade2b6001c44208215b5343e5d6dd5f71ed9e52640", + "0x1d4e08ab4a33a2493c5dcf33400bbc3c4ea5f47fdb50cdd4cccf4011f32cc824", + "0x2c47754a40f72e169bc8c7fee7a32d50b1430f21af245de8b7423d8515ab5b5", + "0x628748bae689cb476f109fb2ff844e05b2484d5729ca2226ed3086dfb324114", + "0x1233a5fb79c8a6ee39a5f033e5515b44f9dee2a0d85bdbc21e52d0375046d62", + "0x1a2d7d2d048a900e480ceb633003ac02af905f17faf5481a09b46c3084537695", + "0x1ce2305d4b39a60c8ad32d1d7faa1ca8e4dfadcf38e09c9c46b88c04667d1b60", + "0x2e0b3503ff52a9ec75cf17da5aff7aed02cd55047468f4a653f2b60f8869dfa8", + "0x1aea12bd2fff8235d2b155598f5e71375bf4d7fe2d04135de682ef781701e091", + "0x13aec782a678e1665cf7e49c48f6036e876fa681bb9e7665ffb6ec3a68a4f29e", + "0x2a9f0bd70f22298944e2412abe9147a6dc16112bc47bc0b2d3f087d294bea5ae", + "0x348a907cc3685a7dd3a9c1dbe6899ca1bdef322ccc41aca4a4d7118f3f9032d", + "0x185bb694e8b8ce30cd20799f52b9e5d3c48d6d9d1c82604a9ed9aa358586be6a", + "0x1baf5e6981bba1b62b7583177a25bc77a0769f8ef78e34f5a7bf9fcb9fe333f3", + "0x8b9c2a9ceb221a8a4cc584451118b454dbdb4deceef2f2f95c32f0ab51f1d39", + "0x2d36e9722092fba4a477cea8d8b0899959dafb84c489c34617f25f4a77dc2a3", + "0x162c88279522e09663ba21ec46c7ab7dc3b202b2f6dc5c35fc4f4222569fd641", + "0x1f5bf1f924b1abe7dd3c3d2264d325083a6f2e770e40a7808c65988f736d9786", + "0x2643ee9cacac81a71db364e7e6e7106e58c0d740439ed78d2c3dba5ce8a03e81", + "0x24c8fd9dbcbe861599cd50ffe88033a56d54981d7b5d51fcbb858cd0961df69d", + "0xf49a66b5566a2b9c3d3d1c6a0734c297b375d57711cc7101915b2bb774bd78d", + "0x2852226428b79c36d38d98a5681f74e5f3c0d398d148f1f3e31761287013c0e2", + "0x18a93bb897b00ca2e5968f38bd6b8035bce5cbf651c06e2ff9851de343ef6c2f", + "0xa3343743ddc7a9281a6981e3a228ab87c09c0e3104b0a5a9972e60ebe449a5c", + "0x27a0e63ba6f50bb6806823824ab1a417a45ccd57f11a2e8a83228dc82c132edd", + "0x13ad8148a835d2bda32ba0ffbe2c636b649b4a9115775f158a4aba1ee7b5670c", + "0x2482e5b41920d323bf3fb101e292fef2a786fbaa3f048dab79bc812f278950d8", + "0xeda1f34d4b6d559df68ac1231431aa27a2118570edcd7aee27534cc1b646825", + "0x17da0150cc9448d7ee1e97c91fc9d939d3593c3aa603200022385a6bee408b68", + "0x1861b2a1eebcc9e67b6385e87c4cce8dd4e034660f21be5cf9b3ee276537c054", + "0x22c96055ab0708b2e0c82b518c4d5d4b25298ca2f9784d67d9ef279118abf957", + "0x28a478edff9b8a353d267d1785e329674f5937e94724611c78f61787e92121da", + "0x16a5bc22003a7323162b3a98cf7d318f201b433997dd52aa224bdc39e8fe59b9", + "0x24e6951682676fc09699ce8e2fc065a0d8bdc352a1f27dc7a362e74a1360631b", + "0x1aa21604de241c67475d7a86cac977d8610e5269bce78ca701a88d9c3adaed99", + "0x13e99883380a4727f46ea81c94f8c5feaba085f30c6ef1777be3eedfeee931d0", + "0x2bb2674f8a4e9a925bc741ff5147b969df26221603cbc78527bb7f8cc5b4a27a", + "0x28a40143087c429d582f3084a9d9f6662b77a95169f302548718e7a03f43c3ba", + "0x174253fe36a6dec3393190dde5108cfc1fbe1dbab9633573c2c9a61c2b4c6f80", + "0x1a1be05afde678f5d0bac89415c1b7a6b7eab1a90b256c93ff12117199ccfe52", + "0x560461756f616d34684a6e3ac8fcca7e86ecb1f69f782ad5ecd2bad72556524", + "0x3cbc47c027d568e1abd6c9f2c713a8bef74a666b5379d7b1de3a46c61e47619", + "0x4542c11586f31cb0ffbd81ec46558afd3f36a964afe05108059f323611251ef", + "0x2d5761c22b6778396bb14639e93aca3e709857b19695a530c9a2ab2a84423337", + "0xe22fdb50b7dddb042fcd2a4599eef3adf4f1e64cf8cafc43ab1f96a8d056d6a", + "0x839b8fdb0f6279b6f3c80bfd4a139bbdd3b1ba4e4fda0dff04e342c483a2b71", + "0x5419066f6b9d153d93cd924a47bb10f2a85744ab4e576c476bdab9365ad6a4c", + "0x2d3424256aed1fd4f72f62e4ba76f3c180540666b236598c9e093148fd2ff069", + "0x233164d449ac77bbcec9eab9e04cd2cdddadc96f3bebeb82a7313355106926a4", + "0x15430491a0e32a1f7f338bd7eb417833082e1376e5ca65c819dd46fe3647cb35", + "0x129f58dd69ce4744c7c8d7655d9ba03ebd5ca74527e0fb74fc64f047620b8871", + "0x976dd55c9c320a98819c84e063daa2294166028839005a5bb65a76af3385134", + "0x2f82201fbd0bdfed52c2f52e6e5db8f54807b3c11e41261e055c8706d5cd49c4", + "0xb43e36618d9654431f8a13f1dfe225490e41b4ce3511a469f2b207d7e1ac347", + "0xa245161b1e460c6631d6611e4e2fca3c3b75746d7db4a4aaedd816d8037dc0a", + "0x61b4e01fc94fc81e8074148bde788c57d6a6a00856f52c303af47e55e36fc96", + "0x499c365dfc8c129c73b84dd267ef00b0842d4bbe7839320c222ff0ee79566d1", + "0x29ed55abb47473e5b432fe2c8e73912819290bd22b2fc29b5cb3f77fe3b9254d", + "0x3a66bcb257774a3c90437ade25832061d40da69a9087dda63f34541b5b7ece2", + "0x2f008a1c1bb669afdd63db1541f64656c54ce63619ff8c4d2d1213b774d3ddac", + "0x13fb02a25934569afec0bcd5bd441cdb63dd6bbbd40138afd7d9c26fa5eb3a40", + "0x25394ecfd19f19143268bf890400aef8996bc1238898bbc396d027479fd73545", + "0x1d7b6e972ee3baa43f478a6aaf1d640eb7b3a29bf75abd13e92a6fd349cc6c20", + "0x19c952c5dbf3f59695173c241cae807efa98923edbd8d40b0eb1978c6d11a211", + "0xb9557aaebe094e360b279129ea1930fa8043e6086b857c28b9d68444a2745bf", + "0x38425a5b49e41a3c14cb4da3cfd9cc47f098d9ef810ae287aa9ab02e4191f58", + "0x302acd7c205e3fe3e23f60a80e3aaf94e63f0edbd0657bb47ea47806ad886de6", + "0x7d8e1998b462df6daa3c77a3b152734b32c5c7d16616dbbaff6dac20b0228fe", + "0x2d1b2036828ec170d1890cfa10a813d7cf64bb2cb414894395c252a9232eb7f1", + "0x2cef1e96cce5f94552f315ff97bef4ed6e8076e255e80391c45aabb25aa4a734", + "0xf92a75da857ed314319f1ddb9c8708b372a4e8909c8056bc8403c5be168a9e6", + "0x313af2685b334b566da0b746a18eca7f024b42dadbfd36ed7a1791a4c5a1ed4", + "0x2aba8b85a31298d676cfdb3d8ffa5c365c86abbfa6d5daaf51673b12010162bc", + "0x1fb8df4a46e202d679e7b990b533ff031c1bbac14a454b2fe955391802410fc7", + "0xb8944f53d458fa4fc3618b6def28e06ea77ff5338fd380decd70a8298fc747", + "0x26d191fdecbbcf39746d4f98ebaa4185e1175e2c279928311568c16091bbb627", + "0xaa666ddcc8590642a3337785539ca82dd7f2e71e3b0304889c40afd044e7eed", + "0x186481cd752a5770a184a4d361e23670114cc148b2ad04c3c696f2b8a6536b9c", + "0x2674c1e255fb1c6a9263260f91279a8c9cc47402259d45378c1fc8ec6d6840fa", + "0x2bf5b87335ad778f07dffb821c49b57ae099bb381986a43a32eebc2a527c51df", + "0x2c8e644baed23acc891b8111a651134f5d38cd72719db51c1ddeeeaa29fd8cc", + "0x748418b0da5d57160b12dd8aa5e212674ce2df9426d26536c27ed1491b26fe1", + "0xcc3776595650b2ff704bf807dbf94bc774509a9de6f7f5f7f6a3e958ed3ce40", + "0x109a13a91abb4c99178f2da1d5424299e67f12867346e1bf92397d0b6decbfc9", + "0xd7fed4d753e6950d109f6fab517217633f5783bf186999c754587519a7d8464", + "0x1082bb9f2aeebe50e65159188dbd118f3bf21932167744e659a4250ceecd512b", + "0x24be293fabb006b8f5e8df054aa6ad3c7ff8ad797494a95c60e2f6e235a2b675", + "0x36cda2a198eb0718c8be9970a8f578df5f5d7c877950880966240d16fef1cdc", + "0x5fec0d4e067ec975aa83b99d814830176bc039dd0b37f14bf4fe2b565cfda4" +}; + +static const std::string mds_matrix_8[] = { + "0xae8042a907adde1a3ec75bb6c6e833f4e6d969db238b6d3f258e2d701a72365", "0x18f27bec2a82bd110a5b192ae4e7c96b58e681c6a7ffc211c5b62664c7363102", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", + "0x1c14ef83340fbe5eccdd46def0f28c5814f1d651eb8e167ba6ba871b8b1e1b3a", "0x2a1f6744ce179d8e334bea4e696bd2841f6ac17ae15521b97a17caa950ad28d7", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0xae8042a907adde1a3ec75bb6c6e833f4e6d969db238b6d3f258e2d701a72365", "0x18f27bec2a82bd110a5b192ae4e7c96b58e681c6a7ffc211c5b62664c7363102", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", + "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1c14ef83340fbe5eccdd46def0f28c5814f1d651eb8e167ba6ba871b8b1e1b3a", "0x2a1f6744ce179d8e334bea4e696bd2841f6ac17ae15521b97a17caa950ad28d7", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", + "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", "0xae8042a907adde1a3ec75bb6c6e833f4e6d969db238b6d3f258e2d701a72365", "0x18f27bec2a82bd110a5b192ae4e7c96b58e681c6a7ffc211c5b62664c7363102", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", + "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x1c14ef83340fbe5eccdd46def0f28c5814f1d651eb8e167ba6ba871b8b1e1b3a", "0x2a1f6744ce179d8e334bea4e696bd2841f6ac17ae15521b97a17caa950ad28d7", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0x2ed314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b", "0x1da6294eb8d63f05ae1e5db8f6f7edce72f780978d5540b0973cb776ed121056", "0xc793df615415e88852d8c957273e4b5ac7340e353ffe108e2db1332639b1881", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0xae8042a907adde1a3ec75bb6c6e833f4e6d969db238b6d3f258e2d701a72365", "0x18f27bec2a82bd110a5b192ae4e7c96b58e681c6a7ffc211c5b62664c7363102", + "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xf9bb18d1ece5fd647afba497e7ea7a2687e956e978e3572c3df73e9278302b9", "0xe0a77c19a07df2f666ea36f7879462c0a78eb28f5c70b3dd35d438dc58f0d9d", "0x2d41dadbd7a49edbf5ce180275769570db76160624e376235b1c2b601495130f", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1f37631a3d9cbfac8f5f7492fcfd4f44d0fd2add2f1c6ae587bee7d24f060572", "0x1c14ef83340fbe5eccdd46def0f28c5814f1d651eb8e167ba6ba871b8b1e1b3a", "0x2a1f6744ce179d8e334bea4e696bd2841f6ac17ae15521b97a17caa950ad28d7" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x1ac475fc32a1778f4c47aab6c1b8bda37ec289e3763b7f20c18979c6ddf31c5f", "0x143776cc7458d82602e21b5e959945b1a1e02c4fc3e169d371fe475008dec621", "0x8f17cd0794e7497fc89bb9aa833203af7fc9587891921a3e902213561373e0d", "0x9024993dffea0abf6f6a9c8379426d5c43e6be7e530bbc0362eccf0a675f927", "0x2aae9ed49ba953e8da34458867c3da21ef4565d4becbe4705127d7a20a399512", "0x26317feed27de528529fa85857b54d1f98f7a4b2baf37c476541a773b51fbc87", "0x1c32416e64001975517ef4b0393b611b34ba3e8100b2042a06f889f7063e31a2", "0xb1e98806318dd823069b492d1b39764ee94a0b85f30c37bfc210aa69b18dfa4" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_grumpkin { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/m31_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/m31_poseidon2.h index ccf566702..101f6c2e3 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/m31_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/m31_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef M31_POSEIDON2_H - #define M31_POSEIDON2_H +#define M31_POSEIDON2_H - #include +#include namespace poseidon2_constants_m31 { @@ -11,308 +11,1099 @@ namespace poseidon2_constants_m31 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 12; - int half_full_rounds_2 = 6; - int partial_rounds_2 = 25; - int alpha_2 = 5; - - static const std::string rounds_constants_2[] = { - "0x4c7e5ab4", "0x5981a113", "0x776aae0f", "0x23f3b647", "0x333f99a3", "0x78e2b909", "0x72457fd4", - "0x67fee18a", "0x749c1e5d", "0x20153da5", "0x288a369c", "0x39bb481a", "0x584d9033", "0x4fb38689", - "0x2769dac8", "0x1350c5c0", "0x31bde689", "0x4d399c82", "0x3151e4ba", "0x56c67c21", "0x12aeae36", - "0x7e7b0890", "0x28fc522c", "0x74766e76", "0x57d58330", "0x3414ea35", "0x38e5c441", "0x1e369712", - "0x15b6d9f3", "0x4808490a", "0xad3f306", "0x70dd4d9e", "0x47f5a80f", "0x670f0a7d", "0x69515f5", - "0x33e1c76b", "0x1388a4eb", "0x374f2db2", "0x648f79a", "0x3418c169", "0x60735181", "0x71035d19", - "0x561879af", "0x649d6193", "0x26fdb0a3", "0xa50811d", "0x1e91c913", "0x293bcdd9", "0x1dcdb10"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 12; - int half_full_rounds_3 = 6; - int partial_rounds_3 = 19; - int alpha_3 = 5; - - static const std::string rounds_constants_3[] = { - "0x6630420a", "0x6e77b6b5", "0x85badf3", "0x6d17b3c", "0x2d2ca8bb", "0x3e585d13", "0x7f96d29c", "0x2c60c89", - "0x3d73c75d", "0x44685392", "0x7545b9b7", "0x14abb4e4", "0x18bc8537", "0x204f93c1", "0x4081b364", "0x5cbe9f9b", - "0x7f9f90a1", "0x3cbf7bc2", "0x268a6eab", "0x6f243411", "0x2c7554f8", "0x5fab2c61", "0x111376ae", "0x2cfe0ebe", - "0x36b2e729", "0x29909ad3", "0x28b820d6", "0x54323e5d", "0x786e4d2e", "0x324f30d3", "0x65f93d17", "0x4f8c73b2", - "0x23d9fe34", "0x17909bd1", "0x74864a54", "0x7120da84", "0x4c238376", "0x28d0791e", "0x154f4ab1", "0x27cd497e", - "0x32d48f16", "0x5e68b6", "0x686a839b", "0x3c24c8fb", "0x530722d5", "0x23fe799a", "0x235dc05f", "0x1912a500", - "0x5bb5c2b0", "0x5742d7d7", "0x37477606", "0x1d600471", "0x427a8b2c", "0x7d89eccd", "0x378e1019"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 22; - int alpha_4 = 5; - - static const std::string rounds_constants_4[] = { - "0x16af2c22", "0x7804cd6b", "0x246e234a", "0x5dd3cd12", "0x321bfb5c", "0x5950358b", "0x7264a446", "0x78a0325e", - "0x56c502c1", "0x459d26df", "0x73a880e9", "0x41ec4bfe", "0x5543742f", "0x72f68275", "0x19ed08b1", "0x147cda79", - "0x637ee4ca", "0xad181b6", "0x6cba3e5", "0x6d19581a", "0x6e0ce518", "0x67ecfcba", "0x1338163a", "0x1b7388ed", - "0x33965b46", "0x4e8fa553", "0x305411f4", "0x58754ce7", "0x4380543d", "0x4f3f78ec", "0x7e2bafa9", "0x60e96f27", - "0x30158e74", "0x64dbacc0", "0x3516eedd", "0x200643cc", "0x714c3435", "0x35a7ae39", "0x22a8d380", "0x17b1c7b5", - "0x14588589", "0x6325321f", "0x18a12d4f", "0x1cd62c68", "0x1ef5bafc", "0x83f3012", "0x6e334dc0", "0x590d574d", - "0x14213a07", "0x74c3e1c4", "0x4b7fc4bd", "0x3a29253d", "0x14b8230", "0x13228033"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = {"0xf15107d", "0x4628fa65", "0x254112b9", "0x8a004cc"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 13; - int alpha_8 = 5; - - static const std::string rounds_constants_8[] = { - "0x12910754", "0x36ed49be", "0x7c97497", "0x40d71fed", "0x2dee313c", "0x26de4470", "0x5d7a5ae2", "0x1f1e33ff", - "0x13c00c61", "0xcc4e3f6", "0x54c32ba0", "0x4c77e54a", "0x7951cd04", "0x4c05faa2", "0x6e479da0", "0x38117730", - "0x7374c4ce", "0x50281aea", "0x48232e55", "0x36539d1e", "0x5e5a4ac1", "0x77ea4408", "0x1cefa067", "0x9ce05ef", - "0x26d24c81", "0x4c873b15", "0x77d2ea65", "0x56b28bb3", "0x2b2b9f8c", "0x4a57e3f9", "0x32c445a7", "0x782f41c7", - "0x6c205891", "0x67503f5e", "0x756c593f", "0x462479a", "0x4271c9ca", "0x4d1af3ce", "0x180e9999", "0x25328db", - "0x398b8c99", "0x3f4755c", "0x68c74b5f", "0x5f548c81", "0x737a627f", "0x6177ee3d", "0x487567c7", "0x67f94f4", - "0x2cd1087d", "0x304d9054", "0x490e2bab", "0x5c659e18", "0x7c47cce3", "0x61a387b5", "0x3857def0", "0x2624467f", - "0x7ef53cc8", "0x1d2ad358", "0x796caff2", "0x10eac4fd", "0x7f4b54a5", "0x35086d00", "0x41b5005f", "0x49ab9f3e", - "0x7d0cf6fe", "0x13904839", "0x67dc28cd", "0x28322a3b", "0x291d6b95", "0x4b5e6304", "0x5e4b793f", "0x1c3de5d4", - "0x52cd150e", "0x7852055b", "0x3f71122b", "0x408ba008", "0x76d7ded9"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = {"0x3128b57", "0x4d7d3aff", "0x350942ab", "0x2ea8c3ee", - "0x5ce80b49", "0x765afd81", "0x198f06fc", "0x7c1b2a17"}; - - int full_rounds_12 = 8; - int half_full_rounds_12 = 4; - int partial_rounds_12 = 12; - int alpha_12 = 5; - - static const std::string rounds_constants_12[] = { - "0x68b6c0e0", "0x4ec257b5", "0x50d9f348", "0x2234cb53", "0x4e4b9ee", "0x305981fe", "0x3352aef9", "0x1c3c33a2", - "0x7aacf58a", "0x6cba897", "0x7af46fc0", "0x51e5eb08", "0x94c6e20", "0x61460e39", "0x693211b7", "0x18cab2e2", - "0x5ab3d0e", "0x61c0b778", "0x7ff68d71", "0x7eedb35c", "0x61ba0c6", "0x26634770", "0x3f0102a4", "0x4aaee298", - "0x38e7a9e8", "0x6f98c0f", "0x75516ec1", "0x692857c5", "0x1d912c5c", "0x56d84ff", "0x2f2d7061", "0x2da16acf", - "0x92aa6f8", "0x1ae7576c", "0x3ba868b1", "0x17199a1b", "0x3cad0e76", "0x42f237e3", "0x7d0453bc", "0x88dc5ca", - "0x7288cf9", "0x5f1b1828", "0x4428bef1", "0x29cedc7d", "0x49e66341", "0x2072a1d1", "0x6803953e", "0x53bc35d3", - "0x2b3dd9bd", "0x7aef95e6", "0xe5b46d0", "0x7d822e91", "0x74a3ffcd", "0x2d1340e1", "0x59f279a", "0x54907d93", - "0x3b46dbce", "0x77aaf554", "0x6cf5ea09", "0x5f1deed7", "0x3c462ae5", "0x14bdbb1f", "0x369dd818", "0xd82f8a6", - "0x1bff0de0", "0x5de6e94a", "0x3d48d65a", "0x6cf6d84", "0x7b48cc6a", "0x447b57d3", "0x76d578c5", "0x5be6b1f7", - "0x539e1fa4", "0x3bd278c3", "0x9bc1c1c", "0x54b09520", "0x6dd578fb", "0x7817c3a1", "0x121990ef", "0x48460fa9", - "0x10f7a489", "0x2dc1eb30", "0x6baed45f", "0x1f88aceb", "0x776749f5", "0x29f0e0a0", "0x39af070f", "0x3ba0ada6", - "0x1c9d037c", "0x67ec538e", "0x47269542", "0x31903718", "0x3f7c997c", "0x1edaeedc", "0x6e6588c8", "0x13dc160e", - "0x7a6589b3", "0xba42ae7", "0x405c7385", "0x3fa52e7f", "0x20cb72d1", "0x65935cca", "0x6cb5cea0", "0x37fcdd04", - "0x56bb831d", "0x17e6dd1f", "0x2a948729", "0x68ae5b61"}; - - static const std::string mds_matrix_12[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_12[] = {"0x4aa20d67", "0x3767088d", "0x5e82bd8b", "0x2833018f", - "0x59423010", "0x461b8a6d", "0x3c643b86", "0x4c08c05d", - "0x569f76cf", "0x4728dbb2", "0x758d80ec", "0x33fa823d"}; - - int full_rounds_16 = 8; - int half_full_rounds_16 = 4; - int partial_rounds_16 = 14; - int alpha_16 = 5; - - static const std::string rounds_constants_16[] = { - "0x768bab52", "0x70e0ab7d", "0x3d266c8a", "0x6da42045", "0x600fef22", "0x41dace6b", "0x64f9bdd4", "0x5d42d4fe", - "0x76b1516d", "0x6fc9a717", "0x70ac4fb6", "0x194ef6", "0x22b644e2", "0x1f7916d5", "0x47581be2", "0x2710a123", - "0x6284e867", "0x18d3afe", "0x5df99ef3", "0x4c1e467b", "0x566f6abc", "0x2994e427", "0x538a6d42", "0x5d7bf2cf", - "0x7fda2dab", "0xfd854c4", "0x46922fca", "0x3d7763a1", "0x19fd05ca", "0xa4bbb43", "0x15075851", "0x3d903d76", - "0x2d290ff7", "0x40809fa0", "0x59dac6ec", "0x127927a2", "0x6bbf0ea0", "0x294140f", "0x24742976", "0x6e84c081", - "0x22484f4a", "0x354cae59", "0x453ffe1", "0x3f47a3cc", "0x88204e", "0x6066e109", "0x3b7c4b80", "0x6b55665d", - "0x3bc4b897", "0x735bf378", "0x508daf42", "0x1884fc2b", "0x7214f24c", "0x7498be0a", "0x1a60e640", "0x3303f928", - "0x29b46376", "0x5c96bb68", "0x65d097a5", "0x1d358e9f", "0x4a9a9017", "0x4724cf76", "0x347af70f", "0x1e77e59a", - "0x7f7ec4bf", "0x421926f", "0x5198e669", "0x34db3148", "0x4368bafd", "0x66685c7f", "0x78d3249a", "0x60187881", - "0x76dad67a", "0x690b437", "0x1ea95311", "0x40e5369a", "0x38f103fc", "0x1d226a21", "0x57090613", "0x1fa42108", - "0x17bbef50", "0x1ff7e11c", "0x47b24ca", "0x4e140275", "0x4fa086f5", "0x79b309c", "0x1159bd47", "0x6d37e4e5", - "0x75d8dce", "0x12121ca0", "0x7f6a7c40", "0x68e182ba", "0x5493201b", "0x444a80e", "0x64f4c6", "0x6467abe6", - "0x66975762", "0x2af68f9b", "0x345b33be", "0x1b70d47f", "0x53db717", "0x381189cb", "0x43b915f8", "0x20df3694", - "0xf459d26", "0x77a0e97b", "0x2f73e739", "0x1876c2f9", "0x65a0e29a", "0x4cabefbe", "0x5abd1268", "0x4d34a760", - "0x12771799", "0x69a0c9ac", "0x39091e55", "0x7f611cd0", "0x3af055da", "0x7ac0bbdf", "0x6e0f3a24", "0x41e3b6f7", - "0x49b3756d", "0x568bc538", "0x20c079d8", "0x1701c72c", "0x7670dc6c", "0x5a439035", "0x7c93e00e", "0x561fbb4d", - "0x1178907b", "0x2737406", "0x32fb24f1", "0x6323b60a", "0x6ab12418", "0x42c99cea", "0x155a0b97", "0x53d1c6aa", - "0x2bd20347", "0x279b3d73", "0x4f5f3c70", "0x245af6c", "0x238359d3", "0x49966a59"}; - - static const std::string mds_matrix_16[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_16[] = { - "0x7b80ac5", "0x6bd9cb34", "0x48ee3fa0", "0x4f63dd1a", "0x18c546b4", "0x5af89e8c", "0x4ff23de9", "0x4f78aaf7", - "0x53bdc6d5", "0x5c59823f", "0x2a471c73", "0x4c975e7a", "0x58dc64d5", "0x6e9315e", "0x2cf32287", "0x2fb6755e"}; - - int full_rounds_20 = 8; - int half_full_rounds_20 = 4; - int partial_rounds_20 = 18; - int alpha_20 = 5; - - static const std::string rounds_constants_20[] = { - "0x30cd4497", "0x67cf7d92", "0x113ca786", "0x28f511f7", "0x4c850311", "0x3dc07be8", "0xc8214b9", "0x18090d97", - "0x684f35fb", "0x7f4e478e", "0x11eeba68", "0x567d0ca7", "0x6d3fbebc", "0x47028460", "0x9a8d433", "0x46bc5d5c", - "0x110805b2", "0x50dddc82", "0x1ee4fa", "0x55ed4719", "0x4708bdce", "0x1a530b2b", "0x6d372400", "0x32101d42", - "0x2b0d7d0", "0x3064f512", "0x670f3c64", "0x35735e31", "0x5a2b6144", "0x210d6ba6", "0x1274e66a", "0x212e3e09", - "0x57e62ff0", "0x6b631874", "0x6b577a1b", "0xd17fdaa", "0x24ebe81b", "0x34f6c9fe", "0x591d5a55", "0x5f45a942", - "0x5e454f3f", "0x23b75633", "0x55076170", "0x3caa9482", "0x6a2cbf00", "0x7224801b", "0x74bb2d64", "0x2e6d0990", - "0x78317bf5", "0x23eab921", "0x663603a8", "0x3e8e97f", "0x4db5d3d", "0x64c1e827", "0x37c478fe", "0x35efc805", - "0x555aaef9", "0x6563ad0c", "0x14c9aeac", "0x16d6e172", "0x424fcbe9", "0x30380855", "0x74d4e5bf", "0x1275ba83", - "0x56f32a2d", "0x3cf97f89", "0x440c5711", "0x48687e8a", "0x496600f8", "0xb0e429f", "0x154b1e26", "0x379bb8ce", - "0x277683e5", "0x4403e094", "0x12033240", "0x3bd006d7", "0x4ee6ee1b", "0x62c6764c", "0x7230552f", "0x4f341de7", - "0x3c8f8c49", "0x6fc6bee2", "0xa3ef74d", "0x23710107", "0x24650c82", "0x12baebd4", "0x46c2f3ce", "0x57816fd9", - "0x443fe51c", "0x2a7805ab", "0x3f508ef1", "0x150b836c", "0x1c014ffa", "0x1c0786be", "0x10645190", "0x607b9c0a", - "0x48961505", "0x6f20b7bb", "0x5b5aea23", "0x1fe5355c", "0x27ef98aa", "0x43e120b", "0x647d5ccd", "0x455c81b2", - "0x6ac27d3f", "0x279f6126", "0x76a15758", "0x58c1b0a6", "0x4af83901", "0x45641d4f", "0x1dfe8c33", "0x3720c88", - "0x3482d40d", "0x770d8960", "0x6108b730", "0x63fc084", "0x96e2a34", "0x130514a0", "0x42bc3eff", "0x43775848", - "0x702960e4", "0x6cf19c79", "0x4c3030dd", "0x6dd27932", "0x64350de9", "0x480e8311", "0x6a22632c", "0x2814bcf6", - "0x117197e3", "0x4844d419", "0x76e181a6", "0x6155d7b4", "0x42dbed26", "0x78c7db7c", "0x62e9c27b", "0x105b4f11", - "0x51d45858", "0x33fa0298", "0x26a08228", "0x5f14581f", "0x3bd89737", "0x2325968f", "0x418512ba", "0x7e416920", - "0x2f47442f", "0xe680af5", "0xc424cba", "0x6d3885ae", "0xa9c8cbe", "0x2485f2a9", "0x1f99357f", "0xf58d531", - "0x32d6f6b1", "0x2c26876d", "0x2de3d38e", "0x5a7b6cc9", "0x1caec7f0", "0x4aa1f575", "0x77af0ccd", "0x19d3be5c", - "0xaa619d8", "0x4cfea78", "0xdb3ab76", "0x2ddffaa3", "0x52246767", "0x78632df8", "0x7bd54641", "0x50d7f018", - "0x318ceb9f", "0x2e69a506", "0x4bd9d1fa", "0x2a0b579a", "0x561238c2", "0x2877bb9a", "0x6ed2c79", "0x229998ba", - "0x737f0185", "0x609aad31"}; - - static const std::string mds_matrix_20[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_20[] = { - "0x1dae800", "0x7ff6f82b", "0x34a931ad", "0x5615364c", "0x7a21d143", "0x5c54896d", "0x2d0b6849", - "0x3bcadb4", "0x4a99a481", "0x3d1d9670", "0x1f312fd0", "0x2fd5a426", "0x5077536f", "0x6e6534bf", - "0x281e1388", "0x23d4b043", "0x17196fb8", "0x5e92eace", "0x28a23c09", "0x2e8a998d"}; - - int full_rounds_24 = 8; - int half_full_rounds_24 = 4; - int partial_rounds_24 = 22; - int alpha_24 = 5; - - static const std::string rounds_constants_24[] = { - "0x1feaba61", "0x53224454", "0x6bceb9e2", "0x5019f9b4", "0x48726592", "0x2b22d0a8", "0x6151bbf9", "0x2f474b21", - "0x2eb5f337", "0x3b645d87", "0x942cef0", "0x65228c52", "0x78ffb30f", "0x4d2837c8", "0xe17ac4f", "0x5546686", - "0x46c06cc", "0xb51c3b6", "0x568db763", "0x38b334e4", "0x57f5acf0", "0x19d32611", "0x77d02f4b", "0x6c82e9b8", - "0x7148c1b6", "0x8067c75", "0x46d1e8c9", "0x30973b07", "0x20614f3b", "0x5c3ff851", "0x30503329", "0x4972e7cc", - "0x2d1d8bc", "0x9d5bfa6", "0x97104c0", "0x7ba49a34", "0x4a07c2fc", "0x24c1ee69", "0x28a6ab41", "0x5d9108a0", - "0x3a7851c7", "0x1dd495f9", "0x12b49ff4", "0x7bad5760", "0x5fed64c2", "0x66f5c96c", "0x7eafbd02", "0x39b3593b", - "0x4a653b49", "0x75091dc1", "0x56e488e0", "0x1704a355", "0x745e4ff3", "0x392ef16e", "0x31e33fdf", "0x2c28c66", - "0x36c3083a", "0x3104d1fa", "0x5b03cda3", "0x6641e1af", "0x37754b56", "0x396f5af9", "0x1a1a461a", "0x688e26f2", - "0x6f829784", "0x1bb91d69", "0x5b788016", "0x704aa5c5", "0x181869c", "0x41211e56", "0xce803a0", "0x23bff3a0", - "0x17fb7064", "0x47317220", "0x76914b53", "0x219c1905", "0x16655528", "0x4df35544", "0x60808465", "0x3350f833", - "0x3bccdc7", "0xa87180a", "0x17a99f5", "0x6e945726", "0x15445504", "0x780533b1", "0x3b91bf38", "0x3fc77eb1", - "0x4b4d960e", "0x3cd93d2e", "0xea4e976", "0x1d5306cc", "0x3a7ac284", "0xec22934", "0x4d979713", "0x51a41c65", - "0x22776a11", "0x5fa34268", "0x1415528d", "0x563fbd14", "0x34f45244", "0x120ea1b6", "0x261368a5", "0x27665ec1", - "0x36be2805", "0x345c4784", "0x17efdcc1", "0x393e6530", "0x6da0b4b8", "0x31e5ded3", "0x675b27ac", "0xae88c30", - "0x577841cc", "0x5fe06dec", "0x56b0691a", "0x7242de1f", "0x3c377529", "0x339b7523", "0x1c662299", "0x57c955a", - "0x7ab6c0f2", "0x25a6ad0a", "0x75850b58", "0x48fd3793", "0xb4366b1", "0xfdd0d49", "0x7db419f9", "0x49b9cc0f", - "0x48949716", "0x29c35890", "0x76445485", "0x1c27d30c", "0x10aa7a3b", "0x30f34fb6", "0x6fe06435", "0x2135ecd", - "0x6caaba96", "0x3eb290d0", "0x22fd8d3b", "0x768b1525", "0x5be95814", "0x523d7fe9", "0x55e94cec", "0x47c42e1f", - "0x1aa53b5e", "0x2fd1fe7e", "0x59230e91", "0x7472da66", "0x6443f2df", "0x2d9de19d", "0x6f7f6a84", "0x77800430", - "0xf014bc8", "0x7bf3d095", "0x26afd318", "0x582561f7", "0x5ee3198c", "0x6acc0000", "0x2f315e26", "0x27cac040", - "0x2595081e", "0x5963b7da", "0x7e073565", "0x6cf3f5f1", "0x9f8a3a4", "0xda8ccfe", "0x60be2365", "0x7ed742f5", - "0x668b8031", "0x4bb03494", "0x59019333", "0x700e2878", "0x1cc45856", "0x1d1617f7", "0x7b988da6", "0x4eb4936c", - "0x78c9f87e", "0x63ce3e94", "0x7178341b", "0x45bc2f86", "0x5b775bc", "0x704b0244", "0x29eed278", "0x47f43032", - "0x2127b2e5", "0x1997903f", "0x24b3ce03", "0xc32298c", "0x7d2b6f3a", "0x17fcaa81", "0x72f37fef", "0x3028e7a9", - "0x5edd4d96", "0x1f96583b", "0x4cd6918a", "0x14880f0e", "0x69170359", "0x173cbd33", "0x969e7f4", "0x6e7f23ab", - "0x6182ea87", "0x4dcb1f5c", "0x585fa113", "0x729cb3b6", "0x1b3a27a", "0x1ba173e7", "0x4b33bcea", "0x63d93bbb", - "0x6b3fbf99", "0x6f17e9d1", "0xc3dd8ba", "0xbc1f9a8", "0x64d3f370", "0x465a6a18"}; - - static const std::string mds_matrix_24[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", - "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", - "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_24[] = { - "0xcd7eceb", "0x74a071f", "0x66aaaeff", "0x1c334b66", "0x4d094cb1", "0x2f8579aa", "0x2709471a", "0x710093ce", - "0x53d435ad", "0x7306a110", "0x57568906", "0x4967d8e0", "0x7f74627f", "0x682145a", "0x478d7525", "0x1eacc229", - "0x651f1141", "0x42f397f0", "0x24e49ad7", "0x5ca35700", "0x42f300ea", "0x2fd01085", "0x28a86484", "0x104402b5"}; - -} // namespace poseidon2_constants_m31 +int full_rounds_2 = 12; +int half_full_rounds_2 = 6; +int partial_rounds_2 = 25; +int alpha_2 = 5; + +static const std::string rounds_constants_2[] = { + "0x4c7e5ab4", + "0x5981a113", + "0x776aae0f", + "0x23f3b647", + "0x333f99a3", + "0x78e2b909", + "0x72457fd4", + "0x67fee18a", + "0x749c1e5d", + "0x20153da5", + "0x288a369c", + "0x39bb481a", + "0x584d9033", + "0x4fb38689", + "0x2769dac8", + "0x1350c5c0", + "0x31bde689", + "0x4d399c82", + "0x3151e4ba", + "0x56c67c21", + "0x12aeae36", + "0x7e7b0890", + "0x28fc522c", + "0x74766e76", + "0x57d58330", + "0x3414ea35", + "0x38e5c441", + "0x1e369712", + "0x15b6d9f3", + "0x4808490a", + "0xad3f306", + "0x70dd4d9e", + "0x47f5a80f", + "0x670f0a7d", + "0x69515f5", + "0x33e1c76b", + "0x1388a4eb", + "0x374f2db2", + "0x648f79a", + "0x3418c169", + "0x60735181", + "0x71035d19", + "0x561879af", + "0x649d6193", + "0x26fdb0a3", + "0xa50811d", + "0x1e91c913", + "0x293bcdd9", + "0x1dcdb10" +}; + +static const std::string mds_matrix_2[] = { + "0x2", "0x1", + "0x1", "0x2" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x2", "0x3" +}; + + +int full_rounds_3 = 12; +int half_full_rounds_3 = 6; +int partial_rounds_3 = 19; +int alpha_3 = 5; + +static const std::string rounds_constants_3[] = { + "0x6630420a", + "0x6e77b6b5", + "0x85badf3", + "0x6d17b3c", + "0x2d2ca8bb", + "0x3e585d13", + "0x7f96d29c", + "0x2c60c89", + "0x3d73c75d", + "0x44685392", + "0x7545b9b7", + "0x14abb4e4", + "0x18bc8537", + "0x204f93c1", + "0x4081b364", + "0x5cbe9f9b", + "0x7f9f90a1", + "0x3cbf7bc2", + "0x268a6eab", + "0x6f243411", + "0x2c7554f8", + "0x5fab2c61", + "0x111376ae", + "0x2cfe0ebe", + "0x36b2e729", + "0x29909ad3", + "0x28b820d6", + "0x54323e5d", + "0x786e4d2e", + "0x324f30d3", + "0x65f93d17", + "0x4f8c73b2", + "0x23d9fe34", + "0x17909bd1", + "0x74864a54", + "0x7120da84", + "0x4c238376", + "0x28d0791e", + "0x154f4ab1", + "0x27cd497e", + "0x32d48f16", + "0x5e68b6", + "0x686a839b", + "0x3c24c8fb", + "0x530722d5", + "0x23fe799a", + "0x235dc05f", + "0x1912a500", + "0x5bb5c2b0", + "0x5742d7d7", + "0x37477606", + "0x1d600471", + "0x427a8b2c", + "0x7d89eccd", + "0x378e1019" +}; + +static const std::string mds_matrix_3[] = { + "0x2", "0x1", "0x1", + "0x1", "0x2", "0x1", + "0x1", "0x1", "0x2" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x2", "0x2", "0x3" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 22; +int alpha_4 = 5; + +static const std::string rounds_constants_4[] = { + "0x16af2c22", + "0x7804cd6b", + "0x246e234a", + "0x5dd3cd12", + "0x321bfb5c", + "0x5950358b", + "0x7264a446", + "0x78a0325e", + "0x56c502c1", + "0x459d26df", + "0x73a880e9", + "0x41ec4bfe", + "0x5543742f", + "0x72f68275", + "0x19ed08b1", + "0x147cda79", + "0x637ee4ca", + "0xad181b6", + "0x6cba3e5", + "0x6d19581a", + "0x6e0ce518", + "0x67ecfcba", + "0x1338163a", + "0x1b7388ed", + "0x33965b46", + "0x4e8fa553", + "0x305411f4", + "0x58754ce7", + "0x4380543d", + "0x4f3f78ec", + "0x7e2bafa9", + "0x60e96f27", + "0x30158e74", + "0x64dbacc0", + "0x3516eedd", + "0x200643cc", + "0x714c3435", + "0x35a7ae39", + "0x22a8d380", + "0x17b1c7b5", + "0x14588589", + "0x6325321f", + "0x18a12d4f", + "0x1cd62c68", + "0x1ef5bafc", + "0x83f3012", + "0x6e334dc0", + "0x590d574d", + "0x14213a07", + "0x74c3e1c4", + "0x4b7fc4bd", + "0x3a29253d", + "0x14b8230", + "0x13228033" +}; + +static const std::string mds_matrix_4[] = { + "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0xf15107d", "0x4628fa65", "0x254112b9", "0x8a004cc" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 13; +int alpha_8 = 5; + +static const std::string rounds_constants_8[] = { + "0x12910754", + "0x36ed49be", + "0x7c97497", + "0x40d71fed", + "0x2dee313c", + "0x26de4470", + "0x5d7a5ae2", + "0x1f1e33ff", + "0x13c00c61", + "0xcc4e3f6", + "0x54c32ba0", + "0x4c77e54a", + "0x7951cd04", + "0x4c05faa2", + "0x6e479da0", + "0x38117730", + "0x7374c4ce", + "0x50281aea", + "0x48232e55", + "0x36539d1e", + "0x5e5a4ac1", + "0x77ea4408", + "0x1cefa067", + "0x9ce05ef", + "0x26d24c81", + "0x4c873b15", + "0x77d2ea65", + "0x56b28bb3", + "0x2b2b9f8c", + "0x4a57e3f9", + "0x32c445a7", + "0x782f41c7", + "0x6c205891", + "0x67503f5e", + "0x756c593f", + "0x462479a", + "0x4271c9ca", + "0x4d1af3ce", + "0x180e9999", + "0x25328db", + "0x398b8c99", + "0x3f4755c", + "0x68c74b5f", + "0x5f548c81", + "0x737a627f", + "0x6177ee3d", + "0x487567c7", + "0x67f94f4", + "0x2cd1087d", + "0x304d9054", + "0x490e2bab", + "0x5c659e18", + "0x7c47cce3", + "0x61a387b5", + "0x3857def0", + "0x2624467f", + "0x7ef53cc8", + "0x1d2ad358", + "0x796caff2", + "0x10eac4fd", + "0x7f4b54a5", + "0x35086d00", + "0x41b5005f", + "0x49ab9f3e", + "0x7d0cf6fe", + "0x13904839", + "0x67dc28cd", + "0x28322a3b", + "0x291d6b95", + "0x4b5e6304", + "0x5e4b793f", + "0x1c3de5d4", + "0x52cd150e", + "0x7852055b", + "0x3f71122b", + "0x408ba008", + "0x76d7ded9" +}; + +static const std::string mds_matrix_8[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x3128b57", "0x4d7d3aff", "0x350942ab", "0x2ea8c3ee", "0x5ce80b49", "0x765afd81", "0x198f06fc", "0x7c1b2a17" +}; + + +int full_rounds_12 = 8; +int half_full_rounds_12 = 4; +int partial_rounds_12 = 12; +int alpha_12 = 5; + +static const std::string rounds_constants_12[] = { + "0x68b6c0e0", + "0x4ec257b5", + "0x50d9f348", + "0x2234cb53", + "0x4e4b9ee", + "0x305981fe", + "0x3352aef9", + "0x1c3c33a2", + "0x7aacf58a", + "0x6cba897", + "0x7af46fc0", + "0x51e5eb08", + "0x94c6e20", + "0x61460e39", + "0x693211b7", + "0x18cab2e2", + "0x5ab3d0e", + "0x61c0b778", + "0x7ff68d71", + "0x7eedb35c", + "0x61ba0c6", + "0x26634770", + "0x3f0102a4", + "0x4aaee298", + "0x38e7a9e8", + "0x6f98c0f", + "0x75516ec1", + "0x692857c5", + "0x1d912c5c", + "0x56d84ff", + "0x2f2d7061", + "0x2da16acf", + "0x92aa6f8", + "0x1ae7576c", + "0x3ba868b1", + "0x17199a1b", + "0x3cad0e76", + "0x42f237e3", + "0x7d0453bc", + "0x88dc5ca", + "0x7288cf9", + "0x5f1b1828", + "0x4428bef1", + "0x29cedc7d", + "0x49e66341", + "0x2072a1d1", + "0x6803953e", + "0x53bc35d3", + "0x2b3dd9bd", + "0x7aef95e6", + "0xe5b46d0", + "0x7d822e91", + "0x74a3ffcd", + "0x2d1340e1", + "0x59f279a", + "0x54907d93", + "0x3b46dbce", + "0x77aaf554", + "0x6cf5ea09", + "0x5f1deed7", + "0x3c462ae5", + "0x14bdbb1f", + "0x369dd818", + "0xd82f8a6", + "0x1bff0de0", + "0x5de6e94a", + "0x3d48d65a", + "0x6cf6d84", + "0x7b48cc6a", + "0x447b57d3", + "0x76d578c5", + "0x5be6b1f7", + "0x539e1fa4", + "0x3bd278c3", + "0x9bc1c1c", + "0x54b09520", + "0x6dd578fb", + "0x7817c3a1", + "0x121990ef", + "0x48460fa9", + "0x10f7a489", + "0x2dc1eb30", + "0x6baed45f", + "0x1f88aceb", + "0x776749f5", + "0x29f0e0a0", + "0x39af070f", + "0x3ba0ada6", + "0x1c9d037c", + "0x67ec538e", + "0x47269542", + "0x31903718", + "0x3f7c997c", + "0x1edaeedc", + "0x6e6588c8", + "0x13dc160e", + "0x7a6589b3", + "0xba42ae7", + "0x405c7385", + "0x3fa52e7f", + "0x20cb72d1", + "0x65935cca", + "0x6cb5cea0", + "0x37fcdd04", + "0x56bb831d", + "0x17e6dd1f", + "0x2a948729", + "0x68ae5b61" +}; + +static const std::string mds_matrix_12[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc" +}; + +static const std::string partial_matrix_diagonal_12[] = { + "0x4aa20d67", "0x3767088d", "0x5e82bd8b", "0x2833018f", "0x59423010", "0x461b8a6d", "0x3c643b86", "0x4c08c05d", "0x569f76cf", "0x4728dbb2", "0x758d80ec", "0x33fa823d" +}; + + +int full_rounds_16 = 8; +int half_full_rounds_16 = 4; +int partial_rounds_16 = 14; +int alpha_16 = 5; + +static const std::string rounds_constants_16[] = { + "0x768bab52", + "0x70e0ab7d", + "0x3d266c8a", + "0x6da42045", + "0x600fef22", + "0x41dace6b", + "0x64f9bdd4", + "0x5d42d4fe", + "0x76b1516d", + "0x6fc9a717", + "0x70ac4fb6", + "0x194ef6", + "0x22b644e2", + "0x1f7916d5", + "0x47581be2", + "0x2710a123", + "0x6284e867", + "0x18d3afe", + "0x5df99ef3", + "0x4c1e467b", + "0x566f6abc", + "0x2994e427", + "0x538a6d42", + "0x5d7bf2cf", + "0x7fda2dab", + "0xfd854c4", + "0x46922fca", + "0x3d7763a1", + "0x19fd05ca", + "0xa4bbb43", + "0x15075851", + "0x3d903d76", + "0x2d290ff7", + "0x40809fa0", + "0x59dac6ec", + "0x127927a2", + "0x6bbf0ea0", + "0x294140f", + "0x24742976", + "0x6e84c081", + "0x22484f4a", + "0x354cae59", + "0x453ffe1", + "0x3f47a3cc", + "0x88204e", + "0x6066e109", + "0x3b7c4b80", + "0x6b55665d", + "0x3bc4b897", + "0x735bf378", + "0x508daf42", + "0x1884fc2b", + "0x7214f24c", + "0x7498be0a", + "0x1a60e640", + "0x3303f928", + "0x29b46376", + "0x5c96bb68", + "0x65d097a5", + "0x1d358e9f", + "0x4a9a9017", + "0x4724cf76", + "0x347af70f", + "0x1e77e59a", + "0x7f7ec4bf", + "0x421926f", + "0x5198e669", + "0x34db3148", + "0x4368bafd", + "0x66685c7f", + "0x78d3249a", + "0x60187881", + "0x76dad67a", + "0x690b437", + "0x1ea95311", + "0x40e5369a", + "0x38f103fc", + "0x1d226a21", + "0x57090613", + "0x1fa42108", + "0x17bbef50", + "0x1ff7e11c", + "0x47b24ca", + "0x4e140275", + "0x4fa086f5", + "0x79b309c", + "0x1159bd47", + "0x6d37e4e5", + "0x75d8dce", + "0x12121ca0", + "0x7f6a7c40", + "0x68e182ba", + "0x5493201b", + "0x444a80e", + "0x64f4c6", + "0x6467abe6", + "0x66975762", + "0x2af68f9b", + "0x345b33be", + "0x1b70d47f", + "0x53db717", + "0x381189cb", + "0x43b915f8", + "0x20df3694", + "0xf459d26", + "0x77a0e97b", + "0x2f73e739", + "0x1876c2f9", + "0x65a0e29a", + "0x4cabefbe", + "0x5abd1268", + "0x4d34a760", + "0x12771799", + "0x69a0c9ac", + "0x39091e55", + "0x7f611cd0", + "0x3af055da", + "0x7ac0bbdf", + "0x6e0f3a24", + "0x41e3b6f7", + "0x49b3756d", + "0x568bc538", + "0x20c079d8", + "0x1701c72c", + "0x7670dc6c", + "0x5a439035", + "0x7c93e00e", + "0x561fbb4d", + "0x1178907b", + "0x2737406", + "0x32fb24f1", + "0x6323b60a", + "0x6ab12418", + "0x42c99cea", + "0x155a0b97", + "0x53d1c6aa", + "0x2bd20347", + "0x279b3d73", + "0x4f5f3c70", + "0x245af6c", + "0x238359d3", + "0x49966a59" +}; + +static const std::string mds_matrix_16[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc" +}; + +static const std::string partial_matrix_diagonal_16[] = { + "0x7b80ac5", "0x6bd9cb34", "0x48ee3fa0", "0x4f63dd1a", "0x18c546b4", "0x5af89e8c", "0x4ff23de9", "0x4f78aaf7", "0x53bdc6d5", "0x5c59823f", "0x2a471c73", "0x4c975e7a", "0x58dc64d5", "0x6e9315e", "0x2cf32287", "0x2fb6755e" +}; + + +int full_rounds_20 = 8; +int half_full_rounds_20 = 4; +int partial_rounds_20 = 18; +int alpha_20 = 5; + +static const std::string rounds_constants_20[] = { + "0x30cd4497", + "0x67cf7d92", + "0x113ca786", + "0x28f511f7", + "0x4c850311", + "0x3dc07be8", + "0xc8214b9", + "0x18090d97", + "0x684f35fb", + "0x7f4e478e", + "0x11eeba68", + "0x567d0ca7", + "0x6d3fbebc", + "0x47028460", + "0x9a8d433", + "0x46bc5d5c", + "0x110805b2", + "0x50dddc82", + "0x1ee4fa", + "0x55ed4719", + "0x4708bdce", + "0x1a530b2b", + "0x6d372400", + "0x32101d42", + "0x2b0d7d0", + "0x3064f512", + "0x670f3c64", + "0x35735e31", + "0x5a2b6144", + "0x210d6ba6", + "0x1274e66a", + "0x212e3e09", + "0x57e62ff0", + "0x6b631874", + "0x6b577a1b", + "0xd17fdaa", + "0x24ebe81b", + "0x34f6c9fe", + "0x591d5a55", + "0x5f45a942", + "0x5e454f3f", + "0x23b75633", + "0x55076170", + "0x3caa9482", + "0x6a2cbf00", + "0x7224801b", + "0x74bb2d64", + "0x2e6d0990", + "0x78317bf5", + "0x23eab921", + "0x663603a8", + "0x3e8e97f", + "0x4db5d3d", + "0x64c1e827", + "0x37c478fe", + "0x35efc805", + "0x555aaef9", + "0x6563ad0c", + "0x14c9aeac", + "0x16d6e172", + "0x424fcbe9", + "0x30380855", + "0x74d4e5bf", + "0x1275ba83", + "0x56f32a2d", + "0x3cf97f89", + "0x440c5711", + "0x48687e8a", + "0x496600f8", + "0xb0e429f", + "0x154b1e26", + "0x379bb8ce", + "0x277683e5", + "0x4403e094", + "0x12033240", + "0x3bd006d7", + "0x4ee6ee1b", + "0x62c6764c", + "0x7230552f", + "0x4f341de7", + "0x3c8f8c49", + "0x6fc6bee2", + "0xa3ef74d", + "0x23710107", + "0x24650c82", + "0x12baebd4", + "0x46c2f3ce", + "0x57816fd9", + "0x443fe51c", + "0x2a7805ab", + "0x3f508ef1", + "0x150b836c", + "0x1c014ffa", + "0x1c0786be", + "0x10645190", + "0x607b9c0a", + "0x48961505", + "0x6f20b7bb", + "0x5b5aea23", + "0x1fe5355c", + "0x27ef98aa", + "0x43e120b", + "0x647d5ccd", + "0x455c81b2", + "0x6ac27d3f", + "0x279f6126", + "0x76a15758", + "0x58c1b0a6", + "0x4af83901", + "0x45641d4f", + "0x1dfe8c33", + "0x3720c88", + "0x3482d40d", + "0x770d8960", + "0x6108b730", + "0x63fc084", + "0x96e2a34", + "0x130514a0", + "0x42bc3eff", + "0x43775848", + "0x702960e4", + "0x6cf19c79", + "0x4c3030dd", + "0x6dd27932", + "0x64350de9", + "0x480e8311", + "0x6a22632c", + "0x2814bcf6", + "0x117197e3", + "0x4844d419", + "0x76e181a6", + "0x6155d7b4", + "0x42dbed26", + "0x78c7db7c", + "0x62e9c27b", + "0x105b4f11", + "0x51d45858", + "0x33fa0298", + "0x26a08228", + "0x5f14581f", + "0x3bd89737", + "0x2325968f", + "0x418512ba", + "0x7e416920", + "0x2f47442f", + "0xe680af5", + "0xc424cba", + "0x6d3885ae", + "0xa9c8cbe", + "0x2485f2a9", + "0x1f99357f", + "0xf58d531", + "0x32d6f6b1", + "0x2c26876d", + "0x2de3d38e", + "0x5a7b6cc9", + "0x1caec7f0", + "0x4aa1f575", + "0x77af0ccd", + "0x19d3be5c", + "0xaa619d8", + "0x4cfea78", + "0xdb3ab76", + "0x2ddffaa3", + "0x52246767", + "0x78632df8", + "0x7bd54641", + "0x50d7f018", + "0x318ceb9f", + "0x2e69a506", + "0x4bd9d1fa", + "0x2a0b579a", + "0x561238c2", + "0x2877bb9a", + "0x6ed2c79", + "0x229998ba", + "0x737f0185", + "0x609aad31" +}; + +static const std::string mds_matrix_20[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc" +}; + +static const std::string partial_matrix_diagonal_20[] = { + "0x1dae800", "0x7ff6f82b", "0x34a931ad", "0x5615364c", "0x7a21d143", "0x5c54896d", "0x2d0b6849", "0x3bcadb4", "0x4a99a481", "0x3d1d9670", "0x1f312fd0", "0x2fd5a426", "0x5077536f", "0x6e6534bf", "0x281e1388", "0x23d4b043", "0x17196fb8", "0x5e92eace", "0x28a23c09", "0x2e8a998d" +}; + + +int full_rounds_24 = 8; +int half_full_rounds_24 = 4; +int partial_rounds_24 = 22; +int alpha_24 = 5; + +static const std::string rounds_constants_24[] = { + "0x1feaba61", + "0x53224454", + "0x6bceb9e2", + "0x5019f9b4", + "0x48726592", + "0x2b22d0a8", + "0x6151bbf9", + "0x2f474b21", + "0x2eb5f337", + "0x3b645d87", + "0x942cef0", + "0x65228c52", + "0x78ffb30f", + "0x4d2837c8", + "0xe17ac4f", + "0x5546686", + "0x46c06cc", + "0xb51c3b6", + "0x568db763", + "0x38b334e4", + "0x57f5acf0", + "0x19d32611", + "0x77d02f4b", + "0x6c82e9b8", + "0x7148c1b6", + "0x8067c75", + "0x46d1e8c9", + "0x30973b07", + "0x20614f3b", + "0x5c3ff851", + "0x30503329", + "0x4972e7cc", + "0x2d1d8bc", + "0x9d5bfa6", + "0x97104c0", + "0x7ba49a34", + "0x4a07c2fc", + "0x24c1ee69", + "0x28a6ab41", + "0x5d9108a0", + "0x3a7851c7", + "0x1dd495f9", + "0x12b49ff4", + "0x7bad5760", + "0x5fed64c2", + "0x66f5c96c", + "0x7eafbd02", + "0x39b3593b", + "0x4a653b49", + "0x75091dc1", + "0x56e488e0", + "0x1704a355", + "0x745e4ff3", + "0x392ef16e", + "0x31e33fdf", + "0x2c28c66", + "0x36c3083a", + "0x3104d1fa", + "0x5b03cda3", + "0x6641e1af", + "0x37754b56", + "0x396f5af9", + "0x1a1a461a", + "0x688e26f2", + "0x6f829784", + "0x1bb91d69", + "0x5b788016", + "0x704aa5c5", + "0x181869c", + "0x41211e56", + "0xce803a0", + "0x23bff3a0", + "0x17fb7064", + "0x47317220", + "0x76914b53", + "0x219c1905", + "0x16655528", + "0x4df35544", + "0x60808465", + "0x3350f833", + "0x3bccdc7", + "0xa87180a", + "0x17a99f5", + "0x6e945726", + "0x15445504", + "0x780533b1", + "0x3b91bf38", + "0x3fc77eb1", + "0x4b4d960e", + "0x3cd93d2e", + "0xea4e976", + "0x1d5306cc", + "0x3a7ac284", + "0xec22934", + "0x4d979713", + "0x51a41c65", + "0x22776a11", + "0x5fa34268", + "0x1415528d", + "0x563fbd14", + "0x34f45244", + "0x120ea1b6", + "0x261368a5", + "0x27665ec1", + "0x36be2805", + "0x345c4784", + "0x17efdcc1", + "0x393e6530", + "0x6da0b4b8", + "0x31e5ded3", + "0x675b27ac", + "0xae88c30", + "0x577841cc", + "0x5fe06dec", + "0x56b0691a", + "0x7242de1f", + "0x3c377529", + "0x339b7523", + "0x1c662299", + "0x57c955a", + "0x7ab6c0f2", + "0x25a6ad0a", + "0x75850b58", + "0x48fd3793", + "0xb4366b1", + "0xfdd0d49", + "0x7db419f9", + "0x49b9cc0f", + "0x48949716", + "0x29c35890", + "0x76445485", + "0x1c27d30c", + "0x10aa7a3b", + "0x30f34fb6", + "0x6fe06435", + "0x2135ecd", + "0x6caaba96", + "0x3eb290d0", + "0x22fd8d3b", + "0x768b1525", + "0x5be95814", + "0x523d7fe9", + "0x55e94cec", + "0x47c42e1f", + "0x1aa53b5e", + "0x2fd1fe7e", + "0x59230e91", + "0x7472da66", + "0x6443f2df", + "0x2d9de19d", + "0x6f7f6a84", + "0x77800430", + "0xf014bc8", + "0x7bf3d095", + "0x26afd318", + "0x582561f7", + "0x5ee3198c", + "0x6acc0000", + "0x2f315e26", + "0x27cac040", + "0x2595081e", + "0x5963b7da", + "0x7e073565", + "0x6cf3f5f1", + "0x9f8a3a4", + "0xda8ccfe", + "0x60be2365", + "0x7ed742f5", + "0x668b8031", + "0x4bb03494", + "0x59019333", + "0x700e2878", + "0x1cc45856", + "0x1d1617f7", + "0x7b988da6", + "0x4eb4936c", + "0x78c9f87e", + "0x63ce3e94", + "0x7178341b", + "0x45bc2f86", + "0x5b775bc", + "0x704b0244", + "0x29eed278", + "0x47f43032", + "0x2127b2e5", + "0x1997903f", + "0x24b3ce03", + "0xc32298c", + "0x7d2b6f3a", + "0x17fcaa81", + "0x72f37fef", + "0x3028e7a9", + "0x5edd4d96", + "0x1f96583b", + "0x4cd6918a", + "0x14880f0e", + "0x69170359", + "0x173cbd33", + "0x969e7f4", + "0x6e7f23ab", + "0x6182ea87", + "0x4dcb1f5c", + "0x585fa113", + "0x729cb3b6", + "0x1b3a27a", + "0x1ba173e7", + "0x4b33bcea", + "0x63d93bbb", + "0x6b3fbf99", + "0x6f17e9d1", + "0xc3dd8ba", + "0xbc1f9a8", + "0x64d3f370", + "0x465a6a18" +}; + +static const std::string mds_matrix_24[] = { + "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", + "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", + "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", + "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", + "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc" +}; + +static const std::string partial_matrix_diagonal_24[] = { + "0xcd7eceb", "0x74a071f", "0x66aaaeff", "0x1c334b66", "0x4d094cb1", "0x2f8579aa", "0x2709471a", "0x710093ce", "0x53d435ad", "0x7306a110", "0x57568906", "0x4967d8e0", "0x7f74627f", "0x682145a", "0x478d7525", "0x1eacc229", "0x651f1141", "0x42f397f0", "0x24e49ad7", "0x5ca35700", "0x42f300ea", "0x2fd01085", "0x28a86484", "0x104402b5" +}; + + +} // namespace poseidon2_constants_m31 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/constants/stark252_poseidon2.h b/icicle/include/icicle/hash/poseidon2_constants/constants/stark252_poseidon2.h index e23f3dd71..cdd746a2c 100644 --- a/icicle/include/icicle/hash/poseidon2_constants/constants/stark252_poseidon2.h +++ b/icicle/include/icicle/hash/poseidon2_constants/constants/stark252_poseidon2.h @@ -1,8 +1,8 @@ #pragma once #ifndef STARK252_POSEIDON2_H - #define STARK252_POSEIDON2_H +#define STARK252_POSEIDON2_H - #include +#include namespace poseidon2_constants_stark252 { @@ -11,576 +11,600 @@ namespace poseidon2_constants_stark252 { * The number in the name corresponds to the arity of hash function */ - int full_rounds_2 = 8; - int half_full_rounds_2 = 4; - int partial_rounds_2 = 83; - int alpha_2 = 3; - - static const std::string rounds_constants_2[] = { - "0x547c0b2119ccef0edbc86fef139ac3b009371cd0e7b823d39086db668f01a67", - "0x25d13966d9b1d8a8b0a24461d3548b968034a2df3baf003380f6628fc031395", - "0x3bccbb230b3e2951552f50783cddfefcd69dfbbe69b9e3b374da25b09ddcd5d", - "0x21dd7103eebcfa472c21d0071d7fe92c59ec5d27b47ad2a2284049e184e980d", - "0x5f29c0816a486384e7f80f3bc851421a590462a07f4c94bf2e9feda3f796f44", - "0x2cafed0401fcd9e7e471d428b5029935eb90cafedbcc2061417e694258004a9", - "0x1bbe0f12ca1a4896ac0d8a9acde51016c354b5b2b32ea01d8c6480be8eb6515", - "0x5a00c0e49379f32aaca35ba153e947ca0cb0354b3d066ffbb51c5d35db97274", - "0x4ed2eac0f68dc99095ca866a1f8de54c2ce24d7b2eea53b6b3d6a2f0655d2de", - "0x28f07ea801653c1f3e92d077be3f5f80e21b398f6f0984a960fe1ef953808c1", - "0x3031352c19ed7c9b4f9189f1661b74e5d79306940d559c0fc1e1cf8205baf17", - "0x29d4ef4f86ef2da1108691d6eb38ea16ac6040c227f110d94103565c2cfc809", - "0x3c6197ee62401f1f8977382b49b73ba48ac51c7f19031e277ae3b98f1df3641", - "0x1a989777c18e767d3ba23bb7d092d25ec8978fe9052e3e9b5b089f65be4f600", - "0x4d86e1df4ca9f1d14661e0dc8bca94bbb857b55e9ce0eaa506aa9f75d2fdbc8", - "0x4e2435293bac0c255aff4e43d7ddd82bb96b28f7e0945fad04c6e76174c3833", - "0x1687b18f40aaa3b781ab58b35e48931c1d901e3c1bd2a2574d6059d4baf1383", - "0x61ae7be0477c61ad41a6970bc9be7be513d31f81d1193f2a1780cf05b1c46bb", - "0x4c7e92fe815f23146a4ec82e7291a08a5b177ef5764dcf46df2ca214f970c01", - "0x7f92042f6010c6e0cd9a7e19f1faa9c9dc2f43481ed1660bcd0e8c1caa5e91e", - "0x37e4fb5f740b26f6ba0ee5ff3f2c53821178996a7eb902b1f1083c81db164cb", - "0x16cf786290c436e88ad1df8ac7168e25e18305522efa0829208c24bf86b5669", - "0x92c72a27c02ee315ef00e56f02238aa85537543a29b7b3f0c3e9e2a8cc0a60", - "0x1d0551aff5c76b13f93d024efb943c21cf311ceb8ef3e7bf2b27a76493b6a5", - "0x180dc73da8e91917462275367c3e5301bc76b00d521265a5ec41a4d6af10182", - "0x44c7608c594a3acee1aa1a97fd7b9c721d15dc5d1cfd880ac281c5480552584", - "0xc81530a72f213c5a9b84c8165052f83d3f45a79706411c19aa026f67461be8", - "0x7c983049b9a9c7216a4fe15846ca6252c4ff30a07b18f228ad624f66b44fbc8", - "0x2e270ed79af756eb7d526c8381dd650b56acebf3d1a47b92f79f123431227cd", - "0x2bee386fbe7d24ae7baf9edf2e72410a88234f388d61307b77f43df3cecb723", - "0xe4b72eedc660ddff42c37a9ce1c81f3643bbe6db5df2b8779975943b73c2b5", - "0x7adfd649cbe1e15a2dc03a9080cc0d163ccc972c22d9394b5cb390c9d78f0e", - "0x758669f21b1dee03b8c3da7f45a694a48c3e353be1039c5b1db16591620b0cb", - "0x66fff1c7b640bd0e2c4b380b116e31e8882cf3870b343a84d96ff15ddbcbd3d", - "0x13514bc819eef10dfdf7ad2c4bdc2a0bf264f9b3d360ce940a71b6b8e561a82", - "0x2d5d38ac5c74a536239987e480ee76d139e94f294520d4d24630520fa93fedd", - "0x5ada8c0d37e34ab419e2ac4e251a98693405dceafb3f698dd8c0e23e801b0ee", - "0x2d8a431002eb79faf0caa66a74e9a4d3c1dcbcdb8035b97e29fb623b261c2b7", - "0x246b834aad5cff22d6f8178662be73677348ec988ae060fe271d101a78011fc", - "0x74a630a4a6a6b4443784b7146362bc295bf928f84aea5a67587e6e4e03ad6be", - "0x5db46563ed853ff54e08677fdbf01d949fe1f0c96c7a926afab0356eb074e74", - "0x31f4e332ec2fe8e993688914786bb8f5f950395576fbeb19bfdc56bea49caee", - "0x1b0b4876b253e95ff1394b933c226e75ede88d5023dc44573f38664ef350a21", - "0x5c37c814dffc2cfe37720760b434a1682623212530c5929ceb82ef7f025ce5a", - "0x4e370cb20d62961681326a38b6d77319ce96f1d5ea1a0712c8269cf7d984ce", - "0x7753e11f6e929f72e3e7c8a73341e57cb9b69e2a9771d6695df9915facc6e2", - "0x75a6ff65d7240c38fd58bb5b648d17a2920a8be26578256f0349e94b47e30a6", - "0x1e6e4b3ecf515d600dbca93a19bba9192c71235dd26f805c9e4c9489fed0737", - "0x6c71a1d241aabf094ab7cd883c8793a194c29285a9e257d76577594b4fe80ea", - "0x5e09a515a2c2a575ef9d36c5f7dba753c17458085ff9bdef92d490a557414a3", - "0x4e33bfdbde19b204b37819258fab2324b0c5d13f6b7d8f229e9aa9400c4db7a", - "0x3235c515b0abb1d7ea83dedc9e73c4ff94c6d89c087fbdf740cb6a5f1a7d88f", - "0x3776e363b266f1649545c791d98008bdf2a81a15b80c88d3f33d3d5bcd09d83", - "0x2e9f55dd45fe9b0e98e8cc3b6158315cab3dace7484d3718cb8893336c8e8b4", - "0x5219ff0ed15e8c02731b1fb696e4d832db1981620fb4b9017cc88422216e949", - "0x135c64c5898ddf9ffe2f29ca8e59e208c8c803b375af5927f6d376617c36bb9", - "0x72a5c93c6ca7489ee1fc3be830fec666f1417c273547e727862b88e5db1b546", - "0x9bbc3f6a03bab8fa14731c8e16e936444720d4cbb3d55ce1275cdc16880342", - "0x3a81bbf22787518445d9d0ff992f5bf5ccee2616cf86b5966105f7a448f3508", - "0x5a1d9c05b71975fee04503657d8350ca3e577114eb3dc246ac5e639971a8f1c", - "0x317c885cee24ac8039e3c46f747e6adb8377ef73b93f004073b4e92d16622aa", - "0x7b87d4724075c7dd7619cad770165090b1845fc064a06dbaf4ba018df21667e", - "0x7995afbb2c5916bc56967866ca2e04ea35cc40d4dcac5fa1182b5e3193c9e2", - "0x429ee3d90493feeb715f7fa9fc7b7515473ff84c8d59c5c71273636b5c53335", - "0x460b2e3a256bd633733d59bf785e1ba089509bff8a453bc52e1e8c4eab86685", - "0xa9cabbe0d7dcd5011b30a60b1cd32f08fc126e18f2d05c6e721485f4d14f97", - "0x728bb0861a5e024d9d476bd5e505e753874690cb1e6d6f234b9de0e9b0a015d", - "0x4e39726d6f50b52ed26241dafed19e2e09611a93045d330b271a2db4c1d9d92", - "0x518ca3cd26b67044826335d1c551ac4845c1d744e7d462fbaf5c0979f05a427", - "0x18375cc71cba17be6660ce77b26812e06a4776e4358e57d5d8cfbd6593b7265", - "0x339d48eeff4196ab53d97ae0363ce9ba4494bcbbd97498f4661431345482c0a", - "0x39fbc157fa6c43721f0dc424e0fa5a1d449c37433f7bbc99ffdbfc588c78e87", - "0x712bf71264b6ae18fbfd1463893f0168e797cc73b1cdaf46a4a95ee363a8452", - "0x495e1038adfde7f84eea0a18eb4f26587c8abcb8609931430a5870f54463749", - "0x71b316c21bb7118b81095eae756f80582b9607c5f717c0459311ae30930a27a", - "0x334f9dd79a0f6c414a3a5ab35af1e82d4850d12e1bb667aecdf193db60d986", - "0x69fe47c40a6a2cb5f04f3433692525b1fc94c2d94da3f17d72b66b17fb83568", - "0x7e36a5063e3a2f3995c758d753ed1b83efade0904e754c45ef347c169a81b0f", - "0x1ca747d60329c52b79e2b9e441c048f59632c8ef746caf06e6ace7f4da7a4d1", - "0x983bbb25e2a25d26246a358c85b4ab2b972e1529c6bb79caa997b7b2c9f835", - "0x15d17ec5c8ea2441151a685f3b7897370242f43856ab4510dc5ad8fd8bc622a", - "0x25773c6d359f9f47dd3b9aa43a74cd10eee88c9b33e6cfbe5cef5913376b98e", - "0x18b7d09ea2160a93d704a7fd6ac433d03779bde1bfa6e0e8249672c05f33d5", - "0x3c605071a551b3c627189556e66306eb0252a20b883ff03bc3216a8bd3076b3", - "0x7bc95c89ff975920f966976541a844f95e0fd839a6f8d55a2fd1ff271689d85", - "0x311a4fc0648a10eea000bb87b694bcd1de36dafc42bd3e85531b7b4da54d003", - "0x263bdf49ef52abdb380fa39d099816fc5b99d45539b693227808320a5434844", - "0x7221b729f57c11996225e97f05e871d497c8d5e0ca51c45777b286869a055aa", - "0x5ae850634be1177ddfafffce8483e6f2040c50c2ea845ea08b9cde7ca5ff6da", - "0x2314df976789a54ce4748fb27c5be848ec9b35d978b203ea113de0be57817db", - "0x5ed9ac105b6e780b443c04acd33aec92c47e4bc4e22d5f804b9637f3e724890", - "0x645367c00075f5ad00074cb63c54ad3737ac523e8485a1dd85c22ca1cb57528", - "0x5d11d6479ae2f83709e55748409776a7697d325d0ca4f4be33e9f4df19bdc3c", - "0x66abdc8ee54c2e5f57f39383b101cc43d1de20ec7060cd322162edd1603e832", - "0x514b2cfde5b0e7b842920feb1d2d82a5a8f8e1fced5afc497f2ef83cc952b9a", - "0xf8bc333bade920251d130c5143117bb178aab3e49f884f5370adb294b98f4c", - "0x1e1d534634535da8e078192b583ce3c53313fca61db75fb1dff94bfa84b8421", - "0x3aa63047d50ee752fef88aa3339f8b04c3f4b890904ec7e09571b9351ba4633", - "0x66113b91714e3aa9bf802907f20c6bee21a5c4daf5c5097f236559f46d8f948"}; - - static const std::string mds_matrix_2[] = {"0x2", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_2[] = {"0x2", "0x3"}; - - int full_rounds_3 = 8; - int half_full_rounds_3 = 4; - int partial_rounds_3 = 83; - int alpha_3 = 3; - - static const std::string rounds_constants_3[] = { - "0x1caafe19abc51e89d9e19e96658904fed74eb9e5769b70e3f9b786afb30dc0a", - "0x6a49348a28b19f4c27358c56b807ada552c834c555fb0039e59af9de62c2019", - "0x5228a48d4fc955881700a9c8d791626098428056657435212fe5e9f844b06d", - "0x3ba61c6bd818a9f8226c750ee48812ca090a6b1e61c4c403d59018076e4bc8d", - "0x6e2a2531c5b77e40fa42f804978db49ec3128dfc512eda0322e76ba7192c1e8", - "0x46401bacd635a7dd2d291a4029da3c669881e860c0b6ac438f32d720cc5080e", - "0x64ff3a8bd01c025e3121cea2ba866f3f5bf7ec9f670443c93dc560a8d412387", - "0x55bfd0d83713139db5d42260cbe94f3e4c1cf21ecd5af4ea9ec8dc1d7ea2096", - "0xc49838bac6734c9e84cfdebbfce7761c8dff31bd112aa068f3393ac6922f03", - "0x4cdf3f1c45550cf9903fe83ff089dc57fde71f21b766cbacaa3e6c578357216", - "0x78ca37a2a066d3cb56e4d7ca4ea372ee2e9bbd19775a196f5f879ae13fa5ab2", - "0x69739e32d9ab7cdaa0b0bd066ead0664e8d96bb7f4a42f7d587b5de6944d329", - "0x673fd4917a99e14cb199ca240a313958995e9eb1c47a913be7ebfbfa5d2a7d2", - "0x30baa62b25de6a89bbc71fb99c9dc870a63d023937fe61f43b27c57617fdd80", - "0x64886a5ef665b774177d5b4b440ab04b7a5c1a89612951b59da0d02ead8ff0d", - "0x7d1eb7b032165794cd31827245d187ffd8f9abbdc81af7ec1cb18856a2eb4de", - "0x2b5a99a6b751957843aabf081ea79c3c9f5de2c31262ccf3734f80fcd2762ab", - "0x1255793b24f0f860522e3f75b6ebc07cdb7e6ff8210c16e7dc5bf7c7c71639c", - "0x4ecddac96630b0cb9becfeb0d7dcebb50dc750362351b28888247179a8d628", - "0x79893ab13a1e627462497ac166ba177a956ca1e3c2e8bec31c3a3d8ef89d85d", - "0x537edab27f234a11cfbbeb3d88034ea9be6d15906806af79e83d88c7e4ccb0b", - "0x7430f75cdc58f7263447bf5c3274918b526abd57bf1bc3242480bb1412ebd09", - "0x65a5821b2a99f38d220b0b82f71bb614be03f4eae7cb61bfb3567765757a64f", - "0x1fef33ca367918040276992b8e2afe308a72d58966aa187db6d6d96d0143c5c", - "0x417e2859a8d763d9579a2de1c5b34b1f60b8abcaac63b68c3ee29460838c0c2", - "0x659fa303e5a1b91a233b43ad73b4ab43a161d045aff0f462a3619c8c504659b", - "0x58a5ee378a9f49acd2a79373c382573beae03a057bc40016f9847dc274ee873", - "0x480e72fdc7c17178576f277cd3e34a78f58ee64ba969ca24c6a67e52f399d0a", - "0x4ff6b8383cfa589064600cccba02175d4488440e2d78154c5f2064688521e9a", - "0x1d55afec1a523ad72d6d2599fa37c9860843ad37949e273e1a71049bec721eb", - "0x533e1fd0e8a47ac2d434c2158f2898ef5c05d76dbec11df13d3a96b77cd1f03", - "0x1f75036b4d208493a66f0693794c3b06ea52ddbc92f938b038587a07fa1cf74", - "0xf27c19da832f5f96835a024d153cf0a55ac70cb6850926e5c3565cce0f098", - "0xfa6dad9c5d5fc88dd1c65bd87abab4eabb9034966c00f10a9abfbdff7721f4", - "0x1525a9da8d1ee034362e5d750cd94c72ea2231cbf2f4bdb3a2a8dbf356c517f", - "0x5ea0f5cd18645f5dbf6ffd7de437a7f28d756b0da77e26908e70a2582258c53", - "0x14730fe1334bdf46740b0c47aa11b9d13a2051abc71318135a9d41651bd2ba6", - "0x691f607600e792ecfcfd03dd9d1049486bca2aa0a1b5304ad5dac77cadfeeb4", - "0x700810ac7be2633ff68f5ba8a7832675b4528d7d372daf74654c5dc5f76a44e", - "0x1b9367599c0850cbd1b2ad107a7a0cf82a5fa873121ea5c97f06197144c5da1", - "0x510d4b04f2c26e18846477272d500c929275c497e690d3ffdf4edf1d843fe8b", - "0x2d0b0edfd9483002bb58b93b9ec72b77a323cc270d522b67e27f70856355c11", - "0x18651665380759d056a47dd537a065b9927e26e4e08e66be57eb889617076a2", - "0x46fe1ddfdad9e163a88677680f9805af9db4a7304f1e3da42671813120e1f9d", - "0x686745b1f6d0f97e5e78f3b5319bf20f488f4aa8cf3654ca27642e27caba0d3", - "0x3670f90ff89791db3c80a7cc4e4ccf84a6f986718e4b44acf05b78c1e4e445", - "0x206310fdf701f1286e498c637e6a49003054923754908b11c8b733407308b25", - "0x679fe3addfab71e90be3157923e14cfcdc8cf022e0c93d0a3f823e7e4b0ddc9", - "0x3efec7fc8b364d48c4b740591411d5921f32fdf3dd1b4162564d3ed7a447918", - "0x2519db11ea2efcbf153a26e364bf5c91260913be3ce159d26119d09868eafe8", - "0x2359738c04c88a78e93588b994b8aa800b9a458b6a71c7689fb1c8bd647e1a4", - "0x3dc42a576a8d93f29ccaaf9641e2481e8a552181c09836415dcf4f41ce41e1", - "0x88b2ebf0d77df7961cf95c1712a11438f258d6c3d2e014113e3d9aef7aaa6c", - "0x431df2e4aa221ae184afbbec3b8a06fe9ddc3ad1a24bcd98946ed1269f7fba0", - "0x2085926430c0c3a93f8bbe276008a73413d85aadeb87c35bca9c42d05a66c34", - "0x6ee17a022415361e687000e8cd1bfc7ec46ace8f2de29b0893e4a0778f10d85", - "0x6b690f00074215603edab594f98465e4de28fecd90f5ba2b2cafd6a7aaa9759", - "0x769d18543a2369458dbe0c9b7628fd2042720f8941cfe1a44358091f47a69aa", - "0x78f414a24db5f2c6d08451073649e356c4edbd8ca66a5fd212eef588d4706da", - "0x75a859ba682bdb6c2967300d5151dfc32e593a6c66a5f416a44466adc18ab93", - "0x6d3b2cc9b371e8feb31d30105f13bd901fb68d66b90959248378c3cf7bb7f73", - "0x150bd3a290bb6a4a8818d2a69aff52d5b6ce4747381f71ab996e23138ec72e6", - "0x60e7d9da09840d7c8615afc8b77d8dbc66408514effd708aac8bd728cedc3d8", - "0x34ddde2b9fddab828de31956a6995885cfda7f16748dd9c73c6c3e19850dbb3", - "0x7cd1821a677861bd5e1772e138616c62e149b03972a79c902af2f21e8da7c7a", - "0x7c6a80fb6b4c8268f0165d904f861df60ca04f2a24357a2d4bd00915492197d", - "0x52ac8cac9cb8bea5abad085f9bdccdb1f4cc903248db7f9be69a21f65d248ca", - "0xe9f66065c1fcde646aeeb6cdf2a9c923f9e6300e1a97965a0723cd2e038423", - "0x572f25fccd60c87d7308a66a7fcddf580e849a6b84a9a743bd434150a9c32ec", - "0x523f4914b37a6e6a93ebb32f11a2b676f64235f71d18881b7c79d8a9399cc8f", - "0x48c368a4c21b1e46256bcb3c110e6ffcd418e5c33bc6bc82e18885f82eafe1f", - "0x7f7b9dde8d7294927d73df6ed2e70fc4dfec7b1a402dca5abf8c0c648586724", - "0x670ff50da1a477ae34d44e27a3c0e87e267322843a2f04e86c8088934fcdf57", - "0x47d2e3788a6ce634c59af265553549586deb4c10038e6e6513ef64c26475f7b", - "0x4096c37cc4770dc8049b4ab483818f5746ffb05cc4916a1479096113fc95720", - "0x6322f2251894cf8934d5974be5a1018258acd2978fd99e0669ea61ce63944be", - "0x5fcaf134497a35fd68e39a5faa41939908d1b6cfba0e1d10764cadc5892f3df", - "0x27e8c046ca5751dd329fe0f499150bd40a7859f6616a31de35c0b73fc14e54e", - "0x1ad15273316815c320ec79d42e535070e2b1f67e5fe6d0d54bfc1336f176189", - "0x4c601a0d1098288096584faa8736bf4ff967e4d3a13389e2dbe2f7fba8b1616", - "0x32c0df48c19587bf6176c7bb18fff5a4c5e6025f07f3bad827fdc8b1da682f5", - "0x6bf016bcfe1b346dce014fd0683b65ff06c5deb8a311261ec5f163499a4f506", - "0x68f22e49430097a2fd3446160f6900a106d6c84f7e2267123c26394187cd0e9", - "0x28943ef3ae18150e46230d933e4799e98b1c9a8eed1b62c13ff182ca75a8497", - "0x51939bd6cf778aae328f9812517e6f860c4b9dbe771a2755b7815a40d12f31", - "0x72f0931ee56e22b129a42c51535b583ffc61859c08be04e0f144760ed0808bb", - "0x36f52567bf4fa74a79ca7b625bcb7eb57103c525b7aa28dd08aa659cbdd5650", - "0x635b5b1847b2a7fc7687c1b35f0d76fafbf1ecd26595e83c3025d96a535675a", - "0x62357f8f54bd53cd32087d324aa13b14355702304205feb23e5a50ab611281", - "0x6ef2b3a77797f7bace6a9866b02cf1d98f48f8c719061b6a07c698dc18d3ced", - "0x28fcdfc38b8059df3534a0bb29699eae6a7ccd2dd6f1a28d791c95780e924f8", - "0x6540dc764d1ef62efbacb347f79780a7b0526e6930426fb2f698364c4563120", - "0x19c2eb9ecae2f62c644bbf6d8f0161281308851f95202d7c4b6b7741a54eee", - "0x1dbbcb555d2b9ebe59b13c5d230539e05a1355cd45912c05e6751adb66155ef", - "0x455a2fd9e3c2d8034d550c80e10736d99682733b35ded2775185a24012109a2", - "0x534757d0cf17a80a60130345f66ceee6ccfd0eddb0b9e1740c71cf99f0d0dc0", - "0x6facad21e991ed6a3871491dd8786dfb6b2b1a6ac149b6735ed249a8c9f3abf", - "0x7dcc26d042cdb987f73227a56df5524c5b9aadfa0714a52de109c71d98bba03", - "0x5592f68cb8c1003b35476b2b3a78c4c619d3196bd90d79412a209b1c51ae9e1", - "0x204601234388ac5ce77bca83703b923512c87de9cd8a9191ef9f749540becaf", - "0x5f359edc9ec808c9e1585d191796834690c8dd7c4f9b20d1fd4b34ad5ba76b8", - "0x5c6dcffa770d4a505fc55da6a90cfdfd5b62062310e876cb3806a4db1768c98", - "0x20e8945ed0f5c1ff4576d28bb683b859ba545a812ff20861bc73cb7c94a94db", - "0x5e1bb202bd0ffbe37c7246abc67f34269e66be12c88b3b734ea52acd3652987", - "0x426cd1b02689f178a17ea7858f8379ce10b2354320a7a4a2e579bf2c79832ea", - "0x6c44f485087cd57554c72dcb55d962e0b3210228825e996de0fba726c2f3a", - "0x6f8b831ecded2b6fd51fa94dc117dfd2e7a5990fb0ca4bb7171920ab38c17b1"}; - - static const std::string mds_matrix_3[] = {"0x2", "0x1", "0x1", "0x1", "0x2", "0x1", "0x1", "0x1", "0x2"}; - - static const std::string partial_matrix_diagonal_3[] = {"0x2", "0x2", "0x3"}; - - int full_rounds_4 = 8; - int half_full_rounds_4 = 4; - int partial_rounds_4 = 84; - int alpha_4 = 3; - - static const std::string rounds_constants_4[] = { - "0x3ae0f1e227f07d44afdc33df7b8915d2bd01ab6dbaae60b2a134e9259cfcd27", - "0x114d526f505e83a1b28c3d9b887ef1a3c8c5748ab23edad68598c7dcd478902", - "0x249a1be6fdcbae398a1e73f8587cc1fca77980ebe0db094bba708090567dcd8", - "0x6e9b4a2f5aa3ce950f161b95bc2748fd9503bbbd3044c4b14c8fcb06d614471", - "0x45ddf8f194953abe944d9dfe6b89db5afeea9e71cd49a4b0d44d58ce67fa956", - "0x61319c4779db0dbc97c6fb6d324769c0643323132f0f63849e404b8038c1060", - "0x69f88e718b6f214c7b38d06fd1f7a660b24845fb218c4704b57eeadc8d1edfa", - "0x24eb120d474e6707c6055cbbb4e5a3b787898f3870be190334bab08e9faeace", - "0x392af08685367da5e82b508122766fc36bf1c966c83e2df55885bed13e164c", - "0x2d1ea3eaddddd61cbf57728cc07425aac654dd92327807a10d71cd997733b3e", - "0x1ea43fd7073a73547c58b9ec4f7b603d1131e1cbc390da838630a0ec5681d7e", - "0x2cd7aaaee44883cfbfbc3eb2bc10fdd88363db84917f3fee72f1d416bdb1137", - "0x4cec80c7cfd350d77b762c7761f294c2b9b90021d54800c800bb1ff25ada780", - "0x78dc8cc28efb02c8fbeedc9131f4cf47964236288ef33de68518d4f765ad01a", - "0x5364e342e441545b3da8e147c472b6fce34533bdf56d7358bcffc33676c2cc", - "0x2ec782c3c6af9a5c5f6af2722878d867f81a7acf7e7c3534465d1eef1d57b79", - "0x55b5b6a91382ef958dbc52221af428c0ce45f3c5a658587e24e9c5fe230e753", - "0x27d6d1f46463db0c4ee3734d6d6b3bd2565f650bc90257572ba6e69724a2c4c", - "0x44378d094cd0927fa638d954a01d6562dbaf0a0fd1a497aa9b20002a5becd26", - "0x2177f8ffc3264b921f642a1e308a9a6fb45a362ad7992aed465eab18c2bf8a1", - "0x7454eb1391bee4825bc1ea17efbf837a650ff4a1bb01b687e293988e4cd9dc0", - "0x59f530f80e6d8e88109a890b5754270a95d3a319fdc84bab642ea90e857305a", - "0xce12241eb2f1ba8761923efc2807f80a270e00e6cc15f48f46f03af36db9c5", - "0x4631319f803ab66aed0e67099a92ac43efe14d7b6eb93d854594d7560c75de2", - "0x7fba42108fbcb20270d591657434256b41e1f7ace4ec8a447ffab116e2c5fd", - "0x34afa14f2b94f6c860752924e9d66c96f71a903cf8852d3c064aa8575208075", - "0x16f7d35c844709af1263e781b173174dae0f3e16a29cdf4865a9bd241035a44", - "0x29e2baaa8c1f891de15c99e50238a0a2b5f24d66150d26fd7fc99ad76d22f55", - "0x6e95a6d02009bb383bbbe62904e90fff4c36c30ee1e2afce1d817c88c85844d", - "0x7f7d392e1ec8f1b46124d6021ce434db52d05e841e1ac4106debc7daadd5ec0", - "0x4c8881c6e3f6f7e2f56954fa3345ed7800bb62f9ac7064afeddc8bc050adae2", - "0x3df086d966e511986118d03226580cb232adc9881ec3a9fc985cc7eb501ba18", - "0x7fcc3f6a5d17440c5b4da4952c800b232bdc5d67faac8a2e86b855e30dcc285", - "0x5c2bfac3abd96afd11dcc6b5d4d8adf36216ca5c254a493c7c596be0791631", - "0x51fc674ff918fb4482f17d44cb9d9e9fb7e2bc649d157029cad49256dfeef52", - "0x7ffbfa9129d5e19f01eff68a07ed26af9c771356190f265de3a06e4fe842f4b", - "0x18169686c7e203a6c0ee6bde81ae847c8c112fb792a98e5057b238aea9e720e", - "0x1de182fbf19cc39e1e4613110edbc29e3629180fb3bedddabad9ec35b733d4f", - "0x3e1349e8d388ca1167c9c5dfe0b2147ce46935df062cb78a74bc2418479b457", - "0x43b1940cb83e55bff0e4f5c7e5869454fb06c00f5b8e3ff3f9bc5a1fc55999", - "0x422864182b4a4d14bc1d82734c4908c209d26ca7f155dfcccfade692e3fb2e9", - "0x3fe6d4a2d84aef0540ad998c3ebb46c883d117b2f8d976aa98faed5837f8f26", - "0x6546260850095602cac9da9fd063dfcb10187541517c7113fedb4ef33fd6ae7", - "0x3325d5be966acaebc0f5621a1afdd0a3c4e2739e4286fecce3b97f89f9aa5f7", - "0x77d11bf5378db4acb06901aadd9f658f03c1dd752d3fd9fb178ad91f345dbdd", - "0x77523ad82921c93a46e98616c6e1b1e2e5eec09e9e69faf825990f0f42a5aad", - "0x1212e3f4f2722f92b8f3224e2eed56273f5fc79f672aacbf1a0ac080114bc34", - "0x6b9ba762cca8b4bfef150dfc05027f4758f74570c5e93e3cf460d117c56623c", - "0x1768fa45ec882f38896ac997ccdf5fa312d8a6d79a0b3df9c72c15a8ee929ba", - "0x778ada07199173134eeb70da7e3caec528385fd95b9cc9f727b602f6a7058c", - "0x594101d59eb0bfe1733514c0a8d4940e7a8279eb502d6540354e800ba63f426", - "0x516adc6896a6ea907c0c5a87fbaa0e38e53c5fb60eef628ddd23e4a7a97aa44", - "0x588c1144b72cafe1251cba01b769757e70de457c7bcda9925db7c936173a716", - "0x4e628700227c9ce28efe3601aae7d8aa67178cd4c188157cf5b17f05d0598e4", - "0x70647385803086055e20181501dbe605836f1742fa3b96ba18c5ea11f18468a", - "0x10daf3a04df63e03036fcd547c6b413fad9e6e59f940dcfb86c072deeca33fb", - "0xed04326e3a573b37ea8f9953466520e795d4e12d1c64c52d3b536f47567987", - "0x4d992639f05752dbe6c70f453fbb53855d21cc88d56aec73896e405c900f96d", - "0xe7f902286b5a1b7d1ab7a6cec38956005b37999ac232f2ae4a6e16cf210d2e", - "0x65ce522826d4a6bb7dd00bb04f89faa995633f42af1a0e6964edd882e3f1fd0", - "0x64697b2715aacc32cdc721af25c5b787527acdcba5c09c13de40ac101701ed2", - "0x6c2bad942d5295cfd69bacb2af51bcbc4ba381c58796bf463c4221541befc63", - "0x5bbc4e2c48c21e8988fb5d91d92c60ec57993584a6dd5b8b4613df5c318107f", - "0x477a43755c395ebc06ac955766bbe802004602c084ffdd0e5e94ff520142d43", - "0x38d4fa47685f81b68003cea49e836861a7ea4a63586d2b6757be15a362b9e3f", - "0x639db31367c9b963a52d386cdfde4e93d674a3a5a9e4f24071cd9870112fc14", - "0x37cb29fd6477b46866bbb838a3547d90e890881c3e24a83286c03239a3071f0", - "0x6c060610fa0c67fcded8c19bafb693945b948fc875ce7621fb2a6b598cde7e5", - "0x23aa9f31fae639bf0644d9c7f4fcf0d6303763e538a25a167531f70e93cec50", - "0x56655709c14a4746a58de5745138701b0471dd8848eb60092362983296c4977", - "0x247ff957bc24c26639e3098166338c4901e89e866bc82c5a5347b4b974d1ab1", - "0x50d38bb080c38722cc3291bca23b789e82ec01e3bba9083c63bd1116ec1fcab", - "0x2745cd5e92aa47245ae1cdf6d93020181e340701f887fa2af4ef1420a373c46", - "0x61bf9671ae3d7f811241802ab1ec4cab48dc18259c1537762e7c8727f3607a5", - "0x54cd8aef42e41596b96667262ec1f7f2bd5d779c998f343843e5e368758969c", - "0xafda685909cbb95e99dce37d8fd59ac222d3f0aff3e8b23ce30e523255c80b", - "0x3f1f8a3a19407808c4abb6fc1fbaa40c5606fecd57740da92dadb4ff3585366", - "0x3c455b8315b2193d492cd7b602a38e711f996e3681ca1d29a80867b53b49d8b", - "0x30785b6eb4b26d66862c947385f29a62a3c5cba6fa0871c0fccd8c5662a9593", - "0x37af8afd15e516cf09f291587a29de7cc955f80bbcc11dc6e48a02dd49756ea", - "0x567312152887c81301e3c4a789d7a2cd0bc128a270f62410d706fc67c4c4cf5", - "0x17c28e94f6fed7c7ad06fbc5e58e7ed45bfcaa64d6f437cf907fc05765bf5c0", - "0x337629222d63f6bb7855f57ca6947efbf586cd8a216e79e24dbbac350dc47c8", - "0x6724110997ff954bd0aa70ea4d705a96b34def12f63057b07a0e843e8f5db38", - "0x5fe567d1b028686059c9e61de051919d998870781e82d13ff47cba051613c7a", - "0x343e6009b4885418f99fec23867045771ad2e0344db4e34e8d6dc30f648eb3c", - "0x4a25c02f017067d34fb912d5110189727d013efc23addf5afd879ada00d517b", - "0x6b2929df0a2fe1a7588afb20d7111fc2d8a10167b4ecf0a1de9f5ddf371bfd7", - "0x5f4483784ac58208082c0fec9cb199f2b7655025285342223d24d4f9721135b", - "0xb8ec66771d0346b595615e31b4ecf247778351bc8b0b443c9bd887f2538c39", - "0x76106c0e0db026825e74dec1b89c2d5012ae592bc1883dbea227a0c3f06c68f", - "0x183b5f2e16fb5a339e8ed191c690926b860b89516d756673760bb63e97cbcc5", - "0x46edbbbfced10a9111d5109d403e0d2a7eb69b3718f441d97fe7d40d4301f27", - "0x65bd7979cf4c4758d5458c47fa0f65af4cacacad39467a037a610ddfb0db579", - "0x5972219ffffc2d18e176c818cfb2a31323356473515644ca328994c9516849", - "0x3323e324563028cde244cb58d01d8456caca5653636569e19b0e499cb0ef769", - "0x162a749a5a5662c6df69b0c81242cf27bc55df0622aab292bb5b80d6342ba4b", - "0x48ade57b4d07dfe92125aa5b680a17f5bec402e1da0e880d3afe6537e5b0092", - "0x1bf69618788b072d29ff3439cb5c800a9e36fd453feae4098a46112d96df936", - "0x6c31f8ce89d5c8320e31017bf9a16bff4e40ee9d7c3a02f8c978449f578efc3", - "0x1dc5d9798692869ad4612fbae5d28aa93f7665755828a840ab8e968646651bc", - "0x5fb5fc52e128b1f2c8d81c59dd22a0fb725ac37b8de860e5a2f64a3957fe0ab", - "0x42c6d49f5bfa8f181223de55541f0a041f15028250bf82603e48028ea52ca70", - "0xaaa339517ebbb7f6327144f673e3fcee23227ef27b53a5cdad40f431bc7869", - "0x11374315bcd85f47a363f6678e3813621fdd00bbbac5b4207172337d6959be1", - "0x5e46d99703b99ace3266e979a62be1fce9cc8bd18490eafa39711d7b59be73e", - "0x4fca2a2507c5be8dc7b0159c8d5e6bb39e6ed054a7d9fc6f6c2be75f0837a1d", - "0x542d758cfe750b05957db7a7a457da24071ad8d878d458d3201152a12510fe0", - "0x2086e705c69d654403076efeba8bf38549c14445e0e571acc2b22ffe5c69ac4", - "0x78920a1bcf289a305369569bac0b11a7fd6c064bdfe677401c5162592e70c4c", - "0x414051123425efa9f182d41d822d0031327b95e5dfcaf39dd96e890403e018b", - "0x709f27b4cf78f1ca6ebed94ff7faf5bc8c5c3e09b93a9e0893b661fb5e650f4", - "0x2f0a8b9633d6d5495df7b726ca39b85581cd09d1d528c8eace4e27e1008af9c", - "0x63273b73e79fcc8af1c6e63a7fbfc3eacdb472d57e174cdb5df71cd7661e21c", - "0x228fb8cf7c3e83ab6d0532123db12787713637ee9c36e795433df8c0b0f79c2", - "0x215926ddc4ff0f97f19d96fcc003d05d8f04a241065233fe9d0a7cf09f3828a"}; - - static const std::string mds_matrix_4[] = {"0x5", "0x7", "0x1", "0x3", "0x4", "0x6", "0x1", "0x1", - "0x1", "0x3", "0x5", "0x7", "0x1", "0x1", "0x4", "0x6"}; - - static const std::string partial_matrix_diagonal_4[] = { - "0x40c07e7bbd39b86fcae7e7523bc39fddaa886a6ef6e72580fd941aa08ab37dd", - "0x6db3ee78e607dc8f1f737405768c6a2ec0923070b1741cd6a36ffbfa900ab3d", - "0x7ea30c9d3115ea2571b6d0907ef784de7f2ddfdebc427dc871bd36a707403ed", - "0x7c3a59d4e85b2e64147d33e35156d7cea9e08a3124acc8dc9b8d2deb9ed7216"}; - - int full_rounds_8 = 8; - int half_full_rounds_8 = 4; - int partial_rounds_8 = 84; - int alpha_8 = 3; - - static const std::string rounds_constants_8[] = { - "0x1dc1b64cf421dced51ff26fc864b0030ca0c190f95bfb32baf8e96634cd0b06", - "0x67f5774f3a4bef2500c250992e1f75692676391ff561f05dcec031ae9058efe", - "0xe37a5ea09c1fdff416e0ba2e74e9142f695b281a7ad12b6d2cfe605972103b", - "0x2a26d3815a899d294341a81ea81be327bbfa0a718512b47c6f52d00b25df30", - "0x369e038ec1c2a5dccf7fb1022110551a21f9a96644a7b06b456bffa61b9578b", - "0x2a660a8b1eac3466fb17525d42cff5a42f77714e68d43cc38ec1b6ea794cced", - "0x420ec1546964e58c410560bbd1074f5b6691dc9eb00680492cd9b6a8dc1a86c", - "0x547647f34378b5b42a57df08fa5d959426f3c9a6bec1c7bd9e6ade8414814ce", - "0x238546938553fb2e75783d4362c8f8a2360efafa94867daa93a607194313394", - "0x175e440f41ce2dc9c031ec35e7099c71e2bc4ccf350a98c8594b39f4a2ea217", - "0x5a21109825acc58e4f6586b10e3cbc67b47f000bda60b4b146cd2402b74f98f", - "0x16ade3aadb7be24a8ed7370678f38c0af03ef5b7787e764b96b5eaf7cf3d18e", - "0x65db07fc98595c39be9fd0c588651a06f07007aa8091ae3441a640a3345088b", - "0x79299c59e40ebd9f09adf271dafe405d93416703d8d5e0a7754407fc1a522c8", - "0x18c322380912c0b08d0a80c0ac1627656f562cf5044bacdfcc955551c7e1aa3", - "0xb942e84022e1279984565b4dd6dadcf7183464cfe1ae56c01b7637246f508b", - "0x671cb1b08341c4acccb429e8ad3c87d9d56da3a55a8889942fb0962904fee17", - "0x66be6353fcc3f1c839844491238b83cf08f8b86af85b1fe28f0b72c74c18e7a", - "0x12fa56b5aa36f3c60f6a1601facef87d402b912cce05368e035cee532fbcf4d", - "0x5f200e942087fe4d99b74f2669774fae02b8b2e2dbe273c279cb63c1de3a8be", - "0x5a3bab97cc9535313ec85520e3046561c50c4588f993a65e3757f0e50041b92", - "0x538d85f1cecb88867bd31a4ee69dbf011e4fb9634c03707e80e024584f6ded8", - "0x23eb9fc9f188395e54597652ace1ce16c996427a68cc1bb25d62cb63a582cf7", - "0x3436ad14e88d93db8e11a44ebbdc419d88362ee0886fd7a33c3c5db30606aea", - "0x42377204e23a3a2742f703fec4455e88688ec55c6c6e1183ba1c8ac5f1caa34", - "0x27926b72ec39c22c5d85c4d68f243883b99ea1cf0609dc1d4af88681e8d125e", - "0x36d1dcba1c367120152c3ac81fb983fbbfd41382c3ee67132fa9f3da6cfb66a", - "0x45d157aa5e1c2058403309185ba61884255e8a4110502bc7b6d62978977944", - "0x73b2b6cac7201a6878d14996703f551fd0e491e5bd299f8d25d52e1e2874800", - "0x78ea702523d066eb77e0d89be25f06b86a4ac1da42bcbb4da211ee2b52def18", - "0x1054cae64b975a6f3aad9f4c62d2f2d3985673f3aee31bc181ece265c3e7825", - "0x45212df41ee81350c9eb7e555975fe898e346c69bbc12e0ad1f231a639f7dc4", - "0x7d13bb0d431b252d142d02fb8125c764cb95ed3b66175f8ff606ee28fe8bb9e", - "0x770b4f5ca8f1f4015aa7872100ed7dcb75f3738ad7c81cb61bfc69d1a9c0823", - "0x31e3809ab7c9b684fb452e6ef9079d659e20685b5129994679d8e51da1b1a68", - "0x727ad1c2130ed1bba0158a6b04b07faf80d64146ac828710e9a951e350dba6", - "0x1b415f267b1bca46e755e6011197adc42e3c558cfffd16f6517beb88e881397", - "0x435bdadddba7d9a75fa223d16785ebc613840c0be181341a0da28fd6bb06afb", - "0x1b63273a2fe917ec496fcaebf59fe08af6f4595b6b4745631d73083ae51ca3b", - "0x66b261ff1d490fc0a0b2d4f69585e33ef966182e6a6b1bf681c57862ab27ed5", - "0x1df5bd89bbfad687ed767ee34d49dd56d29f198749dbaf2f1c17869916dba27", - "0x6067a2abd3daa6fff26a7ce80b527cea2c97cd100971cfce5976298fe695a4a", - "0x748106a445f3382a9e85aee615b308b3c15653a6f3777802c458817e0c27db8", - "0x65145809521313c2656b3017281c246e814fa08d4782834900adbb292b9618a", - "0x7a3c9bc64576572aafd23213bf04fb07e4b87e4f5d0d65c8be438c31540a7f6", - "0x728a59c923362a9e6fb0fa9e59f155ce2774e94d6ba3f7b5e3f8ae560a884a5", - "0xaceb902a596b2f37965292b3bb6a3a9c49a79f3feca40804a649f493c75f9a", - "0x6045b97db08ddd7d2201471f3c67f9b090049634a185d13f487ab458bbe8d07", - "0x2da31f067adcd1fd88a8d0066f45978c6830628b79d6a4494b6dfb302cec555", - "0x4fdadfefe820945fed237faf6d63f600a31f5fe76117c804d35135acb700ae3", - "0x1198cafc274e5fc504a90430974031b234a753e28c0fa3c5137de8cfc11eab6", - "0x3ea656106fa1eba6e811570c7b57c81042cc8ef67bf4c1a70794fc7308f1de7", - "0x78637973d037ea2744c0af32fe1fe7449fa5107dabf20725abb2e5b91d30ca5", - "0x4df4b2c1475c04a1adfcf38060880aa80eb4cc16beac730d57e2824856925e", - "0x7e7fe4f54d69df0e8514964d5a2bcc4c216146fa892fd6b8ab4e03839cafab9", - "0x59d4f7671e8dd6840bcceba26d0665603005e6356db06f59eec3bb3c89c96a", - "0x3f304ca46a7f5415b164c9bc94878d26f0923641355ae7a07efc5a9f66c76b8", - "0x4d1f91e360a2ac75278cc8a0cf8b8e07fd0a568a7e756f651b52f769475bf85", - "0x7efe8ee65f8b4730716b7a0fa7b2066eb9af9ea98dd12b5f56637a5f073befb", - "0x2ec653a36f6cc74cceba2f7733bc4a84c0ffaf0afbe4f3b61568d97fbce327e", - "0x496c4158f94c51e02c532ce1403f600612a2ddb6c2019ec4cd2b1e14147ec56", - "0x735017e7df1d60ce4ab1d565c19c0ff0259b0567c6fab81c67f879871e7f330", - "0x799b6a8b60191aff54dbaa4d830ce2cd6293cfad13addd01be6b1f3276ea758", - "0x1b4aeba51045e0c3cea7501f82c36b53be7c3f1084ec5df68f389de68055ef1", - "0x70d2a624d2ed94cfab065697ff0860dfc455029debf748ec4cafd65fa60977a", - "0x68a09c859ba26fa25b9d05b62df6446487c7d0225f08d702db78c4539d5f820", - "0x4615ad3bde830e21fa37f95a9f22484d0b1f3a473aa8e4e10e47728b73d6e9d", - "0x70fc7fa52fd9e8e941e005a7a869a3085151c568fadd8c5cd386ef4b88ae22a", - "0x91964f379d56c0188868c6b67b9d3e94c340009e6d28e8c870e0c61a36b3f4", - "0x357df0815dceecf9368e7c19e9c021e8f7af6be41be5e3a66e0e65182af4d6b", - "0x46ac7146ab68332bf2ab8e6f884ba60c7962a4db6a9d00603d61fa087fc4a78", - "0x15d4ae46d156b32937364cf349aa0725a40feba408ec1b1113ddba5a644622", - "0x6aead9862822a712a47bfe47d82ac1f3ce3bb266a9a765900ed58e263d68282", - "0x33e85f827f791ad324ed1437011866dc29ee64999cdfe13f836f204f199300", - "0x2c7c67760cd8ce3c0a0582e808acccda386dfce99dfcc609c2cf14eae79fa9", - "0x6c1a7e8c78846e4b084d3d15134407508d7f7ee1932a5b991569731fa2b92f6", - "0x4ef901fc6049a379b2b6dec74e94b7f174249e213d20dbebd2b918168a11a9f", - "0x6e403c26f54ea179578ba3d43283049e8a97cd45bed41996b6f297124ff5c1d", - "0x2a3602932c8509c61b5b1305ba08844eaa012796d59d67fe8b9e6181a00cc32", - "0x111ec0aaff8cec77d1cde861af841e208a9347194457a7a921ec5bec216d14c", - "0x73b4d9fa1cb6b21a91a5ab71d126ac423a14e7d4376669b3032c455d3512d15", - "0x527a133541df13604aad50302347f140a8cb79961ab8dd6ae2751815ff3c732", - "0xaf242af3e0d089bc0f8db4889e7553c6455273d65695ceb74b4240172c46f2", - "0x5830bf5f04afdc52de5a252b88fcc811ec72806e2a27901d073feedcc2cf3c1", - "0x7424d997ab9b63c6cdea6fef723647eb870ef8940c5f26f46253cc06b68c139", - "0x446886c11ff303c299c68d14c1f2840be1077d94f5f63d5c687cb3ea3e4bbbf", - "0x631a09086fe684db052cda0555e31705277edc5e1d2a68e969b27f81ee285a8", - "0x26889f5ab4f2c2cafaebab554e514ffb75ef1a2c18bf54aca68d04e1619ebd6", - "0x7929f41feea5174fe06b989d8301fb5d484e99bf30ff120ff09cf9c8228fd4a", - "0x2be5044f968788cde988633416ea115160e3aaa8399fe3f4bd37f46f9708e4c", - "0xf17d0523891c7a7c620a1a49e3b4b909aac8062f1d1c1e0f57161cbca78b02", - "0x786efed5df1fc4c9fefe186a03370248d093ab2d664f1c4d580544ac193d006", - "0x6f373e69c7490462f53d3485d64bf27e587d773056f51dbc7382f8a85d61998", - "0x1cea0e2294a6e533485c60efad70c94e2c3c8927f1d6cbe7f6c25f507fc114e", - "0x1a8c70aaf9aa249cf6f193d6b45baa8ab9fc69997b5c0c6f0a4485ced0bf34a", - "0x178e3b45dc4d2603c3221121499b6968c5c5f089f42e599a0523dcb9666ac85", - "0xd1915ebd1aad0a86e8b4007f7239882c3cc314b3e044d38c6c4b3267dd6e67", - "0x7ca5dae4800695bd797bb97b384492dd2d0cd5e15d4b9fe6e1d8ee80a08b753", - "0x6b6082f77d4e9672768dd60fff6d267f561478407dd346ec50f1934dc37d88a", - "0x49aa3c242ac10b2cc4d3d14a63e58e891e112a5a4f817df348c52e8240b9cae", - "0x268e51cbe3d348e1646cc459cac6ae63be4f64f3028387932df65141377283c", - "0x1a7225429d1706d4b5ec4919a5d7387eb51216d159ef6594b0887b020be7893", - "0x13a0dfb7f10907e4222393f20753d04b371584ae194cc8c46da771ba17fb5b9", - "0x6b1d3097f50ac809a0d42bcf2cb92d69681ebdbbdc20132634dd0cf2d040fb9", - "0x56d79cc5d6c2b9a95543f17517ed6eb232ce288b32741f403e4acf1aeefe134", - "0x204aeb4a69ef10391876202e83352c18d16f0b17282c0a5b850858eac0ce3dc", - "0x540855a80d3f0c03a12bf57e08d2c11ee78bdaaa56500d9f997666ccead78a2", - "0x216d99f8c632ac1e0cbe6b972962fa12d649276cb41ca71658c18eca8eb70c3", - "0x333d2eff383822915a246ccd931180d1cee6357eb88a903133f102df79f79c3", - "0x67fdec9f13245cfa25b5dfa3d1f2707472c66383014d036fcbd4c2dcb351375", - "0x36deec64f5af15a8a303e2866fa8e247b7cee6051774baa2abfa65346e42ad7", - "0x338fbb3d25c08562336bcfcfd5aacb16df094575d914b8b9b434dee33344bba", - "0x5e80a38ec290edc82ac034f7c4a54d8b54574305c99f33ea84c274948c48bcd", - "0x32e6fe232bd548d72e154eb3ae082fdd03e7ea6370bc45c94bf04d55c1b8bc3", - "0x550d7139cef8aa52db0e466c5f0701a9ca4511bf234824f891bc7096c18e355", - "0xc747bb140fe98d97cb8b04df92df18bd178036e10bc631219b466b8e94420e", - "0x598c37acbdb9fb7655682efa60281accd5dd45db03cb2c99cfe0b535f5467e3", - "0x335c3a0be4056462d645cc5b009524b37d4058a0b2d1a26c1c471098c95419d", - "0x6d1a3dde9e63c23ef2d84ce4faddf4e524f2ca3b36fd9dd1b0bb520f732363e", - "0x17e9984cb5dad2ec8a6bdc79590a5ba49bc9fe00eb4bf03bab2f4f999e30384", - "0x4da49e6f7ef55cfbee8ccae70ff40cc7cd41990b15f98c8290cb059701cc25b", - "0x454fcfdfa7fd68864a35158d8032d98a8543d6461dfe6325a88f2561d9f572f", - "0x945b09474cd0b1eeef627117e09b1eabc18b9d92897cfa7ec938dff5abe696", - "0x3c7779fa40ae44a814bf74ee220e646bfa8bb2a1b37fb20866817bd9930fe3", - "0x7f078819f18bbe8a494784f4d3b79b7681a508e5508f4c7ac626e71d5e8bf40", - "0x6743b80ddf7a5fe812bc4f17acc5f84f6e8858aec6cc68ff4854e9ecbf79749", - "0x3779a8c7c1a6ac73e84c86715a939e350696de9f3718b8c93cbca66970bd5fe", - "0x502d3c3473bd8e7d688051f386dee6d9a3ef64faff2c58fc63dd0fe4b892d8d", - "0x1228692e214cbf7c58fb265a52a0090c8b94679fab9eafe1a76d2bea3a81ac8", - "0x6f4aed19a089339d7c32bcbbc3997ccbbe57a6c4caf2d0eae6a14329625e696", - "0x112d98ef8b3bdbb0ade40f9c20cf1e950573a3ee786311c452dc73b7ba6e034", - "0x655b897c83df406644b61ef9a5ceef9ea8abba78cc082688cc821c39156e669", - "0x5d4cd0079837a70ca9d9bed73f688d77869ae4fc04c8ae48e73a43c3aefa051", - "0x7aced74ea16340e0353df999e84280f6a5066a3dd56913909a01d8ad79d18e6", - "0x324da88f76c46bf96d54f1323b0f471788ef1679fefef4a29cfe8c8ed061e29", - "0x13adf50cd5381f068850e34a7ea2cc527fc6e62daa182efa305be2e2cba93fa", - "0xda8d6039f00b389f9664d7516dfb6c1062c539d34369a46a430e1c06e2c946", - "0x500043e7b438c9cdbf0effc0dad8373e0eba1377f05b7b4ceecf53bff9ef963", - "0x79154aa68d1fbe6dc60ed7180d74243de270588998a4a5750205a10e48f6d4a", - "0x5c54c8396cabdacb087e3e47919e8ac6af5bda3f0269a1b16180a7b14f1b92a", - "0x8b169c489fed2e3eff18fe7cfe70e5219e7edd244f1336b297e20b2d2182ad", - "0x1a90208c8757755b8c803678d5b4196eff0bf201831c572a7e68bd3d4e77f41", - "0x7ddc9bfff1b2b27a10be018b7fd1846bbf7b794ef2a03b578fbc2e4ca7d6c73", - "0x10fa23d64d0f34a2236209672eb2301e8fabfad10b200186da86851d9d72747", - "0x158c239bd20c6791f08f68de66bbb3377b287ba8e3bfa158dc57afd34f02cd9", - "0x1bf60e0492fd3fc2f7e2713bbb1a5d7249c848762eff5ba41af0120afeaaa2c", - "0x7f1ec099ba7d10979f4a42929f1fb0b1f839869e6fc4062fe96c9c9359c69e4", - "0x605bbb407d2116d4097fcc9d246c3b75f8fb5765c7a1453642148c567fc64b0"}; - - static const std::string mds_matrix_8[] = { - "0xa", "0xe", "0x2", "0x6", "0x5", "0x7", "0x1", "0x3", "0x8", "0xc", "0x2", "0x2", "0x4", "0x6", "0x1", "0x1", - "0x2", "0x6", "0xa", "0xe", "0x1", "0x3", "0x5", "0x7", "0x2", "0x2", "0x8", "0xc", "0x1", "0x1", "0x4", "0x6", - "0x5", "0x7", "0x1", "0x3", "0xa", "0xe", "0x2", "0x6", "0x4", "0x6", "0x1", "0x1", "0x8", "0xc", "0x2", "0x2", - "0x1", "0x3", "0x5", "0x7", "0x2", "0x6", "0xa", "0xe", "0x1", "0x1", "0x4", "0x6", "0x2", "0x2", "0x8", "0xc"}; - - static const std::string partial_matrix_diagonal_8[] = { - "0x497454d465e135e410d8d4d87eebf9044063e9aa1117404007501e8ce0bde23", - "0x7f4f3d75ab3aeffdbf3166723e534daa541733620e3ee68929dc651eaf47086", - "0x4a85139b01a3808e1c7621ecc3cadd4184dbf3f0fbfc0076db62ac98c960667", - "0x1f190d316147b04fd4fcae4e6805c017fa809726abd5a910b43014b261b5272", - "0x4c19e5f4d9572b169bdb0345212e23d7e1e62b35bf39451b1ead32bfe6bf135", - "0x1950706ae9759aa2adc97ae95b4d2cc61a1f3089effcc1ee09976a36f8d335f", - "0x6403158bda87841ea16e7a271b5acc5c5f36ced8d413b43c53802e638e7d029", - "0x6f393735a1ee452d20a6ff1168eaaf8941693a39dbe1e8de366b8b4b62f40db"}; - - int full_rounds_12 = 0; - int half_full_rounds_12 = 0; - int partial_rounds_12 = 0; - int alpha_12 = 0; - static const std::string rounds_constants_12[] = {}; - static const std::string mds_matrix_12[] = {}; - static const std::string partial_matrix_diagonal_12[] = {}; - - static const std::string partial_matrix_diagonal_m1_12[] = {}; - - int full_rounds_16 = 0; - int half_full_rounds_16 = 0; - int partial_rounds_16 = 0; - int alpha_16 = 0; - static const std::string rounds_constants_16[] = {}; - static const std::string mds_matrix_16[] = {}; - static const std::string partial_matrix_diagonal_16[] = {}; - - static const std::string partial_matrix_diagonal_m1_16[] = {}; - - int full_rounds_20 = 0; - int half_full_rounds_20 = 0; - int partial_rounds_20 = 0; - int alpha_20 = 0; - static const std::string rounds_constants_20[] = {}; - static const std::string mds_matrix_20[] = {}; - static const std::string partial_matrix_diagonal_20[] = {}; - - static const std::string partial_matrix_diagonal_m1_20[] = {}; - - int full_rounds_24 = 0; - int half_full_rounds_24 = 0; - int partial_rounds_24 = 0; - int alpha_24 = 0; - static const std::string rounds_constants_24[] = {}; - static const std::string mds_matrix_24[] = {}; - static const std::string partial_matrix_diagonal_24[] = {}; - - static const std::string partial_matrix_diagonal_m1_24[] = {}; - -} // namespace poseidon2_constants_stark252 +int full_rounds_2 = 8; +int half_full_rounds_2 = 4; +int partial_rounds_2 = 83; +int alpha_2 = 3; + +static const std::string rounds_constants_2[] = { + "0xbe9862c2c85f9b9579e6ccf7fbf7cc5bcea8d6eb9a694276c85bde86001df7", + "0x6826708efc368ddf57ef6c598d2e603822d07bf58615884f030bd12391dbe59", + "0x354c75c71b9bcfb7bbcb3ff4e717f9f61c589fc7b5d05e952867c189e99c4a", + "0x42459dec4e17fcd194dcb0a86826aa4af72fdfd344e07b6e69c3cb4a9926b3d", + "0x58a66a42c611428aa182078c2301153419a730f49f19c7cb1f781ce5fa09880", + "0x14a34831511e537e22cba8b70897538a3817e51006d639864a3c6b6cc8c52d9", + "0x46df5263df1dc988fa4faa553e965a13ac1f54849aac9280b0dc4e657a7e85", + "0x7b027ab441c2fe8929ed14301e73b8f2ced4af28d00a1c1111d30eda33560d6", + "0x465875d5a6fafe7dd4d0a7439b7a14036ad7f55f3ec0d14f8d694fb9db88db5", + "0x7f7c948cc5cc7c8f80f4a91671bf540c33e23d2f6b5a5cbefd41bd4938f9d22", + "0x4e40bf6e6bdd25631fee78b6518f70a132deaa11047d277baa9cab95beadec", + "0x164489530518c87fa7ebee4fa20e9e8dd1e51543510cf0ef772c243b6a87021", + "0x1337958aefcc73118bd744cafd13ad6dc10397a804293a76e29647d8ec7cfb5", + "0xf556a7d5212b586913f4586fc50ff4dc85d2155c984fd7f8407eae848c6911", + "0x15472c50492ca676f07c334cbaabd3c987639236191c1e763f140e1efe43cbd", + "0x58f1feece2711bb163e352b5eb752cb44a19eb7be5d841887f5dc9f4aaedb7b", + "0x701339969fdc3900bd5bef6c18a5da356182fdd367eb09e22ee3eb19b6a88f1", + "0x3bdca0aadc43dc54a2414b183d1eb65d0d9a2d7a7c89fbeee95dbdabf73fcd1", + "0x11ecf2fbc0d3491c45532948ef2f22d7f9194718cf3a5680ebefa71db126ae0", + "0xf87cf53de358b5c915ccd24635367b7626d8c1cb120ce373d192ace458ca70", + "0x57b09d13f7654330190e89aeb10af8c69e2a39f2cb3d548c0434630c677fbd3", + "0x36b288ce669c74ffdc1be3d1b3bb720081b5d7bdb3b9ae9a1c7d436308022b7", + "0x6c7f3ab2d5cda243f0715e12c2f8da5064a96fad5bc0ad48901eea4b6e7b06", + "0x6ad55a4cd23d8e65364212736985d96879b2a72251b385057ef7e225d00e7fc", + "0x2e47d50c450d7867ae49dba0e62d23aa2a1fe9fc3bef6b1aa3ab7e53451c373", + "0x706473d19142f668c061f4b8080493238d1c6d4b5696531bd35f16e756445e", + "0x564e49e699b7c699d2305365bac93819b16612e033a0a5e3d1d795a561dbfef", + "0xce78054cd89216eb22d76a483f5241fd5658126a0e158092d88ef1cb88573a", + "0x3dffddfde431b2dd2b5a3b4b9774fded32e82776841b70cde36dffbee36b50f", + "0x11f871b5b14e5c5dbd109d2b36f5d6b92c6b65ba1ad5558aabdf589f5d13550", + "0x330f3c9d5e2a807cd85007d5158172cd8d77de56e12db4246e18d4da1068dc0", + "0x3baf5f719a70f0e55dbce44817e614f6070153e7b2b84e07b197418afd684df", + "0x44c695f29934eeac09ba8ff4b3e241223b11ad89fd2e5e8c3f0c6fa33960fcc", + "0x424554dd9dc82659672d20b070437633afc0a2035a3c5d20d3c7d624882272c", + "0x711821d60549afb61d92b8159fc778e9436edea4d15d73289f8374514ea7f98", + "0x52f9ed7a8163b0484fdccbfeddf9ec2f0da49d3fa8cf81ba3c2796c41f0e9b", + "0x268f1d473f1953d9ed0ddf913bc51815da79318b06adfe740cf4f414ce0d2bc", + "0x6a958dd8a4c7c95baa07b7377ef1858f2be1305b3e58bcc66d8279a53736839", + "0x6cfcebf0e65f23751afdce5405be2457be17b442b632038fbf66d207e5b62f2", + "0x14d6956ad5cced753454d9b7db48c1c54c8c3a44a818efd24636645a5554e7", + "0x29d59352e9e62be3a29e19b1be6c491d304584b880ef7d2376e58d10a22c464", + "0x17a534fe6949c84129f48642dac4ab9ae5c23f44301b80a44380e19c7c55454", + "0x3862b06416edd9d30d81614f6c5a069771401c9978f97580d9526d4107450a2", + "0x50184c24aec6d6bb7e2e49f68752b4c3915c91d60eb4bb3144443a22bb386c3", + "0x79a1f35718d165c1f67912047754c37104e6d847ae9d6ef33c6f940df643a17", + "0x28199c7b0898636155cad3447889da7a19c83aba882181bc0ac40172c333743", + "0xa878b12e75e72520b0bfa1b90159c6362776da9072361f0bba3263a4509cbd", + "0x6486eb3d5d4782813946787ce6547333f15dafdae7ac30e5dc5125bfb47730c", + "0x7182a6d866a3f38a4d8022869c98ecd826317ce7e74405000be7e09defa542d", + "0xfe1c02334743a03c9c32e67cb84954bbe54b35ec64f432c6659b54fe90ead6", + "0x63576a64c8803e2f4ff3424cddb8b6e00258f4bb67c97fa72fa2c9c1ea19ca", + "0x86ef6c40c4fe8358f7dde759cca862feaf994dac0a35e3e2c0cda686fdcaa1", + "0xd9b9e1ad71234328ebad892827fe514cda3947f402022231de9f6e021a3c51", + "0x1afe52c82bdf6e38f35b53f2b760f6418772426bc15a468e9621b49e470cfa9", + "0x56c1c837986e980845bf8ca4067488b595f25f52deeb7b27cbed2ba36e714", + "0x1f4ccbb869cbe3824c4df3f37e41f50c48c9932cc8789395660054130758eb7", + "0x4152493af342d9897c9ec8fd64f30b094c11ed3b10f8bdef4d90d0b03935bae", + "0x674d44e7337c9dba1b7274973abba3bd23e42409bac962779647cfd0430e59b", + "0x557998385804d5b01bab2328ccb9a9d99a78fd1f5669a66afcda2e1fcd97bbc", + "0x480daf9416b660713d4d117f312babc93f8bef8dacb76fcb9de62bbe16e08bf", + "0x6837b5553e5e6cd1dd7c021532de8c52518bb40c7497d091cfb7932e10a0750", + "0x24d616e2d6f4bd4215134fe314607071d3ed7df3e9d032a7bde0569341678bf", + "0x4cff8749ba090ec8c0efdeaaee6404c8bb8d4caacfe0497d50b7a94010ea998", + "0x2c70a84dab0194440895aff7c0224cc4d9eb07f60be424ce9e22a7bb30cb60", + "0x61300a17ad11caf2c909c3a0198faad3b89f13ca9a2a868d51b8d8db0e95433", + "0x4ab632b402f5e85cf673d2f7f30dce932a5d6358644efbb82b4a536c3dff25d", + "0x6dcef8a58b7cec7b971f62444579f0b7cec20d5620059b220c67e72892d62c3", + "0x347e6ddb932efe7ecf61cd63195c082b3d69584413b43e0731f013ec9d487e9", + "0x7f1b706b02e8f12190f1bc40fcb6ea1b72cc475d2ba5bfb4af30470f5f141b5", + "0x79321551eb322fba1e88b14ab213e8be48f8537d2a94bbf93eaf1b3a5c8241d", + "0x68cfb70f8a5b2b74b4c301fc6a44b28b58724e267b1b65fb40f18bd1bcc1c8f", + "0x3d6819d69fee87122fda2d9e8a27e51fc726a093ec41a344ce32ccf8db933d0", + "0x5c3769e87ef298cf02dfe564f5e1e9481508f08e1c54e84603ae143d0441e12", + "0x22fb8b063d5e3ea731f0dcb1a078fc04e7158d1a3db6130edd8346525450976", + "0x11f5999cf460780c370dfb98df278d5aab1d4b99ddc41ec93b9bfca7992a454", + "0x17ae182d68f10a1577dea1ee80ba675b9dddcb08b06d905aaef25b0dab120e9", + "0x35bbd28c3692c06981298c570effc98df51d6bd66bf582a8caad755b25df8b", + "0x6b2b4b5fb48323953caea8d9cf6a09d72d7d7006a1c07e337708f9bb11f070f", + "0x3221a5f3b469f6a2d32bd9c4ee046414166baba74dd1f7428dd96c90ecddf88", + "0x160a5ea857c2fc93ab506f5ea269d2ce822d9441a64899f209f1fd884c79d71", + "0x1b6e21f642dc148a9025f7d76c28211faacb6dc97d631293570101da75ec41b", + "0x52ac3318fee1807f80499adb717a04ed85c5d47874e7e7c701bdcde1245c477", + "0x62967e05fbf8cfd415f2d52360823ad7550bdd16b34e1a4e4237616aee219f2", + "0x4426223474b014544b24b850ce73db0a4d531032394ea9a4293ac02e92c8ace", + "0x65e24046821462fc24fc1bb3bfe5e43eac257194e989501dd0caa5418f22103", + "0x5797d23a7fbf9ad36fd17a9bdd9cc10ea66dbed08d6b43d3b0938e383175dde", + "0x2d618b077146615c0e55b2ff0c28dc68d2aff95bb5be7afb59fdb90922d1a17", + "0x63b0b38a64113b424afe9f554375e177735bbf0f10dd597beda4f2eef597239", + "0x32a8d33b2f4ce1769bf5a6657398d4108de5c6e486349f91607f9d69842e0ff", + "0x2d874ef0a216e9b4fcd24131045796492dcebca7afa0273c80f303dfdb7cea", + "0x340b5ecb2822a0ec94a33c2aef04fe1e9c238d3a51093ff39d47742bfe0f087", + "0x7470dcff2e8619c0626a56957ca73ac06eaf5dda1397e359bfd43752c68e3c7", + "0xd1eee859c597bed780401c1c36cb4122481df869fb76ff60431182e66b68dd", + "0x1c83e5fdd9361df5aa82384721bddd6e078c26ff6bc7dbcbb367459836cfe90", + "0x59f1905e756f8408fa5b1739f57aeba0ac7ce0dc801551fe78443af6400c502", + "0x1cb3ceb38cfb80ed6e5b3a500989cdff4f0ebf6f2739378d92937d7a0f3809b", + "0x1be5d2eac5656cee3bb1b807b1d33636c030f659e3be0c43d801e90702b56bc", + "0x590d5813a629b0f3445c1c031815f905345b084bb0b1452f93aaecbe500434a", + "0x43e1e2bcf65a2f1e4a3cd811a85cdfc5fb6950c44f1a684b7969aaef0cc336c" +}; + +static const std::string mds_matrix_2[] = { + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb" +}; + + +int full_rounds_3 = 8; +int half_full_rounds_3 = 4; +int partial_rounds_3 = 83; +int alpha_3 = 3; + +static const std::string rounds_constants_3[] = { + "0x25602ffe218f39a622f4afed3aaebcf8096cb4185f778f2405923ed5bbd4524", + "0x22418f6060ed127b68b4327f82d1e876db84477f55fc02f9bbb21dac82f5aa5", + "0x7ac1e21d0ca08734cfeba05016885d7a184305c5518ad5e84b96ff73b06364d", + "0x54c6b09b873bcdcd3d1fe0389fc01e4a0a2eb16fc4361aa2b1a6c270306fd4c", + "0x26bb853d0199e223e98237f1cb947fd768f75ea53e9515dc95696bf7ddadbd", + "0x31f421a9bc6293c036236a0e105278bfc3bad15bcf520ff8f49d6ea5d8fd0d5", + "0x2dce44ee49da0f30da7534ef01f9a1b10effaadcff7fe02da52a290f681f2e4", + "0x8134efff5220981038f5228793db95bd73785c0c22033016c720e287e4f8a5", + "0x322748c56ab32ed067d515c53702fc5fc971d6b377826066cfb09b4938ad453", + "0x95f904ac3907d43944c67a6c860b5b4e1d57f52c3b04846c5d4977122b826f", + "0x889fd28c5d3f5aada2c39517b8f772a8e8e8faa83df97a5201b597fd0285f", + "0x583309fcbabab1bae9fede103b74dc04f0b54611be641685cdd45e7e42b5beb", + "0x1095635d172d361d6c13d600f9976ec9231c008a153f721d94a6e29e1ed8870", + "0x5f87c327ec9ada0ba1b3f7edb8078067151722668012610ab8875b43a8f6195", + "0xd773a930ca186d314c95d00a832c0dcdf622987d1d3873a14261f04c360c31", + "0x6cd37f66de96298a2829a7f0534cbe6af587c9d36cb56cde06100e0bb8a20ca", + "0x76b063245ac7e47b9b7867add6a7f1c1b46756358ec4a5f23a78ae964f5a08", + "0x20364d89b82b671d46e6bc71924772cf9eb2aeb8e613d8ff0b94c78787a66e9", + "0x7b4367cb11b92c3b7b307da909f32c23973c0ec416d7fe0d8f5c11203fe95e4", + "0x66173365e2fb66dbc2a67bb433a9f60d335fdd4ab103a66c9bd54629e7034dc", + "0x32a65e951acf0f1f3ba9a02145f13c4dbab18e2a8f527bdf7636d3ffa71f63e", + "0x71df55e92d4d6901678bcbf0152d25ed5219272381d7e169418b5e63ef695f6", + "0x62db058df5786fe5bb52dc6f201015a873e3aa060e3b368a5589c456d737505", + "0x7babacefdfcbd31fb3aee910664ef441176b1213cae4c4b2cecbe316d75678a", + "0x58defb98f696ec63a8f7214a07ff75fa3167eb19a85ddf3e856740b9316d830", + "0x489c8c7f07e5656b9ffe493507e5c2c4c0e0cec3d7e03520db8566bca30266f", + "0x3972c7bc93cbcbf1be545259df14f6ce30c9c0567af386f922b78fec1cb04a", + "0x5a804801da6c8ea18e8a67974e591fbf2ec611e22fc8f5730dcd02b48dc2ca6", + "0x69c09371b6d963830fced569b3f164c3df69f7454419b52c8091c3fe3f1b2e5", + "0x3b6c005e75a4776e5151603be9097687228c2641a2a7d25a614cab4e827cc2a", + "0x7416f6fa79a7e80c1f9db3b19cb59a5e18d677b78095bc28bdcc6c9fc82c493", + "0x413e6355bc38c74e64707ae0d799e15cbc5526bcb30ea98f5a5cbaf38c9dc0f", + "0x347924f774dd41c4d988b9dc135ed3d072bf7e3d6973d2be5d8d10c64dc2188", + "0x4def42e1bb8196d0cae9520dbe1961b378bf9c393c90447e157c0e9f5e8a35a", + "0x556d8eb8f600835173b525eda98586044acb035fde59bb79cb471c60d3c76d6", + "0x5279daa2fc167376ad34acabe222a7ead5263ca4275edfd9f1ddde7c11b2c6a", + "0x769d92d9977ce6a00ed648aae50bf1b9349b5f60643b5404e22d268787962a", + "0x1ed71ac539f5f314cb5fedc89e0c273efc92606ee2c239919d3d8564c747d43", + "0x694a087e690e152c352825bd331b8f23a20ab2f8f714755edeaaf36705b20cd", + "0x68fd8ad19784515d8f11e2b62e624f3fa53eebf74ada4d2ddc3e5f9e66904a8", + "0x35d5fca88be94fa76fb5e6b95fb0f30d788a2ce4dad9db601bc2db73e88e028", + "0x69d97ca6727e7699f84dc4e4353c1de1147602c0c59c2ae4c03b45514d7957e", + "0x3a2cd937bb06dd6700563283affc0dac23d85a60474624b72468e23c5ce326a", + "0x6d076980eca7ecc666f20891fecb5b0602447b61f1a217f2e196cd7c45c9286", + "0x4e7056eb3ef5536ef9f64cee94e8c60e437defb1f2ee781c459a498c2fcca9b", + "0x84895cad5a3bc430e7213447e790590b8b7dda50d0ac3e1db3d922c0c83377", + "0x3425f4a4805733e8c8751e92cb6b3555a675e3a1130d93dab40de3369d146ab", + "0x496513966fc084a64fc1780450dddc9ccbc7168e66f8b8ba79eb9468995bbac", + "0x40e657c19b863a0a3163709d7ea29132ce4ab56b2c54f144f4a3fe9282f02a9", + "0x2d654dcde1e9509f836ebe5c7e3223e6689953f75bb102bcf7f9f12c5604318", + "0x4ae9260c9f67142469c001a12ad9ed9f30c7fe6e1c037ee7179fc489af96208", + "0x7097127a3a93ef321481e945855ee0909aa5a8145e4fc5ef3440eacf5cb327a", + "0x54e3133bed59e918be780765b21542f95c3e9a5ded1185f97e7cc289456e76", + "0x5b5788321e60b59a35e8d3fa99dbd250358515d5c8497a5d1c53f76924dc864", + "0x4c41ad748acccc7b896ad80732d1b2f981e99af6916b42529c0e59ffaf3aa9", + "0x4b8b8d3e5430215a6d668747bfea1ed9fd4aea69d2b93ab499049e3118418fc", + "0x6d7c9d127fd5a1a800ca54f4e5ce433495b979fc87c5bbeb7c7d1a10267dc0a", + "0x41c6ba88f7d453dd002b4cc02a293e1f1f18c893e4bc3a9564a5b37b60b64d7", + "0x56ea529ad5d0b8046c4f0fbbd8afc1ec4e2315ba3daf2a35cf93e92b42e5729", + "0x11d65f9d673c5a8bb8aef82017bca5912f7e46f4c1d4434dcb206a8899db887", + "0x734ffac0f6300ca2d543f919e5f2e4da90218e29e9c6fd44b1c05f5041b5dfd", + "0x57ffcd80894e1e946211cd99e68459042c8e8a67b683f3ca1e3d9d750a0b95d", + "0x6d4f28c4e1837aa2cd327f17023aca932830e4f16316a6353f01d0bbd226540", + "0x26aa5fa45f14085b932a06ba20e45c5ba6fcb64d31a009aeae241fc381cff68", + "0x68ea42e095a6a6a7be3a0a754ed824c6021666458f62a21b3a80c7f23317f71", + "0x5166e7b430bfce1ee477716766199e6e68ee65f2c12461066dc749fb006ea2e", + "0xfb0b009997ba9f405fbccdad96dba0f5f538e8d651da01da13ccf9c66c2a7e", + "0x66d0ccba49f46dd19813c42dc8d5557856c258b377576d7c621f08fca5c6d36", + "0x1ff24d876cf682c7a2502593dbb54316f8a6f0f6157e20a822b9727100743d5", + "0x1f8a9388a4e624b8651f319ca50cf13b313227330a4e52007c790237a6582d3", + "0x275573597af38b68f3a525c0d121390098ddfabd21d965b5653a2227b4a81ac", + "0x73e02d53eef8c338d27732fb8124cfb702dab359116b0664702ac9f1f185864", + "0x5c635089980efe099a28dd9fb377309c1c42c79a2e5aaa731916c736dfb9e0b", + "0x5526c2c85ae7317b510db81a46544ee6056f462a1b0a8a91f59e4e39fada95", + "0x7464c1a5c0ed52a277883cd9f2f52c13707f50222ddf8287ff62f5368bdfbb2", + "0x430492734119ce22ead9ef10ad2c84c83f8a5760e1b29a6c26318e839d4f429", + "0x60bbddbea067943c4cb9e978f2deecaae34c715c722cdabc10f5c0024e50b4a", + "0x19ed15111a7cd5ff37f16af2c0f06c010a0c08393e461a0e3aed17dc286bf81", + "0x1c55a6d27bcdc1bbb7c575e99db4ea37b70182941fc0a7f084d25ecea3aeefd", + "0x7ea52892085347c36bbe1831783bf21b193ccd393e3672a4a705f6647ae99f8", + "0x540526d7f566d4d8f0c765c0897f37b6cc7bc21dc1c225dd2907ef608e9f2b8", + "0x41ca646d6cb11dcf205e0397232437dd2aaca1640ce6fdc7c54644d1608616e", + "0x32924d45569f98880adc2b30a3aebfa6de76a8053063ef42cb8e82761c09751", + "0x12be663e989f069fe9c5707d69c8da5c2637c0615af936ac49a42b89c31b3f1", + "0x546f0440f0673cffe4e3720cd190da48db24310add4ce0439c279da1a27d8a4", + "0x13d8ef4f034e50d62b28eaac6d58b264504a465f9208e1137fa188cc0c209f5", + "0x979ffbfb6c983f49e4a02285aee0ec4c0b3dff356cc4c2c706f4fae123357a", + "0x4b5668bbdacb3ed5733a3c9f92b81b0ba601929b86097fb937ed4838c101e4", + "0x755b0b27e4a49f106ff4d26c38f5e3af9115f9c0ed3b6b156981fbf2759a227", + "0x1b6b85b2a492df51eaa656eee57f0c3a3ff552ca1ff9cd640722e0c3db83edf", + "0x202f45eac82c718fc84dbd9a8ea9451985d37d352a69e4a8ac5cc415c1d57aa", + "0x73ee0d06ae941e305c4f9037d463b3ec7648ac8a4b9cca1eb860ed86c80c5ae", + "0x1534858ec42e4ad14b3d1e403269291b1bbea6f0ede4a0b5816fd11e4580a09", + "0x3788d242c03cd781aabdb211b35728b478beeec85ba728739d5a6086709f4c8", + "0x694387b39416265024a145063a052dfefc486c4e49409d39430e95243290b23", + "0x42f511258dd6360d2f0f30e437ad5e2e65bdfd4e4e241a7fb3621a6611a5f8c", + "0x364b6498cf9ed0b62cfd3de4fb3c36e98f8644949d77e2c84509b0dfcd56beb", + "0x41b96612d3fa01a6b540a5d10e656d261f6a47cd5a4ec4a17c13dd64e726e8a", + "0x5fadee4cb51bdd554608ffbabf4c6d3ef93a6051cb7ce7ac0fb21bf6f336766", + "0x67a007c9df4dca2f5a8d40d8246442f56e4538df0fdc9351cda83cd3c9c95c6", + "0xdcb6352bcd3580e1326f70a2f4f794534175ad183ba32b1a4f86d1c9f66d8", + "0x305573ecc67da9c813292d2ca65e96dc91bbf4d8552e7db3e08a6a94ce634ee", + "0x7a2a7be7bc0ab16d5188ede0a76fe2ff485dcd99d25990c2bfc38227d859c6e", + "0xe3d312ca4a960a8fccffe4bf6eccc998936226db7b6c2d5cfac813f2efcc8e", + "0x737ee2af44525b490b7ddd98ab38f52b7324b10de5a7ba658714441f088d8b2", + "0x44a6a19c740f6346e17b80d9cd66d49b1827ef2734777939cf61d56234987df", + "0xfa9e82ada327afa66adf04fadc4ec3fff16248f5bf56093c2c00e06250fd00" +}; + +static const std::string mds_matrix_3[] = { + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd" +}; + +static const std::string partial_matrix_diagonal_3[] = { + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb" +}; + + +int full_rounds_4 = 8; +int half_full_rounds_4 = 4; +int partial_rounds_4 = 84; +int alpha_4 = 3; + +static const std::string rounds_constants_4[] = { + "0x4701b19381327a70dc4b996ac70024866556a63daa55a1036574eaaad010340", + "0x352b83aa035b21462385ddde80b0efacf1fd9e192384fad0b9de7adadc79e44", + "0x3e4c45db84bcdad87ab9adc5f0a9a601e67bb988d5c9295ec434bc19078c7bb", + "0x2dba35a680ddacebf5cf1215bfdb809a7df21a4ded052e51c468845aa8d5044", + "0x28c534531f7e9febc6c6c6baa3237c439bc47681ba04a6f355e97ab7e628104", + "0x6136be22e50c9543e34a38eb7e68203c39e0c56d049cb8fbc5dbe155c174dd2", + "0x77c7d7fbdeb2283969ebc1b0f45a7b3d8673dc027ca18f38decea4fe0e71e81", + "0xc433251f3190bd5b01fef7a3694c2f8caf1353dec1e8eea2818ca96493ab3", + "0x108d70c50e6e68aa726279ab3e2a71d4813f3aef0cc656aeae920c2ab2c5035", + "0x1a5ef460606e1ac64389c1156de4175aee9bf752165e4f82d9aed65d892fa24", + "0xc081c4be9a4c499415dde06197251daf6246f7265f059ade631eb0eb43dbec", + "0x63e19d6707904e2f151ce9e4bc0ca2421bc742e74228b3a812ae2c65ee20141", + "0xe003377b595aee7f636f8447e2fb38f57be6e3030126dd589df99b52321aa5", + "0x5849841ded337f2fb17881bd46ddf417b367e1784a72d1d5b90f367300a816c", + "0x70e2d44f70a80dbabf17419ba8cbe24a522beec1901173a64b04ac470c11e53", + "0xeee2918b539d33e1115db28195cb14bc159552b1e0ed49c9570c681e5ccc43", + "0x39574550b8e4908128cfaa4eb68ee407aa2a3130c3aabeba1c83ec63ef0dca4", + "0x18c96e27f0c96590b335680fcd8b14de81c41453a66ef87de80701100aea6b0", + "0x140d4b61b0bb3bf29fa5b4dd36316ba7088195cd33b20db8b661ab9d6dc932d", + "0x634f300a487006c9ff19eac101aac9e28038b986c5e0a8d4fab86b69fd1a276", + "0x6f6ca2618bba3b09b1633efb8bc8087242fa403380eaa021e710617173b8002", + "0x497134b0be0f6eae30db0c26a2f247c302dee7b1c196ea431df654279468264", + "0x19936653a6fb8595d09f5048033418a36893a6dc57c8e62fdd5f6467075fa1b", + "0x746f002a2e9b1b476f617cdc45f73fb554acfc7d7b70ee035dcc8a98214a76", + "0x489c4f1c8d9638219f5eda397f987bdfee3406db3f5b32dd417217f681db2a4", + "0x7199fc12aee4155f29833e2f656a1e99dae6bace8d749e96c91db864c41ef11", + "0x2a3b35f3b7e13903787a7a2ecb022a049f9de063562cf79c052fb2a0c0068c0", + "0x3de9c8a5b776466640e0210981940370b7d531007b5e627e5b64a94afd28c8f", + "0x2f09e745a873f415848d28361f85a847bb9d06df403507f5174e6c85fe9e8db", + "0x7d571bd2b64d113511e957fe9c3655834a8445ebd054c0e0cb13db2ff03a4a8", + "0x2d72345ad7ff855f5954e354730ef6722a262698275384069334e52bcd2c15e", + "0x4d9454a6af4ef2967c0b7b9100d87ed4023dd8cdf66b29820bd9ba7dbc1088c", + "0x7d3f1b8ddf433d966d723ae149dc9c11158a267315db47552cfd9fab72701a9", + "0x57eace91488e9bb8d9730322eb2521737f567c80cc6fa169d8ac40d183a6390", + "0x1350f83f16636d536ad4195912edc17d8d84a9ee8c99f4dfb06dc06778f9ba8", + "0x6985b256a2ce3e1eb08fbddbd20128d53faa221e9ba46f1c4269b4f83a3550", + "0x3d57b57a60097d08de22e5147d31a22eddb6d506d1343fc82c16e0261d2a34f", + "0x4a911bc6fa32dd2c1e088a0bc86cce7968b7a4ffa0ed82aa1e83da1320cfb9", + "0x1e27f0b77fb0f75026691c343f470611d37d5518c37c28cffe26a857a4c099", + "0x7381cfe35f8c2ac9fd0eb4a7f3ddce3ba15f4317dd37f94a9659e205f0630e7", + "0x16cec14fa52c42efb36e61d16333311ea1cb49bd508bdf4e90a7808f0ecf1c0", + "0x50336b37c6fa762513ac80fec0ff07a529cbb33ff05cd3b1fd2d3d70cacc412", + "0x1bcaa94e95ce3798d48dee1486e239a6323529debc4c9cad515068c95d85b2f", + "0x3f6afd68f494eea1dee1a5cb0fe0fabed6bac941bcdd2cddeba1553ab6abe9a", + "0x7cad97bfce05b253d7e4ced65efcd8b73244bd8bcc33c6befed784afa93e2eb", + "0x374ece842fa7bcb68fa70a8141cf9e48f12c2c16e9fbaf0f36f0313043e0aa3", + "0x517ec68d007aade75e628c6a076ee008efd60f71660e93842509ae06fe6f00c", + "0x42edeaa4c1586fe9775d47edc2f76553a7d89be0267631c16af3217eba09fda", + "0x628de85de6d3ecf26b5215fda9091d95cbdff749988aa5bb35ba5849fc3a9b0", + "0x939e2f2afe5c52d57047bc77adab7ce7171ec1fc3c5d01008f37c2126c52c7", + "0x7120c1b42cde18586ddda2611d832ff99401fdcaa8df43251127b141d912cca", + "0x4372328597372ea90e1007704e0dea50537771ee048f5032e7e61ce6fc804b7", + "0xd79682298a13656090ff0070f15722fdc656606fad20726ed179ebed33beaa", + "0x466a88151e74920804c1548f3bc84da116fd35f7734adeb53a8a541f6033a28", + "0x5408ba156e9693e2eeaac736ca7dd3b9ce3a7d0bc026e7b5922a72e3ca4acd1", + "0x51c7dbd97a97ccd19babcea25db07215d7ac0a44f68bd79ea4e947b63d8f4f9", + "0x7d97e622478d8347f7cb721d165e90f47cf2e60ad37f5fd0d46cbb15a685337", + "0xa681d89e7121121fd5457b2f3a6c2baf2820aa892cc59d598ccd90eeda1ec9", + "0x381502af45d2e8ddfacd9de2ab7d9f8affa98b203cc69a4aee6a98a4f5d67b1", + "0xa769fbdcd131789b13d134468ad10143370901c3209b83fe6f2130fe3747e5", + "0x7a1c49314569c2d524bd22bdca54de034920911ac02700dcde4a4f077f1a509", + "0x660d2dccc5b18fbc0c6a5c5b405568ed06b4ba8c3b5389c5476f5359b69bb09", + "0x3f43cdcfc9bd3b02ce55811186a5ca30db1b4fb891f7a117d9ced9116ec79d9", + "0x4733094bc1efbfd7ba458819265849902bb2c50d7a63f38666f344b7e914da2", + "0x3b76a3881d9c93348920123258de75994c04c03c766bc36fc66b543d958ceab", + "0x75b2749de5409ad013dea19f5993c6ae19ff4616522fe987ddefdfb137d03cf", + "0x78dc362e227b886c51fb0479b613c8aff9756d2499ac39a8d8f7adc62bf73b5", + "0x45ba942f8886e9615be844ef5548fbf3fb4463d9d94bad461856fa5f2572ce9", + "0x1ef79f333efd2af9889ae0da687a4811567368178ae226fb605edfdbb7cf9fe", + "0x4417259dffdfefd1e3961e8cd93affc6581b59a1d0c9ba727f1c57bf25ca9df", + "0x4bb23e00b8e59e0eac1da1dccfd1d0403d36cdb98a951ec944fb6c46997b3e4", + "0x7f65ac7023d07971eaac8aa9fa8488b04b8153042f0b78e6c5b574ee2f5f806", + "0x5e832996c6d1ba0e32e53601a14cb7a39c852e854be9cffd7b1efc7d683e7cb", + "0x3eec054ef797872d49bc62cf2181d86cbdf5d78d93e9a9fff89ce4d5c8b5cb9", + "0x5c2edc560f0ee96af6c1aa8febd4d2ce29ba9ef1a8a1a176cba277a8bd76103", + "0x15b412b0e47b3a02e2c81b36e8222685d26bad3cb8f10d593ece14b0b50aa10", + "0x691befbcb2274adabcb408f31286a316555efdddf2fd55383ac91e5d3aa07be", + "0x2f3b6d9b74ca6ed5946b3db02fa207425cea0d2dc41c58a73e932f54cd2feb5", + "0x67cb30ae494c38a0f32b6d98ea6a0935fc2b83bfea9b89c629ecef80b02888a", + "0x129a1e5aff675e3e962990ec194b3c0755001a32c69e34dd96b44e5f5ce4cbf", + "0x845fdac0c2538896545509d2d5ffe6eb53260bab2170c9d46e47a76057b934", + "0x65ee360432894855a0d0018deff73c618e035d9864b7411317d99b7b2f16ff8", + "0x273a15697a0d2643c582e6479badce045ec90cc0ebcd42f1f94d8da0d048c4e", + "0x3d7db53b3796ee9eb7f386f16356298bb3e560e6fc8707c0c4750caa42541f8", + "0x21d8a08a3f181016db656ef0eb15143295635f1c362f7202a3dc7002af062b4", + "0x7a6453720c4a96ac15d850f8368307635eae30238e268639b2fe2e5325055e0", + "0x6e24bdc4632d72b480fea21bfbb39188e8e50690db0efe5b1e42d67a7e794f2", + "0x45b94c5095481ec8bddbfda99d58ffe6db42f4c23906542a5479278864552b5", + "0x1e5451e6a6220f04d2d69f648e0211da8922aa07eaf38b581c0d0539d655798", + "0x158a7995150c7b7a6c1f0bdd7e40c1914f165f1c250342b05cfad3330ea0c22", + "0x5c27f156ab77ecf108e17e36bb67252cfb77195a41c084ec5e9adeac660cb80", + "0x1fff1501be5e4c6fbf36e0be1f1d5bb29f4b595b06b2578693cab214956e697", + "0x4ceb7219ebc114eb4eb3cdf477ee4da3c47d2212f3b2804b7647ef9f9eab7ae", + "0x5bbb2cdaca30bf6ebab92d21100cd7549d26c0637229782b18e510ee0629f57", + "0x400e9552052992a4a622157ce50573bc932baa0aea3f46adfce576350f5cc53", + "0x7a8f2127783bf83d93fbc3bcac709477f36b626ac9f9ad5785b249d96b90b90", + "0xa73337c0b473a00759c2e6fca9d66b69b7194652c3056d037eda755b0f03c3", + "0x5fefd977b6790932a0c3f7509160de7ee20a6f075e0a224533d745e85f171ad", + "0x6b2dbede010b6eec83ff7f8cb824835244a2fa6e3293291b111fb37959897fd", + "0x7d101083ede5c967b7ff6ad1d94c2b9a64bb24d745af51f85f612d4d3c53d80", + "0x76d1cab910a7be18e019e5062315efd14a0c880ac11112c14e41bc192eededd", + "0x1489e049ee8aab4133c0278932aba57b22f6757d376f988a6e59c17782dfc49", + "0x5f5217fe0f827edba8bfe89c409fb7312a07aef20b1bb2c6331c388b1acaccf", + "0x11593155c29e0cfe8d0d1106db5ffd767fd7818f849aef76a064907fff3416d", + "0x441117a840360e79e4152f937b242e371340e522dd9262b63334aeee563ac0c", + "0x753b9fdc24cf01e4484eeedc8876d4ec84ab53bafa59b371a10bd7b54de5c6f", + "0x2e23f5f36fe9cdb78bd2f227edaa328fa2dfca7da6a095e70c19e63fda52318", + "0x411e92a5ead490ba963827ea28bc2b38ba757cb87e7b75cd863452b0ef83af6", + "0x68fb96b9458f3f223746fa8ea7d5543ff5a9084f98e214bc7369f6de66c0972", + "0x4aa48c3fbd537e1fc5d848f91474e92b998ce21cc7c394d97bfcbe252382288", + "0x7b945dd2a36391016e52e5229cde44932ae1eaa6e81860092d104b4ac473bb4", + "0x19e9eb6ca07a8d39c6eb0dd1d209b7c033ca260e38e44b80cb025dd05e156ff", + "0x13a5a14a3a8f39530e1d00ebc955e4d1c8bcd0b98460a4dba4ff79a6a14276", + "0x5a6654d816082a6f832ee02367a24733a0facf18cafa18932f19b1a1e04f83e", + "0x4f5433e76ad3a5ec08c70dab8e4c115e7696839465ed481979ac732605d791b", + "0x429abe529861cbddd7aa008bbbf977da98b5928e813ce77e4413974c2023c28" +}; + +static const std::string mds_matrix_4[] = { + "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", + "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5" +}; + +static const std::string partial_matrix_diagonal_4[] = { + "0xe366f11329289139c49bf3fbdc652988e38c3aeccc230cfcc37f74bcdf14ae", "0x69e22aa33d9ca43fdce99c6b44cad2727d4d8df7a27d31e14d32d274b49f89", "0x3549f93bb200064f5187faef9f2f9db5c0af0310424be235a89f1025103ed08", "0x66524c7188d13c27cf036114e0d317cac5109f3ff613df6405933c3dd81708e" +}; + + +int full_rounds_8 = 8; +int half_full_rounds_8 = 4; +int partial_rounds_8 = 84; +int alpha_8 = 3; + +static const std::string rounds_constants_8[] = { + "0x4c69f1ad01bfcaf3d34879148353e37d71e68249c23d2f16970df67ca45a8f5", + "0x612a4a9caf3da20fd1b66f856675c7900f6692465af40d23a888c72198b234a", + "0x61e3f9b7eed06ebde9a50b63a9d9d9e9941c6733c1b6ca379e04e5f92d50428", + "0x45a5b9f8831cb6609e7f958378a2ac5fb8ee33bc9c2c4b9e272c6f1dd620f0", + "0x22294e6f0013edae808fbcb3391e52fa8a9bb05a16404ac2ea5141448036308", + "0x64179b14e25ed8a63b7e2a87d63d4b7934f6bcbbec1724e8562b82d55c37f4c", + "0x1a7d8de975f399603caae5484abea0c847b50d23cadd55d54590a69f31748d6", + "0x2c60a319a784cacea2020bcccc4617bf6dbf59806d89f9bb8c8c120f11cab7d", + "0x20a9af21630b463a0b7b786fdf5853632d821c503b41d1ea2437c74f8dfb7c0", + "0x1debcc09bdc3b37fd03d686bde2e8d81b809812972fe1ac8393714025e32d3b", + "0x437e707595a3ec826dbb793e01caf60768a05c247bf3c6df1da1ea732b5a342", + "0x3d1bce145a684c9b45592817dc99d7f6c20ce1dc4818270c773435f72e32d3d", + "0x1e8c3d4ed20a409d65a24ffc6afa297a2635f847ab4480064a03e66da5cee16", + "0xc5bdb66167cb694dd7c992588a51cee30b7c235ef76c4898efb3d6aeefa02d", + "0x390f87611de6af08233c6ca53785bfea40ecc6fffb30d4766fae7566a879300", + "0x3e3e756cae533a1e053ae59f88f2c095ffd18062fff0f6685f6066bb920a50e", + "0x306603d3bd1f897ca08ada5c7d072b772e14b42b9bb28f95b49ff7031a911f2", + "0x521384c2dc18fbc4361d9bcff9a8eb6eef2375378855747eb690046fb236a3a", + "0xb6ecfeb8e00d1b4891c580f73ed6d62236dbcd00b6d2258b014e941589d19f", + "0x5a4128ada921dbb914cf573d6f06cf57c1f537ae59c27dfee352e5fd863f2ac", + "0x3aaa5f463650693d00089ae3b416179c639e510f5de686efe0e3dd8e759dd02", + "0x4bcd58717eb2b79621d30f1113c5caf5e2e088ef63a9d480e11cba9b9840934", + "0x76e156bb0465b39c00b42d9d292ef050edf28d13aaa91ca1a1ce9f6e0d9d89c", + "0x62644dcf73240dd6cc3c503ee1fa0a52ef691c9ebbca607cc82a734ae5e599b", + "0x1ceaf3af454ef2bae5b68cc3eeea13c70af754eb75b9d6013e327619f183f6f", + "0x2d35f82020eec3bf733d1ebed72f6623aae166d8af333bfa4b146687e17e407", + "0x42a4c1e80554f0a8d191a167a7ebd14b2ae0dcb5a306721e82d71650b856b20", + "0x3c426aa2466471278394e81df403acf7dee6ef1156266bcd5e6935f9db6bc32", + "0xd85f71ef669e43ac5e64aa167ed7cdbd4d84537ad036dc168c28d7407cdc52", + "0x7dcbb5ef81a39bbaf49aeca070f317476233a75b75f511b40e18814eb17c7e9", + "0x5b8e28a32be41666f30314287d99df9468c8420dbb3ead1e5299de0693011b0", + "0x4d63750016e39f14392c50d8a763a9f3656b5ac8d4b47eb2d7fab1ef8c830b9", + "0x190db9bca44af2796b80f266310e0731f6d10c60f601f6b397b7d5a33ebc4ec", + "0x32e72d4c4ceb00a73ac23b8c026dd70c375a8f652706cc9e27967569be0c2bb", + "0x3f3414c78b6de1ea105834af2736b7d2084f3b1609662f2163f0a6f0c3788c2", + "0x5c586bb23067b1b6f49d063faf5965424237f0828c7882512bebc05915cf9ed", + "0xee3951ebe8734560728978912eb5ba86d45519dcbe30c2b29bab99cec83b17", + "0x3af5f02e163dbe8f871de742ba4ecf74b96c7a1c5584bfc1de37641ccfdb24c", + "0x3a207e11ba899d8bd2872173b364f3cab2f0376bf2eb667d86a42a26018cedf", + "0x7f43748201550a5334bad24f4b738cb20034e722d59ecdd28c09e534b83ac62", + "0x2c01488ba6971f6f79788b984f7af8703a99294886f8b325425938af01cc0c0", + "0x197e2c0ede3a9179d39e60744a9d5f49f6436ec15eb1e337fdc851f6f8d1dfe", + "0x74b4e5b5040cd009e750dc5d1e44878cf17f12d1c77104794946ff3c1786c77", + "0x61532eb3423d5ec8cb9fc76e80d8207249d8f413a5b60691119ddfed8605daa", + "0x4998bd361ada435221f1a67fb8e42f68150d33f861007741c76a77cf36ed95a", + "0x33dd476d3f1e2a79ec9ba198f24e6b4ce65ec86242140d2aaea4d287805370d", + "0x21c4ce10a21fad56fbc7f8e9490ae1d56dda1c5ccb4b9975fbba7c3d866df21", + "0x62d7bca4148ec86ee451c7efe219faf9b22df5d645bf0ae6cd602ffa523734d", + "0x66acbbf9f0f0b0e6e3f23b7d4befaa42cce0d0a7af08e97a0b68a54bb337322", + "0x1c2805db4880361387f0bc3bafabda7dda31415bf0a02486b0b2b1473db1058", + "0x5851c16b34a049b0c00ca745de9603037bcde3c1e91a510ec380325125d669f", + "0x47e30da046bf91bc72cb17c17977bf6b8ad466f0e99fb82aed7b47297ab4e80", + "0x56601b51d01c15011d42cdcef15f191892c08743be069d7ccf7ac499f78fc25", + "0x7d9771f0b6bd8ec07f3fdce6e8600d9c9673fbcf5c0d84de9e8c971358735b4", + "0x35b570558379244c9563e5ee4d97eeaa48f4d7a60ac528b3a119b821e3aa2b5", + "0x5b165b4dadc431175b1819efd00bfbb266c8259f38d316fa58d7963fae35fed", + "0x20677fabe67eb6112a7c274b74140737d7081326eabada1610de980e6561ba3", + "0x54c1cdde804b20ad7712751914431d52feb27d9ff476d0d88e0f1d45f4cc435", + "0x734a0f0affb6dbead7085ef6c08606199ad6f653c790b2d84a6d9939de0c153", + "0x89be040952b6acd2d6f17ab26d4caf5f1ee56378406cdf1bab71707f7c40ea", + "0x717bebfa609a3a7b36f606103daa1968e0d766a4b656288890e21f79f91133", + "0x1f767f8a06a3987d7f01eea8b99f3b71d0aecea5ffac3debbc97ec3274fe053", + "0x8e27c288d03a5862acd7bbd6494ad4a46316e301cb408275a1f9b5e1399c18", + "0x16edd30714a7911c611add462373730a29f14cd3a0d2ce79c0cb827d3f5d5f3", + "0x621939fe2fa2301029356f5073a3b5e8e5c96fce6c2edf3f1a92bc9ad052aad", + "0x3a6583de2c1fe1b7f35f2c69166a3851c632006ba036a4351ecd92a451240b4", + "0x14772bd1acdd9f35e7b04bbc6eb506d993209b0649ffa7e53e27ad8bd90d655", + "0x39be049b2254213dad5e72bc0d469cdef4a8a591d4378d7e72924b85f8970e3", + "0x732005fda1adafd39adff1eefb970c844bb5e415916049c60f5f3967cc8cbcb", + "0x2a31ad638474b8b0ea212d9adbecfc3c8a203f24709c380d9f5d08605e1f35c", + "0x5f8f5569a2ab1d04778a4f796a3fb0690751d447636f200ff758f43bb4528f3", + "0x6476c3823f012d90a597813131d249bb698b7a01a005ce5d95210540a720b4f", + "0x450cd949010d13911d247d9ae2ecc5ba75fdb210758d08a5273a80b9b97d50f", + "0x7122b06317830153651bbc22fc07f5ed9fd269153b796ae47072ced7baca7aa", + "0x141443e09d71a8744fcacafe6881153b2a02e3c4b9f3498581821b577e0fcf3", + "0x47069866e4b2d755fff5ad60c48dff2e65ffb62becf64a44936e7eb41d7c44", + "0x535409f21aa9cf5c3cdab30a9bca8c1bc6fa4d3277548d2186a9c4955830c50", + "0x7861e4a8673e9d11e1e85dea292456c2dd08d3dd151f6ebcdf589c0e7d492b3", + "0x457fd747ea4546872ed4cb71c157041f27cd5f177bdc6dce54592b158b7d236", + "0x5431b75d5e6aabc91f1705fab7e4265cd9ecbd06b27f2b5ea51599ec6ee9ad7", + "0x721a330b9674d7f69d5310166623836d3b5400be85bbe47be725e0696694d64", + "0x67986668091cd3ddf17701f7ad7f8ddd9184de831b80ce5500bcf9398fd0a54", + "0x472c2bf24e37917703a9b236a395889f6ebafd69976af35dc93d379b5731fa8", + "0x263401c58738c2511279097cd96bb394e5e6d5d5a6d3435d66f9bc43f972618", + "0x74b4f7956944e53000c7e4ba6ff76427491c02a9f98cde9bdfd2bec0478ecdd", + "0x4d2df996f914e33d88af9a9e44e88925c8c87483a5f014fc850f006ae53befa", + "0x266959b992aa8d7f244cafd0e7eaf5c88e0cab56f260e3ff51aee83915cacc9", + "0x2ecb026d34f61f1dcecdead66b17e2b19e8ec4043bbf9d35c3856d3e4594731", + "0xe81f949c194b1f33176567b379ad67c53eb06ab74fa13adcb57e0172776859", + "0x7ac1ecea8503dcdeba418bd7922fbc1172ef8098e7509302489ed23546b5d1c", + "0x1fa54aa4ec4caf9098f41a272f196999c3ef6bf6065c157db857d19ae760f4a", + "0x59a50672f523fdbd9bedc204092163fa944e51bfcf2801d9d8e9b2e4a35c07", + "0x57ce481162726862c04ed88349b6d32aa778faa2ad9509e337e574fe6887ca5", + "0x33670a6fb5a32ae4520351186a6b8235607a99cdf7ddb6c30df46bb0495977d", + "0xe171e34b6bba326e6fbaef7aa63563fb5335e82f6309fc0de4e1e17372e1cf", + "0x6c8ba8c1d8fc610c9637c6a5b4a9e86f3dedfecc2e9560685bfad4aa35bd91b", + "0x7fb057ad4c94b866cd86aa2b27af2485ba3e01b52fc9c962aeb2f8ad7786418", + "0x612043dfcdd719c6cdead829ab6ed9d012dafbb0f9d9e60a2af74aebcfe0403", + "0x513a58b91b9baab36d10efb48f214fb98fd9afcedd9007d5af8741cda6f448d", + "0x51aacc8e93cb91cf89d7f720eca1c7e8d8f085548934354c6f5a4f57ef9b27f", + "0x475429c8d0951f11140219d4ac6704edfeea522ba00e771bf224c0c9725ddd3", + "0x46b76c5fe4c555f6f945c8e8562da830e190e4a62b1bccf74b0928e04d1d603", + "0x539a06a332d2befb276fa5dc57b937b5c494826963d00c35691bfc97b5ef577", + "0x43ff5258eec90043fa662e33145c06b916a057fd04319063818aec71762b359", + "0x11c88b342701747e69d265e68bb721fabb4b2500b5ef8cb183bbc04784f8e06", + "0x2f15d6dcc3e4a8570d7bbbe5319976d1b632a2c8498b6da5ca55648e361a844", + "0x5c77ab1a83ee2dcde1141f3c3a4a9643e625eaaf74e09477bc807d8dcd156d7", + "0x6df1289fbd31441f8518a1c04945daaa628359cdc7fa732390af516534e9cf", + "0x3bd6ea0c4a46b9c70fbee313c86e195aec910af8a4f4fe66e3e6a9e283742d1", + "0x7a64a6aa8adb06d5abc1e4c9b6a29b0a1e6d0c55e3dc839fc09c43c264c5de1", + "0x33ad551d26f5f57ed64e80748c8589819f5247b275a47837f1dafe383a2adc", + "0x76b214782a578126bc042440c6df7982b9206b6db2f458c332b1f91d5239ea1", + "0x50a16ca536d075114d36b4cb5ea4a225431149cb4ee908fc71be46cf383b6e1", + "0x2dbb92edc5408019f98d7812ee636713ab9102fe8b4c6aa0d3f9086c7a2bf1f", + "0x2a3032b27e3870b3c304a8d6e2c2dcae018f13dfdb5ac44b8c7ce3205c0274f", + "0x409b9299f2279f81f59c50b847ad48be70e4718b8e4ca52be725e9ffca98c10", + "0x13e515bfbd2afaefe91c403196195896f83d0aeb028d65fcde87622ea8fa4a6", + "0x6b4ac34c3c88aca49b6b19d315be8acec1e86e306575c3cbb987b7f6d317bb9", + "0x803801648dd3ee1c9d658573239c868ce9eb23ed73ae5a58d4e9657bc91389", + "0x1f3c25d17e6de08c8bef8d122feade0d6b603d58565043047d1f05155911260", + "0x1349cc94514efd721e87c40d72e057ef84fc3155b7520a0046811eac6e12742", + "0x7a48427099050f49fec94b6ef49415ad89b807ac095528f007d167a8771e1c3", + "0x408872018079c4498a4228cd6b5b8be4bb37d7c98c471aa2502e57b7336a946", + "0x7e5803666cecdf0b0d2477db6a084df6932fd76a77ea5dc62d860e45fb96be9", + "0x27c2a474017f87574d736458ea76198e6780b14323eb186e82398318ef542d5", + "0x28298f0fa9b96816ba559cc66e8805152d0228f7915c6101cabf1e119cbef33", + "0x4e7a13bb6acf0d73f47444144f33bb2e7bc1979943e0cba68b248d7ce0d47e7", + "0x5b290c9835aa9ab9ef3f3b04d7dcf33051c3cbbf4c2287597834e9b4c57ab06", + "0x5c30fb50df3eb05479c8b758e0ed1a641e5193e2b0ea8b7c43cb667398943f0", + "0x52451752d6e0a76e060a3372bfe4769bada35e9ea49e53593794688f6ad20fd", + "0x22e783c40d4454c7a601dad77cc6d6953127ae39e8b1df6ee5f4dd8211292de", + "0x3844d2e35eabf5d23b9c133d2930400402ffa916e167aa6807b476eed8d915f", + "0x886c4fffc84912332c0a2986db190451970b21edd1c10982210f6e2c668b2b", + "0x58854835767cf5e984971afa154a61d8f4d9d817171debd67d111d93ecc7bba", + "0x72313f760ff185a2ef627f544caa8f943cd33fe91790fbb9851b17904b2550c", + "0xe68af02e921bd8692afaff5313d91634b1c4a9c08faaf0c0329aea753f9874", + "0x680eda35c24ad8661ac0f479953b2185199fd66879eb909c43f69e7c0f138b4", + "0x27a8c559ec81e4f88302993c3ba6696d7d0639115da900bc7528139904ff434", + "0x1a6e4ad98ad12b170e5f95a7abfcc485b0014a9f559518fff9362b4d913d36f", + "0x2db3d498d888a4c25756777eb7218779098a5e3cd3ecdb68f6f66f5b0a769bd", + "0x6d5e8f4c0d886aad121e637adb31dd954b9cbf49ac26bbe8ffed420c89805b5", + "0x2ce35c37d573df09cb89e84d8849a2517cda773b5d4e6481b2f1275f1c7a845", + "0x32d995fdffc15cc2c81afcac37cf0d3f47b01f6b82c362d88a44def0d12065a", + "0x6d98be2fb574b983e0543bf9233ab7862da898f30cf9ffd144adf14931db7a8", + "0x59935d0ca93e4017b278847fe7400335c99578e2d079eb01e9afbe5e5ee700e", + "0x64221c507d04e0f0e5f6b0f93e194532c0375d6fac4e3cdf54794e9bdc69600", + "0x2b1887564971d93d041e08335542a6f34fbb85adf2d52e96beaab535476fc35", + "0x6412070423cea8e172dc38d983c527fffa1082fc6dc875a018c08ee9b67975f" +}; + +static const std::string mds_matrix_8[] = { + "0x7fffffffffffebcffffffffffffffffffffffffffffffffffffffffffffffed", "0x7fffffffffffe34ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", + "0x7ffffffffffff00fffffffffffffffffffffffffffffffffffffffffffffff1", "0x7fffffffffffe78ffffffffffffffffffffffffffffffffffffffffffffffe9", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7fffffffffffebcffffffffffffffffffffffffffffffffffffffffffffffed", "0x7fffffffffffe34ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", + "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff00fffffffffffffffffffffffffffffffffffffffffffffff1", "0x7fffffffffffe78ffffffffffffffffffffffffffffffffffffffffffffffe9", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", + "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", "0x7fffffffffffebcffffffffffffffffffffffffffffffffffffffffffffffed", "0x7fffffffffffe34ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", + "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffff00fffffffffffffffffffffffffffffffffffffffffffffff1", "0x7fffffffffffe78ffffffffffffffffffffffffffffffffffffffffffffffe9", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffaafffffffffffffffffffffffffffffffffffffffffffffffb", "0x7ffffffffffff66fffffffffffffffffffffffffffffffffffffffffffffff7", "0x7ffffffffffff22fffffffffffffffffffffffffffffffffffffffffffffff3", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7fffffffffffebcffffffffffffffffffffffffffffffffffffffffffffffed", "0x7fffffffffffe34ffffffffffffffffffffffffffffffffffffffffffffffe5", + "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffffeeffffffffffffffffffffffffffffffffffffffffffffffff", "0x7ffffffffffff88fffffffffffffffffffffffffffffffffffffffffffffff9", "0x7ffffffffffff44fffffffffffffffffffffffffffffffffffffffffffffff5", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffffccfffffffffffffffffffffffffffffffffffffffffffffffd", "0x7ffffffffffff00fffffffffffffffffffffffffffffffffffffffffffffff1", "0x7fffffffffffe78ffffffffffffffffffffffffffffffffffffffffffffffe9" +}; + +static const std::string partial_matrix_diagonal_8[] = { + "0x445950872a40d5100cb6dcffff4a7fdc7aa28cad5f81cafb57f4d27b4ab4e5a", "0x789618dc4124c2d1926267333dd0dd5446b64c5887abdfd768e4f9a2543645b", "0x315e82c9e7db8a907ca70eed6f4a007413485f918ac708694f6f9187864d537", "0x7008fa9da9a3f484807eb540a0a0ba3efdbda85d52c8e803649a104b51a8aaa", "0x6c6002d045b34ab6365b4a117018291cba3644864e3618be0f53fd19ff8d45a", "0x66371ba531c2c263a4ad08d7d35f537ecc672420d5d654cc71e5f35a7e2510", "0x375b4b564239a50bca3e9e12893862397c827aeac007dd5ec3ba7060d24f91a", "0x1de7a4a555c6a1e71dca5cd62ccb43b884d371a553d2fc1ef13d174181268a" +}; + + +int full_rounds_12 = 0; +int half_full_rounds_12 = 0; +int partial_rounds_12 = 0; +int alpha_12 = 0; +static const std::string rounds_constants_12[] = {}; +static const std::string mds_matrix_12[] = {}; +static const std::string partial_matrix_diagonal_12[] = {}; + +static const std::string partial_matrix_diagonal_m1_12[] = {}; + + +int full_rounds_16 = 0; +int half_full_rounds_16 = 0; +int partial_rounds_16 = 0; +int alpha_16 = 0; +static const std::string rounds_constants_16[] = {}; +static const std::string mds_matrix_16[] = {}; +static const std::string partial_matrix_diagonal_16[] = {}; + +static const std::string partial_matrix_diagonal_m1_16[] = {}; + + +int full_rounds_20 = 0; +int half_full_rounds_20 = 0; +int partial_rounds_20 = 0; +int alpha_20 = 0; +static const std::string rounds_constants_20[] = {}; +static const std::string mds_matrix_20[] = {}; +static const std::string partial_matrix_diagonal_20[] = {}; + +static const std::string partial_matrix_diagonal_m1_20[] = {}; + + +int full_rounds_24 = 0; +int half_full_rounds_24 = 0; +int partial_rounds_24 = 0; +int alpha_24 = 0; +static const std::string rounds_constants_24[] = {}; +static const std::string mds_matrix_24[] = {}; +static const std::string partial_matrix_diagonal_24[] = {}; + +static const std::string partial_matrix_diagonal_m1_24[] = {}; + + +} // namespace poseidon2_constants_stark252 { #endif diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/babybear_poseidon2_2_7.h.orig b/icicle/include/icicle/hash/poseidon2_constants/scripts/babybear_poseidon2_2_7.h.orig new file mode 100644 index 000000000..b64097afa --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/scripts/babybear_poseidon2_2_7.h.orig @@ -0,0 +1,103 @@ +int full_rounds_2 = 12; +int half_full_rounds_2 = 6; +int partial_rounds_2 = 24; +int alpha_2 = 7; + +static const std::string rounds_constants_2[] = { + "0x76a8932a", + "0x496e51f7", + "0xbb32543", + "0x3b852d97", + "0x54a11a80", + "0x65ba8e68", + "0x29f09389", + "0x2343a6e6", + "0x4b8a8ec1", + "0x676c3489", + "0x3fa2f7a2", + "0x541ef7dd", + "0x2be3fd0c", + "0x212ef216", + "0x6ab70c3d", + "0x162baeaf", + "0xcd8e8f1", + "0x4a4bd455", + "0x3a34c8f0", + "0x11e9d456", + "0x3c11bf77", + "0x1fed11a4", + "0x27eb37f3", + "0x5d6b800f", + rc_idx = 11", + "0x6dcafcd", + "0x28ae336a", + "0x19fd4b2a", + "0xc47274b", + "0x1ccd65c3", + "0x1470aec", + "0x3733a0c2", + "0x151e4376", + "0x18b43754", + "0x4da62b63", + "0x2ed74076", + "0xe0954d8", + "0x368f93a6", + "0x3dcd4061", + "0xe8024cd", + "0x30886148", + "0x3b8f289a", + "0x68785d3b", + "0x4f5afa7b", + "0x335ab08f", + "0x64c82b68", + "0x6c7fd1b5", + "0x76245680", + "0x39fb5f79", + "0x1ab4ac2f", + "0xb838c9b", + "0x3ca5f68e", + "0x274ef903", + "0x14bd49b1", + "0x31e0c277", + "0x52d03b15", + "0x6faa6ba7", + "0x8cd74b3", + "0x5e9c5053", + "0x1edb152a", + "0x3f164fd4", + "0x3037497a", + "0x3491d3c3", + "0x498a68ec", + "0x98e7f05", + "0x6b11f228", + "0xdcab970", + "0x21214194", + "0x24a953a7", + "0x640be0ba", + "0x6548a9e6", + "0x4bd18241", + "0x1f208622", + rc_idx = 59", + "0x20094634" "0x45d3f963", + "0x126e22d8" "0x457524d", + "0x42d213d1" "0xb98477", + "0x667db627" "0x72ad1b94", + "0x29345ea8" "0x240c67d6", + "0x4e79edfa" "0x44abde5", + "0x22abc20" "0x45b04867", + "0x36a8e6ca" "0xdb23d07", + "0x5f11d45" "0x69a97a62", + "0x311d4622" "0x539c81ff", + "0x346d7598" "0x1813c6d6", + "0x61b18ef3" "0x7cb2342" +}; + +static const std::string mds_matrix_2[] = { + "0x2" "0xffffffe", "0x1" "0x7ffffff", + "0x1" "0x7ffffff", "0x2" "0xffffffe" +}; + +static const std::string partial_matrix_diagonal_2[] = { + "0x2" "0xffffffe", "0x3" "0x17fffffd" +}; + diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_barrett_params.py b/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_barrett_params.py new file mode 100755 index 000000000..3de63e676 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_barrett_params.py @@ -0,0 +1,85 @@ +import os +import subprocess +import sys + +possible_hash_width = [2, 3, 4, 8, 12, 16, 20, 24] +small_field_max_width = 64 + +fields = [ + # , , + ["babybear", [2, 3, 4, 8, 12, 16, 20, 24], 0x78000001], # 15 * 2^27 + 1 + ["m31", [2, 3, 4, 8, 12, 16, 20, 24], 0x7fffffff], # 2^31 - 1 + # ["goldilocks", [2, 3, 4, 8, 12, 16, 20, 24], 0xffffffff00000001], # 2^64 - 2^32 + 1 + ["stark252", [2, 3, 4, 8], 0x800000000000011000000000000000000000000000000000000000000000001], # 2^251 + 17 * 2^192 + 1 + ["bn254", [2, 3, 4, 8], 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001], + ["bls12_377", [2, 3, 4, 8], 0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001], + ["bls12_381", [2, 3, 4, 8], 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001], + ["grumpkin", [2, 3, 4, 8], 0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD47], + ["bw6_761", [2, 3, 4, 8], 0x1AE3A4617C510EAC63B05C06CA1493B1A22D9F300F5138F1EF3622FBA094800170B5D44300000008508C00000000001] +] + +script_dir = os.path.dirname(os.path.abspath(__file__)) +constants_files_dir = script_dir + '/../constants' +os.chdir(script_dir) # Run in scripts directory because *.sage.py files are generated there. + +for field in fields: + poseidon2_h_file = f"{field[0]}_poseidon2.h" + FILE_cpp = open(poseidon2_h_file, 'w') + FILE_cpp.write(f'#pragma once\n') + FILE_cpp.write(f'#ifndef {field[0].upper()}_POSEIDON2_H\n') + FILE_cpp.write(f'#define {field[0].upper()}_POSEIDON2_H\n\n') + FILE_cpp.write(f'#include \n\n') + FILE_cpp.write(f'namespace poseidon2_constants_{field[0]} {{\n\n') + FILE_cpp.write(f' /**\n') + FILE_cpp.write(f' * This inner namespace contains constants for running Poseidon2.\n') + FILE_cpp.write(f' * The number in the name corresponds to the arity of hash function\n') + FILE_cpp.write(f' */\n\n') + for hash_width in possible_hash_width: + field_width = len(bin(field[2]))-2 + gen_constants = True + if field_width > small_field_max_width: # large field + if hash_width > max(field[1]): # generate file with empty var's and arrays. + gen_constants = False + alpha = 0 + if not gen_constants: # generate empty file to be concat later + FILE_cpp_tmp = open(f'{field[0]}_poseidon2_{hash_width}_{alpha}.h', 'w') # alpha = 0 just for later concatenation + FILE_cpp_tmp.write(f'int full_rounds_{hash_width} = 0;\n') + FILE_cpp_tmp.write(f'int half_full_rounds_{hash_width} = 0;\n') + FILE_cpp_tmp.write(f'int partial_rounds_{hash_width} = 0;\n') + FILE_cpp_tmp.write(f'int alpha_{hash_width} = 0;\n') + FILE_cpp_tmp.write(f'static const std::string rounds_constants_{hash_width}[] = {{}};\n') + FILE_cpp_tmp.write(f'static const std::string mds_matrix_{hash_width}[] = {{}};\n') + FILE_cpp_tmp.write(f'static const std::string partial_matrix_diagonal_{hash_width}[] = {{}};\n\n') + FILE_cpp_tmp.write(f'static const std::string partial_matrix_diagonal_m1_{hash_width}[] = {{}};\n\n') + FILE_cpp_tmp.close() + else: + gen_constants_cmd = f'sage poseidon2_barrett_params.sage {field[0]} {hash_width} {hex(field[2])}' + print(f'command: {gen_constants_cmd}') + result = subprocess.run([gen_constants_cmd], shell=True, capture_output=True, text=True) + output_lines = result.stdout.strip().split('\n') + for line in output_lines: + print(line) + if line.startswith("RESULT:"): + full_round = int(line.split()[1]) # Not needed in this case. + partial_round = int(line.split()[2]) # Not needed in this case. + alpha = int(line.split()[3]) + break + # exit() # For DEBUG - run a single width of a single field + + with open(f'{field[0]}_poseidon2_{hash_width}_{alpha}.h', 'r') as f_params: + FILE_cpp.write(f_params.read()) + FILE_cpp.write(f'\n') + FILE_cpp.write(f'}} // namespace poseidon2_constants_{field[0]} {{\n') + FILE_cpp.write(f'#endif\n') + FILE_cpp.close() + print(f'rm -rf {constants_files_dir}/{poseidon2_h_file}') + print(f'mv {poseidon2_h_file} {constants_files_dir}') + os.system(f'rm -rf {constants_files_dir}/{poseidon2_h_file}') + os.system(f'mv {poseidon2_h_file} {constants_files_dir}') + os.system(f'rm -rf *.h') + os.system(f'rm -rf *sage.py') + os.system(f'rm -rf *_poseidon_rc_and_mds_matrix_*') + # exit() # For DEBUG - run a single field + +exit() + diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_params.py b/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_mont_params.py similarity index 97% rename from icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_params.py rename to icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_mont_params.py index 66dbdbcf8..f87c283f0 100755 --- a/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_params.py +++ b/icicle/include/icicle/hash/poseidon2_constants/scripts/gen_poseidon2_mont_params.py @@ -53,7 +53,7 @@ FILE_cpp_tmp.write(f'static const std::string partial_matrix_diagonal_m1_{hash_width}[] = {{}};\n\n') FILE_cpp_tmp.close() else: - gen_constants_cmd = f'sage poseidon2_params.sage {field[0]} {hash_width} {hex(field[2])}' + gen_constants_cmd = f'sage poseidon2_mont_params.sage {field[0]} {hash_width} {hex(field[2])}' print(f'command: {gen_constants_cmd}') result = subprocess.run([gen_constants_cmd], shell=True, capture_output=True, text=True) output_lines = result.stdout.strip().split('\n') diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_params.sage b/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_barret_params.sage similarity index 100% rename from icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_params.sage rename to icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_barret_params.sage diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_run.sage b/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_barret_run.sage similarity index 100% rename from icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_run.sage rename to icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_barret_run.sage diff --git a/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_mont_params.sage b/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_mont_params.sage new file mode 100644 index 000000000..2d1526f10 --- /dev/null +++ b/icicle/include/icicle/hash/poseidon2_constants/scripts/poseidon2_mont_params.sage @@ -0,0 +1,796 @@ +# Remark: This script contains functionality for GF(2^n), but currently works only over GF(p)! A few small adaptations are needed for GF(2^n). +from sage.rings.polynomial.polynomial_gf2x import GF2X_BuildIrred_list +from math import * +import itertools + +########################################################################### +# ICICLE: change curve here: ICICLE supported curves/fie;ds +# p = 2147483647 #Mersene +# p = 18446744069414584321 # GoldiLocks +# p = 2013265921 # BabyBear +# p = 52435875175126190479447740508185965837690552500527637822603658699938581184513 # BLS12-381 +# p = 8444461749428370424248824938781546531375899335154063827935233455917409239041 #BLS12-377 +# p = 21888242871839275222246405745257275088548364400416034343698204186575808495617 # BN254/BN256 +# p = 21888242871839275222246405745257275088696311157297823662689037894645226208583 #Grumpkin +# p = 3618502788666131213697322783095070105623107215331596699973092056135872020481 #stark252 + +## ICICLE unsupported +# p = 28948022309329048855892746252171976963363056481941560715954676764349967630337 # Pasta (Pallas) +# p = 28948022309329048855892746252171976963363056481941647379679742748393362948097 # Pasta (Vesta) + +# n = len(p.bits()) # bit +# paper stuff, ignore +# t = 12 # GoldiLocks (t = 12 for sponge, t = 8 for compression) +# t = 16 # BabyBear (t = 24 for sponge, t = 16 for compression) +# t = 3 # BN254/BN256, BLS12-381, Pallas, Vesta (t = 3 for sponge, t = 2 for compression) + +# change t here: For ICICLE: t=3,4 for large fields and small fields for now. + +# ICICLE - CHANGE state size HERE: : t=2,3,4,8,12,16,20,24 are covered in paper. (Mersene, goldilocks,babybear all sizes) +# large fields 255 bits recommended t =2,3,4,8 +# t = 3 + +if len(sys.argv) < 4: + print(f'len(sys.argv) = {len(sys.argv)}') + print("Usage: sage