diff --git a/test/unittests/test_keccak.cpp b/test/unittests/test_keccak.cpp index c4838729..a5b84971 100644 --- a/test/unittests/test_keccak.cpp +++ b/test/unittests/test_keccak.cpp @@ -191,6 +191,122 @@ static keccak_test_case test_cases[] = { {165, "591377841eeb928c4459736464197bda01a6bf716a911fbd9dceee8f58a8e0eb", "76d9a2832ec2db0d94ddf09beb68a8635ab96c71634b7bae294117517a6a44620692175b5c9082c4de8a3cece5a5dc30a414f2ba09061930d9245371bdb729da"}, {166, "7913dce6ae700aa2b21b92eb34afacba68efa6db171dd5384de495bfecb31ed1", "611012d2b06c97b8c46f0f0208156e9a6219436dae9b4607fe90b56a53af5f15c3a92dc067d243ac9f03cd0a3964f131dbff02a49179d30c68602b194d43aeff"}, }; + +static keccak_test_case test_cases_large[] = { + { 128, "20155866f4d806ebddd0d200482ef8e56f7732f42d3976ed97ef28304e9a1ce0", "58ad5c908c5e73fc4698f5a690d8ee651f13a066a820b895e1ff8e569afe22f7891a882db0fe21a3013d3b1dc8dde7f9aa38d708440c3a01a3a991ea4422c2e0"}, + { 145, "a525516054a6c041bfc6714b5c9f0788d51f7c1eaf0d92a7960c47833f636faf", "88bcad61b3d2f99abcf81ba76e11dedcea0167e3eccb7ada3a97326a8397db166e025f5ed8a7ce758ef7c58999d4ea5793b4ab0751b18abb3c1cda6c644dc6bd"}, + { 162, "124aaecac0cd6a20d83532529f292f2bb3d1f75f21a1eb288d1e318389992a29", "da89fcd1f30ab0c11d3c7681c7ff313dd9e57c79b4662166b8f1fea2915be99eb9a30580c8db48d8a36a1025b71c701195eb86e125fdd7fc32fb658479295aff"}, + { 179, "04794c292fa077a92ae7a28fd3de9c5a2c555f43f31ba64c7bffb3f50b7ffad4", "3ecd944ceda355f4007e2411556a2885f8674a710e1b9ac663cc229386b5a5ef10ed9136ace97a703849bc8b488534b4fe4adf2868322a8fa35a66e3ca4d5f79"}, + { 196, "e608dcd3039d6a7e7ac21943d30e185198963ee33cc7cbadf60bb39088c2ced3", "3e5fa26bd05ffc24955e346e29e76329f35ca1f24e71adcd4b2633b2e05c96b5fb4929053db3d02dbd344c400db4f84a469ff3453ed8f9bc77788f1d99c8c2c6"}, + { 213, "34cca2c5e7e467352ae2e8e62eef7871fed2d92c9107eb4933b07840028339bd", "a5954d0770e3a16e27b1210eedad96cc2ef51803b6a8343cad27493cd113ebf39fbe2d7e717c4cae60fbaf5a1fce19f989ed45fe6a41b0bad3aa0608565410de"}, + { 230, "f8c79c568bdff001e41ea0a80721c063336cc5fbe9dad8bb232fd6ab98d84055", "64bb440da25aec4af2dcbc45453b91432e827013f686b78176c6b8d2dc5e10b06694f3c800a875495c20807718848df39365ec51d4707352217289a550031411"}, + { 247, "aff30e246372dc9437da2d5112041cdd8865cfec40148823e7a2258a5b25ba31", "8478f4cf015fbee1f99ee9a8936fd37f6634eeb654a538dda7082e9e93eb47f4d377c22f76268b718d8b4a41a0bf772198db1c9ef267c0b6b76a0342be97c85c"}, + { 264, "20fd7556cce1db2bf5364f93d8a35fb85d0b3ecda54adbe958c19151977fb602", "18fa2a93c749323cbfd15e8a2a06d9833da54b030343bcc2059b80b77de3b1a33a788c1ae122fdf2e8acc4c2ec99c7374ebb06651e01acd33903f695bcaba6f2"}, + { 281, "a25c36aa26851b55ef4c05335ec9240a8f519d6b556f324aa44752a03c222406", "562e15d5e63394acb8de9289370d39e735b06b5fb51c3295968a3f3e0f8c06d32aa8061ae41aca3ad94ff5848d173e19e5cf6cbfe1df8cb30f88db2f900913f1"}, + { 298, "5b2324a234b30883c0017b3db34b5ab0f75fd0416a0ce681283fb772b2b781ba", "1faf73394083ffa8a301348f77e9b0228a2ebb99cfbdb811f65da289f38558a5375ea1f3d109810723f0a0f5f165925674934c95f69d999a8abe037ddddc5478"}, + { 315, "02b991381f32c1019ffb05846d0d5d55ae234121c9a6305868e6f6506c2eedd6", "eedae04e4c654365514ec24ca03c0d8cf1f8e65090221ae9841023462b1292fc3b0a0d249c99b3d75adcf3a9ab4632e14eb3c70946a62bc15708b827ceed76d0"}, + { 332, "fc07a95a5496f2297b05ade1543c194463b483db39719420a539c1dcf0191c28", "fd9422ba63c98627aee154e471172a1822c9c8e56e7c44894c1fa4e2a95758e14ffbc83a64b8a6fd750da8ee26205a500d0b5fe930cdd16b9740c2b6fa3079fc"}, + { 349, "6a6dde82c6a155af4eea866a0f5e3a26a4b8b877c016c14c0ab686279aef128c", "66f08428010ad62f26cc0ca5ebef1b8a16a76ec44eac00c2f5d617bfdb2e61ba2aebae8c4d91db412e166ffb30bf5da22523f1030e93921ccf9c1af1cf95ebfb"}, + { 366, "41242593c41dfba0d5146ca2b07db5ab97833ee8d05f693060cfc4d946c9ca02", "5f50bd89ff490599be7470e428dec5b4872df7eea93f676f5bf091834a3f2aa17efda3fce223e58693a9aff09adf3e7c9ffa1c6167e46fd1fa1d082df5490ded"}, + { 383, "bf007dff11caa9ed878ea9d7c132f7d45135267bfe98e71d65daae82a12d1026", "6388b18d6cb806c919cfa36d897a5a936632bb2928c1a9c968c2bcb7cfa4f015ed70007ccdfc1da212055303d352bb0a90d4f2657d27e8817d019518cece452b"}, + { 400, "90c6686b0ef751564b7c2af965e2528b65e6809432d2fcabf6ef15c5905bcd95", "5464ea5c0109c4ca142fd9f317d1d2219882600596324e5a5387f922e283ad0243767dcbbf68c69d16e9f176b19862f02a74ec6110029a5764a6a8d0fcbf8545"}, + { 417, "b24650349071c31f63db58deed7edb69b2614a052cff4061dc9418af30d31ba8", "bdf90ab6ccdda56ce792c235939523d27eb4246397b45c26e8d42500eefa90c659388e8481a93c0bdd3aced0664d6aae742e13711fb2e52638923ad00cb1e8a4"}, + { 434, "9367a658ae8e5517027c8134eb1fdc69f07b4374374cecd4d6597a81a050214e", "e50ad4f8845360b7ae2ac3abd8ff3d244e48eab5000cebb7d4efd0ac6df90fe60d28c5ae2ed12161b793cd09ed5b82ad7f7c684617f6c84aeb0ced619d52d310"}, + { 451, "80756d3948534ee6890abbf82677cbf7effe64f1665ba0dcab1e64fe7a6f132c", "69eea4df5161189ec7b88f79adbe8c0fd79c96a9963610d558b451d39e18a7d65a201a869ef41aa9932ac7fab38f9beff59729fa5b49474c6cd1e6e1c72e5539"}, + { 468, "eb3038c89637f97ba2bf6ec21ee230e7b6d2d390185198d542d75d01291bc6bb", "76467e1e52086e35ff2446c41b5368dd94c94d5cf0737e81ef5f371c69364f914038cddaac9452e16243fc74a672b5dd1d4b3d10dd4c49c96b93a338c484c284"}, + { 485, "3a49c68e65da4d186acd27fc3e0deaea080fd8154d90bb977d9f509d6ddefc4f", "6eca5177436a06dcedd4a8bd84714079841694c5a82465dc21231a1587bcfa5252a896c35a73b5a5249d7ccbc6f4f6dd924f9a62bff0e688485ced38e88621c9"}, + { 502, "6d920bf83b83919c4cc05a4a655a69b3ad235256cf384fcd3e72410e7dd87f1e", "1de5920cd824c30e6657bf82070cd7ddf4f0b106904951d19d789fb4eb05f006d7b9f725a00c98e36c6159b9f149861f3de54d2bef90df5db289ea2cc363621f"}, + { 519, "0dac4b501cf56f38218693ce7a99d1f59823d34166681058b7507be7d8d2950a", "b04a46ce239a659c54c8af598b23888858610260ee74e2d3d404e703a79749e4d57ea618bc909c82b2c5b79435fc4ce73d406833f61ebaac80eb541cc3f99e90"}, + { 536, "f10d324286331cc6d91c6a9386b970f1b70a8e1c058ca116b0ae800b3f8db6e3", "cb4626eb9aa528b07293beb96618ab96b34eeedc644095b7b215cdae2d874ad50d27e342dc77988b425bb401ee1c6db3c403f2cbceeb7445b6cbb2b7bf563f41"}, + { 553, "941e9fc6e444801e58f05f85a533832c2091546beb0460a187c8b0d35a68bd79", "b71446227c97f7716ab24a2a6b5d31afd23d84c4fcde801a35a874049b4a3100c17b48b686a3a9e7e24f23f6c210fe4253edb059403fbe1bc0fcc7c5803795f4"}, + { 570, "d0b1c6af78f29a63ceba1b0e94c80626706c8f47c237f4c2e2835de12b29780b", "2392b26408bbe6ca2abe1124d1dc3d066eea7765090897fa9d3d82944e8de29090f5ad8d1fb88cc3590bca6b3e898872138d9b15096a733288078fec6d5a9daf"}, + { 587, "0862afa890d4a3d14abcff213d620b42e9ddc9c468162f0fadcd1230da441f46", "4b870f38a016262d68538bd23b05867cbe51c5117fdae634c4ede9c11ef9724af8dbe9809b0aa32ab1f698facdcd0e5bb3b13475acbd6bf2f33a255773a4cc8e"}, + { 604, "1cee7255169b7f3004276788b4d75dd2325b181a8e07860b85ae54b3fe5ef483", "1fd5235cbcd7d5fccd9f70ea3d2a4672ee66e540c57cf250819278d488ac080c628e6d7e1daec755c8c4eb4b8db7b6d62cc52368183bf38e908e53be90b1874b"}, + { 621, "cebb75bdeaeaebeb8bb54d35198b355a78baed7e5e8d702830d07359359c5f30", "67667b61e71b9dc6e43c19f42fed38481bfe5734e08a6ec22c260c27e943d4d0c5fb8de3ae69ef3c1632813924f6a8bc12fdf41c21166817f87580abddf69d31"}, + { 638, "b1146af09f438fec10fe41a277afb951d3fe59bf34c0a190a1e4e9d4739abe2e", "94aafd22aa3691265b4f5041dc21d6d79b21a6c0d9485023b5c56838bf79597126dfcd5ee2b9aafc4072b026ad52ff10d80305e08b564feefda9fca036d4f236"}, + { 655, "78e63491dd35b8c5b2c0447a1b7e9c037c1aa3145c77fe91c2b16828a6815df9", "f3ca9f40af2143677b66484707859aa53a4e3cbb28d95df7d74585e40e402271167ddbd556dc15cb92d61be7a253c3b5bffc020928229cf247b950ca01d614ce"}, + { 672, "0b68a789951aef974bc53911be01d21174be84d0025e76c99dee0a59be62ba58", "1ea6c8039918c2801bfaec33994f25a74e061fe31a8770d696213968d7f59522c821a1c3597f29a7d946d2ff7d41e45a6cfd74d5c7e2b1653edbcc00ade86d86"}, + { 689, "1cba5fa27a83bafa19e46cabb8a64e9e290b3a659dffaa98d2440191b1c6bc38", "4a490c9e7dcf02ac34c0ef719ae60f3e332fe979017533f0218234e71f64f64fa2be9ced378a5f9977ade3ad95122a32119f3a28f9552403924bc45ff16745ec"}, + { 706, "855a6f1736b1d992a9ae0de66e2c27e5ddb3a402df0b9b25a84f4f18fe217c45", "1eb0bee1d9871ef05d5fda84c897f036ff8f5a915a9084e81e7be55a31b72fce31e683417b6926fbca0801bd96adb3c3ffd719f735f74cf5388f4f093b67257a"}, + { 723, "2c7a5c3e3d32920dbf8b14c21bfa63fa96c47f0b749a5c044c2f4a77abf64126", "48954b4751bd46210fe6ac17e40f46bbc596bb6619d6b818b2fcee69a12d038464bec7c358126b2fd8c269e6608c98b12b9f226d27b6d76fd0972005188a6aa8"}, + { 740, "9d716e157a81a0cb6d5a4cde2210e6d2076f694628ac9a1da2fca9b2baeac666", "871a561a759a3e8b3943ec0106332672dc7a87fb6faab459f5aa4afe4743c48e8e6582321e75f6e9b87f269c5591743da29995ff751743f694fd44fcb5bf0050"}, + { 757, "4dee3528451da2abfb4043ce669f543a2e651f9d70a4801357a3927f3a932846", "b64d1f8a8d69c2ec9f88616726ed4c7a5bea5485870b82311ea40c510e26d0330ab2f3e29851fca0bcbdf3b17c01dad1bcfee6bc3d0577456cb3a776fbb05eca"}, + { 774, "84a12a7bbb7926ce5f13465392214e5af06f59db4d84fef6d4de82f1c83a9ba3", "f947d3682af30e7fbab2d8d2aa76590ee5f4ab90c1d8a16d1e494af4b91f45394854bd3d5c4e58de4947d942d375d6db97f84f97ce6345329a875f30f013cd1c"}, + { 791, "d47b0de85c985f5009e145db03c7e5577c322dc56fc740650d37c3c042936ccf", "29177d68b41f46998c97e61b403f7a0ceb1fa3b187e3d6e65eb6d475c6c68b1e19ebad8a72c10caef781eea05064b8bb7ab2a7bdac1755443a3119996cb53b52"}, + { 808, "936493e3daa2f4e855838acab374a38d5a6687e2d3df846b1932abd1c983a443", "894ec877ac07112a9d0c7288c03015c83dd24ba6976cc3557cf07978d37139894fe41f2a5f7d07f1cfe955a27969495db7df28560ea40767bb81e664a9040354"}, + { 825, "e86dc8144f37e251150865496b3365f5f7f1dd1edb9a889dc4f6a6957478d9b4", "bf8efaece476e3342358e36654c39cc63fec67858082d89e014c3cbd5c3a1e148ebbd9f6a0309bfa72af6037889dfd4a6c297791441804c24719e8f8c56c723c"}, + { 842, "de98c139a3b872ec4e0ca9934b144488683432308f497a3bb39ffa5c1414e95a", "80880d59a6b2a37cf294928db124c4625891fbf7a6a2c259d35d62500d9599393557e3b302cada53376c731bc7c73b1f2933013b1a5a7cf2624f9c5a5f8e4166"}, + { 859, "963b09cad62876bf703d07578360645db4f3f0c9cb1067cceb3bd601dae42ba2", "40ed42b2697821fdb2fa0c9a73f0792880f54783e02519cd8fb84c3501b102ac004a2ddc45f14bf813bef317f71d124c91cdc776024396577d5bcf51ecbf3a96"}, + { 876, "af768cf3605c825e51e3f9e0715717d5b5ddfe847fc54ca38f85831a87ccf38b", "4a945650331ba16b5f54e37756a02b6337d0fd58464edea5acc956b8ed8b8ec9711f44f84d7bc488b580d55fcf75b406fd1433826e60bf2829e1d4f0a4f4af6c"}, + { 893, "e3663cf950ee39c6c2986a5c81e3bc61e05714adbefb72e0568a182dc670658c", "27b9577f82973d1ba6867021bb4907a36fa857dac108b32a52b7c42dc013b91af4947766a51b1fff16016faf52d5053b52b37835d6aa7a3c49637458be166f19"}, + { 910, "6029d65463c5bf85f85c95c549471ddd21511294f0c351112cde2431e8887710", "9166c24c5fac2286cdb51500b09a0eceb4f7bac83d668afc6b0a551142087dbb2031e5c13507a8721b766130b81630e9d979c23c4d4f5818ab481e1c251db21a"}, + { 927, "1db82301a5e67e55ab304f8799b3d65cf31a37bc295cc3f939982c3ab2952023", "dc6a40991142be6288ee9a790062a0a1505e0c71280c55dc33d0633c39005c1d8b212bab5cd25345a7accb33d946e1ed0edb1fe64ef4f58faca1c2757e52bb7d"}, + { 944, "5f591977c7f9fa2620da5d90b1f843dba6ebccec15f52f4144620a6c00a01230", "943aa6c4157e62bf67d39dc34435dd93dd6c2501ab11a0309e45e6b94582cac33e17d1438ee02cb2de99b0b01263b244c9a527eb7fa592a7156a532330c3f2b1"}, + { 961, "0883278defe9249cacfae1fc05cf472b3ea79b8eedaf8cbc574b3489b7e5d5f5", "d1d1fa12555bb93ea8548228399a19cb97924da8ce0b8f222d07b8c4d57c2cd0a08355f1a7b221d2edbe84a69b7b5b12fa1de609f7f7dd616576e87e7ef95a27"}, + { 978, "1439fca0a45b982ec5148b107b96603abbb292336eb69e4fb426cc1fcb0dd3f3", "5e01e363074dfcf871b0478bf46e364b050a8265a3012e37327709368f47113ecb7ba6d0f07379bc139c20280398a74e93cf954c2d738741e60483f73fcc8d01"}, + { 995, "98e436a8b23b74f034de5313eee578cdd0dbeff5d918b19c743b808795f046cf", "5635fd28b56f6612ec2c1178386a3fe2d738d0895d3ab2b518e7cf0d333daf20750dc566e3a07f61b7a62ff852035cf71f0a2ae9670b8eb5625fb606519e7f97"}, + {1012, "77ae53da54708fb406dfcd5a54e0d67cb39bd7e55b00f0dd127daa9bbc377fe5", "53e6e8f45d56a6e9dee39eb1f0a37965363ea8b0a0852225182a396a97f6944ce08a4c8cbcba988d749dd3eed6401d7c0e6cda71fc0f69aa9082ce20b31b283f"}, + {1029, "de311c16556ac00597357e4e8ed19d20346b583f55b75adf2615f3ba954553b0", "56e541e4a96d4f1af0053687afd112d11ff2a10a205efb80e47b3684f2a02160b3711072757820068c06071093fdc8ba9c229d88ed14bc59eda83e373ffcf9f4"}, + {1046, "386ab714e5d89d9cb5c2c2ab77050b0e3c6debc51619fffc6076d0d02fce28ab", "2dc4f968ff556a6710369cc274c7fc66eb6bb153b8acbdf524110e38068e72ac29321a951cdee24f6463fab9216a39ffc2c56eaf7c4128713b77d2901d8e9004"}, + {1063, "2d52033e67311aa07b066b4b1ffb3f738bd0795ac0ab8518e97bca821ab56cd0", "5c18a8bab4258c85509be10358f52b94d8a7c21a3fedaec56bc49cedc5d183e42ddfd67fdeb189516f0c70ae1173af5ff8baa339d2b56caca936658824d22189"}, + {1080, "5cfbad76a1121082c712060cf21d34ad51d99a94e490057e2362e6be824af508", "d5ce460ab8b26662a688a9287911c767738080aa6b0ff7e340ed8a24b2fd2ca878c7b1707ae125980997fc509af3dfb9e99813438e5c5d12073bc7cd1eeb9d65"}, + {1097, "56fd9604821ede12246811eb1f9fe0917cb07fea38130e13fcfc9a54704df22a", "b38376b0806edb0302ff192fe4f6a77d0b164b920682488695c84f5f6d20b7b6902057fa93f3e2aa242e9aafc0cda8790be4c18ae1caff4d6d56df89e1494fb3"}, + {1114, "4d8fc492d650ff564db94c83a5a90578d0f8fba8f7fe5eb85f898c385c21081c", "f5c9d636a2526e3619e3939082215a078f404703be1e714bccd35f6040879850f1648b97f908e31f4a5d04abd6eb8529cde74e927e33dcd1333fe930fcede959"}, + {1131, "e0d6d92670f60f2d0d4e8c9123f617acf7ed1c2a8828d4d52c00ca440fd49ba1", "01db8ee607d3e2412ae56e394f056b466bd3149c8d0f2b530da40393d4c372be536fe94ee535e62dd7c720a0723e50267f222fb4c4213398f2ee3776e93051c3"}, + {1148, "b1346f621bf3fecb85428d31b749a2d1fb7216794a0790d43e4f3c97ac6850e3", "3bf26fbdd96cf3265d9b4d5b7967a2e9149484fbe583cc6ee43f378adff73e619f3f662010e26d6a2592077b4882c6bd568b1a50786a0693abfd67271f3e53f3"}, + {1165, "a3d5f4335de7731967fc537bce00659e4b3b5c1f0e973971f6b1359284602442", "73762d84fbd6db6d54945f4ec2dd55c687794ac67867ec531ffee4db4e5499f530bb793e127356cb692e2d235848de3acc4ff39e435cac0804b031b97d389827"}, + {1182, "ab2f9ff9b66a04f27fee5170247f1cb95569e5e1bf4afc7f63156582687d5ef7", "65661b09e7a285a3888c6f21fb9b971c2f9ebbb162b17069915ff8f129f721098aa0dee567c5abb333d9f42d693dca0e606d6a40d4081b0e4f22116e1de08d0c"}, + {1199, "d6e12f8652a03a5c13e9522afb555d780ca53ae45929b7f761ac1c06df3d415b", "303f2c810c9fd77d4e688dfa636817b46e0297756b95785689cf77ae3efbad4c5563881229206f66ece9a78d888f425b856f6887a8966219fe90a976ce4ee998"}, + {1216, "585b2795f98932fcee7734ccb184f48070696a7194d88f426ed274fc49fb6ad3", "b1e5f7ec60a2474fdbb1f6d2e7c92bf142795ad305278659a68899d8c773e81ee0379846f479d836c07198f6a6d1d3e8d7a71e2b0f43d4fdd12acf772da99342"}, + {1233, "f544f55e4795b5c72f114fd36e5f6a0abd7ff4c1da2ff4be60e67c2a3de1c296", "a88f3bc04ecf5001e280714c388cb05bdb1756f2d54bae0cbcd17027e1e62a92ee472bb47e132f28773f9ca93e56839848f03481eb5a00107423b2185ed02484"}, + {1250, "3725faaec54166b6e46efc88c097b9609e711566b6133377dab2e7eb6f63ba44", "e4cf749086fc05e6992423dcd9faf956fccb63ac76e950def0e2ab7c0b4198cff31298d47816f404fdb07c7f4a4ac172dcd7864ea8bb61fe36b2a15fa87a5a47"}, + {1267, "550d5a54808a7ac9d3a43292010400ff420b5f92cde32d28328030363c73212f", "aa84f60a730dd06bebf6c41ea7f3f811a713dc99ad8b64b3f65750d4a865b310bab26df9efdc25b5584d5f7cf1db9916538b67fb7ec5d76112b0520010cf2341"}, + {1284, "c7e8237ec583be9012f8c6213c3b8e6c1b58ddb3ec240333cb64a80605ad7c70", "ee3a40793dc4441d60a2db6a2f2c2a8c409f811c91aac7cd8a35acfee8eab99dae6a3d5be7af4101578b1e61b320fc770645d3bb1cbea4b7309c4bc370e92a6b"}, + {1301, "52a9671b3a6ed779164f87de55bee7d75ed3e480e0f21cdd9654c2f00333c1a7", "55dc71a7fd66b94c31ba17b2974c887509ec377c6d768763e1b30e69a3de51ae1691baae0eaf5bd2b650c49abdfddfcd9127d6f237ae07194d1cce54f57d2fa3"}, + {1318, "a3c0630a6f76291984cf6d940595870268cab441c8ce0b665cefa89c9e7cbda7", "f5e6979b23dc036e4163145fdbd9d93760ffbc5a1d8b1724b065a595b7640c11029c1ddd8fd099ccd12ed1d773990be25f2bc1c0a3bd95840209d0cb638cb810"}, + {1335, "1bca76ab4f8dc021ffc74dfb448b106862bc3076b9ab13be3a99e6e42f41020c", "b6f87503f93c29cf7f2e335192da905da0626279a5ccc632e2fc829b04513064c76562f2add5c997959b4b81847a98bac177ae7d6930eb9a6e22cab04e08d674"}, + {1352, "ec04a7f442a0b1f7439f29f4843b7f2b2fbe82f4e3099759a1aef97a21373086", "d9324f9ee5095de2cde30b30256f02d934b437348c3791c9b1a0fe2793f389eda180eb6131af7ec2b1103edb89a6ff03accd288464b2cc040e95759edd4aeb10"}, + {1369, "e830790bd5367f5a0aefbe7a8d32723d4c69517d06a94bbd45a4cd8e3b6472e7", "d1882b824f71a6317a997170204c4eca2e585720ccad4dfe68030dff50668426283ad16f5fbab664275cf68f5a05686fc34a542d555d2f5519fe648eaffd7bb6"}, + {1386, "b663d13ced14b964bee5ad1e80ba2995302c61d98475b8a89f50e008f7398968", "a3d298455878432e979aefbacc41d413cea3a2099d5422ea37751a9f78d0570b174803b54346ed998ecfaa2c4a944923e2227f86234e74b95eca02f69841760b"}, + {1403, "5ec7d80d9fb15b37f5193e0953a14e7accdf1d285f54f41054cc505159b57738", "f94dcd013b685dc8c9fc6b29a05a934d5cd5c231ca88df3bdea2b3210a8ed1f98a3cfe65c049694b191ace54c5e0376372d364ada2d1462947681135bd0d9666"}, + {1420, "0a5613915f1f0c2f6fd21d905e1db3a279d4107735c856cf76dc35d3ba790c11", "a6d1ec4e71e9317caaec3405d7ec5f0dd38b80fdf46ed1d9945a21cd5ed936d49eb2d610737c416744d11beb151d18c8633de572f72d68eb7b2ae2fa41341d71"}, + {1437, "4b4dd8affb016f7d1cbeb10cac46ffe8c89b02c56caf50249cb7a0e35c2d93da", "3bf45444d0289649c03ea86a7f82f21aa7fccecabc90f43ecbd9ee0fb5ea59ac68387d0d317dbd9e337715e46d3d7f098e4a76d7310ace43616b3e37c78b513e"}, + {1454, "ac1f54f52e7cbf7eb7c5b434476db6c7dd00e202d457e04d3722621a5ab3d860", "e2d1a024fa1fb1d89d7f06478793e5af375ede6b053217159fb759e116b281fe7d3c6353e2d0da9755fd45c16ad8af88824ca1983737b45c7347991728955268"}, + {1471, "15cbdd7e4831a08e5583d3c2ed79f23d1b51773a84e455acde07a72992d7b107", "3c8065b235a50d7423ed0eb20cd00e8e7e5d650d63933c91d336f6dce0669d83e179ad06adfae765e5a6ce6a5d1aabe7eeacd45f23cbf2f62ec7a3050e09846a"}, + {1488, "eeb5ef941379d405b884eaaed09741d88d0724b481f64828b9747c276aeb30a7", "f4b5bad6eca38527c5faa6d807a87852e879435ff713b9983bc173a33dc6f6020b3edeee7ac882d48a318aedf57131698722efcaebc091c9005089a6933eb026"}, + {1505, "f1bf3d0e864df764b16c5986de89d676fcb7a68ab92cc8483c74a127076f34a5", "c0eb21641a8eef573aa8284e24b26ec14bcd19c9526be890da49e037aac8ed726ef3d93967ed03258206a5a09f340b9798245311bd631ed725295b007c9c88c6"}, + {1522, "41b9dceb78acaac3f2002693263a8debf6d62d4c6e6eb6cf7d093d03dd0bf7da", "a0067f9dddb5688d60063c1d5c261dc2c93f5076bb5ac2e33a8199c99ad84bab6479ef14f950b44469bffc39cb80b46c1a84bd4d49edae12433e58c531928926"}, + {1539, "2e2e97eac9ec9b1721f59b96226f875f42cdb95f55eb40e425e0294f33e0e75d", "75f2c69d41b3080cc213c759f172f8b1a042d3e596bad0c99872739f6faa6a34cca1f8c6a2534d0167b4a7c81c5d7192a881d8502d83d2868ac81d7b70571414"}, + {1556, "7bd004878e6c169c2c2cafaf9ee3ea09e2ab048f64ea098369c05aa9cb11ca59", "57ee6bd51017d69507e25e2566aa7e1ae35e041c720dc7ce61cddfa36e268cfe81d91d1b56921617e315f2767f02fcf02753f32ec32dc770f6cd2330ca252d3f"}, + {1573, "ce829dba7856e8436fd39b90d3725de8ac4a2c3ee09c7d22ae5eef9bde79d92d", "88f654868fbb60f543a06af192cc72a87f4112a6ca317ac84ea841d780ba1ec5df3654c444e5e99685b7ed9b884dde00ec34cc5d58967dc135ae0f6a5f722582"}, + {1590, "e882b440c4a555109365e0c175f9a2b666e5cee6654c8dc3ba9e88e6d74bd826", "c6c194c886326973dbc0964675cbf3fdd82a9ae3607e62dc4579348f41feea930c9bef724bdc6c5ba9a6d3ff01d6482d4a0f0e1b7004a1819dd738d09fad5915"}, + {1607, "2cb0b24b9633a355583d0d5230553824b7c6ebe5a6974f47d549caaeb5a05770", "ccc5273a4f6860789160d1b8edb51a4b9f3d087634895308cf40592f596f7fa8eb0c7e6f9289c3a9b3956c3881701e5190e526435e3ab0791dfa5694000a028a"}, + {1624, "7d4ca65fd13183779417ca1c80bf76b24e856f6de2ce1d1caaf5038ce8cabafc", "8fcbc1ff45cd602cc9cdb94764313e12c5a809e82378f75135199f2df04694f40b386b1ce83625e8d4ad209d4b13ab9f65040d54391c13ee9f4822005fa2289a"}, + {1641, "63aed7792eaf510110ad6842847e5b584e3483c8d2527e3385c2b76c89ce3ec0", "022463ff5d8a47eacb27552f842f23cd7e354624a09878fa1345e41c4dc8151f3e80cd5f838ff58bf4216d1ef305cbf9dab147090526e5dbfb561b0b31f95cb3"}, + {1658, "1a7f23290ed4f2f93a7b6825bee43452cc8469c82384fc9ccf59b31337de7872", "ca221710433327d5e727911b869dd013ec7940284123af9771005b457878faecea77777ba9718e35f4cfec65b1fb00ea1f14a7b3a562cbef9ee7a2d8de18b8fa"}, + {1675, "bc57d84c2ca0e29376f765d6673632088a93eaf5a3e5dc0f866530e635f4c42b", "fa13a82135184bd3cd14161e729f60cbe446b9462d9c4d1e8b984ca32a5e15164de005621027390ec95f37bc4698ff31af4f07a3c5ff2f87db6f88183459d50e"}, + {1692, "13549887cfebcbbbc6913615f15b306f0f4c7a038b054c9f7fada8b70559835a", "4f32ad5729471ac456b18cabe1d5fe002fd27620907241cecae4ca63c17ead484c599c84b216e8a15831a76cccd951bb72998496ac6904abf571550c8fbbf407"}, + {1709, "2f055b1a94f94eb3c13aa56ae4adbb1e98308f66dd553c6fb39c980c123648d0", "fd7121376ccd3fa4cbbd6e3102cc14f555e0e3b950bb780d68fff8f1c74d562643cf13ae5e81e7f785f59a852927e1887e81d9d6e44dc2c7826681edcf3815c4"}, + {1726, "e43a21ccd6eb1ec50b3184069213ded14edafb0a92bf59e1eea44c989b4372db", "9371488568490a6550ea83b3f21f89f1138e5b38d4f51b93c50fbbe0faaef4b57e46add773b6ac586b945c6d2b816fe6a61bd03039d4584e802c1ed97c49f56e"}, + {1743, "064c4b10d148ea8a1924c5e44ad9e4474ee2c9c119baecb5505575e5150c7290", "ad641147e6394dc768221b5ad76f9288c913230539a31c19e63191a57eccde28538b92ef812dad982c04a877917f5a414c537244577ab791414b063ed2b80790"}, + {1760, "d6db4389ec1687714988a660d09ee9587414e9bb341c54578645369642393060", "82e900b8b66f258d2c6ff8aaf290f6e7c826c2f9b2f875ac56bd82ffedc7fe0867c01434c6dd4098eee56f0594f049c29c3a7e90e557a5b8fa35d4220da00b44"}, + {1777, "a3baf8aa413563c3d29631ea0e6eedce687348ae99f6fa7ae2c33785ce13c77b", "9879e27ec25798c9ef6e5d24851182619b8214a03474c4abd42f0d7140eb1a63a2f2c5e91e9c7228fd476d6edff0f0cb017e7c35af15615c0894197e3204c841"}, + {1794, "545a39cabc621e29cb9abf4d8a90423949f63fb100dd74a6f44a9e593e03fc86", "ff5789742ed14d440c43d29c98dc1dfb75d5db3164028532aa610e7fa84b596a39b1451d50765620da15b1f8636a9b3c8ead4d044452559fa19e379b6e380458"}, + {1811, "0e3005d7f0ba97c2adc79ad28baf2f626d488aacb24ec518aac63f14459a21d1", "403fbe1cb842aa65cbc49ff52f7ac27692c087aae20de0606f2442ff9ddb196a584410505c98e2f04527721d0c047cf09dbda6739de383ab904efcab6b10d43f"}, + {1828, "ec60c13b246aac8cebb5d51ccb3ecc56e3dc9f187f11f6211def08dd676037e4", "77cf71b7a92a436ad82b8a7ecae96ca7ad3fc06052afdb536bbd35421e76960bde48ea5dd46c08da8435bac4ba1ff66377fc0c0e78fb39d2840db628747906ab"}, + {1845, "2adafbe1c27e7414f07d722ab11c4eed26332a4f416448260ee00fc20f31b1a6", "1bde6bacbe7412ee2878cce5aefc7902a3bab56e3d0b056fb6b3ccc533336beb60cc0d72a5c627238a77227f47a684201cc126a7bb6872ab7e610c76205e29de"}, + {1862, "cb0b036325880f05253bd6fed9ea4dd865db81c89a0badc1e564f3236ee73381", "be08144dcc0f9a156d97c625894ea39735142abd11f66aae24188ed4226637d68ff8b825c6ad17418681633fb3b384d721b8828641f37bc6bb16f6c9555a9d79"}, + {1879, "1aeb58b9c662558170d8f4e1088c24d1701254d78d55d9915115ba8693ff04f2", "ca06acbb846068507962338cd8cb2d84f4abef20437ac3c536bfce541a56ee47a52a1219a636192caed1d59311e7286f6d40e08c50942f20a8a9f226411bf088"}, + {1896, "9c9f9a0a77e755b1400eebc153c7db1654acea51b2a84984252424f5e5291585", "2fffd885dcdd26a52c741b79a83eb5f4288b96f943f98abe19849bbb02ca89e73e8523fd5907bdbce21a7db9c39eafbb3ab322bf58d452c573713df20c573d92"}, + {1913, "c270203d690386cb4cc8ee8789b33c6efca0d10c21de1e1b5a9f4c0fb42e7c83", "4af2d5cfbe582e8184258c87e77bdb20fef687261876c5dfbdec6b19398b90aa45911a1ddad0ff703c6c3589b8dc1775c3b1272e5e3b07d43c4b84359e6f6411"}, + {1930, "8afba6f6b49fc1029398adea0b063e67beea95d74fe0c5f901b5ad189c0a569d", "08303883ac7bbd5a93912d30ff5b6747ff155b9470ccc9e642e0c8f4e75a03ebfd5a414b6141a28a1be70338664e874108b9f8e8594fa243465859fcdb83bf9d"}, + {1947, "7cd0ec6f66b2765bad4afefbe559f0ef673be04fc2a8e7eda62f440dbecc3dd3", "679f94c2149dcd2c48b05ade346e2098692ffa318ead980e11459f331be7a2d5e92af7cee25452a9fa42e64abba223a559a2cc4086b21edc97a28af96df4673f"}, + {1964, "eb744372a0be05f86f798d2d0e47d34a9acaff756e952c7ea49522fe7291256a", "614e49922f72011a08b82acbf7150c011716ea736ba5b607c40f2a51dfe123bd3a5c82beb0c6d4935e8ecfab9f2eb833c7e6daa9411f4f5568f0fd34634d0316"}, + {1981, "853aef48f38e95c7167a43f285c730e27f80fa019114881b85effd9b89238dd2", "64de830e932534b41e9a3966521de86672b576a65c036c9514d3adffc5ca2e93c8de880f345a1675a163b41b786a1d6b14ef17249b480083b5febc2bf5eeac75"}, + {1998, "b12da59415a4496810be086280fc97f63150dd94f289b962b13d7c0b6b7af82d", "3e8a602fb6b38b4188d8754354293d2b7c5e3f22650cdb75868eab7ef0a40f4b33fedd1a940004a1afb5a4cd749cf0582ee9461d3228dbc39b3af7fea86d0a04"}, + {2015, "0283b70353122fd0503afa7ad318ff8f9273ba8c0efc44dcdc35d327a223b9e8", "1abe882eb3776219eb5095460093a4715509e8c00b056a4116d6439ca276214a013ea9c483d487e4bc7819c97cdab58a0df3c77dd27aea0f292ff22b8c8d0491"}, + {2032, "6b2644c4333e957b52099820912d5a0a736d2249ec3e26c37ac948ec2fd5212c", "a99677fdd6b89726a411c82541791286b5f607e1cfa4acf5e4fa68f9597eb9fe69d9a3ef9fb634c46a36313abf0f751ba7f8a4108358a5b0d0ff6109f1c69eee"}, +}; // clang-format on TEST(keccak, nullptr_256) @@ -205,19 +321,6 @@ TEST(keccak, nullptr_512) EXPECT_EQ(to_hex(h), test_cases[0].expected_hash512); } -TEST(keccak, bytes) -{ - const uint8_t* const data = reinterpret_cast(test_text); - - for (auto& t : test_cases) - { - const auto h256 = keccak256(data, t.input_size); - ASSERT_EQ(to_hex(h256), t.expected_hash256) << t.input_size; - const auto h512 = keccak512(data, t.input_size); - ASSERT_EQ(to_hex(h512), t.expected_hash512) << t.input_size; - } -} - TEST(keccak, unaligned) { const auto text_length = std::strlen(test_text); @@ -247,6 +350,84 @@ TEST(keccak, hpp_aliases) EXPECT_EQ(keccak512_64(data).word64s[1], ethash_keccak512_64(data).word64s[1]); } +// parametrized keccak tests + +class bytes : public testing::TestWithParam +{ +}; + +TEST_P(bytes, 256) +{ + const uint8_t* const data = reinterpret_cast(test_text); + + const size_t index = GetParam(); + const auto h256 = keccak256(data, test_cases[index].input_size); + ASSERT_EQ(to_hex(h256), test_cases[index].expected_hash256) << test_cases[index].input_size; +} + +TEST_P(bytes, 512) +{ + const uint8_t* const data = reinterpret_cast(test_text); + + const size_t index = GetParam(); + const auto h512 = keccak512(data, test_cases[index].input_size); + ASSERT_EQ(to_hex(h512), test_cases[index].expected_hash512) << test_cases[index].input_size; +} + +INSTANTIATE_TEST_SUITE_P(keccak, bytes, ::testing::Range(size_t(0), size_t(167))); + +class bytes_large : public testing::TestWithParam +{ +protected: + bytes_large() + { + _test_text_large = reinterpret_cast(malloc(2032 * sizeof(char))); + // generating pseudorandom sequence + uint8_t x = 29; + uint8_t a = 19; + uint8_t b = 13; + const uint8_t c = 5; + const uint8_t d = 7; + for (int i = 0; i < 2032; i++) + { + _test_text_large[i] = (char)x; + x = uint8_t(a * x) + b; + if (i % 11 == 5) + { + a = uint8_t(a * c) + d; + b = uint8_t(b * c) + d; + } + } + } + ~bytes_large() override { free(_test_text_large); } +public: + char* _test_text_large = nullptr; +}; + +TEST_P(bytes_large, 256) +{ + const uint8_t* const data = reinterpret_cast(_test_text_large); + + const size_t index = GetParam(); + const auto h256 = keccak256(data, test_cases_large[index].input_size); + ASSERT_EQ(to_hex(h256), test_cases_large[index].expected_hash256) + << test_cases_large[index].input_size; +} + +TEST_P(bytes_large, 512) +{ + const uint8_t* const data = reinterpret_cast(_test_text_large); + + const size_t index = GetParam(); + const auto h512 = keccak512(data, test_cases_large[index].input_size); + ASSERT_EQ(to_hex(h512), test_cases_large[index].expected_hash512) + << test_cases_large[index].input_size; +} + +INSTANTIATE_TEST_SUITE_P(keccak, bytes_large, ::testing::Range(size_t(0), size_t(113))); + +// end of parametrized keccak tests + TEST(helpers, to_hex) { hash256 h = {};