From fd4421fff3dd66c9808d42e412a3fb082a3be520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michele=20Orr=C3=B9?= Date: Sun, 10 Nov 2024 16:14:27 +0100 Subject: [PATCH] Bump ark versions; add bls12_381 and bn254 to nimue-poseidon. --- nimue-anemoi/Cargo.toml | 4 +- nimue-poseidon/Cargo.toml | 11 +- nimue-poseidon/src/bls12_381.rs | 890 +++++++++++++++++++++++++ nimue-poseidon/src/bls12_381/fr_3_2.rs | 215 ------ nimue-poseidon/src/bls12_381/mod.rs | 3 - nimue-poseidon/src/bn254.rs | 885 ++++++++++++++++++++++++ nimue-poseidon/src/lib.rs | 87 ++- nimue-poseidon/src/tests.rs | 96 ++- nimue/Cargo.toml | 16 +- 9 files changed, 1932 insertions(+), 275 deletions(-) create mode 100644 nimue-poseidon/src/bls12_381.rs delete mode 100644 nimue-poseidon/src/bls12_381/fr_3_2.rs delete mode 100644 nimue-poseidon/src/bls12_381/mod.rs create mode 100644 nimue-poseidon/src/bn254.rs diff --git a/nimue-anemoi/Cargo.toml b/nimue-anemoi/Cargo.toml index 070d8cb..200a671 100644 --- a/nimue-anemoi/Cargo.toml +++ b/nimue-anemoi/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" license = "MIT/Apache-2.0" [dependencies] -ark-ff = "^0.4.2" +ark-ff = "^0.5" nimue = { path = "../nimue", features = ["ark"] } zeroize = "1.8.1" anemoi = {git = "https://github.com/mmaker/anemoi", features=["bls12_381"]} -ark-bls12-381 = "^0.4.0" +ark-bls12-381 = "^0.5" arrayvec = "0.7.6" diff --git a/nimue-poseidon/Cargo.toml b/nimue-poseidon/Cargo.toml index e58629b..1b35f97 100644 --- a/nimue-poseidon/Cargo.toml +++ b/nimue-poseidon/Cargo.toml @@ -6,12 +6,17 @@ license = "MIT/Apache-2.0" [dependencies] nimue = { path = "../nimue", features = ["ark"]} -ark-ff = "^0.4.2" +ark-ff = "0.5.0" zeroize = "1.8.1" -ark-bls12-381 = "^0.4.0" +ark-bls12-381 = {version = "^0.5", optional = true} +ark-bn254 = {version = "^0.5", optional = true} [dev-dependencies] -ark-bls12-381 = "^0.4.0" +ark-bls12-381 = "0.5.0" + +[features] +bls12-381 = ["ark-bls12-381"] +bn254 = ["ark-bn254"] [[example]] name = "schnorr_algebraic_hash" diff --git a/nimue-poseidon/src/bls12_381.rs b/nimue-poseidon/src/bls12_381.rs new file mode 100644 index 0000000..fc64914 --- /dev/null +++ b/nimue-poseidon/src/bls12_381.rs @@ -0,0 +1,890 @@ +use nimue::hash::sponge::DuplexSponge; + +poseidon_sponge!(255, PoseidonPermx5_255_3, x5_255_3); +poseidon_sponge!(255, PoseidonPermx5_255_5, x5_255_5); + +pub type Poseidonx5_255_3 = DuplexSponge; +pub type Poseidonx5_255_5 = DuplexSponge; + +mod x5_255_3 { + use ark_ff::MontFp; + pub type Field = ark_bls12_381::Fr; + pub const ALPHA: u64 = 5; + pub const R_F: usize = 8; + pub const R_P: usize = 57; + pub const N: usize = 3; + pub const R: usize = 2; + + pub const MDS: &'static [[Field; N]] = &[ + [ + MontFp!("0x3d955d6c02fe4d7cb500e12f2b55eff668a7b4386bd27413766713c93f2acfcd"), + MontFp!("0x3798866f4e6058035dcf8addb2cf1771fac234bcc8fc05d6676e77e797f224bf"), + MontFp!("0x2c51456a7bf2467eac813649f3f25ea896eac27c5da020dae54a6e640278fda2"), + ], + [ + MontFp!("0x20088ca07bbcd7490a0218ebc0ecb31d0ea34840e2dc2d33a1a5adfecff83b43"), + MontFp!("0x1d04ba0915e7807c968ea4b1cb2d610c7f9a16b4033f02ebacbb948c86a988c3"), + MontFp!("0x5387ccd5729d7acbd09d96714d1d18bbd0eeaefb2ddee3d2ef573c9c7f953307"), + ], + [ + MontFp!("0x1e208f585a72558534281562cad89659b428ec61433293a8d7f0f0e38a6726ac"), + MontFp!("0x0455ebf862f0b60f69698e97d36e8aafd4d107cae2b61be1858b23a3363642e0"), + MontFp!("0x569e2c206119e89455852059f707370e2c1fc9721f6c50991cedbbf782daef54"), + ], + ]; + + pub const ARK: &'static [[Field; N]; R_F + R_P] = &[ + [ + MontFp!("0x6c4ffa723eaf1a7bf74905cc7dae4ca9ff4a2c3bc81d42e09540d1f250910880"), + MontFp!("0x54dd837eccf180c92c2f53a3476e45a156ab69a403b6b9fdfd8dd970fddcdd9a"), + MontFp!("0x64f56d735286c35f0e7d0a29680d49d54fb924adccf8962eeee225bf9423a85e"), + ], + [ + MontFp!("0x670d5b6efe620f987d967fb13d2045ee3ac8e9cbf7d30e8594e733c7497910dc"), + MontFp!("0x2ef5299e2077b2392ca874b015120d7e7530f277e06f78ee0b28f33550c68937"), + MontFp!("0x0c0981889405b59c384e7dfa49cd4236e2f45ed024488f67c73f51c7c22d8095"), + ], + [ + MontFp!("0x0d88548e6296171b26c61ea458288e5a0d048e2fdf5659de62cfca43f1649c82"), + MontFp!("0x3371c00f3715d44abce4140202abaaa44995f6f1df12384222f61123faa6b638"), + MontFp!("0x4ce428fec6d178d10348f4857f0006a652911085c8d86baa706f6d7975b0fe1b"), + ], + [ + MontFp!("0x1a3c26d755bf65326b03521c94582d91a3ae2c0d8dfb2a345847aece52070ab0"), + MontFp!("0x02dbb4709583838c35a118742bf482d257ed4dfb212014c083a6b059adda82b5"), + MontFp!("0x41f2dd64b9a0dcea721b0035259f45f2a9066690de8f13b9a48ead411d8ff5a7"), + ], + [ + MontFp!("0x5f154892782617b26993eea6431580c0a82c0a4dd0efdb24688726b4108c46a8"), + MontFp!("0x0db98520f9b97cbcdb557872f4b7f81567a1be374f60fc4281a6e04079e00c0c"), + MontFp!("0x71564ed66b41e872ca76aaf9b2fa0ca0695f2162705ca6a1f7ef043fd957f12d"), + ], + [ + MontFp!("0x69191b1fe6acbf888d0c723f754c89e8bd29cb34b1e43ab27be105ea6b38d8b8"), + MontFp!("0x04e9919eb06ff327152cfed30028c5edc667809ce1512e5963329c7040d29350"), + MontFp!("0x573bc78e3ed162e5edd38595feead65481c991b856178f6182a0c7090ff71288"), + ], + [ + MontFp!("0x102800af87fd92eb1dec942469e076602695a1996a4db968bb7f38ddd455db0b"), + MontFp!("0x593d1894c17e5b626f8779acc32d8f188d619c02902ef775ebe81ef1c0fb7a8f"), + MontFp!("0x66850b1b1d5d4e07b03bac49c9feadd051e374908196a806bd296957fa2fe2b7"), + ], + [ + MontFp!("0x46aaa1206232ceb480d6aa16cc03465d8e96a807b28c1e494a81c43e0faffc57"), + MontFp!("0x2102aab97ce5bd94ffd5db908bf28b7f8c36671191d4ee9ac1c5f2fae4780579"), + MontFp!("0x14387b24d1c0c712bbe720164c4093185fcb546a2a7d481abc94e5b8fb5178b7"), + ], + [ + MontFp!("0x5f2179b3a7845836cfced83e64e206f6a6cef2cf737f020b5cfd713c9550fe9f"), + MontFp!("0x1787986ab56e1b56b5443334562b0bc3657d27323b87e3a8485e68ab96d57188"), + MontFp!("0x39ef4b00deefe7e7451adda44428aa22074c496de2c9ed67dcf4861da65f543a"), + ], + [ + MontFp!("0x7271d384cf5c90fd0c48af190c5c765937c7468088b081a99337e6eae53bb20c"), + MontFp!("0x6669e58d04248ca86024fbc196e5f306e522423aa71f84225435328b37a1dd3d"), + MontFp!("0x0c1f1b492b27539d754cba5e46edc1f1ac1c5696da8eb19416b07420bb321c65"), + ], + [ + MontFp!("0x1c4d41a133b97dc467f1f184cf191f331dfc38e79e7e53516c39848c9bd44692"), + MontFp!("0x369ea8e699181b1cf88be9205ab840180c9288e67a359dc0dda4ac74cf9768e2"), + MontFp!("0x4cfa7d72afed332bf0b8a2a719123f7ebfa714b9e3100eaa533dbde6fb985043"), + ], + [ + MontFp!("0x4e592fcde9f3c360e54c6f34d7a8bd41889942e9fe23d9fd4a9e5b3bfbbb3e45"), + MontFp!("0x032b5885586212fb235570996d3a4c40f54ff91598a948ec2722ed865b8438a5"), + MontFp!("0x03f3178956cfd3e2e6614fb134597d3b3cff0d8a33f3523d825982990c068940"), + ], + [ + MontFp!("0x3126e84dfd67a22bf0ce0d9273d8ad40e6109af5bb2bd78d0ac08a16c6248f74"), + MontFp!("0x3527888062f1e2738d7b928e9af244f0a39011390c2dbbcf56d8e087f4087b6f"), + MontFp!("0x64635758efc701dbbe2eb423bf7b5bf6c3d34c6ff92494f3421182a8b187ecf7"), + ], + [ + MontFp!("0x4d7f71960f03db8a2a428cbf77ddc1916a5f4243dbeb2ddaef7b5b5f9d74546e"), + MontFp!("0x37832ba2da93de3643243eba3b9765d75359310617f3fc06d74ac12db57b29c5"), + MontFp!("0x4dce55879ffd9398f96c9e6556a3bb4fc93147965252cb1d6c94b3282ba3fae6"), + ], + [ + MontFp!("0x4ba85e4d2537972c0fd5a4727a58c3d85d98563697a34c0af845bfecd6dc4b40"), + MontFp!("0x582dc453b4cbf6b1d19734b0f337d3423b503703979689f384d0eb96ff5b02ce"), + MontFp!("0x0e6f127f479ee6113540d69b25420a2682f07b23e799566b091a1c891fa224ba"), + ], + [ + MontFp!("0x39c815508d2995bb8ae5035472944706e900b2fb16d5a779fdfff82306f37dbb"), + MontFp!("0x6591aba215bcf96d8aa03220372179a4c5060cfd7f95724ab300d9459f709051"), + MontFp!("0x221807cb4909d549c546a734ad2cd7f60a69e816ace98fad830452a44a343188"), + ], + [ + MontFp!("0x2766a1e33038004da58bce78722380b22b13b0aecb87f38659f3035e1336b53f"), + MontFp!("0x11b5e993e6a9cdc3b5d2f5336dc9bad5074b661537ff890b1babd7f53cada9e3"), + MontFp!("0x29576176f9a5a10e3d0a2c59af26b51f4c5fc86ec59c0f2492deb60ad49eddcd"), + ], + [ + MontFp!("0x51e72c44f9de491c747d8a6d333fb2b3e16ee7571f1340a9a5f6f72363991e98"), + MontFp!("0x2fb360d959be4aa871e071764a5e41eb264d04f0289f098723b69bab09f4d1a6"), + MontFp!("0x03f46b4c3c77957cb595ed61fe13f9e8739a5009311142b69c1e8c07ae250f47"), + ], + [ + MontFp!("0x4683311e382a99927e0ff672cd0543aaebfc0c33ba96ad937818cec979b57b5e"), + MontFp!("0x7117cc69bf566b1b0ba5486b0f1f9bd60f2f945e3cbf33a2ed17076f4caa0dd6"), + MontFp!("0x3bd670c3ce88ea43f254d61c2a9b56d6a4dff19ab5c4d28989d271f3dd6bee25"), + ], + [ + MontFp!("0x2fd2ed0ba1135575995d15061ddb487f2c5c6005feed28d8a01b9d7bee361a1b"), + MontFp!("0x6a66704e22a81e6b7ad8e2f28edd8c9c9a10abf17e053f4d89665810332600ec"), + MontFp!("0x5cbc378be1db3840b32d8d2ebfe2695f810f932a206aacece707ca693f4f933e"), + ], + [ + MontFp!("0x35b716410b3c9374d42e7d39eaca316b6568f0a14cb14d519967aa3ff9970aac"), + MontFp!("0x231c6db056e47a01c192db40e586ededc929b564667377a10bd1465f3852811f"), + MontFp!("0x4904d5de1f512eb14b0f856acb016c7a43079b2f702303752962f336558b0f32"), + ], + [ + MontFp!("0x56d6bc63f429bb7fec7bdd133581f2abc74406a57607c2ba3302481eddba4074"), + MontFp!("0x519d0daccadfbb0167fa79d1afdf36b25f28b9f74f1e65d21d28ce1022579735"), + MontFp!("0x0576cf2418d6bd88f352bb26da1066637575f85688cdb981c7787f8094e5a71a"), + ], + [ + MontFp!("0x16672be70221dfa20aa110bdce12e1e66ab171db4eadd9935baa0e3aa49e437a"), + MontFp!("0x1e51c73bc2aeb9e877d9c2c18f17b03ea3dfcc04adfc649780ce4bcbc43b0b69"), + MontFp!("0x1271c830507a211c8e2ebdfb372f79c8a42a9e84e4fdb0dcb35d55e4d155e169"), + ], + [ + MontFp!("0x67077397c2b01db4de4b78adf97e0ebceb20cb91647db49a7bc06a5ce1b25544"), + MontFp!("0x2e5454b258106b63f0ab01924767b4aecce371202abc28a260adc45f35570b9d"), + MontFp!("0x440f72769f137a8078f05063cfa4e2b73b2381b72b68e97b1c1e9cd18df36f82"), + ], + [ + MontFp!("0x6ae1478fc162c50032fef2ef79c93ca7ee25b16358704f434f6cddcce2fc9c40"), + MontFp!("0x0c0f3630409a2242a39ebb33c5c7cf18965b8932621aab4ca2c315d4441b6987"), + MontFp!("0x0d1bd84a786a990adf88b51f253bd9032cb50ce4682bafe103893af36d5e75dc"), + ], + [ + MontFp!("0x30ce425059810dd94aae2f255666b0fe8bc52ff701c385c43a998926539dd401"), + MontFp!("0x395a1e753153b56d1a9ec2ca73099425e446dfa668dc73da2ea311abe5e3d96d"), + MontFp!("0x57f09d89e827d00392fdc0c3d21b1a5bae2d689894ced82f58e256a03d20ef91"), + ], + [ + MontFp!("0x1065b71b135e4feb8b3cba3c252daa084cb5624b0ba76f48f6a03854bfdbcacc"), + MontFp!("0x3d5f53bd162f053f045547952a06bc83bc413e17957977e359d9bd4c8883203d"), + MontFp!("0x05f467a5081bd3479d6b49f697b0a75d264b42b95b2bed475cd58ffd05322d85"), + ], + [ + MontFp!("0x6f5ad8e3ed272494c36a5a52a7d034e04b633460c16a512d0d8002f8fa0e3484"), + MontFp!("0x23c293275e282bf15cdbffae1f00a2712e76aa6d62820542159e9d6f115df3b8"), + MontFp!("0x3757e7009ca9bec8bba29308b9922354eeeff3beb4113174bf8cde584722d31b"), + ], + [ + MontFp!("0x406f25e72d0264ed50473ec95a7ec53ebe114898f84deb06e53715ae24725342"), + MontFp!("0x046dcfa2d6d655c7c551f7440772b056e7d3f2c65ac52e4496c4fc753130ad45"), + MontFp!("0x49c2e954d649ee1c4e72ce8c1833c33796ab29dbb0486fe53b04687b2063259f"), + ], + [ + MontFp!("0x2caa8aae247ef83e63dbe8e5efc89d7d28ffd8bf7a5331e245af8aebc872a759"), + MontFp!("0x5efa9f8f32d9ec1d3a3d8cea806e068909b3d3562fdc3f91f2d899f8109bc717"), + MontFp!("0x0df424bdf3b0c60395cd7380029a633692b933250b79371e09122c8c39aa1301"), + ], + [ + MontFp!("0x2d012e3e811cf4b88aed6f38d5cc8c3456dbae1741f501574321906efb474930"), + MontFp!("0x709c043fc648c48a5bfb5ea25d5f0557d03aadff9d6ec1afaf2032f3aadb9dba"), + MontFp!("0x1bb9b23d6805ed1179a1dad95740513dcea114185a8ed34e17dc8077dc830916"), + ], + [ + MontFp!("0x0fab922a838c55af1e2349b1e50b56d0690c200d0f2318aad4b7bd8a38a47f61"), + MontFp!("0x4d58799d4501ee8e89c73db7a4ff48d9f5e80fd5984afc67f3054f59d3dc74d1"), + MontFp!("0x4f130b733cb78f3940da337d187934e48765956ad2ca7b75b7bf8e293b46a758"), + ], + [ + MontFp!("0x03e7812afd6c480faef03c3beadfb882923a743a4e60e58a259e7ed4598cca97"), + MontFp!("0x739ea276a5ef7008fffc02a3c853f4d56eaeee7df395cbee8bbe6b502b81ca1a"), + MontFp!("0x0ae97e00a91a4e761815fde0e9506629373ef7ce765ecb1bc7ba0ca2decd7d01"), + ], + [ + MontFp!("0x6d6c41e1315436781a774555668cc3d41c99c78dc107f443ba0ae60cdb287c16"), + MontFp!("0x18d683776871c1918c2b5c632cb1854dff865c4b1b8bd66e46d2fa2a8d515c34"), + MontFp!("0x3597acab641c21dc5475eb8b04b0e2ae91700acad1b543e8c7e69d574eb5a15a"), + ], + [ + MontFp!("0x63df64938297594b4e8bf2ddd6bcaee6f2b9703e5814ddeca44d341b9e7d24a2"), + MontFp!("0x009ab455f6b4c7755da22615073e9839cd12a88d1f9b583d7ad61bde4009b873"), + MontFp!("0x09e21d43c56b0abfc26d0fb7a3ebfd3a7743bbeea99ac2b8f61cc23d1c673a12"), + ], + [ + MontFp!("0x4db404b9eae6a9f39417be43c93a9f6d136a0784b73789d590ada0a60df0d16c"), + MontFp!("0x0c6f0ecaf32a3d60aaebeaf3f8ccb00a10ee19def3836b78fc905bfeaf2b80a9"), + MontFp!("0x3518d688407ca0e548165b9796a4279d038720408a3c822dc44ce8974ea8ad8d"), + ], + [ + MontFp!("0x27ba9d4584a23881e23aa0340dc266b32b56455c30e6da78b37741de7ac5b185"), + MontFp!("0x63d33e44fda7868d50858e482fbff7c29143d60fe00817cf32e0efab4c3ad6eb"), + MontFp!("0x561a72b93fecdbd83d67a5022d9a221cf21b22cff2d79c114bf01c71f2641ae9"), + ], + [ + MontFp!("0x48a1625a9ee1102971aa28bc07a5ba88ac6424801502ff4fcb6994824c2e5e36"), + MontFp!("0x46a003c184ecf0e00fa8ef7dbb356366be4d63a3847634b46a18ecd47667d1bc"), + MontFp!("0x37d6efb2876f3cba63a60821e50853d0997947b96f633607bb36ded243ded838"), + ], + [ + MontFp!("0x14f96acdb291ed2bf98a5bed063f6911598bdff1f6c0219bbefa447ab1918163"), + MontFp!("0x573d156263dc8edf24efced0c465587cbdd1a2c792cbadd58abf95e037d3c668"), + MontFp!("0x46839e7d70370149b35b3a07d8406acbaff07615747d2101bbad18abb9891f95"), + ], + [ + MontFp!("0x3b74a3420d1b988408fe8d8fcb51a81f16f8d17d082da9ba61fbc8031d8ff59b"), + MontFp!("0x059f3301178a22026798b07a8578611d7c56c16bfbbe6a058f4e44016aaa172d"), + MontFp!("0x467d9ff3508feb318b07acf9184537462e987c58b7ef486873e1de428eaa3f32"), + ], + [ + MontFp!("0x716cac6b0fc8f63d406d38d6b82c8ed4e5665e449f07b572b83f43c9f9ba2004"), + MontFp!("0x7121fa9ca506687b3c49dc2060731c85ae48596be138148d8ea365333b8f03a6"), + MontFp!("0x10000c75e6e03366bba4f59c68f312becb7ae0c30d4aa141940a7531105ef7e0"), + ], + [ + MontFp!("0x375487214c07542fa5b6a5736344466a06c2cb4c1838c9966925cd8c5888c3ca"), + MontFp!("0x2361aaf969f732be06b159772a097f3518ed9485449edcfd367e289f0964c486"), + MontFp!("0x2ddba8679308f327c27023a893c0458d1e73dcd64a39b22b130fd9e4f283f906"), + ], + [ + MontFp!("0x6303e21755b1de4d65495bae9685e05162245106f53d7407ec0883e39695b15c"), + MontFp!("0x5aa3dddf8da369722b2e1c8f2aacf0625d08264f8a0ed320df110ab42f5b0c1f"), + MontFp!("0x3525eb41c2db9cf9cd08652d815d7c91f3294defeee702efedb5f777284cd1fd"), + ], + [ + MontFp!("0x0079ae4df49f78b97cb0e3c3f4b225538d4a0c4827e333d27a29398c17c26c9e"), + MontFp!("0x533c8c1b05e2dd7e7e19ea4b027cc8bd559c2e2a622207b0c13bc7afdd7bc3b7"), + MontFp!("0x4989a01e4fe4b1bd544e5cd4288895068897cba899ddb01779f6e2b08024d3ab"), + ], + [ + MontFp!("0x1c7f5858eabb1e2b8c3104808dc68ae3de05381fc74704a2afbd2fcc42cdd3c8"), + MontFp!("0x55faf16bbea2ee0f35413b9808c135fb1e4729c90b4cce4c345238c6dc557639"), + MontFp!("0x156a82f8e5aea455d9c8c436f89c6f9ecbce0ecaafdd13b93f255e075c72ebd0"), + ], + [ + MontFp!("0x37c7047032df0027d7bc128e9a107582f25ba0b7387230a05864aee420724703"), + MontFp!("0x40ab847795176c24af06d5000ceedb82d87492cbde5c1c262a83a9b6b6f4b264"), + MontFp!("0x5a73bece689545bd2de9ef263d5036152f36e2250c76711e8bc9ed9bda7af685"), + ], + [ + MontFp!("0x1c4a903be5dff4440b4f38e56f988cddacc57371aeebb06cb64ab5d21d9562f5"), + MontFp!("0x5bba81a692e87b51c7c176730fd05cfd100b0bd86d69b4b4f367277a2302b2f8"), + MontFp!("0x2f875bdd6669a8ff920c3d7bedd74c101541d4b184b7e1bc0b90ddb26902319d"), + ], + [ + MontFp!("0x5e89035bbe943f9e6024db13c58bbc748d3f1654050c7ffe084b763efceff3bd"), + MontFp!("0x728cff754d7a76a7f8b00656412ad8874e7bab9827706ca6d6d13c72a0c6812e"), + MontFp!("0x6dcfa6338bfe3569524a968abc95c706801fcc695ee3f5854a79e4689625481c"), + ], + [ + MontFp!("0x24ce56469aeaa4243053bb62c07100002b8f74c4ac74c350beff0c0be47e5a51"), + MontFp!("0x6a72f954f591825caa43c3ba7ccfea7aa1a00de5a681e52de6148252062f8363"), + MontFp!("0x59922ae3f06524d2028e9aa00a136613d4306fd5f4247ad0a6a587be0fb0081c"), + ], + [ + MontFp!("0x50d8b98688f4980b1a0c2b5313f8ac9660b1e9199b5f59ed3709e0f1d9185552"), + MontFp!("0x3184262ef10e9b0ab57cfc898fb68342cb86ed6e25e536fa94caa605b4a3caf1"), + MontFp!("0x69980a1f4b883cac1039fc47dba993503d4ae5ad40ed112a5a5070090006f73e"), + ], + [ + MontFp!("0x1d5a91b930b89934745ba00bd9094b67f95e41e3778fe0420880e80bbf8078e1"), + MontFp!("0x0ddebce4b6ca45d69b2f70c8b54e425615c1aadadccda74e0882eb79c445778f"), + MontFp!("0x68c8362e93a371d7c9551edf3e3f3b14c54c729c1fab0fa6eebae7da09855826"), + ], + [ + MontFp!("0x3dcc6a17e074d0350ffc0e5426e1bb6894e6c958f96f3d7d9c4240b948cde438"), + MontFp!("0x03b8aba0ee959a4e51cb5cfc458b0f4ad3a9b59797394c3d3c9eb57adeca2308"), + MontFp!("0x0f24cc57f3b2fbf25375c71d71bbb97b2d193fc1a203ccc514c074d461001ec4"), + ], + [ + MontFp!("0x71e9bfa7f66afbafbf139a70baedfb1b202a2e51e6b6c420e28dd342a5eb0cd6"), + MontFp!("0x3ac9c11890e96a2dcda6405a6c52a47e803d6674e65117f1a8adf701d68cd02a"), + MontFp!("0x45c00146e1b89ad5ccb8a02202482023751b88997d8fba1af5c0e7a68dadb63c"), + ], + [ + MontFp!("0x1f98bdb8dc318e3e2e28cc3d8b85e334f74b57e15b02e1637ae035b04bda3b5c"), + MontFp!("0x2ec077dbbc7bf2affe7ddd8b8a7f900f3019cddc8ce55cf9782004f65f51257b"), + MontFp!("0x32c377fc988f600a2c2ef5d5376e2e31faf1c2d1a618db011fbfec1ff337568d"), + ], + [ + MontFp!("0x0a820d131da844383bdfc1a053d8aceec7f2eb345ab6c21d38e829db8d05861e"), + MontFp!("0x5bd95df8a933f7b7e263e013f45a92c0e786dba563e210b77d5a40f961092e60"), + MontFp!("0x264cf7b75095fb96b420fb3f31c064299e78e796e8b3735bd0a186cd3817708d"), + ], + [ + MontFp!("0x27d3e47b2f11ada6a9a5d329e00a128c9836be92ee92429ab891e71d11dc29f2"), + MontFp!("0x64354b412c8cfa1319e4afd891e619a8fbbde04d85bef4ad0548689295d2bce2"), + MontFp!("0x0db0f967487ee52e0836fb7135bce37fbd32887e911de52d0b855a5afac1f770"), + ], + [ + MontFp!("0x1c9a155911b36c896475995417197faad870737a9ce5d9d3a5000f5396978e9d"), + MontFp!("0x65ae557151ae9ec7f870fa2804bfb88e669dc0f8865b140f964f1f93180ac531"), + MontFp!("0x52c6f6242517362c066020764fef4a5574749106a6dad534d136e7fe885fcb40"), + ], + [ + MontFp!("0x6e44c5bcd5dc6591e2f84290a313b71a04da8da398dd10135d22bb23df41e883"), + MontFp!("0x2146d3e371040feba8595049a285944bd45a458dccb059c785c2adf032c8b710"), + MontFp!("0x16db9ceb3074a795499a37c20ffc9eaca9b07a5a25824aa6adcdb19fabdff0b9"), + ], + [ + MontFp!("0x5903725fd86fec14c9cf2a273017eb01d3a1785039397060650c4e228a6e6571"), + MontFp!("0x54c75952f908e3f99e05718bd1f59bb6c414bc2aebacd81c47189885cbbc566a"), + MontFp!("0x0dba4abc7f188e33e7f309317b7b9f5c22870ca90bcee7b576dd0b52619a39f6"), + ], + [ + MontFp!("0x3950231611808399ad3ba5b78cad4c6bed6f364b9346541dfffa4d16366d257e"), + MontFp!("0x1a6d8230bb9e8d1af552b9bab8babfe505931dd87e200fc7b3c57160a5bc4ae2"), + MontFp!("0x6b3dd35220ecd616eea4309ac9a8118e9dc65a3f7c1ef52dde7a3d33578c43a0"), + ], + [ + MontFp!("0x6da00240c3505b214c8d8ce3f48914247adb9f0ecf239d7baeada5183d31ba54"), + MontFp!("0x37c3720b132d3a719424e29c37acb7dfbd709ec9497a3162175424bf063c6e18"), + MontFp!("0x500f85a3d06a0b5a05c5e93ae70084802fd499c7e6ed1ee6e26b4bf8fd6838fb"), + ], + [ + MontFp!("0x2b37f70d73366d32d575186d0787fc8ce539b73f83c6e7eaab27be85f4faaaf4"), + MontFp!("0x1d8efd6e52d4f936415e5c4814f3366804e2386857a4befa2a53aab21ddb68de"), + MontFp!("0x33303b8a8f2d811be65a977907d17d133f3a64c59fe2a9c5c2d4517e3eb390e3"), + ], + [ + MontFp!("0x2c1ba860f51e0c2eaf4a9a6bf095c65fab3ee15c145f404fbb0272b5ca14a449"), + MontFp!("0x0b0849c7a3adea03a89d101081c9c9f4f66ef917d09c7957584db9a75aec2378"), + MontFp!("0x41e7e30c77579da7809c3e757821c869b53f103fcb752ac82f8a734d4abdc792"), + ], + [ + MontFp!("0x182e66be60686c8c5e6518430845f98924fe8d7d43e628bf75ff52a716371b9c"), + MontFp!("0x373b2508c2fca1a288fa4f54a6edf02f2661e664dcf4ff2a74f3d06b1a00ddc4"), + MontFp!("0x1735b442b3acaad0bbe630f308e03f1aa6f56bdb029e50c1393533cee1a45c30"), + ], + [ + MontFp!("0x22abe8ea470a0372911bcef1367e10aa220491d76caeaa5959feb5d75f4a1f9f"), + MontFp!("0x5caab387eb997f774f64151ed21abfa5364a83c6f065d92bd9c92f2719b8e80b"), + MontFp!("0x57b33094aeff828377897b56e1c432978d07c668ef25a36bc5e2e835aaeff725"), + ], + ]; +} + +mod x5_255_5 { + use ark_ff::MontFp; + pub type Field = ark_bls12_381::Fr; + pub const ALPHA: u64 = 5; + pub const R_F: usize = 8; + pub const R_P: usize = 60; + pub const N: usize = 5; + pub const R: usize = 4; + + pub const MDS: &'static [[Field; N]] = &[ + [ + MontFp!("0x354423b163d1078b0dd645be56316e34a9b98e52dcf9f469be44b108be46c107"), + MontFp!("0x44778737e8bc1154aca1cd92054a1e5b83808403705f7d54da88bbd1920e1053"), + MontFp!("0x5872eefb5ab6b2946556524168a2aebb69afd513a2fff91e50167b1f6e4055e0"), + MontFp!("0x43dff85b25129835819bc8c95819f1a34136f6114e900cd3656e1b9e0e13f86a"), + MontFp!("0x07803d2ffe72940596803f244ac090a9cf2d3616546520bc360c7eed0b81cbf8"), + ], + [ + MontFp!("0x45d6bc4b818e2b9a53e0e2c0a08f70c34167fd8128e05ac800651ddfee0932d1"), + MontFp!("0x08317abbb9e5046b22dfb79e64c8184855107c1d95dddd2b63ca10dddea9ff1a"), + MontFp!("0x1bb80eba77c5dcffafb55ccba4ae39ac8f94a054f2a0ee3006b362f709d5e470"), + MontFp!("0x038e75bdcf8be7fd3a1e844c4de7333531bbd5a8d2c3779627df88e7480e7c5c"), + MontFp!("0x2dd797a699e620ea6b31b91ba3fad4a82f40cffb3e8a30c0b7a546ff69a9002b"), + ], + [ + MontFp!("0x4b906f9ee339b196e958e3541b555b4b53e540a113b2f1cabba627be16eb5608"), + MontFp!("0x605f0c707b82ef287f46431f9241fe4acf0b7ddb151803cbcf1e7bbd27c3e974"), + MontFp!("0x100c514bf38f6ff10df1c83bb428397789cfff7bb0b1280f52343861e8c8737e"), + MontFp!("0x2d40ce8af8a252f5611701c3d6b1e517161d0549ef27f443570c81fcdfe3706b"), + MontFp!("0x3e6418bdf0313f59afc5f40b4450e56881110ea9a0532e8092efb06a12a8b0f1"), + ], + [ + MontFp!("0x71788bf7f6c0cebae5627c5629d012d5fba52428d1f25cdaa0a7434e70e014d0"), + MontFp!("0x55cc73296f7e7d26d10b9339721d7983ca06145675255025ab00b34342557db7"), + MontFp!("0x0f043b29be2def73a6c6ec92168ea4b47bc9f434a5e6b5d48677670a7ca4d285"), + MontFp!("0x62ccc9cdfed859a610f103d74ea04dec0f6874a9b36f3b4e9b47fd73368d45b4"), + MontFp!("0x55fb349dd6200b34eaba53a67e74f47d08e473da139dc47e44df50a26423d2d1"), + ], + [ + MontFp!("0x45bfbe5ed2f4a01c13b15f20bba00ff577b1154a81b3f318a6aff86369a66735"), + MontFp!("0x6a008906685587af05dce9ad2c65ea1d42b1ec32609597bd00c01f58443329ef"), + MontFp!("0x004feebd0dbdb9b71176a1d43c9eb495e16419382cdf7864e4bce7b37440cd58"), + MontFp!("0x09f080180ce23a5aef3a07e60b28ffeb2cf1771aefbc565c2a3059b39ed82f43"), + MontFp!("0x2f7126ddc54648ab6d02493dbe9907f29f4ef3967ad8cd609f0d9467e1694607"), + ], + ]; + + pub const ARK: &'static [[Field; N]; R_F + R_P] = &[ + [ + MontFp!("0x5ee52b2f39e240a4006e97a15a7609dce42fa9aa510d11586a56db98fa925158"), + MontFp!("0x3e92829ce321755f769c6fd0d51e98262d7747ad553b028dbbe98b5274b9c8e1"), + MontFp!("0x7067b2b9b65af0519cef530217d4563543852399c2af1557fcd9eb325b5365e4"), + MontFp!("0x725e66aa00e406f247f00002487d092328c526f2f5a3c456004a71cea83845d5"), + MontFp!("0x72bf92303a9d433709d29979a296d98f147e8e7b8ed0cb452bd9f9508f6e4711"), + ], + [ + MontFp!("0x3d7e5deccc6eb706c315ff02070232127dbe99bc6a4d1b23e967d35205b87694"), + MontFp!("0x13558f81fbc15c2793cc349a059d752c712783727e1443c74098cd66fa12b78b"), + MontFp!("0x686f2c6d24dfb9cddbbf717708ca6e04a70f0e077766a39d5bc5de5155e6fcb2"), + MontFp!("0x582bc59317a001ed75ffe1c225901d67d8d3764a70eb254f810afc895cbf231b"), + MontFp!("0x076df166a42eae40f6df9e5908a54f69a77f4c507ea6dd07d671682cbc1a9534"), + ], + [ + MontFp!("0x531f360b9640e565d580688ee5d09e2635997037e87129303bf8297459ab2492"), + MontFp!("0x30be41b5a9d8af19a5f922794008a263a121837bcbe113d59621ea30beefd075"), + MontFp!("0x39f57e4c8a1178d875210f820977f7fcd33812d444f88e471040676e3e591306"), + MontFp!("0x3514084b13bc0be636482204d9cddb072ee674c5cb1238890ee6206a3e7bf035"), + MontFp!("0x6372b6bc660daf6b04361caff785b46bbe59eb6a34ab93e23d6364e655dc3a36"), + ], + [ + MontFp!("0x422af985e648814bec5af62c142828e002d4b014b702760106b0b90c50d11de5"), + MontFp!("0x3296e51f12e0f5c49747c1beb050ff320e2eb7422807eb0c157a372dba2ea013"), + MontFp!("0x3b76246abaf33b03dd5b589b80a7fac0ae7f1ad8a9623bb7cf7432c90e27358d"), + MontFp!("0x0b40e7e02f5cb836c883c7cef72ec48e87c1808f7d829e2ee0bec0ee709f7409"), + MontFp!("0x2ee81b5c29c93b8a6e8871c01d0380a698e547475359b4a4befc22ed2232690f"), + ], + [ + MontFp!("0x341ff90fc4a8afee9b74c464955ba9b357252e915b8d39ea7c1318eda718f54d"), + MontFp!("0x55eddabde058f3b5e9dae90873ec9bd7b05927da36925e7dfb7bc290c1da125e"), + MontFp!("0x6b34ad8cec56aae4595c403377cd2aa990a2f09b931f832781221965bb081b1c"), + MontFp!("0x707de76df294fb845309d2160e1bdffebefd57a80c8658899e2c95e77254c752"), + MontFp!("0x05e9b152bfd4946b9c109f930eb01892f314597507d28c735a266f4277bb2a32"), + ], + [ + MontFp!("0x1589a5cbcee13b696b6f0a1dbbabc08394ab00ed5a6ae6435020e9e3e2fc909a"), + MontFp!("0x7116a5d027fe73fbc45bfc60fd875c3116fe3a567e830d1d2d38655223dbd7ec"), + MontFp!("0x05382ee6ad97381eb3137f5a90ea13298dac6bc7c2204906044fafc01bfe6ae4"), + MontFp!("0x0900bcfe5e7c1b7d0aa80c714b7b2a0c1df7473362138a9dc5c552d11c1d0015"), + MontFp!("0x0513deb89d2e48fc729440dc08d0256a79cda84d511a04e0d92cce3c7e55a7c2"), + ], + [ + MontFp!("0x6bbb5f1736d499fe3fda42ad40a2b124952ac35fe970ebde38c65cc20ad2afc8"), + MontFp!("0x5782ac68a8da0ba09f4d17e7e4b46caa4411a27e60be92168ce75bed95453e05"), + MontFp!("0x2d83f3324639c5d83a1ffcf6ac693eef98d8ea4877d547c62b304b0a9f4a0c28"), + MontFp!("0x16d3a13700ec503e29ca4d0c6342864595134408b6668bbf1766bb48d7f96cba"), + MontFp!("0x318050e971e075931253b00430d35f89f40a88fc73d62150882a8e87149d7244"), + ], + [ + MontFp!("0x7180760dd839d8bffbf9b1e26826cb4f6de65fa868a8143e1dc8c2b6ac6d1ac2"), + MontFp!("0x5cf2aa95907e59c4725cc17c8cf492f9a7eeef2de337ac227a983c444ae0e80e"), + MontFp!("0x2b8345763484d7ec02d6ee267b7c737ca9de41e2186416bf91c65eb0cd11c0a4"), + MontFp!("0x055aa90aa60ef9b7f3c29c7500c64e6b85929220a6418dfad37ead3928059117"), + MontFp!("0x541d5e4be0967bf49a595c1d8290b750305a334f3347c01b57f8ba313170e1ca"), + ], + [ + MontFp!("0x05c0a1f16f97f582caaf4338f018f869e8dd0fa32f007bad1a1a4780053d5817"), + MontFp!("0x01519e13858591aa93b9c1d7f849276ac1d2011b7fd19a475371c7968d9f52cd"), + MontFp!("0x69c30d5a27f4dffa19c956c348287a704676d999f23044036b9e687a45a1a113"), + MontFp!("0x58c93b899aa53e06e82b6346e36338841ba7279d2b7a0ecd3aa20f292852936f"), + MontFp!("0x06b8a12870a15479d41018fed6f1a29102ae23e13d0fbccec93ace48bdb9dc93"), + ], + [ + MontFp!("0x33eda3c347379e61c2297aa1026682d22f95dc3c7e46e68ab3adb4b0939d76e2"), + MontFp!("0x187728045111275b93a1218a148ada85a1f6e2059c443ac7d61fe81e3130b89b"), + MontFp!("0x397ec485c5a8b0c8a03ff543e9a9e5a4dc0dd4849fe955bb77b452e2e22c4f17"), + MontFp!("0x2f33f8de90f81248455d5a6592667092992be0468372addbaff664caa84cd2d5"), + MontFp!("0x061a1a458994ddf9f38c5edfbd737d3ceb05deaee685058b14943e7e9246ebca"), + ], + [ + MontFp!("0x4b73ab5b9d35f47307b731e3cf1a1a22e7068e2744f2af0ef6bd78bf8aae4845"), + MontFp!("0x5578b7ad5f8d4f3b8e618af7d8d5ec8bf837d2d9486527fe2f9bf7464f8516ad"), + MontFp!("0x50b4f055d860f89e12883209f847a4b1a2395fb419eb53c182dbb555c962255c"), + MontFp!("0x0b2da770936d6c778be289557ddd2ca024b93fa38c5d4541344e883a69611813"), + MontFp!("0x47d8441e1ae7cb8ffc52a18c67afff3cf7543cad51605b2d4e2513f1e1868b68"), + ], + [ + MontFp!("0x619da3bf44b42acd949ed572c9f3c195ed20b0b91bcd9e95ee3750d26f3b0ebd"), + MontFp!("0x6c9e249e89b2b4cf9cd7772950e0cc9d06688d4f051095eafd116371ede49ab7"), + MontFp!("0x210bd3217a141c55877d4528a4e80d5d81d78de7addce85994082281a6250d4b"), + MontFp!("0x4e1d8e4079c14c83847af6394d7dc23f33ebf71593379583ec574bf5c86ea9a6"), + MontFp!("0x699187330fc1d606e8b31b677651a2c7d1c87d4d001018031792cad0ad3f2826"), + ], + [ + MontFp!("0x2946bfc0f45c1f1a0dc4c343a85259f6a6237f064481fe66eda76f01998a01ea"), + MontFp!("0x5543e07588375c6d800e5e42d1bfd8b7a92a2a35d65b234ded85f879f82a3d66"), + MontFp!("0x660e9d0f2f866e8d12b40dd9d9c03cc8b9ca78600bd649f0fffb2c388dcc8b43"), + MontFp!("0x38f06c48d4dc53cb1b69619244cc2a610fdc4229ea316980dffe9131a72b4209"), + MontFp!("0x5c9a73a16521ddf463f9de314dd5f7255bc66add48297615b761f34e4636762d"), + ], + [ + MontFp!("0x310931f0204c9936fe659e9ebbda832c930172130b3f5476c6c6ee5e7fef3e45"), + MontFp!("0x72eb1d833664d8989998af11441ac49654c12210b3465e5ac67a99679634a3af"), + MontFp!("0x6981346585a2a466a9255841f710e1d083bdcc21c0aa6721745e158218767a94"), + MontFp!("0x0370a259836b3766d563ed3cdcf55ace52655111a1017d8c76eaf8f97e81d858"), + MontFp!("0x4f63c45a324b8b974c22a20a6c670eb62d47ef900541b63f1d362b8bbe4ec418"), + ], + [ + MontFp!("0x6a4c7347121c2d4745ecffaad22281cc4d58ea74453b7d2b625b890190fdc7ad"), + MontFp!("0x36d8869bb69a51ee99622af09d6878c5b715084b25f6e4560a7498557fe87fb5"), + MontFp!("0x18faa7f51e1b7a442f9123806872094c0de8a46a6d8402f31f0cde3fcb878394"), + MontFp!("0x3610d022aacbe58593e0d6aa7eefdca767f5ddfe7fa1fb9fb4f80225d82b617b"), + MontFp!("0x3b5f13d6a8bbff31569bc6860087b2a4b361146a04ad5fc7396a3d0c59f68c1c"), + ], + [ + MontFp!("0x40e919335051c6aaaee033745c41b6fa36739a097d94ce6eb075ec03da2a978b"), + MontFp!("0x2f54586ab9b7886340f8ed5254f29128a85e2fb1e3725bf3c9cd8bddadc947f1"), + MontFp!("0x00606231b689a040363e5afc050f9fc9296d6c620a885eeaffe91be387cbe96c"), + MontFp!("0x4b55696db6b0fa327527a76e6ab6b688561c879e53d858e4c90a1122210130e1"), + MontFp!("0x569c39bd78356991953aef4b1a01fdf71710bb05eea1f447c3e5efe13bd62894"), + ], + [ + MontFp!("0x537f73fcaa256497a2582e45105f1dc10f39c7fce9b88cab5523af3f5f82dcd9"), + MontFp!("0x2d58d32120c25995cd0754ab9fdf9ad67d67623cfd1fcbf489f51fa6e6eee4a2"), + MontFp!("0x37cb0f655951fca18a4ccdddd4d8466f8839ba8e320a104cb47a59cd387d322f"), + MontFp!("0x4e29d154430c9bced788d2eed8f3e01b5da24c1d3710e490bc40ee6d5903213c"), + MontFp!("0x47597b7a9018192ef22d6dd24555af1c0c51d8a90b54d8a0bdc2df7967d7a28b"), + ], + [ + MontFp!("0x4e01b43205fca0b4a32582abe600f3a326035fe7e028cb0569bac43c997b98ce"), + MontFp!("0x0172ffdfba7e43ca807d5b5de7727b4e41706c1f2858c1e8a46c27ed3eae5ff2"), + MontFp!("0x2216dd907ab98c0d1e720a46ef83334a236d2c134ccf35ef8e889421e70ebe03"), + MontFp!("0x168709f668b635f03607a39390a0de71306d6430ce2babf7292d789d25c0f8d5"), + MontFp!("0x0ff6a3823440877dfd355dea80595e21115d0dfe3472cec4ad1437572cc6151d"), + ], + [ + MontFp!("0x44e37699b3c72f50ec1a754c72e6fa3f5a074181dd63d189ba36447d34e536ff"), + MontFp!("0x267298d2e46227f7f7f422e3059f18d83a8795731b13f6568ce54730cd3fe9ae"), + MontFp!("0x1ecbe7a60848077203373441a5b09b44693a155fe226442259e37ac47209235a"), + MontFp!("0x31cb23e6b5d7393577d5f5c3368c5bdd5b434ee6319f07e502031cc393d4eccb"), + MontFp!("0x5d4c550c4a6eccd74b74d6279b3d9bc755084588156a1bef673657dc2116ecfc"), + ], + [ + MontFp!("0x226056b5dec9afd19190ac48740c3b5ab1bb429b19f56894a3dec3f104d238c0"), + MontFp!("0x09077c021183dd37ad10451ded70d7ae6ec4819ae76ce23fb2a0be63e69907d9"), + MontFp!("0x53545c868ba0fbf0ed1ed7a24ec11b2ecfba5b37fd5cee80774e1ecdea991ed4"), + MontFp!("0x69521c33d148e678ca10b33103812cd27597c4a6cddbe83f4970d4b96e03304d"), + MontFp!("0x01d5779be7477b96aac6532ef919e61c624072be54587e0698999dd5f460e446"), + ], + [ + MontFp!("0x57875a44441d2f191ac7d8de42691ab55fd3401bbaf04b786ef0603b3edf2927"), + MontFp!("0x1d5c957da0832d5b94e76f7abdb190972774b594ed232810bfcafe5441839d37"), + MontFp!("0x1b678335a80fd045fc7ce1897aa129f67bd55ca9ca801bd88eb7cc868538bd7a"), + MontFp!("0x31e69d706a5c1e011c1cb1809e5bf1857c90f9f50b9e1ae5ad36e4d3dcdbb7ed"), + MontFp!("0x485df8462ed7a18de34aa6e99ecc9bbf2db075a096b56bc2943b76a99c4bb1a0"), + ], + [ + MontFp!("0x1e46fdcbb3705f663a350e78f99024912d80c95779195807aae82cbb494ce9e4"), + MontFp!("0x441d0fa0e9cb86c3a2a1f87151681c603c3e028f1a0670be2149eed4f0a24f08"), + MontFp!("0x02a3caff274f40942062340ec1fae17c1b1e97c2f0fc7e847c90e9317fea2c0c"), + MontFp!("0x4caf281080c0b2f2f638bf0f4859442f4c9da94e9994dada34c5c914130c1a9e"), + MontFp!("0x444470c6c49b5b9a38181c3af20bcfea572450946135baea85cfd6b692fa6464"), + ], + [ + MontFp!("0x6d5e07a13376fc883bea2dcdbad7f80b7780f231cdd33f5b98618f42cc49ec2f"), + MontFp!("0x1b9470418a07d8c88c767d1e63e8d5cc7f810cc530db1340181ecbbb212e0f70"), + MontFp!("0x4134c8666c685b712f4aec72077c540ef4a041dcaa123caabd57b83fc6266f14"), + MontFp!("0x3d5d0489e27362db9bf0cc7217477d81d2a73e1a44edc43e32d43bb544287c9d"), + MontFp!("0x71d7d4a91945e796f538f03b9324497489009ec1a0a403de062ed5bb4d7c2400"), + ], + [ + MontFp!("0x646c3d732a94f722384ac266b41e06cf21bf24fb9426c9556d8ac9514f0875f7"), + MontFp!("0x4f860c9e5d9bb73057d93c207902d9e60fd6a7c779fde1ebf16b853dba1ea9ad"), + MontFp!("0x05801566eb9e119e2f9ace565c9488cd999d66a5753eb4b9887363137baa09ab"), + MontFp!("0x0263bdb8654cf1245ae4589370dfd5eeb109a50944eef54308566055b887ee01"), + MontFp!("0x4cc39561e65eb05cb8c83f9854750a9114a996eb23e6a0bb07d2d61f0baf0a62"), + ], + [ + MontFp!("0x36b544778b2fdb94f808ad8d077b7f0b44f3bba515ecdf026919e2fed09a106d"), + MontFp!("0x3fb1f7aec47cbe990151d4bf703c38349b95f409abdf0504e67c1a55ef82294c"), + MontFp!("0x637e7eb19cf539aada7e48bc6b72e5ccb0e3f6913f18a0d55696dddfcb1b587a"), + MontFp!("0x73bc630fcece6947fb81ac8e0f1f1671ed6042c3ef3bbb12ed554f28b48b46ec"), + MontFp!("0x304b46f52d597b964fbec3fc0dceee442febe6131359e156c194ab7be2a11e6d"), + ], + [ + MontFp!("0x067d85956dcfff7fd9f6a0fec505b7f4998e3d85672623677a6d974d6b111de6"), + MontFp!("0x65830d8053bf8afc0ba5274f1a4c4cce617fa624b480f13ed3eb369fbba78e67"), + MontFp!("0x6c32c101e08a962bd996d759a6c012a4d97aedaab9fc99c1fa735a16cd24dd44"), + MontFp!("0x11fb2d160e41a1845fd14578c617285081fb1a16a21b36cfd5065b30fac574e3"), + MontFp!("0x50aada39348c4736f6c59f7f053c488ed999a33ad23501d9c635aa03baf90db5"), + ], + [ + MontFp!("0x5a5f0e3a32b260fbdfdc8c0eaf3a99396992b50b6dbb63a9d1e1ddf9c91d78d4"), + MontFp!("0x62c9f6d9aea355d358f2986ad487c2ae443122e1edfb076930865608d05c3b39"), + MontFp!("0x520cea06cee20150703a1c8000d4a5f22b3efeb9e34eb90bad0b4ff091b33683"), + MontFp!("0x6da4e4682545c1f4c0076f5845fbbcf48632a9c193a92593d12d248031f2c893"), + MontFp!("0x1ba5502cee2ea2d07a64f68f0a7492d2426382a5b9662d0410e086107399989b"), + ], + [ + MontFp!("0x6ab843ca92240f8a82862da071d53f048272d55425907fc8d0e60dcccd5a1ea4"), + MontFp!("0x3f65c2dfa6bb39c1b291c40f810cc912015384a2a24fd322b6375e27bd069322"), + MontFp!("0x6a2df71a64cb0d9a548e3b65ba4e646ff5e519cab564b5f77b3fe08e038b9c3a"), + MontFp!("0x64776bf2b66bcd09c8661ee6ca6b8251bb4aba5a7ba181464d905db561ca45e1"), + MontFp!("0x6d7bed0d258b518eda13368f00be2cc0a94d71cc203d5905c35b10a3ee53eea8"), + ], + [ + MontFp!("0x371b958b5c79c889d1786edfe404119773f728822637fb4890b8847a93f97af1"), + MontFp!("0x56923182c33cb4dbf0988ba2314378dfd7491b3467b6134e6283c87a1478cbb8"), + MontFp!("0x3c4304994ef664d6aa19e3db492c306534281b5b6f857fa6ffae67bdba99c09e"), + MontFp!("0x0d003bd3068fa94c4f7bbe6ba02993acd341a27ed2fd7ecaa4e6b0b9d0abd85a"), + MontFp!("0x1073cb8c08510e7d88ed4cdf78e96b297cabe9d6677db47289b056c2a640da01"), + ], + [ + MontFp!("0x5c57522580fbc75883658d4b7b8ea07e1a4fc75f453c09edd9d249ff1bd31ae0"), + MontFp!("0x2a5bec9b422b4dc64958f4752d0c091ffa7904e0ce4809728d16235bb41d707f"), + MontFp!("0x379c4a9b4174c5878f72b60fa985f7aa86c1fd868683bdbe8fae194cda2e56c7"), + MontFp!("0x3634e042e79d046adb911d57b338e78f51ac7d212c5a5c6dc4fa1a05ddb58c82"), + MontFp!("0x3ace976310c5040e1484d1a6d42993ac5923d474ce5497a3fac468af25843a01"), + ], + [ + MontFp!("0x3f5a856ab863b7584bc2e6e4c610b9df55a9306eb68894d630ff7d04f243e6f5"), + MontFp!("0x0d52822f5581fe9c5dab0b1f8d04eae183deb87c89504544a3d5558594b3149b"), + MontFp!("0x3c119e173586c22059bb09d2af4fc1044c8fc44f709233f7625e5fffa6696596"), + MontFp!("0x3e154fd5a026d7c6584faf8c089d82fd560f138392a8d4a5fe287859994c96b5"), + MontFp!("0x47251339c44d737b21df0ed1e204a28b68c9abb58f1cf2232f8a2da433e24b0b"), + ], + [ + MontFp!("0x73d84625f38db2f3842d7724d8e79d6d0349a93b8d6142603eea382ba6ed8692"), + MontFp!("0x42929bffc19bf9cd1c53d10440b0760a3be6442db20458b692b4ba3901e6003f"), + MontFp!("0x39b16b0fc3700aa93e0cac53fcaf7e84495ac3b49553b2e1a5ff9f73fe74de50"), + MontFp!("0x2b715e21640cfb6f77b91a4f6d3dcaef9b5faa7c0bfe94c8d80b0824292603bc"), + MontFp!("0x306bef0c637b5d7c8d6486915f6623f4e1ed81971f40772ec60feb5e243d32a0"), + ], + [ + MontFp!("0x5287d6ece65ef5df6e1c65dddf1d97cfa019157a5c90c004527c9d7c7496d814"), + MontFp!("0x0d760a2132c9092b0c8c89cbdf4fb1bd282791ef6284b73a44b313e8118e7d0c"), + MontFp!("0x5e830f4484268a349e4d9f6178ef745460f1f8456b04d0dc7814844052d51eb5"), + MontFp!("0x2468669481610965d8439f60a66aa61fbc7b18e82b35aa4755873ec4db82174e"), + MontFp!("0x23b6ea9e4d1fde701c719c2afab1272ea22b172bf7afe0837364ad9a2f698bd4"), + ], + [ + MontFp!("0x412024b2e86e9d5e903a5fbda26200be47003e3b0dcc322480d3079850606cc0"), + MontFp!("0x1f64c17825c1ce9333d211d45a555b5ceaa4608a354ed3237db56225b3a9459b"), + MontFp!("0x0b66fa87587ab95d5d29dde50cd606a1bc2c45fd223c03d0693c88b13ae23039"), + MontFp!("0x3086c386026698e733e54e5e17f65cb26c17fe64e76f85902cc184d5dd8ef0cf"), + MontFp!("0x72036acd9ef575414d5437327d902da6396cc70c0bcffcef2a82b4c296b5ea93"), + ], + [ + MontFp!("0x53d89e4470b3ea1eb861717e47c08fda42f6e61fc08118b16645ae5e8fdd664f"), + MontFp!("0x4ebea65d1fc5c5167b1412ffcbf8900a8df2096c25d7011e6c74f500662465f8"), + MontFp!("0x5ee6e1e0312e78e2e67b246a95afdd79e2e7a5b9b0ef6ee36c3d1639f9736e65"), + MontFp!("0x1d770c0cc2c2231213624d58b7875b1715554f6100784bb2b545e405c7fcb94e"), + MontFp!("0x2ea5c9837af445988c480fc6a55b1e5640dbe38d5e8cf1ddd85bc42c3658d9ca"), + ], + [ + MontFp!("0x6fb78d12c35235f738b1667749064d0066fa7cfe3a9624cb0944f16d37bc485e"), + MontFp!("0x35b75e89e794282cee1e66991ccfb2499dce4366b88d7be5f7b5775c12103a22"), + MontFp!("0x50e83b08162e7ccfe2d0f19aea4753ba83ef5c40572d6e904cfe2419ee9d901d"), + MontFp!("0x3fc5c93031cbcecf12d5831aaa6b2b3071657cd669f7b377b2fef4a7bfc9adf2"), + MontFp!("0x37895bdfe29a174b98cd4b49104e56ea09e41c7b50f9aa95b400b529c545f5b4"), + ], + [ + MontFp!("0x695e405509a0981035ba77e27cdcf53f3bc15d20fe4e43a335aeb6406ae1837d"), + MontFp!("0x104985a48aa7e0a668d8cc7140c255ed1b8482ac5febbd3d7a1cca0e96cf0682"), + MontFp!("0x118220b30330f1954e7d94d40fb1043a1a79ca83e68e9ef590601a86a4a917a4"), + MontFp!("0x098b3be7845a63543c13d211efac076b94a9528d34cb355faf0ff7a0d5ee9991"), + MontFp!("0x69ca1313dcddd8c2f5c5c7ee93a1d2a94726c0c0bc4a303fcf83109b23bf3621"), + ], + [ + MontFp!("0x570c1bd286b258b8bf11e8b85a2eb0c6dbfc2e4cdf01a0cde5464aa009b5bd43"), + MontFp!("0x4f2921de3696018e0d1ca7cdd5a4064ebf51845ab25b2d395b71c341ea8527da"), + MontFp!("0x19035c69cbaf0e0e7e02c5c524a8cc56de0e52d1936a9a10b7580f0c0555878f"), + MontFp!("0x2b8fdad2064a6f58d01e8c48d49bb25730780055829c1faead0430afcfbc5669"), + MontFp!("0x60ef9a74bbf8b98cb8248856492257f30c7520b3353a6fec9d90d48be46070ba"), + ], + [ + MontFp!("0x4c9a6bc8284e783afd6c425f8cbdab82c0db3eac060a2dc00eca48ed6d1d052b"), + MontFp!("0x68e6d3a83ac8e60c92d2860ff7557e1fbe3b91c38fabbde8b28371dccce2a10b"), + MontFp!("0x56e0e39848046f0305d268b28aa753a41d48586e8579d5f95f12dba60e181d4c"), + MontFp!("0x5176824fd8c92fed23df24c382a9fdf86aeeecab0b6716bef53da57bd3f551eb"), + MontFp!("0x3aaf796b71041e8b2b494bca3b030f56a0c5663149093c8a179c0f3e24d0f718"), + ], + [ + MontFp!("0x101cd65865abc573f5382df3636f4d60bc669aaa70f09ba040d61ef8d09c5296"), + MontFp!("0x2581f83d616d932b438bfe0062082d4e1ed7d34b9a1cf63580199731d44a4b25"), + MontFp!("0x65d74f6d1320dd1dc9412547b130bc7ad03c4e80cd8a44c108f24ec7aa35489a"), + MontFp!("0x0d5cb6e19c9aac7d9f51f176ed42d008317a189dc4f6fc5c36fc6d451a035916"), + MontFp!("0x0e367d17423501e62db9fd487f72076f2d1de6dabd3c175341ce35f925c9941e"), + ], + [ + MontFp!("0x3f3f101f7c8abd6bebe6b81dadf0ff5fa31ec7140e317909a8d2f94ce4adc890"), + MontFp!("0x6d5f212b5f4775095ab1d20fffd41dd73ab69b4ac60e9de11693f8e6bab88e67"), + MontFp!("0x6b11154212e86e185a4cb17dc2b9dc061f72bf9cc3df5f95f7b87f1101d09f1c"), + MontFp!("0x43f4cf980ff1a9101ca3c4601814f8de4124d108be2584ee9ffb9505188d35fd"), + MontFp!("0x5d9be9303e3a25e8fa1abb6f2a7e3250231091100f9d7311b050b52666ec8f02"), + ], + [ + MontFp!("0x1eb3b147885e1261d9034ca89a658817caef5ae629e1265cd32c6ef89ce704e9"), + MontFp!("0x1595d95dac2c4653d32b01c3fbc294b2922140e41b93c5e7f5702212226d7140"), + MontFp!("0x578b22f1f6d6eeb61507f0de1c817bb876b9cd079a18be9e99e2faa8e02618e2"), + MontFp!("0x4de38f88c5e8ba1890b3695c912ccacd63721298c9ba3d3668b44f2a13b40abd"), + MontFp!("0x0b9df0b81af072be21be9f08df336d3babe6ed5bfc199c73f2e97ccc73de80ae"), + ], + [ + MontFp!("0x2a1a8c6d54abda22954e90386d40cc7d5c4f54c592ec2c69a9574601e88b6559"), + MontFp!("0x5c5d96136cd1c4ae8fa1db9273083567345b407eb66f73a313ab8ad1a76cb157"), + MontFp!("0x1ade9e2b734e937fc2fa04ca445236faf24e6d47ad1a4baa3408102c0d1e6363"), + MontFp!("0x49354c394824998704e44eeb2ba6cb6fb431c334b648e6c87565e5fe133e8079"), + MontFp!("0x4ea258f019a8055902a696b85547652519b8d8d92de4bf18e2dbfa41264a9a6e"), + ], + [ + MontFp!("0x008a5162adf5ebd8711fd8139418509e472abc02908084f2e494086232336808"), + MontFp!("0x6badee92872dcc00812a1cbc8081dd65ece0c7d3512af5a9df5fed7428557c81"), + MontFp!("0x324c64ef2693e966965246bb7bb8c04b57a21fbee9be8c4a10096222bc83cc51"), + MontFp!("0x3f14138eee87c93b0fbfe7efdcfa906525b0ce0f3b9a7431a492f8cb71514219"), + MontFp!("0x0db99fa5ce25d50f557415ad181f1399840574f678b2534cae8f774bc8703009"), + ], + [ + MontFp!("0x23d984702589f3275211041a4bde9d79329967723ec029da095bdbe733e97381"), + MontFp!("0x6c5144ace155e976e287f1b95951194895bac2e5d54b07b62c3afe0eeafcbe39"), + MontFp!("0x57a3e420fe7e0638bfb4d0b2c6286c2946166a6eb17836571909da153c3204de"), + MontFp!("0x156621c4691a9240863577f10e29dc66a37d1b94e756869984c22d9f9d284726"), + MontFp!("0x1b1e774a7ec903650adffe34f6aa8201d356e41e0951d38fb83a89413d078e4b"), + ], + [ + MontFp!("0x514b940e5717c1ae53ea29b9a5a15998e294f69c1f553fe56124f66a16a78d53"), + MontFp!("0x16350c6898d04d355d966c1d7827eee076a1ebd90781639e120feab665391ea9"), + MontFp!("0x5b8b30d8c5ae46c4171d40478886c71c28fc86a3ae4a52ad1c05d8bcb9991b52"), + MontFp!("0x5226cdc8a40c229ea4fb08f2c10e0e24cd41f24ca5fa5b5ab73e7340f632e727"), + MontFp!("0x64383db664537c84a0a4030c3318f2f19cbeda46c70460035ad9d9240011639d"), + ], + [ + MontFp!("0x61068a086ab73c87701b2642af25f6a430240936ba473a9a258cbf90db275277"), + MontFp!("0x5bf320a3e8a48c6a85e2dffc4740d1b381ec4aa0771d885dc16adee569403ad3"), + MontFp!("0x2603e0fd03264a856c1a7b8f1c5a22c3b98f4858c345e8e0a68e3f6424dd2dfb"), + MontFp!("0x100d221342e64ed7e4f1520be70f5b0134031f8a31b4790ebb8e0a89e50b42e2"), + MontFp!("0x0e61bad85ce909438ecc028b55085ec2cee0dd3ac5a7bcaa79d96186747a4606"), + ], + [ + MontFp!("0x570a2045ca0fa7288d7f372f36bd075c2517a9743c9baa46503c4396e1f316f4"), + MontFp!("0x1a64e108621e134020ea761d8f2c5bb42f24fab7641b095f1d164d1fc7b8be90"), + MontFp!("0x097f0f28fd299e3597ffd761e9ae8b0fa46526c9d78503dc9dd5f61df3a085d7"), + MontFp!("0x1d1063cb1be0f9f96aca5e5e39be9df69c96ff717c7d0c7cfe179cd6dce27505"), + MontFp!("0x3e30f5d48b3c2475b8f3ba08cba27caed32b1cf67f76ba9223803733e13ad863"), + ], + [ + MontFp!("0x2b30db4198cd832506017fa26430d204476113cc791ee110cf5586af5ce3824c"), + MontFp!("0x2b520e374519be203c022ec51dcf8d972dd01abfaea371de9b1532647fca7bfd"), + MontFp!("0x183b9a8e45fd480e822f8a97a8d2f127d0ef561914903229fbc5602bea46cb37"), + MontFp!("0x4e01e6edf11ef4c94fe8589f9622a70709330a12e68591f6ea7dda994117bdc8"), + MontFp!("0x52ee256fb3031d20fc299de7fabd0d4ef2e7f12539760dafb0fbc8560a40ee16"), + ], + [ + MontFp!("0x327f5e141e4758d3d9a94c1628a57c817cf84fc0082b8dc098adbe84c1430979"), + MontFp!("0x3d0e12036899e5be167de13913901831a714ea5617b94de6de070ddc117bac71"), + MontFp!("0x1d9466d50efd1be3080d0aec4b81dd5cdf1ad4681e3ac04d08057f8fe49cdf0b"), + MontFp!("0x2360abd7728da2dcda3f495a9a4f0f2aaff1d2420b8f6a7fed6592e1463f3d00"), + MontFp!("0x23c1df4ddd6da863a1a2837e5222150278adfd4faf2fae7beaf64ed67a30736c"), + ], + [ + MontFp!("0x1e98ec3b325a2a11738273f94516a9d56107f33062661e571342bc043764cf77"), + MontFp!("0x431de5d108f8f7109df3059abcc16ccbd17e18676ef64f8998498e4a3f331fde"), + MontFp!("0x550937f2bf0f1adb53f412d49ffd2886158703c375f87d059461f740d655e3d0"), + MontFp!("0x1341fa99aca4bfc0f511dc9a9bc57c1e7aeb41ebb3a9140f5f93af1b3aeeb582"), + MontFp!("0x706889448219016f970b32463a87e355b55ce0a34401dbfe4dd19fb3f93dec2e"), + ], + [ + MontFp!("0x28d6207e409ab1c6e8e196d9e363040070b6c6fc4685a5482f80ba38cb792dc5"), + MontFp!("0x6827087ecdf4e6bc7c396c59de859cbf08f92c361b5174e7f681ba0e72f83aaa"), + MontFp!("0x553e112dab620286f6cf2d31325b971a6516dc7776a6e5ef37bcb11d1785299d"), + MontFp!("0x40b44f7413d152f0d46460c54e9572fd91174b4b94a3595d709119e49925354c"), + MontFp!("0x4d324dd7dfdf2380ef9f6d3c4f4bc4c5f90dbbbf2f1fd923256913f33a45cc09"), + ], + [ + MontFp!("0x609b3ae79dcdc8a8379a690394c95805d862bc31068b572ac126bbc082ebf8b7"), + MontFp!("0x33973520a1d9fb67048d64a22ad1b75b081d88c135a556dbc1b6a8479f75eaa7"), + MontFp!("0x3bcb7630fc45d34b78fd253d0b5275ecfa85ce48125ef7275c3a9205d01b85d8"), + MontFp!("0x1287f419048e81322d73bb9333e9b854e4ceac4b993b5342547263a486b42e34"), + MontFp!("0x2a2f5a5a689471d5ef46d669e449ccdc1d37256618722f08cc2c7e75d06fc277"), + ], + [ + MontFp!("0x38c913fdc729a28b7e354947f2b6449029976d442e349bc1c2acf3b0fa28bc92"), + MontFp!("0x421826bc690adac2b1f3637bc5e2333cb5e4bce3f9e8eac1a0a76df32a7ebff7"), + MontFp!("0x30ac2452c3a07bb924b6f7ed47cd6581499d532c5f90bf7fbc69556ff3bf6b09"), + MontFp!("0x40ce93f92b281e538efbe7cec9a22a9c005eef428dde3cdd46191630f563ba04"), + MontFp!("0x4fc3dd6720c87f672f7b6ff129e9b2a3236ec760a71f78aee84925d8e7616e97"), + ], + [ + MontFp!("0x3f3ba6f9f12ca6f934f92b17f4f3bd8ec261e5870610557f687bc734eadaa2d4"), + MontFp!("0x11d9eedda8d94fcbed859f5787fe20b7d4483cd319d8215530e2e316c89ee635"), + MontFp!("0x29981cff92be6c882c89feb59849d014fcd163699b5b4fdafca335552c4581d1"), + MontFp!("0x4c4fe2838d175c666c0d3f20d8dfefdcbcdacebca86e013d8ad29b6a0cf6bb79"), + MontFp!("0x630428a99469c03f9027d3c601864185d360d920771ea950732cf000b869a09a"), + ], + [ + MontFp!("0x46a776fbf1f36d7fdfa7a210cbb2ffa533540068c169e12f127cb14d9b587056"), + MontFp!("0x41a775960677e6c5fdf73c2a409b6e5c08e271cbb8c825f598a1801c84fde5ae"), + MontFp!("0x3086af931c41d791deb57f7f82dc511e4d349f42b52c3e0080097c4e44373dc8"), + MontFp!("0x155516da7a229b61392a39cc10a67112f512203cab706428f5fbbb3a9fd89fbd"), + MontFp!("0x41bdb1e32081ac55f42969658f78e308bdf50175b619c3ca8e3bfdf1ca984684"), + ], + [ + MontFp!("0x01344d21e02b9c20d0d886a02167cf8502c3614ab909ae2fa7929b12d3e88519"), + MontFp!("0x733a3e92f74b793915beab78e87bd88a2227aa5406df54dc9a2c5e80a11f71e5"), + MontFp!("0x6a6cc17a31ba2fe1411cdebeb0809bf4ff0069b0d6ac681edf816ef4c59b6f64"), + MontFp!("0x0a77e0a85b06c1b152098066bd36933264641627192e3acdbf611bd002918820"), + MontFp!("0x3efb107ebed9b44672f679bffec0121fb509d19e97ae1bac3a86384e274c8c94"), + ], + [ + MontFp!("0x3c0c4b441b0ea7ffe03c011db9aab4f86ec4849a0c783a3b7af21b05f5654482"), + MontFp!("0x28072c7bfa64f6cb97e4341cd18809ef5cd083374fbec26370c2b0ac02dcdafe"), + MontFp!("0x1962306e92b3c7295b2f7435ed8f67dda3a15ec6d8b0786d7727d071663ab22b"), + MontFp!("0x594dc533611f7f588838f894a26b1cd27432c63f9fbe03ef2d95d9a2d191ae3f"), + MontFp!("0x3e287fec491c686222949bc16c2308ade64e3a0a1dccdb25d64f9d5b94ead6e7"), + ], + [ + MontFp!("0x2a95d47fb725b3978a7f90e601f2a9ab39074b35594e0bd133f9c5f34d765d42"), + MontFp!("0x29c603ecc031a9750a4d826e4abf3874bc76c76cc7ea306b3b9636f9653ff58c"), + MontFp!("0x0bbff6ba283aa42f01172bb82a2838e50941227abc3a2a5b1215b9a6d68de07c"), + MontFp!("0x73c7ee55aaa453d36ed857353bc227375244a7e554ceeea2018eb9cb39a51e74"), + MontFp!("0x3ff41b13d4cb3140ac8426322e88ff6f16895d88e6de3336cc88c693e0d38175"), + ], + [ + MontFp!("0x03043688d4c991763362912a460be95b668fe9b1823fe90febfb3ffc7652ab24"), + MontFp!("0x33a29a0d56a7a64d36a67da2c691ff3eaf8ec7f0d78b357e7d2254c5b0e28f73"), + MontFp!("0x185db562fc75b43ba2710ad5e9114486b3e9712fe4c88f98b333c0c6211ac882"), + MontFp!("0x147b89a0cff9083b8952b3ef292c683f75d523f932711c6e1db3f28f5163b1fb"), + MontFp!("0x58ebc5d6b50bb1e4fdb4dcdfae1b69027978826f757ee4dc10d34f963f98fb59"), + ], + [ + MontFp!("0x1318791367815809badf1f3ed677e50cef92021c65549b2dabaa52c7b424f5a9"), + MontFp!("0x5bce78553694ba32f793c8d7f8d09ac63d0d7ada32b888d61b87849f3eda9557"), + MontFp!("0x026bebcc38f0b2804ed21f2e2b16af2194375ff2559fbc588a8962caf0b684c0"), + MontFp!("0x494bceff689f9885a3998de0eaaa7ac71a04522700f2e067efdbb037c6e53c66"), + MontFp!("0x03ebaf5f0602347c4ed2bdb9a86eb955cb5cd5378f7a6f369dccb69792de8bd2"), + ], + [ + MontFp!("0x3626d91f9f05334cb32d3a42eed03f7a553a0ed4cada2db08b45b548bd3b3655"), + MontFp!("0x63ee9e5c5cd3c83e93757ed93358ff0583d761e595b62f11df27bd4292ffb6e5"), + MontFp!("0x705dd80b2db4492c8b9984439b823681c4d9c8dcddcc04b9786a90051513a0e1"), + MontFp!("0x2636ac2ac559be8fe509641dbc67e55db47bb051e05ef06301020c9501f110f1"), + MontFp!("0x4781b8da302c7764951730e7ac0892de64537d94db2e19b84eec5a2d9539288e"), + ], + [ + MontFp!("0x197852b9a62e16779725f35cd8daf52ffbc8cc9c902c16923f2ff8873795ca86"), + MontFp!("0x1c3e49f33fd73480b280dba7744cf67e244449048f8fc84f7b6e452b4ede9a35"), + MontFp!("0x41d20cdc6a15c07fd9735c89b155412fcbb7bd3cdfc27abaad2a3a8a90e99743"), + MontFp!("0x0c3a7aaeb5f65d907944d7aa48c27648be3d0371bd97a9c060e8ef4f573521b8"), + MontFp!("0x52ea7c3f75cba07991674295c4e1462108401b9a103736623943d42e4fbe334e"), + ], + [ + MontFp!("0x1106537bf3150b442b0992ee517b69707c3042015e938f97a63d5c924e67f677"), + MontFp!("0x71de967042516a5b990ef18ae9956fab89f361b950e0639963017c237ee2a0cf"), + MontFp!("0x664a4487e02f7bfa07a1db6ab94a0d1ed0f9e74002bde9cfcbb65f6f74dbfca0"), + MontFp!("0x1023721fd7285260935b5a347f167ce721dd6ae5004c4debc68066bac8f2c467"), + MontFp!("0x2d52fbc95404515f5456c74b65186c860a89dcda8c84bf68fbf715f3d58fe3f2"), + ], + [ + MontFp!("0x6d987c9de419fb6e075441fd99606303e765d8696bcfe01a0d11aa0bd47c8601"), + MontFp!("0x422016ce4d744029b1440a288d7988e43d0f29d616c47f70322ff87cfbc69301"), + MontFp!("0x1f82afe8eb16611abc6600f7dc2a72c8e1d39643c189f3caa1ead08241a896c4"), + MontFp!("0x3bb8684cf815ae6d8a789e0e488c6fb2ac46883fe1cfeb8cfa6f3dbca0f954bd"), + MontFp!("0x3d5a1a6e571306fac431b098cdb3c4518f5a8fc436535766fe9e1bb8bda95d1d"), + ], + [ + MontFp!("0x5e36e175c5d7df42b86285f43b1e4c6bfbaca19f1019073d38d04de0d0647669"), + MontFp!("0x2c3b1b86ce90cb3fe74c5c99b20c3314e28e2f07ce8d932030caee4dfe5055f1"), + MontFp!("0x0bfba44d41c49044bce730d8af86fe0397fff85ec10288b847868d0e9834f754"), + MontFp!("0x0b79924b9e44662369c615cc8d7f36fe4a4b2a79045cee61c413eaf91d82e0c2"), + MontFp!("0x048a11ec75eb154b70223a40cc0db9104b13f6a4ca24e7b9707963ee6f9f74ef"), + ], + [ + MontFp!("0x6dd58a400d366014e46b0b9785ce9d78516813ed2eb329dc4531bfbd8e80eec0"), + MontFp!("0x112844b7c50e7e676b616e72539d5751dec5a063456921b6b16f9e930cc35ebc"), + MontFp!("0x217b616b50e729547af8ceef5008d1edf8d90bc9a7f3ce7c9bc71867e1c06471"), + MontFp!("0x3f9a0b8402ffa291bccbb46dcd2522dea790b35a8503da46717c63917dcb7b79"), + MontFp!("0x42a44fc114c0cad9badf62b911610bdc4b1a0ba9f656f66173a5476e63dfce86"), + ], + [ + MontFp!("0x294223972f4c7e9c9ebefebf059eb90f44479956f5337b12a2eb803e313e96cc"), + MontFp!("0x448101837874eb1bda92bc8a632cbf8f70a0664bbcf3a196609b14c53ee4dbcb"), + MontFp!("0x53a26c6e2b3df0b17faf6a259bc5531d3ae79da59eb8fc5f594e0b886d8d97be"), + MontFp!("0x207c7c32631a75fe8e0da895367176d24e32c5573ec91acf235f3c6c307807cd"), + MontFp!("0x20f955773b13b160d3575eb2380b466f7d38cb4a0e12a15d43d147645c3944ca"), + ], + ]; +} diff --git a/nimue-poseidon/src/bls12_381/fr_3_2.rs b/nimue-poseidon/src/bls12_381/fr_3_2.rs deleted file mode 100644 index d99ecaa..0000000 --- a/nimue-poseidon/src/bls12_381/fr_3_2.rs +++ /dev/null @@ -1,215 +0,0 @@ -use ark_bls12_381::Fr; -use ark_ff::MontFp; - -pub type Field = Fr; -pub const ALPHA: u64 = 3; -pub const FULL_ROUNDS: usize = 8; -pub const TOTAL_ROUNDS: usize = 8; -pub const N: usize = 3; -pub const R: usize = 2; - -pub const MDS: &'static [[Fr; 3]] = &[ - [ - MontFp!("43228725308391137369947362226390319299014033584574058394339561338097152657858"), - MontFp!("20729134655727743386784826341366384914431326428651109729494295849276339718592"), - MontFp!("14275792724825301816674509766636153429127896752891673527373812580216824074377"), - ], - [ - MontFp!("3039440043015681380498693766234886011876841428799441709991632635031851609481"), - MontFp!("6678863357926068615342013496680930722082156498064457711885464611323928471101"), - MontFp!("37355038393562575053091209735467454314247378274125943833499651442997254948957"), - ], - [ - MontFp!("26481612700543967643159862864328231943993263806649000633819754663276818191580"), - MontFp!("30103264397473155564098369644643015994024192377175707604277831692111219371047"), - MontFp!("5712721806190262694719203887224391960978962995663881615739647362444059585747"), - ], -]; - -pub const ARK: &'static [[Fr; 3]] = &[ - [ - MontFp!("44595993092652566245296379427906271087754779418564084732265552598173323099784"), - MontFp!("23298463296221002559050231199021122673158929708101049474262017406235785365706"), - MontFp!("34212491019164671611180318500074499609633402631511849759183986060951187784466"), - ], - [ - MontFp!("19098051134080182375553680073525644187968170656591203562523489333616681350367"), - MontFp!("7027675418691353855077049716619550622043312043660992344940177187528247727783"), - MontFp!("47642753235356257928619065424282314733361764347085604019867862722762702755609"), - ], - [ - MontFp!("24281836129477728386327945482863886685457469794572168729834072693507088619997"), - MontFp!("12624893078331920791384400430193929292743809612452779381349824703573823883410"), - MontFp!("22654862987689323504199204643771547606936339944127455903448909090318619188561"), - ], - [ - MontFp!("27229172992560143399715985732065737093562061782414043625359531774550940662372"), - MontFp!("13224952063922250960936823741448973692264041750100990569445192064567307041002"), - MontFp!("40380869235216625717296601204704413215735530626882135230693823362552484855508"), - ], - [ - MontFp!("4245751157938905689397184705633683893932492370323323780371834663438472308145"), - MontFp!("8252156875535418429533049587170755750275631534314711502253775796882240991261"), - MontFp!("32910829712934971129644416249914075073083903821282503505466324428991624789936"), - ], - [ - MontFp!("49412601297460128335642438246716127241669915737656789613664349252868389975962"), - MontFp!("841661305510340459373323516098909074520942972558284146843779636353111592117"), - MontFp!("37926489020263024391336570420006226544461516787280929232555625742588667303947"), - ], - [ - MontFp!("18433043696013996573551852847056868761017170818820490351056924728720017242180"), - MontFp!("45376910275288438312773930242803223482318753992595269901397542214841496212310"), - MontFp!("47854349410014339708332226068958253098964727682486278458389508597930796651514"), - ], - [ - MontFp!("32638426693771251366613055506166587312642876874690861030672730491779486904360"), - MontFp!("19105439281696418043426755774110765432959446684037017837894045255490581318047"), - MontFp!("13484299981373196201166722380389594773562113262309564134825386266765751213853"), - ], - [ - MontFp!("63360321133852659797114062808297090090814531427710842859827725871241144161"), - MontFp!("42427543035537409467993338717379268954936885184662765745740070438835506287271"), - MontFp!("149101987103211771991327927827692640556911620408176100290586418839323044234"), - ], - [ - MontFp!("8341764062226826803887898710015561861526081583071950015446833446251359696930"), - MontFp!("45635980415044299013530304465786867101223925975971912073759959440335364441441"), - MontFp!("49833261156201520743834327917353893365097424877680239796845398698940689734850"), - ], - [ - MontFp!("26764715016591436228000634284249890185894507497739511725029482580508707525029"), - MontFp!("25054530812095491217523557726611612265064441619646263299990388543372685322499"), - MontFp!("47654590955096246997622155031169641628093104787883934397920286718814889326452"), - ], - [ - MontFp!("16463825890556752307085325855351334996898686633642574805918056141310194135796"), - MontFp!("17473961341633494489168064889016732306117097771640351649096482400214968053040"), - MontFp!("49914603434867854893558366922996753035832008639512305549839666311012232077468"), - ], - [ - MontFp!("17122578514152308432111470949473865420090463026624297565504381163777697818362"), - MontFp!("34870689836420861427379101859113225049736283485335674111421609473028315711541"), - MontFp!("4622082908476410083286670201138165773322781640914243047922441301693321472984"), - ], - [ - MontFp!("6079244375752010013798561155333454682564824861645642293573415833483620500976"), - MontFp!("2635090520059500019661864086615522409798872905401305311748231832709078452746"), - MontFp!("19070766579582338321241892986615538320421651429118757507174186491084617237586"), - ], - [ - MontFp!("12622420533971517050761060317049369208980632120901481436392835424625664738526"), - MontFp!("8965101225657199137904506150282256568170501907667138404080397024857524386266"), - MontFp!("27085091008069524593196374148553176565775450537072498305327481366756159319838"), - ], - [ - MontFp!("45929056591150668409624595495643698205830429971690813312608217341940499221218"), - MontFp!("50361689160518167880500080025023064746137161030119436080957023803101861300846"), - MontFp!("6722586346537620732668048024627882970582133613352245923413730968378696371065"), - ], - [ - MontFp!("7340485916200743279276570085958556798507770452421357119145466906520506506342"), - MontFp!("25946733168219652706630789514519162148860502996914241011500280690204368174083"), - MontFp!("9962367658743163006517635070396368828381757404628822422306438427554934645464"), - ], - [ - MontFp!("7221669722700687417346373353960536661883467014204005276831020252277657076044"), - MontFp!("21487980358388383563030903293359140836304488103090321183948009095669344637431"), - MontFp!("44389482047246878765773958430749333249729101516826571588063797358040130313157"), - ], - [ - MontFp!("32887270862917330820874162842519225370447850172085449103568878409533683733185"), - MontFp!("15453393396765207016379045014101989306173462885430532298601655955681532648226"), - MontFp!("5478929644476681096437469958231489102974161353940993351588559414552523375472"), - ], - [ - MontFp!("41981370411247590312677561209178363054744730805951096631186178388981705304138"), - MontFp!("3474136981645476955784428843999869229067282976757744542648188369810577298585"), - MontFp!("26251477770740399889956219915654371915771248171098220204692699710414817081869"), - ], - [ - MontFp!("51916561889718854106125837319509539220778634838409949714061033196765117231752"), - MontFp!("25355145802812435959748831835587713214179184608408449220418373832038339021974"), - MontFp!("31950684570730625275416731570246297947385359051792335826965013637877068017530"), - ], - [ - MontFp!("40966378914980473680181850710703295982197782082391794594149984057481543436879"), - MontFp!("1141315130963422417761731263662398620858625339733452795772225916965481730059"), - MontFp!("9812100862165422922235757591915383485338044715409891361026651619010947646011"), - ], - [ - MontFp!("25276091996614379065765602410190790163396484122487585763380676888280427744737"), - MontFp!("18512694312063606403196469408971540495273694846641903978723927656359350642619"), - MontFp!("5791584766415439694303685437881192048262049244830616851865505314899699012588"), - ], - [ - MontFp!("34501536331706470927069149344450300773777486993504673779438188495686129846168"), - MontFp!("10797737565565774079718466476236831116206064650762676383469703413649447678207"), - MontFp!("42599392747310354323136214835734307933597896695637215127297036595538235868368"), - ], - [ - MontFp!("1336670998775417133322626564820911986969949054454812685145275612519924150700"), - MontFp!("2630141283339761901081411552890260088516693208402906795133548756078952896770"), - MontFp!("5206688943117414740600380377278238268309952400341418217132724749372435975215"), - ], - [ - MontFp!("10739264253827005683370721104077252560524362323422172665530191908848354339715"), - MontFp!("48010640624945719826344492755710886355389194986527731603685956726907395779674"), - MontFp!("47880724693177306044229143357252697148359033158394459365791331000715957339701"), - ], - [ - MontFp!("51658938856669444737833983076793759752280196674149218924101718974926964118996"), - MontFp!("27558055650076329657496888512074319504342606463881203707330358472954748913263"), - MontFp!("38886981777859313701520424626728402175860609948757992393598285291689196608037"), - ], - [ - MontFp!("17152756165118461969542990684402410297675979513690903033350206658079448802479"), - MontFp!("43766946932033687220387514221943418338304186408056458476301583041390483707207"), - MontFp!("24324495647041812436929170644873622904287038078113808264580396461953421400343"), - ], - [ - MontFp!("6935839211798937659784055008131602708847374430164859822530563797964932598700"), - MontFp!("42126767398190942911395299419182514513368023621144776598842282267908712110039"), - MontFp!("5702364486091252903915715761606014714345316580946072019346660327857498603375"), - ], - [ - MontFp!("28184981699552917714085740963279595942132561155181044254318202220270242523053"), - MontFp!("27078204494010940048327822707224393686245007379331357330801926151074766130790"), - MontFp!("5004172841233947987988267535285080365124079140142987718231874743202918551203"), - ], - [ - MontFp!("7974360962120296064882769128577382489451060235999590492215336103105134345602"), - MontFp!("48062035869818179910046292951628308709251170031813126950740044942870578526376"), - MontFp!("26361151154829600651603985995297072258262605598910254660032612019129606811983"), - ], - [ - MontFp!("46973867849986280770641828877435510444176572688208439836496241838832695841519"), - MontFp!("1219439673853113792340300173186247996249367102884530407862469123523013083971"), - MontFp!("8063356002935671186275773257019749639571745240775941450161086349727882957042"), - ], - [ - MontFp!("8815571992701260640209942886673939234666734294275300852283020522390608544536"), - MontFp!("36384568984671043678320545346945893232044626942887414733675890845013312931948"), - MontFp!("7493936589040764830842760521372106574503511314427857201860148571929278344956"), - ], - [ - MontFp!("26516538878265871822073279450474977673130300973488209984756372331392531193948"), - MontFp!("3872858659373466814413243601289105962248870842202907364656526273784217311104"), - MontFp!("8291822807524000248589997648893671538524566700364221355689839490238724479848"), - ], - [ - MontFp!("32842548776827046388198955038089826231531188946525483251252938248379132381248"), - MontFp!("10749428410907700061565796335489079278748501945557710351216806276547834974736"), - MontFp!("43342287917341177925402357903832370099402579088513884654598017447701677948416"), - ], - [ - MontFp!("29658571352070370791360499299098360881857072189358092237807807261478461425147"), - MontFp!("7805182565862454238315452208989152534554369855020544477885853141626690738363"), - MontFp!("30699555847500141715826240743138908521140760599479365867708690318477369178275"), - ], - [ - MontFp!("1231951350103545216624376889222508148537733140742167414518514908719103925687"), - MontFp!("24784260089125933876714702247471508077514206350883487938806451152907502751770"), - MontFp!("36563542611079418454711392295126742705798573252480028863133394504154697924536"), - ], -]; diff --git a/nimue-poseidon/src/bls12_381/mod.rs b/nimue-poseidon/src/bls12_381/mod.rs deleted file mode 100644 index 8e228b3..0000000 --- a/nimue-poseidon/src/bls12_381/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod fr_3_2; - -poseidon_sponge!(PoseidonBls12381Fr3_1, fr_3_2); diff --git a/nimue-poseidon/src/bn254.rs b/nimue-poseidon/src/bn254.rs new file mode 100644 index 0000000..c90da25 --- /dev/null +++ b/nimue-poseidon/src/bn254.rs @@ -0,0 +1,885 @@ +poseidon_sponge!(254, PoseidonPermx5_254_3, x5_254_3); +poseidon_sponge!(254, PoseidonPermx5_254_5, x5_254_5); + +mod x5_254_3 { + use ark_ff::MontFp; + pub type Field = ark_bn254::Fr; + pub const ALPHA: u64 = 5; + pub const R_F: usize = 8; + pub const R_P: usize = 57; + pub const N: usize = 3; + pub const R: usize = 2; + + pub const MDS: &'static [[Field; N]] = &[ + [ + MontFp!("0x109b7f411ba0e4c9b2b70caf5c36a7b194be7c11ad24378bfedb68592ba8118b"), + MontFp!("0x16ed41e13bb9c0c66ae119424fddbcbc9314dc9fdbdeea55d6c64543dc4903e0"), + MontFp!("0x2b90bba00fca0589f617e7dcbfe82e0df706ab640ceb247b791a93b74e36736d"), + ], + [ + MontFp!("0x2969f27eed31a480b9c36c764379dbca2cc8fdd1415c3dded62940bcde0bd771"), + MontFp!("0x2e2419f9ec02ec394c9871c832963dc1b89d743c8c7b964029b2311687b1fe23"), + MontFp!("0x101071f0032379b697315876690f053d148d4e109f5fb065c8aacc55a0f89bfa"), + ], + [ + MontFp!("0x143021ec686a3f330d5f9e654638065ce6cd79e28c5b3753326244ee65a1b1a7"), + MontFp!("0x176cc029695ad02582a70eff08a6fd99d057e12e58e7d7b6b16cdfabc8ee2911"), + MontFp!("0x19a3fc0a56702bf417ba7fee3802593fa644470307043f7773279cd71d25d5e0"), + ], + ]; + + pub const ARK: &'static [[Field; N]; R_F + R_P] = &[ + [ + MontFp!("0x0ee9a592ba9a9518d05986d656f40c2114c4993c11bb29938d21d47304cd8e6e"), + MontFp!("0x00f1445235f2148c5986587169fc1bcd887b08d4d00868df5696fff40956e864"), + MontFp!("0x08dff3487e8ac99e1f29a058d0fa80b930c728730b7ab36ce879f3890ecf73f5"), + ], + [ + MontFp!("0x2f27be690fdaee46c3ce28f7532b13c856c35342c84bda6e20966310fadc01d0"), + MontFp!("0x2b2ae1acf68b7b8d2416bebf3d4f6234b763fe04b8043ee48b8327bebca16cf2"), + MontFp!("0x0319d062072bef7ecca5eac06f97d4d55952c175ab6b03eae64b44c7dbf11cfa"), + ], + [ + MontFp!("0x28813dcaebaeaa828a376df87af4a63bc8b7bf27ad49c6298ef7b387bf28526d"), + MontFp!("0x2727673b2ccbc903f181bf38e1c1d40d2033865200c352bc150928adddf9cb78"), + MontFp!("0x234ec45ca27727c2e74abd2b2a1494cd6efbd43e340587d6b8fb9e31e65cc632"), + ], + [ + MontFp!("0x15b52534031ae18f7f862cb2cf7cf760ab10a8150a337b1ccd99ff6e8797d428"), + MontFp!("0x0dc8fad6d9e4b35f5ed9a3d186b79ce38e0e8a8d1b58b132d701d4eecf68d1f6"), + MontFp!("0x1bcd95ffc211fbca600f705fad3fb567ea4eb378f62e1fec97805518a47e4d9c"), + ], + [ + MontFp!("0x10520b0ab721cadfe9eff81b016fc34dc76da36c2578937817cb978d069de559"), + MontFp!("0x1f6d48149b8e7f7d9b257d8ed5fbbaf42932498075fed0ace88a9eb81f5627f6"), + MontFp!("0x1d9655f652309014d29e00ef35a2089bfff8dc1c816f0dc9ca34bdb5460c8705"), + ], + [ + MontFp!("0x04df5a56ff95bcafb051f7b1cd43a99ba731ff67e47032058fe3d4185697cc7d"), + MontFp!("0x0672d995f8fff640151b3d290cedaf148690a10a8c8424a7f6ec282b6e4be828"), + MontFp!("0x099952b414884454b21200d7ffafdd5f0c9a9dcc06f2708e9fc1d8209b5c75b9"), + ], + [ + MontFp!("0x052cba2255dfd00c7c483143ba8d469448e43586a9b4cd9183fd0e843a6b9fa6"), + MontFp!("0x0b8badee690adb8eb0bd74712b7999af82de55707251ad7716077cb93c464ddc"), + MontFp!("0x119b1590f13307af5a1ee651020c07c749c15d60683a8050b963d0a8e4b2bdd1"), + ], + [ + MontFp!("0x03150b7cd6d5d17b2529d36be0f67b832c4acfc884ef4ee5ce15be0bfb4a8d09"), + MontFp!("0x2cc6182c5e14546e3cf1951f173912355374efb83d80898abe69cb317c9ea565"), + MontFp!("0x005032551e6378c450cfe129a404b3764218cadedac14e2b92d2cd73111bf0f9"), + ], + [ + MontFp!("0x233237e3289baa34bb147e972ebcb9516469c399fcc069fb88f9da2cc28276b5"), + MontFp!("0x05c8f4f4ebd4a6e3c980d31674bfbe6323037f21b34ae5a4e80c2d4c24d60280"), + MontFp!("0x0a7b1db13042d396ba05d818a319f25252bcf35ef3aeed91ee1f09b2590fc65b"), + ], + [ + MontFp!("0x2a73b71f9b210cf5b14296572c9d32dbf156e2b086ff47dc5df542365a404ec0"), + MontFp!("0x1ac9b0417abcc9a1935107e9ffc91dc3ec18f2c4dbe7f22976a760bb5c50c460"), + MontFp!("0x12c0339ae08374823fabb076707ef479269f3e4d6cb104349015ee046dc93fc0"), + ], + [ + MontFp!("0x0b7475b102a165ad7f5b18db4e1e704f52900aa3253baac68246682e56e9a28e"), + MontFp!("0x037c2849e191ca3edb1c5e49f6e8b8917c843e379366f2ea32ab3aa88d7f8448"), + MontFp!("0x05a6811f8556f014e92674661e217e9bd5206c5c93a07dc145fdb176a716346f"), + ], + [ + MontFp!("0x29a795e7d98028946e947b75d54e9f044076e87a7b2883b47b675ef5f38bd66e"), + MontFp!("0x20439a0c84b322eb45a3857afc18f5826e8c7382c8a1585c507be199981fd22f"), + MontFp!("0x2e0ba8d94d9ecf4a94ec2050c7371ff1bb50f27799a84b6d4a2a6f2a0982c887"), + ], + [ + MontFp!("0x143fd115ce08fb27ca38eb7cce822b4517822cd2109048d2e6d0ddcca17d71c8"), + MontFp!("0x0c64cbecb1c734b857968dbbdcf813cdf8611659323dbcbfc84323623be9caf1"), + MontFp!("0x028a305847c683f646fca925c163ff5ae74f348d62c2b670f1426cef9403da53"), + ], + [ + MontFp!("0x2e4ef510ff0b6fda5fa940ab4c4380f26a6bcb64d89427b824d6755b5db9e30c"), + MontFp!("0x0081c95bc43384e663d79270c956ce3b8925b4f6d033b078b96384f50579400e"), + MontFp!("0x2ed5f0c91cbd9749187e2fade687e05ee2491b349c039a0bba8a9f4023a0bb38"), + ], + [ + MontFp!("0x30509991f88da3504bbf374ed5aae2f03448a22c76234c8c990f01f33a735206"), + MontFp!("0x1c3f20fd55409a53221b7c4d49a356b9f0a1119fb2067b41a7529094424ec6ad"), + MontFp!("0x10b4e7f3ab5df003049514459b6e18eec46bb2213e8e131e170887b47ddcb96c"), + ], + [ + MontFp!("0x2a1982979c3ff7f43ddd543d891c2abddd80f804c077d775039aa3502e43adef"), + MontFp!("0x1c74ee64f15e1db6feddbead56d6d55dba431ebc396c9af95cad0f1315bd5c91"), + MontFp!("0x07533ec850ba7f98eab9303cace01b4b9e4f2e8b82708cfa9c2fe45a0ae146a0"), + ], + [ + MontFp!("0x21576b438e500449a151e4eeaf17b154285c68f42d42c1808a11abf3764c0750"), + MontFp!("0x2f17c0559b8fe79608ad5ca193d62f10bce8384c815f0906743d6930836d4a9e"), + MontFp!("0x2d477e3862d07708a79e8aae946170bc9775a4201318474ae665b0b1b7e2730e"), + ], + [ + MontFp!("0x162f5243967064c390e095577984f291afba2266c38f5abcd89be0f5b2747eab"), + MontFp!("0x2b4cb233ede9ba48264ecd2c8ae50d1ad7a8596a87f29f8a7777a70092393311"), + MontFp!("0x2c8fbcb2dd8573dc1dbaf8f4622854776db2eece6d85c4cf4254e7c35e03b07a"), + ], + [ + MontFp!("0x1d6f347725e4816af2ff453f0cd56b199e1b61e9f601e9ade5e88db870949da9"), + MontFp!("0x204b0c397f4ebe71ebc2d8b3df5b913df9e6ac02b68d31324cd49af5c4565529"), + MontFp!("0x0c4cb9dc3c4fd8174f1149b3c63c3c2f9ecb827cd7dc25534ff8fb75bc79c502"), + ], + [ + MontFp!("0x174ad61a1448c899a25416474f4930301e5c49475279e0639a616ddc45bc7b54"), + MontFp!("0x1a96177bcf4d8d89f759df4ec2f3cde2eaaa28c177cc0fa13a9816d49a38d2ef"), + MontFp!("0x066d04b24331d71cd0ef8054bc60c4ff05202c126a233c1a8242ace360b8a30a"), + ], + [ + MontFp!("0x2a4c4fc6ec0b0cf52195782871c6dd3b381cc65f72e02ad527037a62aa1bd804"), + MontFp!("0x13ab2d136ccf37d447e9f2e14a7cedc95e727f8446f6d9d7e55afc01219fd649"), + MontFp!("0x1121552fca26061619d24d843dc82769c1b04fcec26f55194c2e3e869acc6a9a"), + ], + [ + MontFp!("0x00ef653322b13d6c889bc81715c37d77a6cd267d595c4a8909a5546c7c97cff1"), + MontFp!("0x0e25483e45a665208b261d8ba74051e6400c776d652595d9845aca35d8a397d3"), + MontFp!("0x29f536dcb9dd7682245264659e15d88e395ac3d4dde92d8c46448db979eeba89"), + ], + [ + MontFp!("0x2a56ef9f2c53febadfda33575dbdbd885a124e2780bbea170e456baace0fa5be"), + MontFp!("0x1c8361c78eb5cf5decfb7a2d17b5c409f2ae2999a46762e8ee416240a8cb9af1"), + MontFp!("0x151aff5f38b20a0fc0473089aaf0206b83e8e68a764507bfd3d0ab4be74319c5"), + ], + [ + MontFp!("0x04c6187e41ed881dc1b239c88f7f9d43a9f52fc8c8b6cdd1e76e47615b51f100"), + MontFp!("0x13b37bd80f4d27fb10d84331f6fb6d534b81c61ed15776449e801b7ddc9c2967"), + MontFp!("0x01a5c536273c2d9df578bfbd32c17b7a2ce3664c2a52032c9321ceb1c4e8a8e4"), + ], + [ + MontFp!("0x2ab3561834ca73835ad05f5d7acb950b4a9a2c666b9726da832239065b7c3b02"), + MontFp!("0x1d4d8ec291e720db200fe6d686c0d613acaf6af4e95d3bf69f7ed516a597b646"), + MontFp!("0x041294d2cc484d228f5784fe7919fd2bb925351240a04b711514c9c80b65af1d"), + ], + [ + MontFp!("0x154ac98e01708c611c4fa715991f004898f57939d126e392042971dd90e81fc6"), + MontFp!("0x0b339d8acca7d4f83eedd84093aef51050b3684c88f8b0b04524563bc6ea4da4"), + MontFp!("0x0955e49e6610c94254a4f84cfbab344598f0e71eaff4a7dd81ed95b50839c82e"), + ], + [ + MontFp!("0x06746a6156eba54426b9e22206f15abca9a6f41e6f535c6f3525401ea0654626"), + MontFp!("0x0f18f5a0ecd1423c496f3820c549c27838e5790e2bd0a196ac917c7ff32077fb"), + MontFp!("0x04f6eeca1751f7308ac59eff5beb261e4bb563583ede7bc92a738223d6f76e13"), + ], + [ + MontFp!("0x2b56973364c4c4f5c1a3ec4da3cdce038811eb116fb3e45bc1768d26fc0b3758"), + MontFp!("0x123769dd49d5b054dcd76b89804b1bcb8e1392b385716a5d83feb65d437f29ef"), + MontFp!("0x2147b424fc48c80a88ee52b91169aacea989f6446471150994257b2fb01c63e9"), + ], + [ + MontFp!("0x0fdc1f58548b85701a6c5505ea332a29647e6f34ad4243c2ea54ad897cebe54d"), + MontFp!("0x12373a8251fea004df68abcf0f7786d4bceff28c5dbbe0c3944f685cc0a0b1f2"), + MontFp!("0x21e4f4ea5f35f85bad7ea52ff742c9e8a642756b6af44203dd8a1f35c1a90035"), + ], + [ + MontFp!("0x16243916d69d2ca3dfb4722224d4c462b57366492f45e90d8a81934f1bc3b147"), + MontFp!("0x1efbe46dd7a578b4f66f9adbc88b4378abc21566e1a0453ca13a4159cac04ac2"), + MontFp!("0x07ea5e8537cf5dd08886020e23a7f387d468d5525be66f853b672cc96a88969a"), + ], + [ + MontFp!("0x05a8c4f9968b8aa3b7b478a30f9a5b63650f19a75e7ce11ca9fe16c0b76c00bc"), + MontFp!("0x20f057712cc21654fbfe59bd345e8dac3f7818c701b9c7882d9d57b72a32e83f"), + MontFp!("0x04a12ededa9dfd689672f8c67fee31636dcd8e88d01d49019bd90b33eb33db69"), + ], + [ + MontFp!("0x27e88d8c15f37dcee44f1e5425a51decbd136ce5091a6767e49ec9544ccd101a"), + MontFp!("0x2feed17b84285ed9b8a5c8c5e95a41f66e096619a7703223176c41ee433de4d1"), + MontFp!("0x1ed7cc76edf45c7c404241420f729cf394e5942911312a0d6972b8bd53aff2b8"), + ], + [ + MontFp!("0x15742e99b9bfa323157ff8c586f5660eac6783476144cdcadf2874be45466b1a"), + MontFp!("0x1aac285387f65e82c895fc6887ddf40577107454c6ec0317284f033f27d0c785"), + MontFp!("0x25851c3c845d4790f9ddadbdb6057357832e2e7a49775f71ec75a96554d67c77"), + ], + [ + MontFp!("0x15a5821565cc2ec2ce78457db197edf353b7ebba2c5523370ddccc3d9f146a67"), + MontFp!("0x2411d57a4813b9980efa7e31a1db5966dcf64f36044277502f15485f28c71727"), + MontFp!("0x002e6f8d6520cd4713e335b8c0b6d2e647e9a98e12f4cd2558828b5ef6cb4c9b"), + ], + [ + MontFp!("0x2ff7bc8f4380cde997da00b616b0fcd1af8f0e91e2fe1ed7398834609e0315d2"), + MontFp!("0x00b9831b948525595ee02724471bcd182e9521f6b7bb68f1e93be4febb0d3cbe"), + MontFp!("0x0a2f53768b8ebf6a86913b0e57c04e011ca408648a4743a87d77adbf0c9c3512"), + ], + [ + MontFp!("0x00248156142fd0373a479f91ff239e960f599ff7e94be69b7f2a290305e1198d"), + MontFp!("0x171d5620b87bfb1328cf8c02ab3f0c9a397196aa6a542c2350eb512a2b2bcda9"), + MontFp!("0x170a4f55536f7dc970087c7c10d6fad760c952172dd54dd99d1045e4ec34a808"), + ], + [ + MontFp!("0x29aba33f799fe66c2ef3134aea04336ecc37e38c1cd211ba482eca17e2dbfae1"), + MontFp!("0x1e9bc179a4fdd758fdd1bb1945088d47e70d114a03f6a0e8b5ba650369e64973"), + MontFp!("0x1dd269799b660fad58f7f4892dfb0b5afeaad869a9c4b44f9c9e1c43bdaf8f09"), + ], + [ + MontFp!("0x22cdbc8b70117ad1401181d02e15459e7ccd426fe869c7c95d1dd2cb0f24af38"), + MontFp!("0x0ef042e454771c533a9f57a55c503fcefd3150f52ed94a7cd5ba93b9c7dacefd"), + MontFp!("0x11609e06ad6c8fe2f287f3036037e8851318e8b08a0359a03b304ffca62e8284"), + ], + [ + MontFp!("0x1166d9e554616dba9e753eea427c17b7fecd58c076dfe42708b08f5b783aa9af"), + MontFp!("0x2de52989431a859593413026354413db177fbf4cd2ac0b56f855a888357ee466"), + MontFp!("0x3006eb4ffc7a85819a6da492f3a8ac1df51aee5b17b8e89d74bf01cf5f71e9ad"), + ], + [ + MontFp!("0x2af41fbb61ba8a80fdcf6fff9e3f6f422993fe8f0a4639f962344c8225145086"), + MontFp!("0x119e684de476155fe5a6b41a8ebc85db8718ab27889e85e781b214bace4827c3"), + MontFp!("0x1835b786e2e8925e188bea59ae363537b51248c23828f047cff784b97b3fd800"), + ], + [ + MontFp!("0x28201a34c594dfa34d794996c6433a20d152bac2a7905c926c40e285ab32eeb6"), + MontFp!("0x083efd7a27d1751094e80fefaf78b000864c82eb571187724a761f88c22cc4e7"), + MontFp!("0x0b6f88a3577199526158e61ceea27be811c16df7774dd8519e079564f61fd13b"), + ], + [ + MontFp!("0x0ec868e6d15e51d9644f66e1d6471a94589511ca00d29e1014390e6ee4254f5b"), + MontFp!("0x2af33e3f866771271ac0c9b3ed2e1142ecd3e74b939cd40d00d937ab84c98591"), + MontFp!("0x0b520211f904b5e7d09b5d961c6ace7734568c547dd6858b364ce5e47951f178"), + ], + [ + MontFp!("0x0b2d722d0919a1aad8db58f10062a92ea0c56ac4270e822cca228620188a1d40"), + MontFp!("0x1f790d4d7f8cf094d980ceb37c2453e957b54a9991ca38bbe0061d1ed6e562d4"), + MontFp!("0x0171eb95dfbf7d1eaea97cd385f780150885c16235a2a6a8da92ceb01e504233"), + ], + [ + MontFp!("0x0c2d0e3b5fd57549329bf6885da66b9b790b40defd2c8650762305381b168873"), + MontFp!("0x1162fb28689c27154e5a8228b4e72b377cbcafa589e283c35d3803054407a18d"), + MontFp!("0x2f1459b65dee441b64ad386a91e8310f282c5a92a89e19921623ef8249711bc0"), + ], + [ + MontFp!("0x1e6ff3216b688c3d996d74367d5cd4c1bc489d46754eb712c243f70d1b53cfbb"), + MontFp!("0x01ca8be73832b8d0681487d27d157802d741a6f36cdc2a0576881f9326478875"), + MontFp!("0x1f7735706ffe9fc586f976d5bdf223dc680286080b10cea00b9b5de315f9650e"), + ], + [ + MontFp!("0x2522b60f4ea3307640a0c2dce041fba921ac10a3d5f096ef4745ca838285f019"), + MontFp!("0x23f0bee001b1029d5255075ddc957f833418cad4f52b6c3f8ce16c235572575b"), + MontFp!("0x2bc1ae8b8ddbb81fcaac2d44555ed5685d142633e9df905f66d9401093082d59"), + ], + [ + MontFp!("0x0f9406b8296564a37304507b8dba3ed162371273a07b1fc98011fcd6ad72205f"), + MontFp!("0x2360a8eb0cc7defa67b72998de90714e17e75b174a52ee4acb126c8cd995f0a8"), + MontFp!("0x15871a5cddead976804c803cbaef255eb4815a5e96df8b006dcbbc2767f88948"), + ], + [ + MontFp!("0x193a56766998ee9e0a8652dd2f3b1da0362f4f54f72379544f957ccdeefb420f"), + MontFp!("0x2a394a43934f86982f9be56ff4fab1703b2e63c8ad334834e4309805e777ae0f"), + MontFp!("0x1859954cfeb8695f3e8b635dcb345192892cd11223443ba7b4166e8876c0d142"), + ], + [ + MontFp!("0x04e1181763050e58013444dbcb99f1902b11bc25d90bbdca408d3819f4fed32b"), + MontFp!("0x0fdb253dee83869d40c335ea64de8c5bb10eb82db08b5e8b1f5e5552bfd05f23"), + MontFp!("0x058cbe8a9a5027bdaa4efb623adead6275f08686f1c08984a9d7c5bae9b4f1c0"), + ], + [ + MontFp!("0x1382edce9971e186497eadb1aeb1f52b23b4b83bef023ab0d15228b4cceca59a"), + MontFp!("0x03464990f045c6ee0819ca51fd11b0be7f61b8eb99f14b77e1e6634601d9e8b5"), + MontFp!("0x23f7bfc8720dc296fff33b41f98ff83c6fcab4605db2eb5aaa5bc137aeb70a58"), + ], + [ + MontFp!("0x0a59a158e3eec2117e6e94e7f0e9decf18c3ffd5e1531a9219636158bbaf62f2"), + MontFp!("0x06ec54c80381c052b58bf23b312ffd3ce2c4eba065420af8f4c23ed0075fd07b"), + MontFp!("0x118872dc832e0eb5476b56648e867ec8b09340f7a7bcb1b4962f0ff9ed1f9d01"), + ], + [ + MontFp!("0x13d69fa127d834165ad5c7cba7ad59ed52e0b0f0e42d7fea95e1906b520921b1"), + MontFp!("0x169a177f63ea681270b1c6877a73d21bde143942fb71dc55fd8a49f19f10c77b"), + MontFp!("0x04ef51591c6ead97ef42f287adce40d93abeb032b922f66ffb7e9a5a7450544d"), + ], + [ + MontFp!("0x256e175a1dc079390ecd7ca703fb2e3b19ec61805d4f03ced5f45ee6dd0f69ec"), + MontFp!("0x30102d28636abd5fe5f2af412ff6004f75cc360d3205dd2da002813d3e2ceeb2"), + MontFp!("0x10998e42dfcd3bbf1c0714bc73eb1bf40443a3fa99bef4a31fd31be182fcc792"), + ], + [ + MontFp!("0x193edd8e9fcf3d7625fa7d24b598a1d89f3362eaf4d582efecad76f879e36860"), + MontFp!("0x18168afd34f2d915d0368ce80b7b3347d1c7a561ce611425f2664d7aa51f0b5d"), + MontFp!("0x29383c01ebd3b6ab0c017656ebe658b6a328ec77bc33626e29e2e95b33ea6111"), + ], + [ + MontFp!("0x10646d2f2603de39a1f4ae5e7771a64a702db6e86fb76ab600bf573f9010c711"), + MontFp!("0x0beb5e07d1b27145f575f1395a55bf132f90c25b40da7b3864d0242dcb1117fb"), + MontFp!("0x16d685252078c133dc0d3ecad62b5c8830f95bb2e54b59abdffbf018d96fa336"), + ], + [ + MontFp!("0x0a6abd1d833938f33c74154e0404b4b40a555bbbec21ddfafd672dd62047f01a"), + MontFp!("0x1a679f5d36eb7b5c8ea12a4c2dedc8feb12dffeec450317270a6f19b34cf1860"), + MontFp!("0x0980fb233bd456c23974d50e0ebfde4726a423eada4e8f6ffbc7592e3f1b93d6"), + ], + [ + MontFp!("0x161b42232e61b84cbf1810af93a38fc0cece3d5628c9282003ebacb5c312c72b"), + MontFp!("0x0ada10a90c7f0520950f7d47a60d5e6a493f09787f1564e5d09203db47de1a0b"), + MontFp!("0x1a730d372310ba82320345a29ac4238ed3f07a8a2b4e121bb50ddb9af407f451"), + ], + [ + MontFp!("0x2c8120f268ef054f817064c369dda7ea908377feaba5c4dffbda10ef58e8c556"), + MontFp!("0x1c7c8824f758753fa57c00789c684217b930e95313bcb73e6e7b8649a4968f70"), + MontFp!("0x2cd9ed31f5f8691c8e39e4077a74faa0f400ad8b491eb3f7b47b27fa3fd1cf77"), + ], + [ + MontFp!("0x23ff4f9d46813457cf60d92f57618399a5e022ac321ca550854ae23918a22eea"), + MontFp!("0x09945a5d147a4f66ceece6405dddd9d0af5a2c5103529407dff1ea58f180426d"), + MontFp!("0x188d9c528025d4c2b67660c6b771b90f7c7da6eaa29d3f268a6dd223ec6fc630"), + ], + [ + MontFp!("0x3050e37996596b7f81f68311431d8734dba7d926d3633595e0c0d8ddf4f0f47f"), + MontFp!("0x15af1169396830a91600ca8102c35c426ceae5461e3f95d89d829518d30afd78"), + MontFp!("0x1da6d09885432ea9a06d9f37f873d985dae933e351466b2904284da3320d8acc"), + ], + [ + MontFp!("0x2796ea90d269af29f5f8acf33921124e4e4fad3dbe658945e546ee411ddaa9cb"), + MontFp!("0x202d7dd1da0f6b4b0325c8b3307742f01e15612ec8e9304a7cb0319e01d32d60"), + MontFp!("0x096d6790d05bb759156a952ba263d672a2d7f9c788f4c831a29dace4c0f8be5f"), + ], + [ + MontFp!("0x054efa1f65b0fce283808965275d877b438da23ce5b13e1963798cb1447d25a4"), + MontFp!("0x1b162f83d917e93edb3308c29802deb9d8aa690113b2e14864ccf6e18e4165f1"), + MontFp!("0x21e5241e12564dd6fd9f1cdd2a0de39eedfefc1466cc568ec5ceb745a0506edc"), + ], + [ + MontFp!("0x1cfb5662e8cf5ac9226a80ee17b36abecb73ab5f87e161927b4349e10e4bdf08"), + MontFp!("0x0f21177e302a771bbae6d8d1ecb373b62c99af346220ac0129c53f666eb24100"), + MontFp!("0x1671522374606992affb0dd7f71b12bec4236aede6290546bcef7e1f515c2320"), + ], + [ + MontFp!("0x0fa3ec5b9488259c2eb4cf24501bfad9be2ec9e42c5cc8ccd419d2a692cad870"), + MontFp!("0x193c0e04e0bd298357cb266c1506080ed36edce85c648cc085e8c57b1ab54bba"), + MontFp!("0x102adf8ef74735a27e9128306dcbc3c99f6f7291cd406578ce14ea2adaba68f8"), + ], + [ + MontFp!("0x0fe0af7858e49859e2a54d6f1ad945b1316aa24bfbdd23ae40a6d0cb70c3eab1"), + MontFp!("0x216f6717bbc7dedb08536a2220843f4e2da5f1daa9ebdefde8a5ea7344798d22"), + MontFp!("0x1da55cc900f0d21f4a3e694391918a1b3c23b2ac773c6b3ef88e2e4228325161"), + ], + ]; +} + +mod x5_254_5 { + use ark_ff::MontFp; + pub type Field = ark_bn254::Fr; + pub const ALPHA: u64 = 5; + pub const R_F: usize = 8; + pub const R_P: usize = 60; + pub const N: usize = 5; + pub const R: usize = 4; + + pub const MDS: &'static [[Field; N]] = &[ + [ + MontFp!("0x251e7fdf99591080080b0af133b9e4369f22e57ace3cd7f64fc6fdbcf38d7da1"), + MontFp!("0x25fb50b65acf4fb047cbd3b1c17d97c7fe26ea9ca238d6e348550486e91c7765"), + MontFp!("0x293d617d7da72102355f39ebf62f91b06deb5325f367a4556ea1e31ed5767833"), + MontFp!("0x104d0295ab00c85e960111ac25da474366599e575a9b7edf6145f14ba6d3c1c4"), + MontFp!("0x0aaa35e2c84baf117dea3e336cd96a39792b3813954fe9bf3ed5b90f2f69c977"), + ], + [ + MontFp!("0x2a70b9f1d4bbccdbc03e17c1d1dcdb02052903dc6609ea6969f661b2eb74c839"), + MontFp!("0x281154651c921e746315a9934f1b8a1bba9f92ad8ef4b979115b8e2e991ccd7a"), + MontFp!("0x28c2be2f8264f95f0b53c732134efa338ccd8fdb9ee2b45fb86a894f7db36c37"), + MontFp!("0x21888041e6febd546d427c890b1883bb9b626d8cb4dc18dcc4ec8fa75e530a13"), + MontFp!("0x14ddb5fada0171db80195b9592d8cf2be810930e3ea4574a350d65e2cbff4941"), + ], + [ + MontFp!("0x2f69a7198e1fbcc7dea43265306a37ed55b91bff652ad69aa4fa8478970d401d"), + MontFp!("0x001c1edd62645b73ad931ab80e37bbb267ba312b34140e716d6a3747594d3052"), + MontFp!("0x15b98ce93e47bc64ce2f2c96c69663c439c40c603049466fa7f9a4b228bfc32b"), + MontFp!("0x12c7e2adfa524e5958f65be2fbac809fcba8458b28e44d9265051de33163cf9c"), + MontFp!("0x2efc2b90d688134849018222e7b8922eaf67ce79816ef468531ec2de53bbd167"), + ], + [ + MontFp!("0x0c3f050a6bf5af151981e55e3e1a29a13c3ffa4550bd2514f1afd6c5f721f830"), + MontFp!("0x0dec54e6dbf75205fa75ba7992bd34f08b2efe2ecd424a73eda7784320a1a36e"), + MontFp!("0x1c482a25a729f5df20225815034b196098364a11f4d988fb7cc75cf32d8136fa"), + MontFp!("0x2625ce48a7b39a4252732624e4ab94360812ac2fc9a14a5fb8b607ae9fd8514a"), + MontFp!("0x07f017a7ebd56dd086f7cd4fd710c509ed7ef8e300b9a8bb9fb9f28af710251f"), + ], + [ + MontFp!("0x2a20e3a4a0e57d92f97c9d6186c6c3ea7c5e55c20146259be2f78c2ccc2e3595"), + MontFp!("0x1049f8210566b51faafb1e9a5d63c0ee701673aed820d9c4403b01feb727a549"), + MontFp!("0x02ecac687ef5b4b568002bd9d1b96b4bef357a69e3e86b5561b9299b82d69c8e"), + MontFp!("0x2d3a1aea2e6d44466808f88c9ba903d3bdcb6b58ba40441ed4ebcf11bbe1e37b"), + MontFp!("0x14074bb14c982c81c9ad171e4f35fe49b39c4a7a72dbb6d9c98d803bfed65e64"), + ], + ]; + + pub const ARK: &'static [[Field; N]; R_F + R_P] = &[ + [ + MontFp!("0x0eb544fee2815dda7f53e29ccac98ed7d889bb4ebd47c3864f3c2bd81a6da891"), + MontFp!("0x0554d736315b8662f02fdba7dd737fbca197aeb12ea64713ba733f28475128cb"), + MontFp!("0x2f83b9df259b2b68bcd748056307c37754907df0c0fb0035f5087c58d5e8c2d4"), + MontFp!("0x2ca70e2e8d7f39a12447ac83052451b461f15f8b41a75ef31915208f5aba9683"), + MontFp!("0x1cb5f9319be6a45e91b04d7222271c94994196f12ed22c5d4ec719cb83ecfea9"), + ], + [ + MontFp!("0x2eb4f99c69f966ebf8a42192de7ff61621c7bb47b93750c2b9ea08d18446c122"), + MontFp!("0x224a28e5a35385a7c5198169e405d9ea0fc7da8b93ee13b6d5f7d099e299520e"), + MontFp!("0x0f7411b465e600eed8afdd6afca49c3036f33ecbd9a0f97823796b993bbd82f7"), + MontFp!("0x0f9d0d5aad2c9555a2be7150392d8d9819b208ae3370f99a0626f9ff5d90e4e3"), + MontFp!("0x1e9a96dc8292bb596f52a59538d329229732b25259cf744b6a12d30702d6fba0"), + ], + [ + MontFp!("0x08780514ccd90380887d578c45555e593cfe52eab4b945c6c2cd4d528fb3fe3c"), + MontFp!("0x272498fced686c7ac8149fa3f73ef8c2ced64717e3556d5a59f119d629ccb5fc"), + MontFp!("0x01ef8f9dd7c93aac4b7cb80930bd06eb45bd350aff585f10e3d0ef8a782ef7df"), + MontFp!("0x045b9f59b6595e614dc08f222b469b138e886e64bf3c40aa97ea0ae754934d30"), + MontFp!("0x0ac1e91c57d9da919fd6f59d2a40ff8ea3e41e24e247a387adf2584295d61c66"), + ], + [ + MontFp!("0x028a1621a94054b0c7f9a421353cd89d0fd67061aee99979d12e68f04e62d134"), + MontFp!("0x26b41802c071ea4c9632647ed059236e50c19c3fb3c96d09d02aae2a0dcd9dbc"), + MontFp!("0x2fb5dda8072bb72cbaac2f63e468215e05c9de06758db6a94af34384aedb462b"), + MontFp!("0x2212d3a0f5fccaf244ff3547fd823249ad8ab8ba2a18d383dd05c56ee894d850"), + MontFp!("0x1b041ad5b2f0684258e4dfaeea09be56a3276fdb19f44c015cd0c7eed465e2e3"), + ], + [ + MontFp!("0x0a01776bb22f4b6b8eccff33e76fded3144fb7e3ac14e846a91e64afb1500eff"), + MontFp!("0x2b7b5674aaecc3cbf34d3f275066d549a4f33ae8c15cf827f7936440810ace43"), + MontFp!("0x29d299b80cd4489e4cf75779ed54b48c60b042257b78fc004c1b803381a3bdfd"), + MontFp!("0x1c46831d9a74529357641c219d721a74a427110032b5e1dd19dde30424be401e"), + MontFp!("0x06d7626c953ccb72f37141dc34d578e036296c0657674f80739ae1d883e91269"), + ], + [ + MontFp!("0x28ffddc86f18c136c54002748e0c410edc5c440a3022cd960f108c71cda2930c"), + MontFp!("0x2e67f7ee5e4aa295f85deed09e400b17be67f1b7ed2ab6adb8ec0619f6fbc5e9"), + MontFp!("0x26ce38fa636c90630e97f25114a79a2dca56859ef759e53ce7abf22c24e80f27"), + MontFp!("0x2e6e07c3c95bf7c34dd7a01d00a7ffec42cb3d16a1f72721afacb4c4cfd35db1"), + MontFp!("0x2aa74f7597f0c9f45f91d7961c3a54fb8890d276612e1246384b1470da24d8cc"), + ], + [ + MontFp!("0x287d681a46a2faae2c7c090f668ab45b8a71313c1509183e2ec0ca639b7f73fe"), + MontFp!("0x212bd19df812eaaef4a40600528f3d7da5d3106ff565aa3b11e29f3305e73c04"), + MontFp!("0x1154f7cf519186bf1aafb14b350eb860f97fd9740926dab93809c28404713504"), + MontFp!("0x1dff6385cb31f1c24637810a4bd1b16fbf5152905be36583da747e79661fc207"), + MontFp!("0x0e444582d22b4e76c081d34c44c18e424011a34d5476252863ea3c606b551e5c"), + ], + [ + MontFp!("0x0323c9e433ba66c4abab6638328f02f1815773e9c2846323ff72d3aab7e4eff8"), + MontFp!("0x12746bbd71791059193bba79cdec448f25b8cf002740112db70f2c6876a9c29d"), + MontFp!("0x1173b7d112c2a798fd9b9d3751842c75d466c837cf50d73efd049eb4438a2240"), + MontFp!("0x13d51c1090a1ad4876d1e555d7fed13da8e5713b25026ebe5fdb4808703243da"), + MontFp!("0x00874c1344a4ad51ff8dcb7cbd2d9743cb72743f0394efe7f4a58ebeb956baa1"), + ], + [ + MontFp!("0x22df22131aaab85865ce236b07f244fa0eea48d3546e97d6a32a562074fef08f"), + MontFp!("0x0bf964d2dbd25b908708b437a445fc3e984524a59101e6c18bf5eb05a919f155"), + MontFp!("0x09b18d9b917a55bca302be1f7f181e0e640b9d73a9ab298c69b435b5fc502f32"), + MontFp!("0x094f5534444fae36a4bfc1d5bf3dc05bfbbbc70a6365366dd6745a5067289e43"), + MontFp!("0x2999bab1a5f25210519fa6622af53a15a3e240c0da5701cb784fddc0dc23f01f"), + ], + [ + MontFp!("0x2f6898c07581f6371ca94db73710e88084301bce8a93d13669575a11b03a3d23"), + MontFp!("0x07268eaaba08bc19ec16d7e1318a4740565deb1e8e5742f862174b1a6866fccb"), + MontFp!("0x186279b003454db01339ff77113bc9eb62603e078e1c6689a6c9582c41a0529f"), + MontFp!("0x18a3f736509197d6e4915bdd04d3e5ddb67e2cc5de9a22750768e5524737172c"), + MontFp!("0x0a21fa1988cf38d877cc1e2ed24c808c725e2d4bcb2d3a007b5987b87085671d"), + ], + [ + MontFp!("0x15b285cbe26c467f1faf5ef6a64625228328c184a2c43bc00b36a135e785fba2"), + MontFp!("0x164b7062c4671cf08c08b8c3f9806d560b7775b7c902f5788cd28de3e779f161"), + MontFp!("0x0890ba0819ac0a6f86d9865fe7e50ef361c61d3d43b6e65d7a24f651249baa70"), + MontFp!("0x2fbea4d65d7ed425a42712e5a721e4eaa627ac5cb0eb878ccc2ee0aed543e922"), + MontFp!("0x0492bf383c36fa55540303a3b536f85e7b70a58e854ab9b9103d7f5f379abaaa"), + ], + [ + MontFp!("0x05e91fe944e944104e20251c565142d61d6185a9ce85675f6a969d56292dc24e"), + MontFp!("0x12fe5c2029e4b33893d463cb041acad0995b9621e6e49c3b7e380a76e36e6c1c"), + MontFp!("0x024154adf0255d47958f7723921474131f2629fadc89496906cd01dc6fa0784e"), + MontFp!("0x18824a09e6afaf4a36ed2462a86bd0bad798815644f2bbde8813c13457a45550"), + MontFp!("0x0c8b482dba0ad51be9f255de0c3dbddddf84a630af68d50bbb06983e3d5d58a5"), + ], + [ + MontFp!("0x17325fd0ab635871363e0a1667d3b67c5a4fa67fcd6aaf86441392878fdb05e6"), + MontFp!("0x050ae95f6d2f1519122f5af67b690f31e550773fa8d18bf71cc6d0e911fa402e"), + MontFp!("0x0f0d139a0e81e943038cb288d62636764bbb6295f07569885771ec84edc50c40"), + MontFp!("0x1c0f8697795689cdf70fd2f2c0f93d1a79b39ebc7a1b1c549dbbca7b8e747cd6"), + MontFp!("0x2bd0f940ad936b796d2bc2e048bc979e49be23a4b13598f9fe536a16dc1d81e6"), + ], + [ + MontFp!("0x27eb1be27c9c4e934778c09a0053337fa06ebb275e096d167ce54d1e96ee62cb"), + MontFp!("0x2e4889d830a67e5a8f96bdd3155a7ca3284fbd307d1f71b0f151be62548e2aea"), + MontFp!("0x193fe3db0ab47d3c5d2ec5e9c5bd9983c9891f2cadc165db6064bbe6fcc1e305"), + MontFp!("0x2bf3086e96c36c7bce415907ad0c40ed6e9661c009679e4e37cb13027c83e525"), + MontFp!("0x12f16e2de6d4ad46a98cdb697c6cad5dd5e7e413f741ccf29ff2ea486e59bb28"), + ], + [ + MontFp!("0x2a72147d230119f3a0262e3653ddd19f33f3d5d6ec6c4bf0ad919b0343b92d2f"), + MontFp!("0x21be0e2c4bfd64e56dc47f957806dc5f0a2d9bcc26412e2977df79acc10ba974"), + MontFp!("0x0e2d7e1dc946d70b2749a3b54367b25a71b84fb911aa57ae137fd4b6c21b444a"), + MontFp!("0x2667f7fb5a4fa1246170a745d8a4188cc31adb0eae3325dc9f3f07d4b92b3e2e"), + MontFp!("0x2ccc6f431fb7400730a783b66064697a1550c12b08dfeb72830e107da78e3405"), + ], + [ + MontFp!("0x08888a94fc5a2ca34f0201462420001fae6dbee9e8ca0c242ec50621e38e6e5d"), + MontFp!("0x02977b34eeaa3cb6ad40dd42c9b6fdd7a0d2fbe753af88b36acfcd3ccbc53f2a"), + MontFp!("0x120ccce13d28b75cfd6fb6c9ea13a648bfcfe0d7e6ff8e9610b5e9f971e16b9a"), + MontFp!("0x09fad2269c4a8e93c81e1b9770ea098c92787a4575b2bd73a0bf2af32f86ff3c"), + MontFp!("0x026091fd3d4c44d50a4b310e4ac6f0fa0debdb70775eeb8af630cffb60092d6f"), + ], + [ + MontFp!("0x29404aa2ba565b77bb7fba9dfb6fc3212543cc56afad6afcb904fd2bca893994"), + MontFp!("0x2749475c399aaf39d4e87c2548695b4ef1ffd86590e0827de7201351b7c883f9"), + MontFp!("0x098c842322479f7239912b50424685cba2ebe2dc2e4da70ac7557dab65ffa222"), + MontFp!("0x18cef581222b647e31238e57fead7d5c758ace14c93c4da40191d0c053b51936"), + MontFp!("0x13177839c68a5080d4e746745e43711d3cbc0ca4a108f98d63b2aa681698de60"), + ], + [ + MontFp!("0x020ca696f531e43ec088f56f4b74325626cc4df712c0e5f0a907d88e5f0deffd"), + MontFp!("0x27230eede9cccfc9fa805a30fc548db693d13708c646841d16e028387c7ac022"), + MontFp!("0x01645911c1198b01d64fde34a342a1786497c05969a015439057d2fe75bb281c"), + MontFp!("0x2c323fe16481bf496e439c88341ce25f198971e14487056cfdca4a451a5d8643"), + MontFp!("0x0fc082dfe70728e8450bd2074c3e22e1b022c124d3bffe8b5af88ae6db5085c8"), + ], + [ + MontFp!("0x2052c174800db209d8cdca568dcc25b3be9642116ac4c77efe8a488b423521ee"), + MontFp!("0x28e420e10df2fbb5af96d621d55423190be351ce8129065a8dd9fd05b3ece9c0"), + MontFp!("0x25698ca5e24a1b799f783c4462a24db655d6ae1bdacd1cb549d6e0bc3ae5069a"), + MontFp!("0x160a9981a5c89a57cf8ffbfa57d51049a297b61074422ac134d9b857d6984d35"), + MontFp!("0x21c91a39e145c3bc34d9b694b843f3bf8b7cebf59ddbb0a064642b069997f3d4"), + ], + [ + MontFp!("0x1ac8d80dcd5ee876d2b09345ef112345d6eaa029d93f03b6d10975461e41734c"), + MontFp!("0x0ab3e6ad0ecf8b8e7c1662a4174c52225d822895e2755544b8dbcea5657ce02c"), + MontFp!("0x1c675182512620ae27e3b0b917b3a21ca52ef3ef5909b4e1c5b2237cbdab3377"), + MontFp!("0x2cdbc998dfd7affd3d948d0c85bad2e2e37a4a3e07a7d75d0c8a9092ac2bed45"), + MontFp!("0x23b584a56e2117b0774bf67cc0dee33324337350309dff833e491a133bb63b2e"), + ], + [ + MontFp!("0x1e9e2b310f60ba9f8cb73030a3c9d2a10d133bc6ba4ec1152f3d20de1465e9a5"), + MontFp!("0x0e01e365ba5b3031abc3e720140ae746c9ab5dab987520c460bcd4f1fa5b22db"), + MontFp!("0x040884cdcfc64bfc7b7127340498d5c443382011b61c9a4b1387d85bc1264e68"), + MontFp!("0x190b1ee1205eb9500c74a3998f2bea36353f1724d6067ed0a0a17de311ef9668"), + MontFp!("0x1647c72aec6c4388d04f52fc23cd9c08c1dfcf65ce61e165fc28d1f832bd3b2c"), + ], + [ + MontFp!("0x2430006346a0145f799880cc4c8736269f5494d89fb48b02842e595b71e4541d"), + MontFp!("0x177b9a08343917e1365107a3da3ae7f69d853902bb16bacb3221850252b757af"), + MontFp!("0x04a420e642b11ae94e58862a68f5e32609cd53d0ae29423439b11d04666df4f8"), + MontFp!("0x25d0e0f739fb39fc105a88fab0afd810de2461858e956ccccdfabeddb6a25c8f"), + MontFp!("0x04476d91b7eff2fd85905cbf58651edc320cb15610eaed452c4d4ffa0c740a27"), + ], + [ + MontFp!("0x1090c0b68b3d7d7b8bc9ca2419eb8dea1c28f6d5e1250cb5e9780fd9ca286fae"), + MontFp!("0x25393ce3b9256d50448a725c5c7cd5ad376f2d435855c10ebf2899cb5c6617be"), + MontFp!("0x25931c0c7371f4f1fc862f306e6e5830ed824388d6b9342697d144f0fab46630"), + MontFp!("0x2396cb501700bbe6c82aad51b0fb79cf8a4d353185d5808203f73f22afbf62f6"), + MontFp!("0x26a363483348b58954ea748a7129a7b0a3dc9068c3cca7b5b3f0ce03b8724884"), + ], + [ + MontFp!("0x27ca107ca204f2a18d6f1535b92c5478c99b893334215f6ba7a0e5b45fcd6897"), + MontFp!("0x26da28fc097ed77ce4662bde326b2cceac15f7301178581d8d2d02b3b2d91056"), + MontFp!("0x056ab351691d8bb3703e3055070ac9cc655774c1bb35d57572971ba56ee0cb89"), + MontFp!("0x2638b57f23b754aec76d109a2f481aa3c22547a11ffc50152d729af632376a90"), + MontFp!("0x304754bb8c57d60732f492c2605184fdc33e46a532bdec80ea7bc5519ede7cef"), + ], + [ + MontFp!("0x00d1727f8457ee03514f155b5806cbf748ec6857fc554010752ac93a9b7619ac"), + MontFp!("0x00ee1f3c66fbc05c43ba295a303c72fab5bca86805ec9419c588e50947761fa3"), + MontFp!("0x0afafadcf5b4dd4a4a76b5a1d82415fd10a19fbcfc59078c61f9297eb675d972"), + MontFp!("0x0b2449f39746085e86ce45e8eed108ee65a234835a0a6a5ea8996d124dd04d0a"), + MontFp!("0x206b0ce2f1b2c5b7c9f37b0045227095f6c6f071ec3bdda76a7ddf4823dd5dd6"), + ], + [ + MontFp!("0x0feba4fb87834c7cb696e67433628cd6caffc3a4ef20fea852c7e1029459409c"), + MontFp!("0x254dbfac74c49b0b8926752e084e02513b06f1315e6d70e18173e972336e55d3"), + MontFp!("0x0addb1372cee4e164655168c367559e19606c5bd17910aeb37719edfa0ca8762"), + MontFp!("0x26b25b7e257f3e97c799024fb019f65c6ca4d8d81b1ae16221a589d68831d759"), + MontFp!("0x090995b79acec240413b8d4c658787e5a4657b9ab00bdb5b1960b1059e113ba3"), + ], + [ + MontFp!("0x08dbdc2e21ef11f2c57299687843cea3eb0d8e40e99131f42974178d44f73b7b"), + MontFp!("0x09e8aba671481197679faf752a0f78e342fe9c491596ab6758f170939785179f"), + MontFp!("0x1deb05180e833e45659052a7ebaf816c7efd12a7f9eec94b7bc7c683f1363d5c"), + MontFp!("0x19a70ec6bdfc9098a926efbcc04aa9ee248997e8b2c24af335fd6523e5250879"), + MontFp!("0x21d773660adafb8a879986f9aab4890566353a3777d8a3f1eb93abe10bbf1f64"), + ], + [ + MontFp!("0x09f1890f72e9dc713e20ba637b89d5d397a6b01fcd667347f6f46617841c3901"), + MontFp!("0x05af459361eb454d2a300c61e446998d48fa1f897bf219d608c2145c33b111c3"), + MontFp!("0x0fa1a1d6829f0345664a66dc75a657335f336f15f340756cfa12fc850cc8b513"), + MontFp!("0x02e47a35bcc0c3a0bda0b1c0307ad543f4280fcf87f636f853655cf97a628bb0"), + MontFp!("0x14f773e9834c6bdeb8f90e78bf4c24b7203411460112491036621895204d0f12"), + ], + [ + MontFp!("0x102d98cf502ed843255cf19d29bc7d8e642abe7cfd639992ffb091962fc8f7cc"), + MontFp!("0x043dd5f4aa5a76dd4c47f6c65da7ca2320d4c73ad3294738cba686a7e91373c2"), + MontFp!("0x21833819c3337194a6c0d29a48d4f2676f0e7c79743a306f4cfdb2b26bd11efa"), + MontFp!("0x0f281925cf5ee649b474a6819d116ca3eb4eca246c311ecadc53262a3cff2b53"), + MontFp!("0x0d3e2477a7b10beb44709c7746d6824edf625dd60504d5dc93ce662f15c238d6"), + ], + [ + MontFp!("0x2cd7f641bedbf66956ff8a01be9cde35d80f80ab51e73b49acbfc3eff5aefc44"), + MontFp!("0x29e95b492bf2f95f4d09380f98b74e389149d24045811d7a86dd861310463cf8"), + MontFp!("0x22da66bc62e8f011266efca86a6c810f9ae4c51af6ffeb57f8b3c50df83cc13e"), + MontFp!("0x0fe6d30de7a82d163023491794f4aca3220db79e8129df3643072d841925554a"), + MontFp!("0x0050e842a1299909123c46eff185c23ad312d03fef1adfecc7e07ecb298fd67f"), + ], + [ + MontFp!("0x2130a3a7b3221222be34cc53a42d7733666f9ddf714ed7c5885cbbdb63108c21"), + MontFp!("0x2df9ee294edf99e3d8d5883fe0566c24aa66731f34a93280e1d328e67b33c9fa"), + MontFp!("0x1bf7d6e489ad8c0cf26eb68cc21ff54158132396dc250aeba4b6fc5fc3372762"), + MontFp!("0x0c602fa155be958761eaf739617ab136cf7b807728bf7fe35d4778d311780e54"), + MontFp!("0x2e50e2c5b36aa20532407d86b8d22d7d5154080a24972faeb63faf0121ed7f21"), + ], + [ + MontFp!("0x17c2510982a7b5825710d6290ec4f782f674995ee8409b42b459123b180332e1"), + MontFp!("0x0b0d52f03c8af7276803ecf2465b885b21337b538eabd2f6b2ab255f376b42a8"), + MontFp!("0x0f5633df1972b9455953d88a63f80647a9ac77c6c0f85d4561972dd8fab8bd14"), + MontFp!("0x0ebf7ad29ca13804e1422e939681155124780ff43e76e929035498130a7f1572"), + MontFp!("0x1aff13c81bda47e80b02962173bba343e18f94bee27c8a57661b1103a720ffe2"), + ], + [ + MontFp!("0x210449dbf5cf3061da2465be85505862d3f31de1a3b58ff35713be57efac6c07"), + MontFp!("0x088230c2794e50c57d75cd6d3c7b9dbe19d1e2f1d3001044b93ad1c3ee629817"), + MontFp!("0x1c408c256490b0a1da08dc464138dfc78cce9a9e16c7705617a4d6dbb20e7e3a"), + MontFp!("0x074517e081eb4c1f22d1771200fb07658f7c77654d58440490dd6f557e9e3903"), + MontFp!("0x02d04e9c21df1dbd88524bdb203691b4cee5530559d6cf0fa05adf61e12fdcbf"), + ], + [ + MontFp!("0x2eb7a011b8bce91082e13ebd75de3b58eb9b4650dae9f11aa81db32cf1b67b13"), + MontFp!("0x2efda77ed35f4af0299f75d6e8a849b54d2ac6bf95368304e6030c18f0cf17b5"), + MontFp!("0x09199dcafd50ce642eddbeda65206d4f61a73d10852b8114c51b2440192ae064"), + MontFp!("0x268c5cfc446d399c4dd319db666a75b5cb655d8c1797e9fa76181cb4216e1562"), + MontFp!("0x2303a652c949071826b0e9a36c80578697b44e912cce6687012854eda11a18dc"), + ], + [ + MontFp!("0x27c53563b12a6ee2c3f041f31dc45922bc5353eb110868d237073f4efb35fbdf"), + MontFp!("0x1201a87eaf4ae618f02bd82d0a5109049969b5248cfe90f42c278f22615d2b0e"), + MontFp!("0x2c43169439fcd69ead8214997bb069becafcb1ba2c51e5706cb4b43dab2a443d"), + MontFp!("0x0683597315359040ea03c45d6984c6894f46cbb36d702e3c4fb9847e6304d944"), + MontFp!("0x03545706706eab36afb93b128febd16fb0425e158314197b77795ad3a798d183"), + ], + [ + MontFp!("0x1a33c254ec117619d35f1fc051b31728740bed23a6a37870edb393b71a0c0e6b"), + MontFp!("0x1ffe6968a4470cd567b0c002281caf996e88f71e759b87e6f338e517f1690c78"), + MontFp!("0x0fd66e03ba8808ffecb059c899fd80f4140ddd5d2a5c4483107f4e02e355b393"), + MontFp!("0x263ab69f13b966f8197394552906b17e6c8617a7bdd5d74a7be3396b7fe013ab"), + MontFp!("0x16a425e47d1110625054d5a165de413e3bd87d5aa3958fdd6eb7e03e39ba4046"), + ], + [ + MontFp!("0x2dc510a4719ec10cad752f03c673f0e253cc31d13e39e909fcc5f73af9138d9a"), + MontFp!("0x24df8e8d856c5b5e1bd1cad23d07dda3423c5179329b7a82cb4aa709a94576e5"), + MontFp!("0x2bcc94ff4fc3c76f3cd5c68915a042e87628249a01b09561bdf24a6cdce5620f"), + MontFp!("0x076c1e88dc540c8d8de54e343df7c429d3295f52c38cffe6b48be86852da97df"), + MontFp!("0x09b5f209a451ac431c051fb12d9a5e4fe40ee1601120947da990fb8e12cb46e1"), + ], + [ + MontFp!("0x205f17b0d8729e2eaa88d6a44135a6ab64e9424f55b0f1ea0683af75eb677c07"), + MontFp!("0x281c5c688836f6cf912638c38be046cd091681f0a41761720cdd1edf9f237029"), + MontFp!("0x1a053e6878e900f45f4d67448c471cf3009a44e7a02ea50e4afa44f2592621f5"), + MontFp!("0x100dc7d426debe3007fb7ceac84e4f5468efcb897e7bbee981742839d59e064c"), + MontFp!("0x17022672a016a957bb87e2cfadc8b75fb28905bdb62c82c80b1cb31b411e49c8"), + ], + [ + MontFp!("0x1086db7e2760fc8b71053a87ebe151239fb8b547182b170de0c27203f954f4d2"), + MontFp!("0x15384fe39d73b63302460ae4c2942fac2b41fb65a185536fb85dd24fd7584064"), + MontFp!("0x2ebb599fe9136d424bf4abc5342c6c7447b1a853205fcfb5519e551357709008"), + MontFp!("0x1b4b5e87cfb9262cfec3c0f0542e4c5a4cf278292b4ce3eed996fac6f4d37288"), + MontFp!("0x2465053ae50b6885801f3f82e302cafbbb4a7581bb4fba60b637febe659e5057"), + ], + [ + MontFp!("0x114f32edcdea09cd095c5bb5d38f1b97da9f05e18b3708bf6e0ab9d3d54859ef"), + MontFp!("0x2bc70dfeb2baab2f6b387cd77be779ac2e5e5519f3d18123ee28d8c2543c7148"), + MontFp!("0x01c9bf7a203ce22b775e3a61ad7e77b6a78348b9f6ec68a412e49bfe32c05415"), + MontFp!("0x0514b0fe5909ea887bedb0295fbbcec355cfb575ff6a97cd9f4ad00ccb57ee9b"), + MontFp!("0x267c76ec81934cc81a132a8b058910a12092520b12a201af03e3202d7b6c1b7e"), + ], + [ + MontFp!("0x29170e3322b3d8d5c78c84babbb470adf1622493ce83e95cfb151cf757bde5d6"), + MontFp!("0x019f6a8124b19e33af33e5d3873f9c335c6f09a45486cab536dd596ca41d9519"), + MontFp!("0x1904aa4d6908544a8b348e9db1981c27009ed8ea171518ae5405d036242b60e9"), + MontFp!("0x26f17873949bc679f7f043956694e422b3cee1de9dd6f6473b932a476455ff1a"), + MontFp!("0x1ac668f612b8243c193b33720b8aa54040c476031197131ebdcac9b18bc48f75"), + ], + [ + MontFp!("0x0996d961a75c0d07196dae45bf624766ccfbf8555be9796da52f81568ef0663d"), + MontFp!("0x030c97e1b8cad1d4fd50d1b4383fbe6674d171f99c63febb5425b395c24fc819"), + MontFp!("0x06e3ad6a46900e2d3953370255b68f89b3e523f1fe502642ee226f2d8bd0848f"), + MontFp!("0x1d6b3755331cd0216b6880e42f9880f565cb94b0e0455153a329890588cc916e"), + MontFp!("0x28e4dcba4b96f12a59b041535e730ac8c35189dc0b85ac033dd38c08bae531f2"), + ], + [ + MontFp!("0x08b6086046a835508ccf484f2974b6a6b0712a476260376c7a3b3e4bc4a47a14"), + MontFp!("0x162cd2ca7fe3b5f1444bcec97812019bb6fd85fba6a0536a89643e15b9bb3b52"), + MontFp!("0x28f1e03baaea9bbc05af5b11937e4f5cb5c9a9c1192063d1998c01c64d483a76"), + MontFp!("0x1bdb062778d7c15da395af2734c25faa0127d2aab4aa71366031a0bb6791ce10"), + MontFp!("0x2375839502e09890cb2914e829627e0e0fc98870b2324a8b50329ebdd24749cb"), + ], + [ + MontFp!("0x1fa8662fbcb61fb3ad7c55668dc9423a332dc87cfb2df456e92d33611ed7bb50"), + MontFp!("0x1e4fad2dd6b0a6f1f8707f721716c8a446e2fb2c47a5138f3f7f9736079d7694"), + MontFp!("0x211256d16c7269fd6df6f5fcdd1fa788ba3bd050059f53d261b0f5f13731ffe7"), + MontFp!("0x2e49084b336eceaa4f8e2a2e6af08318f42060e574dda341f4a1079b12bcc5a5"), + MontFp!("0x0ce19f54cdc39f7f3bf35192ac6808211aecea08dfe14cab758d25891fb00bb9"), + ], + [ + MontFp!("0x0011c5d56c390e893cc394221261d8748dc60451e4ae4e1c84a8468bab2c14cb"), + MontFp!("0x17d79ff06b63ac2a8a9e05ee6af3dbb7ca60e17bfa39b47514a8cd8051579b4c"), + MontFp!("0x19a7d3a446cb5393dc74560093592b06b1a8b35cd6416a2ecab00173639015fa"), + MontFp!("0x030c00a0933dcdba2a808b2e1b9282f331f04596d8928da7aa6c3c97237037a6"), + MontFp!("0x16bcb447ce2d50f3ae25ad080695382e935d2d00184c4acc9370be8aab64139c"), + ], + [ + MontFp!("0x12341b46b0150aa25ea4ec8715312997e62124f37cab7b6d39255b7cd66feb1d"), + MontFp!("0x0e86d13917f44050b72a97b2bf610c84002fc28e296d1044dc89212db6a49ff4"), + MontFp!("0x08e6eb4089d37d66d357e00b53d7f30d1052a181f8f2eb14d059025b110c7262"), + MontFp!("0x2ea123856245f6c84738d15dd1481a0c0415ccb351a1e0cee10c48ce97ca7b18"), + MontFp!("0x2dca72b2ebcab8c23446e00330b163104195789025413abf664db0f9c84dfa6f"), + ], + [ + MontFp!("0x06ff9ed50d327e8463329f585ec924b3f2f6b4235f036fa4c64a26cbd42b6a6b"), + MontFp!("0x246a10b7e3e0089947f7c9bda3d54df8e2a60e0cca84ea2ac630a4535afbf730"), + MontFp!("0x22a63501c5f04b9018719ed99d700ee52f846a715ae67ad75c96b39d688b6691"), + MontFp!("0x2f4c50477f7fd9c671799ac5d2e224cdb9164f58351d8aa140ec07e514fae937"), + MontFp!("0x10ffb7aad1f51c7d13b17f4d876d9a1e38f0ba8a4a23d4b50cda32cad851567e"), + ], + [ + MontFp!("0x0e9cefddc3c2d3bea4d39722532d5420784027352187e7af1a056935c35803ae"), + MontFp!("0x07af84a4d3141e7ac23352e6dc6ea4afa1656f96a33c8978a3e83bdd4ba62b41"), + MontFp!("0x2d9e31a10aebc761f8de00d14b1e566d1a39323d6e89b638e940f3ec8a22c3c5"), + MontFp!("0x27f19a6532e66b5333db1afd592f66f1d36034b314dad8447656747be27e64c7"), + MontFp!("0x0058fa3c8454d63354b2024c3b4a577a180ed99f8f3155cd7e4d617d47d07ffd"), + ], + [ + MontFp!("0x041627b6715b780967957c080699343eb0414a205d3a175d708964956816a5d5"), + MontFp!("0x006ac49dd9253edc7f632e57b958ccecd98201471cf1f66589888f12b727c52d"), + MontFp!("0x0131adffd8bd7254b1d8c3616bbe3386ec0c9c0d6d25a9a4ec46a6bf18301398"), + MontFp!("0x1c4a6f52c9fccf7a4138e413ef62a28377977ad7e25e49a3cf030e1cd8f9f5b6"), + MontFp!("0x03f2a6be51ec677f946551b3860ea479fee048ae2078aeb7d1f7958d2c2645f6"), + ], + [ + MontFp!("0x2da770aad2c2eb09391a0cb78ef3a9648a1372d8543119564d7376396b8ddc62"), + MontFp!("0x15278463665f74cddc1802febfab02cec9d45fe866c359c738062afb75d64a03"), + MontFp!("0x12fe278aa36544eac9731027090518d434e38ea966a08a6f8d580638ac54c773"), + MontFp!("0x149b9c802182558a4c45d119d3f4cc7fd8587604ca4f0d6e21b06ff30b6a23b6"), + MontFp!("0x0812e7b4d847bc8517d19319772f3c9855e044fd60dbac9a0adc4959b691dfe4"), + ], + [ + MontFp!("0x02ed8d8ddeafe3d9d8df7f28a0bfaa7f555813c7e7503aea2a66973703a0c61b"), + MontFp!("0x0ebd073ba0537b514deb6029f921029e55e5e4d9a03d6b6ba1304038662d4db8"), + MontFp!("0x15c754d5b14b2c4205c6ba8d2ccd028255b3e792c6afa08b44ee75b62eff9f59"), + MontFp!("0x169515c89ac5479db0ed8fa6fa311b391cc1235270f4cbc5c29e7cbc30e8732a"), + MontFp!("0x25479fbfb3a68f982388f2621001101608bdc29f6ff037696d9161f5cd9a4fef"), + ], + [ + MontFp!("0x14475c4bd520451f3c852cb0311a578ca7f8e6e972182196ce09486e94be6071"), + MontFp!("0x045a691066cc66bec9baf2798833a1dfd3a847502aec8d5f5c4e73363d097799"), + MontFp!("0x26029c0c267c799fb833ac8a11e3a3f0147a8ca037221b90013b8bcb37eba683"), + MontFp!("0x163facb34ff572fbf7c946969c1c260873ce12a6a94a3e45b8101d5b948d1641"), + MontFp!("0x2c714e96e1913b351d969320cc69d5ec13e06a6275e58688af8ee00c4240ee28"), + ], + [ + MontFp!("0x1c1661e2a7ce74b75aba84665ecd2bf9ddd6268f06debfe2d52b804eff1d5fa6"), + MontFp!("0x06a69ae795ee9bfe5e5af3e6619a47d26635b34c2a0889fea8c3c068b7dc2c71"), + MontFp!("0x113d58535d892115c5d28b4c19a3609374dbdbadf54195c731416c85d731d46a"), + MontFp!("0x2ab89102e2b8d5e638ff97d761da6042e534f1ff47f7917a2ca1a74063b46101"), + MontFp!("0x03c11ca79e41fdfe962730c45e699546349031893da2b4fd39804fd6a15ad1b3"), + ], + [ + MontFp!("0x27096c672621403888014ddbbbfc9da1f7f67b4d4cfe846c6adf040faaf2669c"), + MontFp!("0x2de32ad15497aef4d504d4deeb53b13c66db790ce486130caa9dc2b57ef5be0d"), + MontFp!("0x0dc108f2b0a280d2fd5d341310722a2d28c738dddaec9f3d255754448eefd001"), + MontFp!("0x1869f3b763fe8164c96858a1bb9efad5bcdc3eebc409be7c7d34ca50365d832f"), + MontFp!("0x022ed3a2d9ff31cbf82559fe6a911843b616945e16a568d48c6d33767129682d"), + ], + [ + MontFp!("0x2155d6005210169e3944ed1365bd0e7292fca1f27c19c26610c6aec077d026bc"), + MontFp!("0x0de1ba7a562a8f7acae93263f5f1b4bbec0c0556c91af3db3ea5928c8caeae85"), + MontFp!("0x05dbb4406024beabcfce5bf46ec7da38126f740bce8d637b6351dfa7da902563"), + MontFp!("0x05d4149baac413bed4d8dc8ad778d32c00e789e3fcd72dccc97e5427a368fd5e"), + MontFp!("0x01cdf8b452d97c2b9be5046e7397e76ff0b6802fa941c7879212e22172c27b2e"), + ], + [ + MontFp!("0x1fc6a71867027f56af8085ff81adce33c4d7c5015eced8c71b0a22279d46c07c"), + MontFp!("0x1040bef4c642d0345d4d59a5a7a3a42ba9e185b75306d9c3568e0fda96aaafc2"), + MontFp!("0x16b79c3a6bf316e0ff2c91b289334a4d2b21e95676431918a8081475ab8fad0d"), + MontFp!("0x20dff1bc30f6db6b434b3a1387e3c8c6a34070e52b601fc13cbe1cdcd59f474e"), + MontFp!("0x0212ac2ab7a6eaaec254955030a970f8062dd4171a726a8bdfb7fd8512ae060d"), + ], + [ + MontFp!("0x2f29377491474442869a109c9215637cb02dc03134f0044213c8119f6996ae09"), + MontFp!("0x0984ca6a5f9185d525ec93c33fea603273be9f3866aa284c5837d9f32d814bfa"), + MontFp!("0x0d080a6b6b3b60700d299bd6fa81220de491361c8a6bd19ceb0ee9294b24f028"), + MontFp!("0x0e65cd99e84b052f6789530638cb0ad821acc85b6400264dce929ed7c85a4544"), + MontFp!("0x2e208875bc7ac1224808f72c716cd05ee30e3d20380ff6a655975da12736920b"), + ], + [ + MontFp!("0x2989f3ae477c2fd376a0b0ff3d7dfac1ae2e3b894afd29f64a60d1aa8592bad5"), + MontFp!("0x11361ce544e941379222d101e6fac0ce918106a463290a3e3a74c3cea7189459"), + MontFp!("0x1e8d014b86cb5a7da539e10c173f6a75d122a822b8fb366c34c8bd05a2061438"), + MontFp!("0x173f65adec8deee27ba812ad29558e23a0c2324167ef6c91212ee2c28ee98733"), + MontFp!("0x01c36daaf9f01f1bafee8bd0c779ac3e5da5df7ad45499d0991bd695310eddd9"), + ], + [ + MontFp!("0x1353acb08c05adb4aa9ab1c485bb85fff277d1a3f2fc89944a6f5741f381e562"), + MontFp!("0x2e5abd2537207cad1860e71ea1188ee4009d33deb4f93aeb20f1c87a3b064d34"), + MontFp!("0x191d5c5edaef42d3d02eedbb7ab8562513deb4eb34913a13421726ba8f69455c"), + MontFp!("0x11d7f8d1f269264282a263fea6d7599d82a04c74c127de9dee7939dd2dcd089e"), + MontFp!("0x04218fde366829ed90f79ad5e67997973445cb4cd6bc6f951bad085286cac971"), + ], + [ + MontFp!("0x0070772f7cf52453048397ca5f47a202027b73b489301c3227b71c730d76d6dd"), + MontFp!("0x038a389baef5d9a7c865b065687a1d9b67681a98cd051634c1dc04dbe3d2b861"), + MontFp!("0x09a5eefab8b36a80cda446b2b4b59ccd0f39d00966a50beaf19860789015a6e5"), + MontFp!("0x01b588848b8b47c8b969c145109b4b583d9ec99edfacb7489d16212c7584cd8c"), + MontFp!("0x0b846e4a390e560f6e1af6dfc3341419545e5abfa323d817fed91e30d42954a6"), + ], + [ + MontFp!("0x23a6679c7d9adb660d43a02ddb900040eb1513bc394fc4f985cabfe85ce72fe3"), + MontFp!("0x2e0374a699197e343e5caa35f1351e9f4c3402fb7c85ecccf72f31d6fe089254"), + MontFp!("0x0752cd899e52dc4d7f7a08af4cde3ff64b8cc0b1176bb9ec37d41913a7a27b48"), + MontFp!("0x068f8813127299dac349a2b6d57397a50275142b664b802c99e2873dd7ae55a7"), + MontFp!("0x2ba70a102355d549677574167434b3f986872d04a295b5b8b374330f2da202b5"), + ], + [ + MontFp!("0x2c467af88748abf6a334d1df03b5521309f9099b825dd289b8609e70a0b50828"), + MontFp!("0x05c5f20bef1bd82701009a2b448ae881e3a52c2d1a31957296d29e5763e8f497"), + MontFp!("0x0dc6385fdc567be5842a381f6006e2c60cd083a2c649d9f23ac8c9fe61b73871"), + MontFp!("0x142d3983f3dc7f7e19d49911b8670fa70378d5b84150d25ed255baa8114b369c"), + MontFp!("0x29a01efb2f6aa894fd7e6d98c96a0fa0f36f86a7a99aa35c00fa18c1b2df67bf"), + ], + [ + MontFp!("0x0525ffee737d605138c4a5066644ec630ab9e8afc64555b7d2a1af04eb613a76"), + MontFp!("0x1e807dca81d79581f076677ca0e822767e164f614910264ef177cf4238301dc8"), + MontFp!("0x0385fb3f89c74dc993510816472474d34c0223e0f733a52fdba56082dbd8757c"), + MontFp!("0x037640dc1afc0143e1a6298e53cae59fcfabd7016fd6ef1af558f337bab0ea01"), + MontFp!("0x1341999a1ed86919f12a6c5260829eee5fd56cf031da8050b7e4c0de896074b4"), + ], + [ + MontFp!("0x069eb075866b0af356906d4bafb10ad773afd642efdcc5657b244f65bed8ece7"), + MontFp!("0x171c0b81e62136e395b38e8e08b3e646d2726101d3afaa02ea1909a619033696"), + MontFp!("0x2c81814c9453f51cb6eb55c311753e84cbbdcb39bfe696f95575107502acced8"), + MontFp!("0x29d843c0415d35d9e3b33fadcf274b2ab04b39032adca92ce39b8a86a7c3a604"), + MontFp!("0x085d6a1070f3513d8436bccdabb78750d8e15ea5947f2cdaa7669cf3fae7728b"), + ], + [ + MontFp!("0x11820363ed541daa10a44ba665bf302cdbf1dd4e6706b02c9e2a5cda412fc394"), + MontFp!("0x201935a58f5c57fc02b60d61a83785bddfd3150e05f1df5d105840b751a16317"), + MontFp!("0x0a8c2820c56971aae27a952abd33a03d46794eedd686cd8ecfed610e87c02e9a"), + MontFp!("0x180638ff301a64ca04abd6d0bd7500b6650b65ff33e6be1fd50dbc163a281877"), + MontFp!("0x095c716266f1de59044f97114a4158a3f85ca8a937cfbec63e9b321a812dd36b"), + ], + [ + MontFp!("0x17c31ea02fbc378320d86ffed6c7ca1583b618c5c1a687818d4087a497d73490"), + MontFp!("0x05b86c4bb8ef318b6a7227e4192d149d3c17a9764ccd660de4d50a77f192a91b"), + MontFp!("0x265bc95df4a4c4876ff70d7ea2fde2c7ab15f4a6ae0d237cd6ce74ba986c7a7b"), + MontFp!("0x24752b47bc6c6bc8d9bbe48f5fef2f6908701739c5f5b4b3d6c886d4715c7929"), + MontFp!("0x14814a1e0f492a4ea0d86e527a96482178d624b98da96ee5e583b9324d974efe"), + ], + [ + MontFp!("0x10def931073b6479bd60577378f29381997c8e041d3cfb3dc7523bca906f00bd"), + MontFp!("0x14f7ae770bf7e95f7f706c0d8ab4ed03fa0b880d28c69d031b4592c98610175f"), + MontFp!("0x1aef50a0cee751b59f926af40e8035d19decc9d428ebe4e775c5cc9dce1ce589"), + MontFp!("0x041935607172f68eba65ca60068dfe3b086c2a2d57d09602951214b57e73cf5a"), + MontFp!("0x26863e9dd24255d1573bd083959b856c0493fbefe83c819837a151d3bf452cb8"), + ], + [ + MontFp!("0x2036efb6f9830965eb3d7a068bd087c9f5adf251ba62052c652738e63ff8b3af"), + MontFp!("0x0c712a975b74dc9d766b639a029969ca30be4f75a753f854b00fa4f1b4f4ee9b"), + MontFp!("0x08014dab3cd1667e27afc99bfac1e6807afdff6456492ca3375731d387539699"), + MontFp!("0x198d07192db4fac2a82a4a79839d6a2b97c4dd4d37b4e8f3b53009f79b34e6a4"), + MontFp!("0x29eb1de42a3ad381b23b4131426897a32709b29d53bb946dfd15784d1f63e572"), + ], + ]; +} diff --git a/nimue-poseidon/src/lib.rs b/nimue-poseidon/src/lib.rs index 651cd0f..fb97ae8 100644 --- a/nimue-poseidon/src/lib.rs +++ b/nimue-poseidon/src/lib.rs @@ -1,13 +1,18 @@ //! This code has been blatantly stolen from `ark-crypto-primitive::sponge` //! from William Lin, with contributions from Pratyush Mishra, Weikeng Chen, Yuwen Zhang, Kristian Sosnin, Merlyn, Wilson Nguyen, Hossein Moghaddas, and others. -use ark_ff::PrimeField; +use std::fmt::Debug; +use ark_ff::PrimeField; use nimue::hash::sponge::DuplexSponge; use nimue::hash::sponge::Sponge; use nimue::hash::Unit; +/// Poseidon Sponge. +/// +/// The `NAME` const is to distinbuish between different bitsizes of the same Field. +/// For instance Bls12_381 and Bn254 both have field type Fp, 4> but are different fields. #[derive(Clone)] -pub struct PoseidonSponge { +pub struct PoseidonSponge { /// Number of rounds in a full-round operation. pub full_rounds: usize, /// Number of rounds in a partial-round operation. @@ -24,21 +29,26 @@ pub struct PoseidonSponge { pub state: [F; N], } -pub type PoseidonHash = DuplexSponge>; +pub type PoseidonHash = + DuplexSponge>; -impl AsRef<[F]> for PoseidonSponge { +impl AsRef<[F]> + for PoseidonSponge +{ fn as_ref(&self) -> &[F] { &self.state } } -impl AsMut<[F]> for PoseidonSponge { +impl AsMut<[F]> + for PoseidonSponge +{ fn as_mut(&mut self) -> &mut [F] { &mut self.state } } -impl PoseidonSponge { +impl PoseidonSponge { fn apply_s_box(&self, state: &mut [F], is_full_round: bool) { // Full rounds apply the S Box (x^alpha) to every element of state if is_full_round { @@ -52,35 +62,37 @@ impl PoseidonSponge { } } + #[inline] fn apply_ark(&self, state: &mut [F], round_number: usize) { - for (i, state_elem) in state.iter_mut().enumerate() { - state_elem.add_assign(&self.ark[round_number][i]); - } + state.iter_mut().enumerate().for_each(|(i, state_elem)| { + *state_elem += self.ark[round_number][i]; + }); } fn apply_mds(&self, state: &mut [F]) { - let mut new_state = Vec::new(); - for i in 0..state.len() { + let mut new_state = [F::ZERO; N]; + for i in 0..N { let mut cur = F::zero(); - for (j, &state_elem) in state.iter().enumerate() { - let term = state_elem * self.mds[i][j]; - cur.add_assign(&term); + for j in 0..N { + cur += state[j] * self.mds[i][j]; } - new_state.push(cur); + new_state[i] = cur; } - state.clone_from_slice(&new_state[..state.len()]) + state.clone_from_slice(&new_state); } } -impl zeroize::Zeroize for PoseidonSponge { +impl zeroize::Zeroize + for PoseidonSponge +{ fn zeroize(&mut self) { self.state.zeroize(); } } -impl Sponge for PoseidonSponge +impl Sponge for PoseidonSponge where - PoseidonSponge: Default, + PoseidonSponge: Default, F: PrimeField + Unit, { type U = F; @@ -103,16 +115,14 @@ where self.apply_mds(&mut state); } - for i in full_rounds_over_2..(full_rounds_over_2 + self.partial_rounds) { - self.apply_ark(&mut state, i); + for i in 0..self.partial_rounds { + self.apply_ark(&mut state, full_rounds_over_2 + i); self.apply_s_box(&mut state, false); self.apply_mds(&mut state); } - for i in - (full_rounds_over_2 + self.partial_rounds)..(self.partial_rounds + self.full_rounds) - { - self.apply_ark(&mut state, i); + for i in 0..full_rounds_over_2 { + self.apply_ark(&mut state, full_rounds_over_2 + self.partial_rounds + i); self.apply_s_box(&mut state, true); self.apply_mds(&mut state); } @@ -120,23 +130,26 @@ where } } +impl Debug + for PoseidonSponge +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.state.fmt(f) + } +} + /// Initialization of constants. #[allow(unused)] macro_rules! poseidon_sponge { - ($name: ident, $path: tt) => { - pub type $name = nimue::hash::sponge::DuplexSponge< - crate::PoseidonSponge<$path::Field, { $path::R }, { $path::N }>, - >; + ($bits: expr, $name: ident, $path: tt) => { + pub type $name = crate::PoseidonSponge<$bits, $path::Field, { $path::R }, { $path::N }>; - impl Default for crate::PoseidonSponge<$path::Field, { $path::R }, { $path::N }> { + impl Default for $name { fn default() -> Self { let alpha = $path::ALPHA; - let full_rounds = $path::FULL_ROUNDS; - let total_rounds = $path::TOTAL_ROUNDS; - let partial_rounds = total_rounds - full_rounds; Self { - full_rounds, - partial_rounds, + full_rounds: $path::R_F, + partial_rounds: $path::R_P, alpha, ark: $path::ARK, mds: $path::MDS, @@ -147,8 +160,12 @@ macro_rules! poseidon_sponge { }; } +#[cfg(feature = "bls12-381")] pub mod bls12_381; +#[cfg(feature = "bn254")] +pub mod bn254; + /// Unit-tests. #[cfg(test)] mod tests; diff --git a/nimue-poseidon/src/tests.rs b/nimue-poseidon/src/tests.rs index 6a8a6f7..b4f80d6 100644 --- a/nimue-poseidon/src/tests.rs +++ b/nimue-poseidon/src/tests.rs @@ -1,15 +1,56 @@ -use crate::PoseidonHash; -use ark_bls12_381::Fr; -use nimue::IOPattern; -use nimue::UnitTranscript; +use nimue::hash::sponge::Sponge; -/// Check that poseidon can indeed be instantiated and doesn't do terribly stupid things like give 0 challenges. +fn test_vector(input: &[H::U], output: &[H::U]) +where + H::U: PartialEq + std::fmt::Debug, +{ + let mut hash = H::new([0; 32]); + hash.as_mut().clone_from_slice(input); + hash.permute(); + assert_eq!(hash.as_ref(), output); +} + +#[cfg(feature = "bls12-381")] #[test] -fn test_poseidon_basic() { - type F = Fr; - type H = PoseidonHash; +fn test_poseidon_bls12_381() { + use crate::bls12_381::{PoseidonPermx5_255_3, PoseidonPermx5_255_5}; + use ark_ff::MontFp; + use nimue::IOPattern; + use nimue::UnitTranscript; + + type F = ark_bls12_381::Fr; - let io = IOPattern::::new("test") + let tv_x5_255_3_input: [F; 3] = [ + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000000"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000001"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000002"), + ]; + let tv_x5_255_3_output: [F; 3] = [ + MontFp!("0x28ce19420fc246a05553ad1e8c98f5c9d67166be2c18e9e4cb4b4e317dd2a78a"), + MontFp!("0x51f3e312c95343a896cfd8945ea82ba956c1118ce9b9859b6ea56637b4b1ddc4"), + MontFp!("0x3b2b69139b235626a0bfb56c9527ae66a7bf486ad8c11c14d1da0c69bbe0f79a"), + ]; + test_vector::(&tv_x5_255_3_input, &tv_x5_255_3_output); + + let tv_x5_255_5_input: [F; 5] = [ + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000000"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000001"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000002"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000003"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000004"), + ]; + let tv_x5_255_5_output: [F; 5] = [ + MontFp!("0x2a918b9c9f9bd7bb509331c81e297b5707f6fc7393dcee1b13901a0b22202e18"), + MontFp!("0x65ebf8671739eeb11fb217f2d5c5bf4a0c3f210e3f3cd3b08b5db75675d797f7"), + MontFp!("0x2cc176fc26bc70737a696a9dfd1b636ce360ee76926d182390cdb7459cf585ce"), + MontFp!("0x4dc4e29d283afd2a491fe6aef122b9a968e74eff05341f3cc23fda1781dcb566"), + MontFp!("0x03ff622da276830b9451b88b85e6184fd6ae15c8ab3ee25a5667be8592cce3b1"), + ]; + test_vector::(&tv_x5_255_5_input, &tv_x5_255_5_output); + + // Check that poseidon can indeed be instantiated and doesn't do terribly stupid things like give 0 challenges. + use crate::bls12_381::Poseidonx5_255_3; + let io = IOPattern::::new("test") .absorb(1, "in") .squeeze(10, "out"); let mut merlin = io.to_merlin(); @@ -22,3 +63,40 @@ fn test_poseidon_basic() { assert_ne!(challenge, F::from(0)); } } + +#[cfg(feature = "bn254")] +#[test] +fn test_poseidon_bn254() { + use crate::bn254::{PoseidonPermx5_254_3, PoseidonPermx5_254_5}; + use ark_ff::MontFp; + + type F = ark_bn254::Fr; + + let tv_x5_254_3_input: [F; 3] = [ + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000000"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000001"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000002"), + ]; + let tv_x5_254_3_output: [F; 3] = [ + MontFp!("0x115cc0f5e7d690413df64c6b9662e9cf2a3617f2743245519e19607a4417189a"), + MontFp!("0x0fca49b798923ab0239de1c9e7a4a9a2210312b6a2f616d18b5a87f9b628ae29"), + MontFp!("0x0e7ae82e40091e63cbd4f16a6d16310b3729d4b6e138fcf54110e2867045a30c"), + ]; + test_vector::(&tv_x5_254_3_input, &tv_x5_254_3_output); + + let tv_x5_254_5_input: [F; 5] = [ + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000000"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000001"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000002"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000003"), + MontFp!("0x0000000000000000000000000000000000000000000000000000000000000004"), + ]; + let tv_x5_254_5_output: [F; 5] = [ + MontFp!("0x299c867db6c1fdd79dcefa40e4510b9837e60ebb1ce0663dbaa525df65250465"), + MontFp!("0x1148aaef609aa338b27dafd89bb98862d8bb2b429aceac47d86206154ffe053d"), + MontFp!("0x24febb87fed7462e23f6665ff9a0111f4044c38ee1672c1ac6b0637d34f24907"), + MontFp!("0x0eb08f6d809668a981c186beaf6110060707059576406b248e5d9cf6e78b3d3e"), + MontFp!("0x07748bc6877c9b82c8b98666ee9d0626ec7f5be4205f79ee8528ef1c4a376fc7"), + ]; + test_vector::(&tv_x5_254_5_input, &tv_x5_254_5_output); +} diff --git a/nimue/Cargo.toml b/nimue/Cargo.toml index 4fbff4d..8a91a2b 100644 --- a/nimue/Cargo.toml +++ b/nimue/Cargo.toml @@ -15,11 +15,11 @@ generic-array = "0.14.7" keccak = { version = "0.1.4"} log = "0.4.20" # optional dependencies -ark-ff = { version = "0.4.0", optional = true } -ark-ec = { version = "0.4.0", optional = true } -ark-serialize = { version = "0.4.2", optional = true, features = ["std"] } +ark-ff = { version = "^0.5", optional = true } +ark-ec = { version = "^0.5", optional = true } +ark-serialize = { version = "^0.5", optional = true, features = ["std"] } group = { version = "0.13.0", optional = true } -ark-bls12-381 = { version = "0.4.0", optional = true } +ark-bls12-381 = { version = "^0.5", optional = true } hex = "0.4.3" [features] @@ -36,15 +36,15 @@ blake2 = "0.10.6" hex = "0.4.3" # test curve25519 compatibility curve25519-dalek = { version = "4.0.0", features = ["group"] } -ark-curve25519 = "0.4.0" +ark-curve25519 = "0.5.0" # test algebraic hashers bls12_381 = "0.8.0" -ark-bls12-381 = { version = "0.4.0", features = ["std"] } +ark-bls12-381 = { version = "^0.5", features = ["std"] } anyhow = { version = "1.0.75", features = ["backtrace"] } -ark-pallas = { version = "0.4.0", features = ["std"] } +ark-pallas = { version = "^0.5", features = ["std"] } pallas = "0.22.0" pasta_curves = "0.5.1" -ark-vesta = { version = "0.4.0", features = ["std"] } +ark-vesta = { version = "^0.5", features = ["std"] } sha3 = "0.10.8" [package.metadata.docs.rs]