From 92c996ab1743579898ada3c542243f527ee46584 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:12:00 -0700 Subject: [PATCH] [feat] make assembly block Solidity memory safe (#39) * feat: make assembly block Solidity memory safe * chore: add back example solidity code --- .../examples/StandardPlonkVerifier.sol | 2050 +++++++++-------- snark-verifier/src/loader/evm/code.rs | 8 +- snark-verifier/src/loader/evm/loader.rs | 5 +- .../src/system/halo2/transcript/evm.rs | 5 +- 4 files changed, 1042 insertions(+), 1026 deletions(-) diff --git a/snark-verifier-sdk/examples/StandardPlonkVerifier.sol b/snark-verifier-sdk/examples/StandardPlonkVerifier.sol index d6e9427c..2ac09483 100644 --- a/snark-verifier-sdk/examples/StandardPlonkVerifier.sol +++ b/snark-verifier-sdk/examples/StandardPlonkVerifier.sol @@ -5,7 +5,13 @@ pragma solidity 0.8.19; contract Halo2Verifier { fallback(bytes calldata) external returns (bytes memory) { - assembly { + assembly ("memory-safe") { + // Enforce that Solidity memory layout is respected + let data := mload(0x40) + if iszero(eq(data, 0x80)) { + revert(0, 0) + } + let success := true let f_p := 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47 let f_q := 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 @@ -24,250 +30,246 @@ contract Halo2Verifier { valid := and(valid, is_affine) } } - mstore(0x20, mod(calldataload(0x0), f_q)) -mstore(0x40, mod(calldataload(0x20), f_q)) -mstore(0x60, mod(calldataload(0x40), f_q)) -mstore(0x80, mod(calldataload(0x60), f_q)) -mstore(0xa0, mod(calldataload(0x80), f_q)) -mstore(0xc0, mod(calldataload(0xa0), f_q)) -mstore(0xe0, mod(calldataload(0xc0), f_q)) -mstore(0x100, mod(calldataload(0xe0), f_q)) -mstore(0x120, mod(calldataload(0x100), f_q)) -mstore(0x140, mod(calldataload(0x120), f_q)) -mstore(0x160, mod(calldataload(0x140), f_q)) -mstore(0x180, mod(calldataload(0x160), f_q)) -mstore(0x0, 17740244582459666476042487670110999380715355991411842331101569887719361442506) + mstore(0xa0, mod(calldataload(0x0), f_q)) +mstore(0xc0, mod(calldataload(0x20), f_q)) +mstore(0xe0, mod(calldataload(0x40), f_q)) +mstore(0x100, mod(calldataload(0x60), f_q)) +mstore(0x120, mod(calldataload(0x80), f_q)) +mstore(0x140, mod(calldataload(0xa0), f_q)) +mstore(0x160, mod(calldataload(0xc0), f_q)) +mstore(0x180, mod(calldataload(0xe0), f_q)) +mstore(0x1a0, mod(calldataload(0x100), f_q)) +mstore(0x1c0, mod(calldataload(0x120), f_q)) +mstore(0x1e0, mod(calldataload(0x140), f_q)) +mstore(0x200, mod(calldataload(0x160), f_q)) +mstore(0x80, 4821513469282282135963313459762076388609226322911319502565905456075264100373) { let x := calldataload(0x180) - mstore(0x1a0, x) + mstore(0x220, x) let y := calldataload(0x1a0) - mstore(0x1c0, y) + mstore(0x240, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x1c0) - mstore(0x1e0, x) + mstore(0x260, x) let y := calldataload(0x1e0) - mstore(0x200, y) + mstore(0x280, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x200) - mstore(0x220, x) + mstore(0x2a0, x) let y := calldataload(0x220) - mstore(0x240, y) + mstore(0x2c0, y) success := and(validate_ec_point(x, y), success) } -mstore(0x260, keccak256(0x0, 608)) +mstore(0x2e0, keccak256(0x80, 608)) { - let hash := mload(0x260) - mstore(0x280, mod(hash, f_q)) - mstore(0x2a0, hash) + let hash := mload(0x2e0) + mstore(0x300, mod(hash, f_q)) + mstore(0x320, hash) } { let x := calldataload(0x240) - mstore(0x2c0, x) + mstore(0x340, x) let y := calldataload(0x260) - mstore(0x2e0, y) + mstore(0x360, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x280) - mstore(0x300, x) + mstore(0x380, x) let y := calldataload(0x2a0) - mstore(0x320, y) + mstore(0x3a0, y) success := and(validate_ec_point(x, y), success) } -mstore(0x340, keccak256(0x2a0, 160)) +mstore(0x3c0, keccak256(0x320, 160)) { - let hash := mload(0x340) - mstore(0x360, mod(hash, f_q)) - mstore(0x380, hash) + let hash := mload(0x3c0) + mstore(0x3e0, mod(hash, f_q)) + mstore(0x400, hash) } -mstore8(928, 1) -mstore(0x3a0, keccak256(0x380, 33)) +mstore8(1056, 1) +mstore(0x420, keccak256(0x400, 33)) { - let hash := mload(0x3a0) - mstore(0x3c0, mod(hash, f_q)) - mstore(0x3e0, hash) + let hash := mload(0x420) + mstore(0x440, mod(hash, f_q)) + mstore(0x460, hash) } { let x := calldataload(0x2c0) - mstore(0x400, x) + mstore(0x480, x) let y := calldataload(0x2e0) - mstore(0x420, y) + mstore(0x4a0, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x300) - mstore(0x440, x) + mstore(0x4c0, x) let y := calldataload(0x320) - mstore(0x460, y) + mstore(0x4e0, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x340) - mstore(0x480, x) + mstore(0x500, x) let y := calldataload(0x360) - mstore(0x4a0, y) + mstore(0x520, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x380) - mstore(0x4c0, x) + mstore(0x540, x) let y := calldataload(0x3a0) - mstore(0x4e0, y) + mstore(0x560, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x3c0) - mstore(0x500, x) + mstore(0x580, x) let y := calldataload(0x3e0) - mstore(0x520, y) + mstore(0x5a0, y) success := and(validate_ec_point(x, y), success) } -mstore(0x540, keccak256(0x3e0, 352)) +mstore(0x5c0, keccak256(0x460, 352)) { - let hash := mload(0x540) - mstore(0x560, mod(hash, f_q)) - mstore(0x580, hash) + let hash := mload(0x5c0) + mstore(0x5e0, mod(hash, f_q)) + mstore(0x600, hash) } { let x := calldataload(0x400) - mstore(0x5a0, x) + mstore(0x620, x) let y := calldataload(0x420) - mstore(0x5c0, y) + mstore(0x640, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x440) - mstore(0x5e0, x) + mstore(0x660, x) let y := calldataload(0x460) - mstore(0x600, y) + mstore(0x680, y) success := and(validate_ec_point(x, y), success) } { let x := calldataload(0x480) - mstore(0x620, x) + mstore(0x6a0, x) let y := calldataload(0x4a0) - mstore(0x640, y) + mstore(0x6c0, y) success := and(validate_ec_point(x, y), success) } -mstore(0x660, keccak256(0x580, 224)) +mstore(0x6e0, keccak256(0x600, 224)) { - let hash := mload(0x660) - mstore(0x680, mod(hash, f_q)) - mstore(0x6a0, hash) - } -mstore(0x6c0, mod(calldataload(0x4c0), f_q)) -mstore(0x6e0, mod(calldataload(0x4e0), f_q)) -mstore(0x700, mod(calldataload(0x500), f_q)) -mstore(0x720, mod(calldataload(0x520), f_q)) -mstore(0x740, mod(calldataload(0x540), f_q)) -mstore(0x760, mod(calldataload(0x560), f_q)) -mstore(0x780, mod(calldataload(0x580), f_q)) -mstore(0x7a0, mod(calldataload(0x5a0), f_q)) -mstore(0x7c0, mod(calldataload(0x5c0), f_q)) -mstore(0x7e0, mod(calldataload(0x5e0), f_q)) -mstore(0x800, mod(calldataload(0x600), f_q)) -mstore(0x820, mod(calldataload(0x620), f_q)) -mstore(0x840, mod(calldataload(0x640), f_q)) -mstore(0x860, mod(calldataload(0x660), f_q)) -mstore(0x880, mod(calldataload(0x680), f_q)) -mstore(0x8a0, mod(calldataload(0x6a0), f_q)) -mstore(0x8c0, mod(calldataload(0x6c0), f_q)) -mstore(0x8e0, mod(calldataload(0x6e0), f_q)) -mstore(0x900, mod(calldataload(0x700), f_q)) -mstore(0x920, mod(calldataload(0x720), f_q)) -mstore(0x940, mod(calldataload(0x740), f_q)) -mstore(0x960, mod(calldataload(0x760), f_q)) -mstore(0x980, mod(calldataload(0x780), f_q)) -mstore(0x9a0, mod(calldataload(0x7a0), f_q)) -mstore(0x9c0, mod(calldataload(0x7c0), f_q)) -mstore(0x9e0, mod(calldataload(0x7e0), f_q)) -mstore(0xa00, mod(calldataload(0x800), f_q)) -mstore(0xa20, mod(calldataload(0x820), f_q)) -mstore(0xa40, mod(calldataload(0x840), f_q)) -mstore(0xa60, mod(calldataload(0x860), f_q)) -mstore(0xa80, mod(calldataload(0x880), f_q)) -mstore(0xaa0, mod(calldataload(0x8a0), f_q)) -mstore(0xac0, keccak256(0x6a0, 1056)) + let hash := mload(0x6e0) + mstore(0x700, mod(hash, f_q)) + mstore(0x720, hash) + } +mstore(0x740, mod(calldataload(0x4c0), f_q)) +mstore(0x760, mod(calldataload(0x4e0), f_q)) +mstore(0x780, mod(calldataload(0x500), f_q)) +mstore(0x7a0, mod(calldataload(0x520), f_q)) +mstore(0x7c0, mod(calldataload(0x540), f_q)) +mstore(0x7e0, mod(calldataload(0x560), f_q)) +mstore(0x800, mod(calldataload(0x580), f_q)) +mstore(0x820, mod(calldataload(0x5a0), f_q)) +mstore(0x840, mod(calldataload(0x5c0), f_q)) +mstore(0x860, mod(calldataload(0x5e0), f_q)) +mstore(0x880, mod(calldataload(0x600), f_q)) +mstore(0x8a0, mod(calldataload(0x620), f_q)) +mstore(0x8c0, mod(calldataload(0x640), f_q)) +mstore(0x8e0, mod(calldataload(0x660), f_q)) +mstore(0x900, mod(calldataload(0x680), f_q)) +mstore(0x920, mod(calldataload(0x6a0), f_q)) +mstore(0x940, mod(calldataload(0x6c0), f_q)) +mstore(0x960, mod(calldataload(0x6e0), f_q)) +mstore(0x980, mod(calldataload(0x700), f_q)) +mstore(0x9a0, mod(calldataload(0x720), f_q)) +mstore(0x9c0, mod(calldataload(0x740), f_q)) +mstore(0x9e0, mod(calldataload(0x760), f_q)) +mstore(0xa00, mod(calldataload(0x780), f_q)) +mstore(0xa20, mod(calldataload(0x7a0), f_q)) +mstore(0xa40, mod(calldataload(0x7c0), f_q)) +mstore(0xa60, mod(calldataload(0x7e0), f_q)) +mstore(0xa80, mod(calldataload(0x800), f_q)) +mstore(0xaa0, mod(calldataload(0x820), f_q)) +mstore(0xac0, mod(calldataload(0x840), f_q)) +mstore(0xae0, mod(calldataload(0x860), f_q)) +mstore(0xb00, mod(calldataload(0x880), f_q)) +mstore(0xb20, mod(calldataload(0x8a0), f_q)) +mstore(0xb40, keccak256(0x720, 1056)) { - let hash := mload(0xac0) - mstore(0xae0, mod(hash, f_q)) - mstore(0xb00, hash) + let hash := mload(0xb40) + mstore(0xb60, mod(hash, f_q)) + mstore(0xb80, hash) } -mstore8(2848, 1) -mstore(0xb20, keccak256(0xb00, 33)) +mstore8(2976, 1) +mstore(0xba0, keccak256(0xb80, 33)) { - let hash := mload(0xb20) - mstore(0xb40, mod(hash, f_q)) - mstore(0xb60, hash) + let hash := mload(0xba0) + mstore(0xbc0, mod(hash, f_q)) + mstore(0xbe0, hash) } { let x := calldataload(0x8c0) - mstore(0xb80, x) + mstore(0xc00, x) let y := calldataload(0x8e0) - mstore(0xba0, y) + mstore(0xc20, y) success := and(validate_ec_point(x, y), success) } -mstore(0xbc0, keccak256(0xb60, 96)) +mstore(0xc40, keccak256(0xbe0, 96)) { - let hash := mload(0xbc0) - mstore(0xbe0, mod(hash, f_q)) - mstore(0xc00, hash) + let hash := mload(0xc40) + mstore(0xc60, mod(hash, f_q)) + mstore(0xc80, hash) } { let x := calldataload(0x900) - mstore(0xc20, x) + mstore(0xca0, x) let y := calldataload(0x920) - mstore(0xc40, y) + mstore(0xcc0, y) success := and(validate_ec_point(x, y), success) } { - let x := mload(0x20) -x := add(x, shl(88, mload(0x40))) -x := add(x, shl(176, mload(0x60))) -mstore(3168, x) -let y := mload(0x80) -y := add(y, shl(88, mload(0xa0))) -y := add(y, shl(176, mload(0xc0))) -mstore(3200, y) + let x := mload(0xa0) +x := add(x, shl(88, mload(0xc0))) +x := add(x, shl(176, mload(0xe0))) +mstore(3296, x) +let y := mload(0x100) +y := add(y, shl(88, mload(0x120))) +y := add(y, shl(176, mload(0x140))) +mstore(3328, y) success := and(validate_ec_point(x, y), success) } { - let x := mload(0xe0) -x := add(x, shl(88, mload(0x100))) -x := add(x, shl(176, mload(0x120))) -mstore(3232, x) -let y := mload(0x140) -y := add(y, shl(88, mload(0x160))) -y := add(y, shl(176, mload(0x180))) -mstore(3264, y) + let x := mload(0x160) +x := add(x, shl(88, mload(0x180))) +x := add(x, shl(176, mload(0x1a0))) +mstore(3360, x) +let y := mload(0x1c0) +y := add(y, shl(88, mload(0x1e0))) +y := add(y, shl(176, mload(0x200))) +mstore(3392, y) success := and(validate_ec_point(x, y), success) } -mstore(0xce0, mulmod(mload(0x680), mload(0x680), f_q)) -mstore(0xd00, mulmod(mload(0xce0), mload(0xce0), f_q)) -mstore(0xd20, mulmod(mload(0xd00), mload(0xd00), f_q)) -mstore(0xd40, mulmod(mload(0xd20), mload(0xd20), f_q)) -mstore(0xd60, mulmod(mload(0xd40), mload(0xd40), f_q)) +mstore(0xd60, mulmod(mload(0x700), mload(0x700), f_q)) mstore(0xd80, mulmod(mload(0xd60), mload(0xd60), f_q)) mstore(0xda0, mulmod(mload(0xd80), mload(0xd80), f_q)) mstore(0xdc0, mulmod(mload(0xda0), mload(0xda0), f_q)) @@ -284,222 +286,222 @@ mstore(0xf00, mulmod(mload(0xee0), mload(0xee0), f_q)) mstore(0xf20, mulmod(mload(0xf00), mload(0xf00), f_q)) mstore(0xf40, mulmod(mload(0xf20), mload(0xf20), f_q)) mstore(0xf60, mulmod(mload(0xf40), mload(0xf40), f_q)) -mstore(0xf80, addmod(mload(0xf60), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q)) -mstore(0xfa0, mulmod(mload(0xf80), 21888232434711746154598842647110004286396165347431605739555851272621938401409, f_q)) -mstore(0xfc0, mulmod(mload(0xfa0), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) -mstore(0xfe0, addmod(mload(0x680), 912313628429477159406456086641000229562273017905841394476902509870102141130, f_q)) -mstore(0x1000, mulmod(mload(0xfa0), 495188420091111145957709789221178673495499187437761988132837836548330853701, f_q)) -mstore(0x1020, addmod(mload(0x680), 21393054451748164076288695956036096415052865212978272355565366350027477641916, f_q)) -mstore(0x1040, mulmod(mload(0xfa0), 16064522944768515290584536219762686197737451920702130080538975732575755569557, f_q)) -mstore(0x1060, addmod(mload(0x680), 5823719927070759931661869525494588890810912479713904263159228454000052926060, f_q)) -mstore(0x1080, mulmod(mload(0xfa0), 14686510910986211321976396297238126901237973400949744736326777596334651355305, f_q)) -mstore(0x10a0, addmod(mload(0x680), 7201731960853063900270009448019148187310390999466289607371426590241157140312, f_q)) -mstore(0x10c0, mulmod(mload(0xfa0), 10939663269433627367777756708678102241564365262857670666700619874077960926249, f_q)) -mstore(0x10e0, addmod(mload(0x680), 10948579602405647854468649036579172846983999137558363676997584312497847569368, f_q)) -mstore(0x1100, mulmod(mload(0xfa0), 15402826414547299628414612080036060696555554914079673875872749760617770134879, f_q)) -mstore(0x1120, addmod(mload(0x680), 6485416457291975593831793665221214391992809486336360467825454425958038360738, f_q)) -mstore(0x1140, mulmod(mload(0xfa0), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) -mstore(0x1160, addmod(mload(0x680), 19102728315457599142069468034376470979900453007937332237837518576196438670601, f_q)) -mstore(0x1180, mulmod(mload(0xfa0), 1, f_q)) -mstore(0x11a0, addmod(mload(0x680), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q)) -mstore(0x11c0, mulmod(mload(0xfa0), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) -mstore(0x11e0, addmod(mload(0x680), 20461838439117790833741043996939313553025008529160428886800406442142042007110, f_q)) -mstore(0x1200, mulmod(mload(0xfa0), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) -mstore(0x1220, addmod(mload(0x680), 2855281034601326619502779289517034852317245347382893578658160672914005347465, f_q)) -mstore(0x1240, mulmod(mload(0xfa0), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) -mstore(0x1260, addmod(mload(0x680), 18122161250104879439014068220095202351720788102473020950742332016437772306424, f_q)) -mstore(0x1280, mulmod(mload(0xfa0), 5854133144571823792863860130267644613802765696134002830362054821530146160770, f_q)) -mstore(0x12a0, addmod(mload(0x680), 16034109727267451429382545614989630474745598704282031513336149365045662334847, f_q)) -mstore(0x12c0, mulmod(mload(0xfa0), 14557038802599140430182096396825290815503940951075961210638273254419942783582, f_q)) -mstore(0x12e0, addmod(mload(0x680), 7331204069240134792064309348431984273044423449340073133059930932155865712035, f_q)) -mstore(0x1300, mulmod(mload(0xfa0), 9697063347556872083384215826199993067635178715531258559890418744774301211662, f_q)) -mstore(0x1320, addmod(mload(0x680), 12191179524282403138862189919057282020913185684884775783807785441801507283955, f_q)) -mstore(0x1340, mulmod(mload(0xfa0), 12459868075641381822485233712013080087763946065665469821362892189399541605692, f_q)) -mstore(0x1360, addmod(mload(0x680), 9428374796197893399761172033244195000784418334750564522335311997176266889925, f_q)) -mstore(0x1380, mulmod(mload(0xfa0), 6955697244493336113861667751840378876927906302623587437721024018233754910398, f_q)) -mstore(0x13a0, addmod(mload(0x680), 14932545627345939108384737993416896211620458097792446905977180168342053585219, f_q)) -mstore(0x13c0, mulmod(mload(0xfa0), 20345677989844117909528750049476969581182118546166966482506114734614108237981, f_q)) -mstore(0x13e0, addmod(mload(0x680), 1542564881995157312717655695780305507366245854249067861192089451961700257636, f_q)) -mstore(0x1400, mulmod(mload(0xfa0), 5289443209903185443361862148540090689648485914368835830972895623576469023722, f_q)) -mstore(0x1420, addmod(mload(0x680), 16598799661936089778884543596717184398899878486047198512725308562999339471895, f_q)) -mstore(0x1440, mulmod(mload(0xfa0), 557567375339945239933617516585967620814823575807691402619711360028043331811, f_q)) -mstore(0x1460, addmod(mload(0x680), 21330675496499329982312788228671307467733540824608342941078492826547765163806, f_q)) +mstore(0xf80, mulmod(mload(0xf60), mload(0xf60), f_q)) +mstore(0xfa0, mulmod(mload(0xf80), mload(0xf80), f_q)) +mstore(0xfc0, mulmod(mload(0xfa0), mload(0xfa0), f_q)) +mstore(0xfe0, mulmod(mload(0xfc0), mload(0xfc0), f_q)) +mstore(0x1000, addmod(mload(0xfe0), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q)) +mstore(0x1020, mulmod(mload(0x1000), 21888232434711746154598842647110004286396165347431605739555851272621938401409, f_q)) +mstore(0x1040, mulmod(mload(0x1020), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) +mstore(0x1060, addmod(mload(0x700), 912313628429477159406456086641000229562273017905841394476902509870102141130, f_q)) +mstore(0x1080, mulmod(mload(0x1020), 495188420091111145957709789221178673495499187437761988132837836548330853701, f_q)) +mstore(0x10a0, addmod(mload(0x700), 21393054451748164076288695956036096415052865212978272355565366350027477641916, f_q)) +mstore(0x10c0, mulmod(mload(0x1020), 16064522944768515290584536219762686197737451920702130080538975732575755569557, f_q)) +mstore(0x10e0, addmod(mload(0x700), 5823719927070759931661869525494588890810912479713904263159228454000052926060, f_q)) +mstore(0x1100, mulmod(mload(0x1020), 14686510910986211321976396297238126901237973400949744736326777596334651355305, f_q)) +mstore(0x1120, addmod(mload(0x700), 7201731960853063900270009448019148187310390999466289607371426590241157140312, f_q)) +mstore(0x1140, mulmod(mload(0x1020), 10939663269433627367777756708678102241564365262857670666700619874077960926249, f_q)) +mstore(0x1160, addmod(mload(0x700), 10948579602405647854468649036579172846983999137558363676997584312497847569368, f_q)) +mstore(0x1180, mulmod(mload(0x1020), 15402826414547299628414612080036060696555554914079673875872749760617770134879, f_q)) +mstore(0x11a0, addmod(mload(0x700), 6485416457291975593831793665221214391992809486336360467825454425958038360738, f_q)) +mstore(0x11c0, mulmod(mload(0x1020), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) +mstore(0x11e0, addmod(mload(0x700), 19102728315457599142069468034376470979900453007937332237837518576196438670601, f_q)) +mstore(0x1200, mulmod(mload(0x1020), 1, f_q)) +mstore(0x1220, addmod(mload(0x700), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q)) +mstore(0x1240, mulmod(mload(0x1020), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) +mstore(0x1260, addmod(mload(0x700), 20461838439117790833741043996939313553025008529160428886800406442142042007110, f_q)) +mstore(0x1280, mulmod(mload(0x1020), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) +mstore(0x12a0, addmod(mload(0x700), 2855281034601326619502779289517034852317245347382893578658160672914005347465, f_q)) +mstore(0x12c0, mulmod(mload(0x1020), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) +mstore(0x12e0, addmod(mload(0x700), 18122161250104879439014068220095202351720788102473020950742332016437772306424, f_q)) +mstore(0x1300, mulmod(mload(0x1020), 5854133144571823792863860130267644613802765696134002830362054821530146160770, f_q)) +mstore(0x1320, addmod(mload(0x700), 16034109727267451429382545614989630474745598704282031513336149365045662334847, f_q)) +mstore(0x1340, mulmod(mload(0x1020), 14557038802599140430182096396825290815503940951075961210638273254419942783582, f_q)) +mstore(0x1360, addmod(mload(0x700), 7331204069240134792064309348431984273044423449340073133059930932155865712035, f_q)) +mstore(0x1380, mulmod(mload(0x1020), 9697063347556872083384215826199993067635178715531258559890418744774301211662, f_q)) +mstore(0x13a0, addmod(mload(0x700), 12191179524282403138862189919057282020913185684884775783807785441801507283955, f_q)) +mstore(0x13c0, mulmod(mload(0x1020), 12459868075641381822485233712013080087763946065665469821362892189399541605692, f_q)) +mstore(0x13e0, addmod(mload(0x700), 9428374796197893399761172033244195000784418334750564522335311997176266889925, f_q)) +mstore(0x1400, mulmod(mload(0x1020), 6955697244493336113861667751840378876927906302623587437721024018233754910398, f_q)) +mstore(0x1420, addmod(mload(0x700), 14932545627345939108384737993416896211620458097792446905977180168342053585219, f_q)) +mstore(0x1440, mulmod(mload(0x1020), 20345677989844117909528750049476969581182118546166966482506114734614108237981, f_q)) +mstore(0x1460, addmod(mload(0x700), 1542564881995157312717655695780305507366245854249067861192089451961700257636, f_q)) +mstore(0x1480, mulmod(mload(0x1020), 5289443209903185443361862148540090689648485914368835830972895623576469023722, f_q)) +mstore(0x14a0, addmod(mload(0x700), 16598799661936089778884543596717184398899878486047198512725308562999339471895, f_q)) +mstore(0x14c0, mulmod(mload(0x1020), 557567375339945239933617516585967620814823575807691402619711360028043331811, f_q)) +mstore(0x14e0, addmod(mload(0x700), 21330675496499329982312788228671307467733540824608342941078492826547765163806, f_q)) { - let prod := mload(0xfe0) + let prod := mload(0x1060) - prod := mulmod(mload(0x1020), prod, f_q) - mstore(0x1480, prod) - - prod := mulmod(mload(0x1060), prod, f_q) - mstore(0x14a0, prod) - prod := mulmod(mload(0x10a0), prod, f_q) - mstore(0x14c0, prod) + mstore(0x1500, prod) prod := mulmod(mload(0x10e0), prod, f_q) - mstore(0x14e0, prod) + mstore(0x1520, prod) prod := mulmod(mload(0x1120), prod, f_q) - mstore(0x1500, prod) + mstore(0x1540, prod) prod := mulmod(mload(0x1160), prod, f_q) - mstore(0x1520, prod) + mstore(0x1560, prod) prod := mulmod(mload(0x11a0), prod, f_q) - mstore(0x1540, prod) + mstore(0x1580, prod) prod := mulmod(mload(0x11e0), prod, f_q) - mstore(0x1560, prod) + mstore(0x15a0, prod) prod := mulmod(mload(0x1220), prod, f_q) - mstore(0x1580, prod) + mstore(0x15c0, prod) prod := mulmod(mload(0x1260), prod, f_q) - mstore(0x15a0, prod) + mstore(0x15e0, prod) prod := mulmod(mload(0x12a0), prod, f_q) - mstore(0x15c0, prod) + mstore(0x1600, prod) prod := mulmod(mload(0x12e0), prod, f_q) - mstore(0x15e0, prod) + mstore(0x1620, prod) prod := mulmod(mload(0x1320), prod, f_q) - mstore(0x1600, prod) + mstore(0x1640, prod) prod := mulmod(mload(0x1360), prod, f_q) - mstore(0x1620, prod) + mstore(0x1660, prod) prod := mulmod(mload(0x13a0), prod, f_q) - mstore(0x1640, prod) + mstore(0x1680, prod) prod := mulmod(mload(0x13e0), prod, f_q) - mstore(0x1660, prod) + mstore(0x16a0, prod) prod := mulmod(mload(0x1420), prod, f_q) - mstore(0x1680, prod) + mstore(0x16c0, prod) prod := mulmod(mload(0x1460), prod, f_q) - mstore(0x16a0, prod) + mstore(0x16e0, prod) - prod := mulmod(mload(0xf80), prod, f_q) - mstore(0x16c0, prod) + prod := mulmod(mload(0x14a0), prod, f_q) + mstore(0x1700, prod) + + prod := mulmod(mload(0x14e0), prod, f_q) + mstore(0x1720, prod) + + prod := mulmod(mload(0x1000), prod, f_q) + mstore(0x1740, prod) } -mstore(0x1700, 32) -mstore(0x1720, 32) -mstore(0x1740, 32) -mstore(0x1760, mload(0x16c0)) -mstore(0x1780, 21888242871839275222246405745257275088548364400416034343698204186575808495615) -mstore(0x17a0, 21888242871839275222246405745257275088548364400416034343698204186575808495617) -success := and(eq(staticcall(gas(), 0x5, 0x1700, 0xc0, 0x16e0, 0x20), 1), success) +mstore(0x1780, 32) +mstore(0x17a0, 32) +mstore(0x17c0, 32) +mstore(0x17e0, mload(0x1740)) +mstore(0x1800, 21888242871839275222246405745257275088548364400416034343698204186575808495615) +mstore(0x1820, 21888242871839275222246405745257275088548364400416034343698204186575808495617) +success := and(eq(staticcall(gas(), 0x5, 0x1780, 0xc0, 0x1760, 0x20), 1), success) { - let inv := mload(0x16e0) + let inv := mload(0x1760) let v - v := mload(0xf80) - mstore(3968, mulmod(mload(0x16a0), inv, f_q)) + v := mload(0x1000) + mstore(4096, mulmod(mload(0x1720), inv, f_q)) + inv := mulmod(v, inv, f_q) + + v := mload(0x14e0) + mstore(5344, mulmod(mload(0x1700), inv, f_q)) + inv := mulmod(v, inv, f_q) + + v := mload(0x14a0) + mstore(5280, mulmod(mload(0x16e0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1460) - mstore(5216, mulmod(mload(0x1680), inv, f_q)) + mstore(5216, mulmod(mload(0x16c0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1420) - mstore(5152, mulmod(mload(0x1660), inv, f_q)) + mstore(5152, mulmod(mload(0x16a0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x13e0) - mstore(5088, mulmod(mload(0x1640), inv, f_q)) + mstore(5088, mulmod(mload(0x1680), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x13a0) - mstore(5024, mulmod(mload(0x1620), inv, f_q)) + mstore(5024, mulmod(mload(0x1660), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1360) - mstore(4960, mulmod(mload(0x1600), inv, f_q)) + mstore(4960, mulmod(mload(0x1640), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1320) - mstore(4896, mulmod(mload(0x15e0), inv, f_q)) + mstore(4896, mulmod(mload(0x1620), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x12e0) - mstore(4832, mulmod(mload(0x15c0), inv, f_q)) + mstore(4832, mulmod(mload(0x1600), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x12a0) - mstore(4768, mulmod(mload(0x15a0), inv, f_q)) + mstore(4768, mulmod(mload(0x15e0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1260) - mstore(4704, mulmod(mload(0x1580), inv, f_q)) + mstore(4704, mulmod(mload(0x15c0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1220) - mstore(4640, mulmod(mload(0x1560), inv, f_q)) + mstore(4640, mulmod(mload(0x15a0), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x11e0) - mstore(4576, mulmod(mload(0x1540), inv, f_q)) + mstore(4576, mulmod(mload(0x1580), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x11a0) - mstore(4512, mulmod(mload(0x1520), inv, f_q)) + mstore(4512, mulmod(mload(0x1560), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1160) - mstore(4448, mulmod(mload(0x1500), inv, f_q)) + mstore(4448, mulmod(mload(0x1540), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x1120) - mstore(4384, mulmod(mload(0x14e0), inv, f_q)) + mstore(4384, mulmod(mload(0x1520), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x10e0) - mstore(4320, mulmod(mload(0x14c0), inv, f_q)) + mstore(4320, mulmod(mload(0x1500), inv, f_q)) inv := mulmod(v, inv, f_q) v := mload(0x10a0) - mstore(4256, mulmod(mload(0x14a0), inv, f_q)) - inv := mulmod(v, inv, f_q) - - v := mload(0x1060) - mstore(4192, mulmod(mload(0x1480), inv, f_q)) - inv := mulmod(v, inv, f_q) - - v := mload(0x1020) - mstore(4128, mulmod(mload(0xfe0), inv, f_q)) + mstore(4256, mulmod(mload(0x1060), inv, f_q)) inv := mulmod(v, inv, f_q) - mstore(0xfe0, inv) + mstore(0x1060, inv) } -mstore(0x17c0, mulmod(mload(0xfc0), mload(0xfe0), f_q)) -mstore(0x17e0, mulmod(mload(0x1000), mload(0x1020), f_q)) -mstore(0x1800, mulmod(mload(0x1040), mload(0x1060), f_q)) -mstore(0x1820, mulmod(mload(0x1080), mload(0x10a0), f_q)) -mstore(0x1840, mulmod(mload(0x10c0), mload(0x10e0), f_q)) -mstore(0x1860, mulmod(mload(0x1100), mload(0x1120), f_q)) -mstore(0x1880, mulmod(mload(0x1140), mload(0x1160), f_q)) -mstore(0x18a0, mulmod(mload(0x1180), mload(0x11a0), f_q)) -mstore(0x18c0, mulmod(mload(0x11c0), mload(0x11e0), f_q)) -mstore(0x18e0, mulmod(mload(0x1200), mload(0x1220), f_q)) -mstore(0x1900, mulmod(mload(0x1240), mload(0x1260), f_q)) -mstore(0x1920, mulmod(mload(0x1280), mload(0x12a0), f_q)) -mstore(0x1940, mulmod(mload(0x12c0), mload(0x12e0), f_q)) -mstore(0x1960, mulmod(mload(0x1300), mload(0x1320), f_q)) -mstore(0x1980, mulmod(mload(0x1340), mload(0x1360), f_q)) -mstore(0x19a0, mulmod(mload(0x1380), mload(0x13a0), f_q)) -mstore(0x19c0, mulmod(mload(0x13c0), mload(0x13e0), f_q)) -mstore(0x19e0, mulmod(mload(0x1400), mload(0x1420), f_q)) -mstore(0x1a00, mulmod(mload(0x1440), mload(0x1460), f_q)) +mstore(0x1840, mulmod(mload(0x1040), mload(0x1060), f_q)) +mstore(0x1860, mulmod(mload(0x1080), mload(0x10a0), f_q)) +mstore(0x1880, mulmod(mload(0x10c0), mload(0x10e0), f_q)) +mstore(0x18a0, mulmod(mload(0x1100), mload(0x1120), f_q)) +mstore(0x18c0, mulmod(mload(0x1140), mload(0x1160), f_q)) +mstore(0x18e0, mulmod(mload(0x1180), mload(0x11a0), f_q)) +mstore(0x1900, mulmod(mload(0x11c0), mload(0x11e0), f_q)) +mstore(0x1920, mulmod(mload(0x1200), mload(0x1220), f_q)) +mstore(0x1940, mulmod(mload(0x1240), mload(0x1260), f_q)) +mstore(0x1960, mulmod(mload(0x1280), mload(0x12a0), f_q)) +mstore(0x1980, mulmod(mload(0x12c0), mload(0x12e0), f_q)) +mstore(0x19a0, mulmod(mload(0x1300), mload(0x1320), f_q)) +mstore(0x19c0, mulmod(mload(0x1340), mload(0x1360), f_q)) +mstore(0x19e0, mulmod(mload(0x1380), mload(0x13a0), f_q)) +mstore(0x1a00, mulmod(mload(0x13c0), mload(0x13e0), f_q)) +mstore(0x1a20, mulmod(mload(0x1400), mload(0x1420), f_q)) +mstore(0x1a40, mulmod(mload(0x1440), mload(0x1460), f_q)) +mstore(0x1a60, mulmod(mload(0x1480), mload(0x14a0), f_q)) +mstore(0x1a80, mulmod(mload(0x14c0), mload(0x14e0), f_q)) { - let result := mulmod(mload(0x18a0), mload(0x20), f_q) -result := addmod(mulmod(mload(0x18c0), mload(0x40), f_q), result, f_q) -result := addmod(mulmod(mload(0x18e0), mload(0x60), f_q), result, f_q) -result := addmod(mulmod(mload(0x1900), mload(0x80), f_q), result, f_q) -result := addmod(mulmod(mload(0x1920), mload(0xa0), f_q), result, f_q) + let result := mulmod(mload(0x1920), mload(0xa0), f_q) result := addmod(mulmod(mload(0x1940), mload(0xc0), f_q), result, f_q) result := addmod(mulmod(mload(0x1960), mload(0xe0), f_q), result, f_q) result := addmod(mulmod(mload(0x1980), mload(0x100), f_q), result, f_q) @@ -507,923 +509,927 @@ result := addmod(mulmod(mload(0x19a0), mload(0x120), f_q), result, f_q) result := addmod(mulmod(mload(0x19c0), mload(0x140), f_q), result, f_q) result := addmod(mulmod(mload(0x19e0), mload(0x160), f_q), result, f_q) result := addmod(mulmod(mload(0x1a00), mload(0x180), f_q), result, f_q) -mstore(6688, result) - } -mstore(0x1a40, mulmod(mload(0x700), mload(0x6e0), f_q)) -mstore(0x1a60, addmod(mload(0x6c0), mload(0x1a40), f_q)) -mstore(0x1a80, addmod(mload(0x1a60), sub(f_q, mload(0x720)), f_q)) -mstore(0x1aa0, mulmod(mload(0x1a80), mload(0x820), f_q)) -mstore(0x1ac0, mulmod(mload(0x560), mload(0x1aa0), f_q)) -mstore(0x1ae0, mulmod(mload(0x780), mload(0x760), f_q)) -mstore(0x1b00, addmod(mload(0x740), mload(0x1ae0), f_q)) -mstore(0x1b20, addmod(mload(0x1b00), sub(f_q, mload(0x7a0)), f_q)) -mstore(0x1b40, mulmod(mload(0x1b20), mload(0x840), f_q)) -mstore(0x1b60, addmod(mload(0x1ac0), mload(0x1b40), f_q)) -mstore(0x1b80, mulmod(mload(0x560), mload(0x1b60), f_q)) -mstore(0x1ba0, addmod(1, sub(f_q, mload(0x920)), f_q)) -mstore(0x1bc0, mulmod(mload(0x1ba0), mload(0x18a0), f_q)) -mstore(0x1be0, addmod(mload(0x1b80), mload(0x1bc0), f_q)) -mstore(0x1c00, mulmod(mload(0x560), mload(0x1be0), f_q)) -mstore(0x1c20, mulmod(mload(0x9e0), mload(0x9e0), f_q)) -mstore(0x1c40, addmod(mload(0x1c20), sub(f_q, mload(0x9e0)), f_q)) -mstore(0x1c60, mulmod(mload(0x1c40), mload(0x17c0), f_q)) -mstore(0x1c80, addmod(mload(0x1c00), mload(0x1c60), f_q)) -mstore(0x1ca0, mulmod(mload(0x560), mload(0x1c80), f_q)) -mstore(0x1cc0, addmod(mload(0x980), sub(f_q, mload(0x960)), f_q)) -mstore(0x1ce0, mulmod(mload(0x1cc0), mload(0x18a0), f_q)) -mstore(0x1d00, addmod(mload(0x1ca0), mload(0x1ce0), f_q)) -mstore(0x1d20, mulmod(mload(0x560), mload(0x1d00), f_q)) -mstore(0x1d40, addmod(mload(0x9e0), sub(f_q, mload(0x9c0)), f_q)) -mstore(0x1d60, mulmod(mload(0x1d40), mload(0x18a0), f_q)) +result := addmod(mulmod(mload(0x1a20), mload(0x1a0), f_q), result, f_q) +result := addmod(mulmod(mload(0x1a40), mload(0x1c0), f_q), result, f_q) +result := addmod(mulmod(mload(0x1a60), mload(0x1e0), f_q), result, f_q) +result := addmod(mulmod(mload(0x1a80), mload(0x200), f_q), result, f_q) +mstore(6816, result) + } +mstore(0x1ac0, mulmod(mload(0x780), mload(0x760), f_q)) +mstore(0x1ae0, addmod(mload(0x740), mload(0x1ac0), f_q)) +mstore(0x1b00, addmod(mload(0x1ae0), sub(f_q, mload(0x7a0)), f_q)) +mstore(0x1b20, mulmod(mload(0x1b00), mload(0x8a0), f_q)) +mstore(0x1b40, mulmod(mload(0x5e0), mload(0x1b20), f_q)) +mstore(0x1b60, mulmod(mload(0x800), mload(0x7e0), f_q)) +mstore(0x1b80, addmod(mload(0x7c0), mload(0x1b60), f_q)) +mstore(0x1ba0, addmod(mload(0x1b80), sub(f_q, mload(0x820)), f_q)) +mstore(0x1bc0, mulmod(mload(0x1ba0), mload(0x8c0), f_q)) +mstore(0x1be0, addmod(mload(0x1b40), mload(0x1bc0), f_q)) +mstore(0x1c00, mulmod(mload(0x5e0), mload(0x1be0), f_q)) +mstore(0x1c20, addmod(1, sub(f_q, mload(0x9a0)), f_q)) +mstore(0x1c40, mulmod(mload(0x1c20), mload(0x1920), f_q)) +mstore(0x1c60, addmod(mload(0x1c00), mload(0x1c40), f_q)) +mstore(0x1c80, mulmod(mload(0x5e0), mload(0x1c60), f_q)) +mstore(0x1ca0, mulmod(mload(0xa60), mload(0xa60), f_q)) +mstore(0x1cc0, addmod(mload(0x1ca0), sub(f_q, mload(0xa60)), f_q)) +mstore(0x1ce0, mulmod(mload(0x1cc0), mload(0x1840), f_q)) +mstore(0x1d00, addmod(mload(0x1c80), mload(0x1ce0), f_q)) +mstore(0x1d20, mulmod(mload(0x5e0), mload(0x1d00), f_q)) +mstore(0x1d40, addmod(mload(0xa00), sub(f_q, mload(0x9e0)), f_q)) +mstore(0x1d60, mulmod(mload(0x1d40), mload(0x1920), f_q)) mstore(0x1d80, addmod(mload(0x1d20), mload(0x1d60), f_q)) -mstore(0x1da0, mulmod(mload(0x560), mload(0x1d80), f_q)) -mstore(0x1dc0, addmod(1, sub(f_q, mload(0x17c0)), f_q)) -mstore(0x1de0, addmod(mload(0x17e0), mload(0x1800), f_q)) -mstore(0x1e00, addmod(mload(0x1de0), mload(0x1820), f_q)) -mstore(0x1e20, addmod(mload(0x1e00), mload(0x1840), f_q)) -mstore(0x1e40, addmod(mload(0x1e20), mload(0x1860), f_q)) -mstore(0x1e60, addmod(mload(0x1e40), mload(0x1880), f_q)) -mstore(0x1e80, addmod(mload(0x1dc0), sub(f_q, mload(0x1e60)), f_q)) -mstore(0x1ea0, mulmod(mload(0x880), mload(0x360), f_q)) -mstore(0x1ec0, addmod(mload(0x7e0), mload(0x1ea0), f_q)) -mstore(0x1ee0, addmod(mload(0x1ec0), mload(0x3c0), f_q)) -mstore(0x1f00, mulmod(mload(0x8a0), mload(0x360), f_q)) -mstore(0x1f20, addmod(mload(0x6c0), mload(0x1f00), f_q)) -mstore(0x1f40, addmod(mload(0x1f20), mload(0x3c0), f_q)) -mstore(0x1f60, mulmod(mload(0x1f40), mload(0x1ee0), f_q)) -mstore(0x1f80, mulmod(mload(0x1f60), mload(0x940), f_q)) -mstore(0x1fa0, mulmod(1, mload(0x360), f_q)) -mstore(0x1fc0, mulmod(mload(0x680), mload(0x1fa0), f_q)) -mstore(0x1fe0, addmod(mload(0x7e0), mload(0x1fc0), f_q)) -mstore(0x2000, addmod(mload(0x1fe0), mload(0x3c0), f_q)) -mstore(0x2020, mulmod(4131629893567559867359510883348571134090853742863529169391034518566172092834, mload(0x360), f_q)) -mstore(0x2040, mulmod(mload(0x680), mload(0x2020), f_q)) -mstore(0x2060, addmod(mload(0x6c0), mload(0x2040), f_q)) -mstore(0x2080, addmod(mload(0x2060), mload(0x3c0), f_q)) -mstore(0x20a0, mulmod(mload(0x2080), mload(0x2000), f_q)) -mstore(0x20c0, mulmod(mload(0x20a0), mload(0x920), f_q)) -mstore(0x20e0, addmod(mload(0x1f80), sub(f_q, mload(0x20c0)), f_q)) -mstore(0x2100, mulmod(mload(0x20e0), mload(0x1e80), f_q)) -mstore(0x2120, addmod(mload(0x1da0), mload(0x2100), f_q)) -mstore(0x2140, mulmod(mload(0x560), mload(0x2120), f_q)) -mstore(0x2160, mulmod(mload(0x8c0), mload(0x360), f_q)) -mstore(0x2180, addmod(mload(0x740), mload(0x2160), f_q)) -mstore(0x21a0, addmod(mload(0x2180), mload(0x3c0), f_q)) -mstore(0x21c0, mulmod(mload(0x8e0), mload(0x360), f_q)) -mstore(0x21e0, addmod(mload(0x7c0), mload(0x21c0), f_q)) -mstore(0x2200, addmod(mload(0x21e0), mload(0x3c0), f_q)) -mstore(0x2220, mulmod(mload(0x2200), mload(0x21a0), f_q)) -mstore(0x2240, mulmod(mload(0x2220), mload(0x9a0), f_q)) -mstore(0x2260, mulmod(8910878055287538404433155982483128285667088683464058436815641868457422632747, mload(0x360), f_q)) -mstore(0x2280, mulmod(mload(0x680), mload(0x2260), f_q)) -mstore(0x22a0, addmod(mload(0x740), mload(0x2280), f_q)) -mstore(0x22c0, addmod(mload(0x22a0), mload(0x3c0), f_q)) -mstore(0x22e0, mulmod(11166246659983828508719468090013646171463329086121580628794302409516816350802, mload(0x360), f_q)) -mstore(0x2300, mulmod(mload(0x680), mload(0x22e0), f_q)) +mstore(0x1da0, mulmod(mload(0x5e0), mload(0x1d80), f_q)) +mstore(0x1dc0, addmod(mload(0xa60), sub(f_q, mload(0xa40)), f_q)) +mstore(0x1de0, mulmod(mload(0x1dc0), mload(0x1920), f_q)) +mstore(0x1e00, addmod(mload(0x1da0), mload(0x1de0), f_q)) +mstore(0x1e20, mulmod(mload(0x5e0), mload(0x1e00), f_q)) +mstore(0x1e40, addmod(1, sub(f_q, mload(0x1840)), f_q)) +mstore(0x1e60, addmod(mload(0x1860), mload(0x1880), f_q)) +mstore(0x1e80, addmod(mload(0x1e60), mload(0x18a0), f_q)) +mstore(0x1ea0, addmod(mload(0x1e80), mload(0x18c0), f_q)) +mstore(0x1ec0, addmod(mload(0x1ea0), mload(0x18e0), f_q)) +mstore(0x1ee0, addmod(mload(0x1ec0), mload(0x1900), f_q)) +mstore(0x1f00, addmod(mload(0x1e40), sub(f_q, mload(0x1ee0)), f_q)) +mstore(0x1f20, mulmod(mload(0x900), mload(0x3e0), f_q)) +mstore(0x1f40, addmod(mload(0x860), mload(0x1f20), f_q)) +mstore(0x1f60, addmod(mload(0x1f40), mload(0x440), f_q)) +mstore(0x1f80, mulmod(mload(0x920), mload(0x3e0), f_q)) +mstore(0x1fa0, addmod(mload(0x740), mload(0x1f80), f_q)) +mstore(0x1fc0, addmod(mload(0x1fa0), mload(0x440), f_q)) +mstore(0x1fe0, mulmod(mload(0x1fc0), mload(0x1f60), f_q)) +mstore(0x2000, mulmod(mload(0x1fe0), mload(0x9c0), f_q)) +mstore(0x2020, mulmod(1, mload(0x3e0), f_q)) +mstore(0x2040, mulmod(mload(0x700), mload(0x2020), f_q)) +mstore(0x2060, addmod(mload(0x860), mload(0x2040), f_q)) +mstore(0x2080, addmod(mload(0x2060), mload(0x440), f_q)) +mstore(0x20a0, mulmod(4131629893567559867359510883348571134090853742863529169391034518566172092834, mload(0x3e0), f_q)) +mstore(0x20c0, mulmod(mload(0x700), mload(0x20a0), f_q)) +mstore(0x20e0, addmod(mload(0x740), mload(0x20c0), f_q)) +mstore(0x2100, addmod(mload(0x20e0), mload(0x440), f_q)) +mstore(0x2120, mulmod(mload(0x2100), mload(0x2080), f_q)) +mstore(0x2140, mulmod(mload(0x2120), mload(0x9a0), f_q)) +mstore(0x2160, addmod(mload(0x2000), sub(f_q, mload(0x2140)), f_q)) +mstore(0x2180, mulmod(mload(0x2160), mload(0x1f00), f_q)) +mstore(0x21a0, addmod(mload(0x1e20), mload(0x2180), f_q)) +mstore(0x21c0, mulmod(mload(0x5e0), mload(0x21a0), f_q)) +mstore(0x21e0, mulmod(mload(0x940), mload(0x3e0), f_q)) +mstore(0x2200, addmod(mload(0x7c0), mload(0x21e0), f_q)) +mstore(0x2220, addmod(mload(0x2200), mload(0x440), f_q)) +mstore(0x2240, mulmod(mload(0x960), mload(0x3e0), f_q)) +mstore(0x2260, addmod(mload(0x840), mload(0x2240), f_q)) +mstore(0x2280, addmod(mload(0x2260), mload(0x440), f_q)) +mstore(0x22a0, mulmod(mload(0x2280), mload(0x2220), f_q)) +mstore(0x22c0, mulmod(mload(0x22a0), mload(0xa20), f_q)) +mstore(0x22e0, mulmod(8910878055287538404433155982483128285667088683464058436815641868457422632747, mload(0x3e0), f_q)) +mstore(0x2300, mulmod(mload(0x700), mload(0x22e0), f_q)) mstore(0x2320, addmod(mload(0x7c0), mload(0x2300), f_q)) -mstore(0x2340, addmod(mload(0x2320), mload(0x3c0), f_q)) -mstore(0x2360, mulmod(mload(0x2340), mload(0x22c0), f_q)) -mstore(0x2380, mulmod(mload(0x2360), mload(0x980), f_q)) -mstore(0x23a0, addmod(mload(0x2240), sub(f_q, mload(0x2380)), f_q)) -mstore(0x23c0, mulmod(mload(0x23a0), mload(0x1e80), f_q)) -mstore(0x23e0, addmod(mload(0x2140), mload(0x23c0), f_q)) -mstore(0x2400, mulmod(mload(0x560), mload(0x23e0), f_q)) -mstore(0x2420, mulmod(mload(0x900), mload(0x360), f_q)) -mstore(0x2440, addmod(mload(0x1a20), mload(0x2420), f_q)) -mstore(0x2460, addmod(mload(0x2440), mload(0x3c0), f_q)) -mstore(0x2480, mulmod(mload(0x2460), mload(0xa00), f_q)) -mstore(0x24a0, mulmod(284840088355319032285349970403338060113257071685626700086398481893096618818, mload(0x360), f_q)) -mstore(0x24c0, mulmod(mload(0x680), mload(0x24a0), f_q)) -mstore(0x24e0, addmod(mload(0x1a20), mload(0x24c0), f_q)) -mstore(0x2500, addmod(mload(0x24e0), mload(0x3c0), f_q)) -mstore(0x2520, mulmod(mload(0x2500), mload(0x9e0), f_q)) -mstore(0x2540, addmod(mload(0x2480), sub(f_q, mload(0x2520)), f_q)) -mstore(0x2560, mulmod(mload(0x2540), mload(0x1e80), f_q)) -mstore(0x2580, addmod(mload(0x2400), mload(0x2560), f_q)) -mstore(0x25a0, mulmod(mload(0x560), mload(0x2580), f_q)) -mstore(0x25c0, addmod(1, sub(f_q, mload(0xa20)), f_q)) -mstore(0x25e0, mulmod(mload(0x25c0), mload(0x18a0), f_q)) -mstore(0x2600, addmod(mload(0x25a0), mload(0x25e0), f_q)) -mstore(0x2620, mulmod(mload(0x560), mload(0x2600), f_q)) -mstore(0x2640, mulmod(mload(0xa20), mload(0xa20), f_q)) -mstore(0x2660, addmod(mload(0x2640), sub(f_q, mload(0xa20)), f_q)) -mstore(0x2680, mulmod(mload(0x2660), mload(0x17c0), f_q)) -mstore(0x26a0, addmod(mload(0x2620), mload(0x2680), f_q)) -mstore(0x26c0, mulmod(mload(0x560), mload(0x26a0), f_q)) -mstore(0x26e0, addmod(mload(0xa60), mload(0x360), f_q)) -mstore(0x2700, mulmod(mload(0x26e0), mload(0xa40), f_q)) -mstore(0x2720, addmod(mload(0xaa0), mload(0x3c0), f_q)) -mstore(0x2740, mulmod(mload(0x2720), mload(0x2700), f_q)) -mstore(0x2760, addmod(mload(0x7c0), mload(0x360), f_q)) -mstore(0x2780, mulmod(mload(0x2760), mload(0xa20), f_q)) -mstore(0x27a0, addmod(mload(0x800), mload(0x3c0), f_q)) +mstore(0x2340, addmod(mload(0x2320), mload(0x440), f_q)) +mstore(0x2360, mulmod(11166246659983828508719468090013646171463329086121580628794302409516816350802, mload(0x3e0), f_q)) +mstore(0x2380, mulmod(mload(0x700), mload(0x2360), f_q)) +mstore(0x23a0, addmod(mload(0x840), mload(0x2380), f_q)) +mstore(0x23c0, addmod(mload(0x23a0), mload(0x440), f_q)) +mstore(0x23e0, mulmod(mload(0x23c0), mload(0x2340), f_q)) +mstore(0x2400, mulmod(mload(0x23e0), mload(0xa00), f_q)) +mstore(0x2420, addmod(mload(0x22c0), sub(f_q, mload(0x2400)), f_q)) +mstore(0x2440, mulmod(mload(0x2420), mload(0x1f00), f_q)) +mstore(0x2460, addmod(mload(0x21c0), mload(0x2440), f_q)) +mstore(0x2480, mulmod(mload(0x5e0), mload(0x2460), f_q)) +mstore(0x24a0, mulmod(mload(0x980), mload(0x3e0), f_q)) +mstore(0x24c0, addmod(mload(0x1aa0), mload(0x24a0), f_q)) +mstore(0x24e0, addmod(mload(0x24c0), mload(0x440), f_q)) +mstore(0x2500, mulmod(mload(0x24e0), mload(0xa80), f_q)) +mstore(0x2520, mulmod(284840088355319032285349970403338060113257071685626700086398481893096618818, mload(0x3e0), f_q)) +mstore(0x2540, mulmod(mload(0x700), mload(0x2520), f_q)) +mstore(0x2560, addmod(mload(0x1aa0), mload(0x2540), f_q)) +mstore(0x2580, addmod(mload(0x2560), mload(0x440), f_q)) +mstore(0x25a0, mulmod(mload(0x2580), mload(0xa60), f_q)) +mstore(0x25c0, addmod(mload(0x2500), sub(f_q, mload(0x25a0)), f_q)) +mstore(0x25e0, mulmod(mload(0x25c0), mload(0x1f00), f_q)) +mstore(0x2600, addmod(mload(0x2480), mload(0x25e0), f_q)) +mstore(0x2620, mulmod(mload(0x5e0), mload(0x2600), f_q)) +mstore(0x2640, addmod(1, sub(f_q, mload(0xaa0)), f_q)) +mstore(0x2660, mulmod(mload(0x2640), mload(0x1920), f_q)) +mstore(0x2680, addmod(mload(0x2620), mload(0x2660), f_q)) +mstore(0x26a0, mulmod(mload(0x5e0), mload(0x2680), f_q)) +mstore(0x26c0, mulmod(mload(0xaa0), mload(0xaa0), f_q)) +mstore(0x26e0, addmod(mload(0x26c0), sub(f_q, mload(0xaa0)), f_q)) +mstore(0x2700, mulmod(mload(0x26e0), mload(0x1840), f_q)) +mstore(0x2720, addmod(mload(0x26a0), mload(0x2700), f_q)) +mstore(0x2740, mulmod(mload(0x5e0), mload(0x2720), f_q)) +mstore(0x2760, addmod(mload(0xae0), mload(0x3e0), f_q)) +mstore(0x2780, mulmod(mload(0x2760), mload(0xac0), f_q)) +mstore(0x27a0, addmod(mload(0xb20), mload(0x440), f_q)) mstore(0x27c0, mulmod(mload(0x27a0), mload(0x2780), f_q)) -mstore(0x27e0, addmod(mload(0x2740), sub(f_q, mload(0x27c0)), f_q)) -mstore(0x2800, mulmod(mload(0x27e0), mload(0x1e80), f_q)) -mstore(0x2820, addmod(mload(0x26c0), mload(0x2800), f_q)) -mstore(0x2840, mulmod(mload(0x560), mload(0x2820), f_q)) -mstore(0x2860, addmod(mload(0xa60), sub(f_q, mload(0xaa0)), f_q)) -mstore(0x2880, mulmod(mload(0x2860), mload(0x18a0), f_q)) -mstore(0x28a0, addmod(mload(0x2840), mload(0x2880), f_q)) -mstore(0x28c0, mulmod(mload(0x560), mload(0x28a0), f_q)) -mstore(0x28e0, mulmod(mload(0x2860), mload(0x1e80), f_q)) -mstore(0x2900, addmod(mload(0xa60), sub(f_q, mload(0xa80)), f_q)) -mstore(0x2920, mulmod(mload(0x2900), mload(0x28e0), f_q)) -mstore(0x2940, addmod(mload(0x28c0), mload(0x2920), f_q)) -mstore(0x2960, mulmod(mload(0xf60), mload(0xf60), f_q)) -mstore(0x2980, mulmod(mload(0x2960), mload(0xf60), f_q)) -mstore(0x29a0, mulmod(1, mload(0xf60), f_q)) -mstore(0x29c0, mulmod(1, mload(0x2960), f_q)) -mstore(0x29e0, mulmod(mload(0x2940), mload(0xf80), f_q)) -mstore(0x2a00, mulmod(mload(0xce0), mload(0x680), f_q)) -mstore(0x2a20, mulmod(mload(0x2a00), mload(0x680), f_q)) -mstore(0x2a40, mulmod(mload(0x680), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) -mstore(0x2a60, addmod(mload(0xbe0), sub(f_q, mload(0x2a40)), f_q)) -mstore(0x2a80, mulmod(mload(0x680), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) -mstore(0x2aa0, addmod(mload(0xbe0), sub(f_q, mload(0x2a80)), f_q)) -mstore(0x2ac0, mulmod(mload(0x680), 1, f_q)) -mstore(0x2ae0, addmod(mload(0xbe0), sub(f_q, mload(0x2ac0)), f_q)) -mstore(0x2b00, mulmod(mload(0x680), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) -mstore(0x2b20, addmod(mload(0xbe0), sub(f_q, mload(0x2b00)), f_q)) -mstore(0x2b40, mulmod(mload(0x680), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) -mstore(0x2b60, addmod(mload(0xbe0), sub(f_q, mload(0x2b40)), f_q)) -mstore(0x2b80, mulmod(mload(0x680), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) -mstore(0x2ba0, addmod(mload(0xbe0), sub(f_q, mload(0x2b80)), f_q)) -mstore(0x2bc0, mulmod(12142985201493934370659158242092015678465417407805993602870272259656026591649, mload(0x2a00), f_q)) -mstore(0x2be0, mulmod(mload(0x2bc0), 1, f_q)) +mstore(0x27e0, addmod(mload(0x840), mload(0x3e0), f_q)) +mstore(0x2800, mulmod(mload(0x27e0), mload(0xaa0), f_q)) +mstore(0x2820, addmod(mload(0x880), mload(0x440), f_q)) +mstore(0x2840, mulmod(mload(0x2820), mload(0x2800), f_q)) +mstore(0x2860, addmod(mload(0x27c0), sub(f_q, mload(0x2840)), f_q)) +mstore(0x2880, mulmod(mload(0x2860), mload(0x1f00), f_q)) +mstore(0x28a0, addmod(mload(0x2740), mload(0x2880), f_q)) +mstore(0x28c0, mulmod(mload(0x5e0), mload(0x28a0), f_q)) +mstore(0x28e0, addmod(mload(0xae0), sub(f_q, mload(0xb20)), f_q)) +mstore(0x2900, mulmod(mload(0x28e0), mload(0x1920), f_q)) +mstore(0x2920, addmod(mload(0x28c0), mload(0x2900), f_q)) +mstore(0x2940, mulmod(mload(0x5e0), mload(0x2920), f_q)) +mstore(0x2960, mulmod(mload(0x28e0), mload(0x1f00), f_q)) +mstore(0x2980, addmod(mload(0xae0), sub(f_q, mload(0xb00)), f_q)) +mstore(0x29a0, mulmod(mload(0x2980), mload(0x2960), f_q)) +mstore(0x29c0, addmod(mload(0x2940), mload(0x29a0), f_q)) +mstore(0x29e0, mulmod(mload(0xfe0), mload(0xfe0), f_q)) +mstore(0x2a00, mulmod(mload(0x29e0), mload(0xfe0), f_q)) +mstore(0x2a20, mulmod(1, mload(0xfe0), f_q)) +mstore(0x2a40, mulmod(1, mload(0x29e0), f_q)) +mstore(0x2a60, mulmod(mload(0x29c0), mload(0x1000), f_q)) +mstore(0x2a80, mulmod(mload(0xd60), mload(0x700), f_q)) +mstore(0x2aa0, mulmod(mload(0x2a80), mload(0x700), f_q)) +mstore(0x2ac0, mulmod(mload(0x700), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) +mstore(0x2ae0, addmod(mload(0xc60), sub(f_q, mload(0x2ac0)), f_q)) +mstore(0x2b00, mulmod(mload(0x700), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) +mstore(0x2b20, addmod(mload(0xc60), sub(f_q, mload(0x2b00)), f_q)) +mstore(0x2b40, mulmod(mload(0x700), 1, f_q)) +mstore(0x2b60, addmod(mload(0xc60), sub(f_q, mload(0x2b40)), f_q)) +mstore(0x2b80, mulmod(mload(0x700), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) +mstore(0x2ba0, addmod(mload(0xc60), sub(f_q, mload(0x2b80)), f_q)) +mstore(0x2bc0, mulmod(mload(0x700), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) +mstore(0x2be0, addmod(mload(0xc60), sub(f_q, mload(0x2bc0)), f_q)) +mstore(0x2c00, mulmod(mload(0x700), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) +mstore(0x2c20, addmod(mload(0xc60), sub(f_q, mload(0x2c00)), f_q)) +mstore(0x2c40, mulmod(12142985201493934370659158242092015678465417407805993602870272259656026591649, mload(0x2a80), f_q)) +mstore(0x2c60, mulmod(mload(0x2c40), 1, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2bc0), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2be0)), f_q), result, f_q) -mstore(11264, result) + let result := mulmod(mload(0xc60), mload(0x2c40), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2c60)), f_q), result, f_q) +mstore(11392, result) } -mstore(0x2c20, mulmod(12858672892267984631233883117647866851148059157064290846881981435700301865966, mload(0x2a00), f_q)) -mstore(0x2c40, mulmod(mload(0x2c20), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) +mstore(0x2ca0, mulmod(12858672892267984631233883117647866851148059157064290846881981435700301865966, mload(0x2a80), f_q)) +mstore(0x2cc0, mulmod(mload(0x2ca0), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2c20), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2c40)), f_q), result, f_q) -mstore(11360, result) + let result := mulmod(mload(0xc60), mload(0x2ca0), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2cc0)), f_q), result, f_q) +mstore(11488, result) } -mstore(0x2c80, mulmod(20880316823902385764034220950270964645276820671488089374347912013802613180902, mload(0x2a00), f_q)) -mstore(0x2ca0, mulmod(mload(0x2c80), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) +mstore(0x2d00, mulmod(20880316823902385764034220950270964645276820671488089374347912013802613180902, mload(0x2a80), f_q)) +mstore(0x2d20, mulmod(mload(0x2d00), 19032961837237948602743626455740240236231119053033140765040043513661803148152, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2c80), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2ca0)), f_q), result, f_q) -mstore(11456, result) + let result := mulmod(mload(0xc60), mload(0x2d00), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2d20)), f_q), result, f_q) +mstore(11584, result) } -mstore(0x2ce0, mulmod(17575202995145968412995467587554373308969396527144859871466654432792864477050, mload(0x2a00), f_q)) -mstore(0x2d00, mulmod(mload(0x2ce0), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) +mstore(0x2d60, mulmod(17575202995145968412995467587554373308969396527144859871466654432792864477050, mload(0x2a80), f_q)) +mstore(0x2d80, mulmod(mload(0x2d60), 3766081621734395783232337525162072736827576297943013392955872170138036189193, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2ce0), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2d00)), f_q), result, f_q) -mstore(11552, result) - } -mstore(0x2d40, mulmod(1, mload(0x2ae0), f_q)) -mstore(0x2d60, mulmod(mload(0x2d40), mload(0x2b20), f_q)) -mstore(0x2d80, mulmod(mload(0x2d60), mload(0x2b60), f_q)) -mstore(0x2da0, mulmod(mload(0x2d80), mload(0x2ba0), f_q)) + let result := mulmod(mload(0xc60), mload(0x2d60), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2d80)), f_q), result, f_q) +mstore(11680, result) + } +mstore(0x2dc0, mulmod(1, mload(0x2b60), f_q)) +mstore(0x2de0, mulmod(mload(0x2dc0), mload(0x2ba0), f_q)) +mstore(0x2e00, mulmod(mload(0x2de0), mload(0x2be0), f_q)) +mstore(0x2e20, mulmod(mload(0x2e00), mload(0x2c20), f_q)) { - let result := mulmod(mload(0xbe0), 1, f_q) -result := addmod(mulmod(mload(0x680), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q), result, f_q) -mstore(11712, result) + let result := mulmod(mload(0xc60), 1, f_q) +result := addmod(mulmod(mload(0x700), 21888242871839275222246405745257275088548364400416034343698204186575808495616, f_q), result, f_q) +mstore(11840, result) } -mstore(0x2de0, mulmod(21869340487638379139105209872801492456082780734504032269410146788560475001942, mload(0xce0), f_q)) -mstore(0x2e00, mulmod(mload(0x2de0), 1, f_q)) +mstore(0x2e60, mulmod(21869340487638379139105209872801492456082780734504032269410146788560475001942, mload(0xd60), f_q)) +mstore(0x2e80, mulmod(mload(0x2e60), 1, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2de0), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2e00)), f_q), result, f_q) -mstore(11808, result) + let result := mulmod(mload(0xc60), mload(0x2e60), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2e80)), f_q), result, f_q) +mstore(11936, result) } -mstore(0x2e40, mulmod(16199055355995875908874098831560099797649990976433931925532505422809603664814, mload(0xce0), f_q)) -mstore(0x2e60, mulmod(mload(0x2e40), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) +mstore(0x2ec0, mulmod(16199055355995875908874098831560099797649990976433931925532505422809603664814, mload(0xd60), f_q)) +mstore(0x2ee0, mulmod(mload(0x2ec0), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2e40), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2e60)), f_q), result, f_q) -mstore(11904, result) + let result := mulmod(mload(0xc60), mload(0x2ec0), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2ee0)), f_q), result, f_q) +mstore(12032, result) } -mstore(0x2ea0, mulmod(4865187280763976036134135047793386535665014353502380106898040096680231678680, mload(0xce0), f_q)) -mstore(0x2ec0, mulmod(mload(0x2ea0), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) +mstore(0x2f20, mulmod(4865187280763976036134135047793386535665014353502380106898040096680231678680, mload(0xd60), f_q)) +mstore(0x2f40, mulmod(mload(0x2f20), 20975929243409798062839949658616274858986091382510192949221301676705706354487, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2ea0), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2ec0)), f_q), result, f_q) -mstore(12000, result) + let result := mulmod(mload(0xc60), mload(0x2f20), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2f40)), f_q), result, f_q) +mstore(12128, result) } -mstore(0x2f00, mulmod(mload(0x2d60), mload(0x2a60), f_q)) -mstore(0x2f20, mulmod(20461838439117790833741043996939313553025008529160428886800406442142042007111, mload(0x680), f_q)) -mstore(0x2f40, mulmod(mload(0x2f20), 1, f_q)) +mstore(0x2f80, mulmod(mload(0x2de0), mload(0x2ae0), f_q)) +mstore(0x2fa0, mulmod(20461838439117790833741043996939313553025008529160428886800406442142042007111, mload(0x700), f_q)) +mstore(0x2fc0, mulmod(mload(0x2fa0), 1, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2f20), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2f40)), f_q), result, f_q) -mstore(12128, result) + let result := mulmod(mload(0xc60), mload(0x2fa0), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x2fc0)), f_q), result, f_q) +mstore(12256, result) } -mstore(0x2f80, mulmod(1426404432721484388505361748317961535523355871255605456897797744433766488506, mload(0x680), f_q)) -mstore(0x2fa0, mulmod(mload(0x2f80), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) +mstore(0x3000, mulmod(1426404432721484388505361748317961535523355871255605456897797744433766488506, mload(0x700), f_q)) +mstore(0x3020, mulmod(mload(0x3000), 1426404432721484388505361748317961535523355871255605456897797744433766488507, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2f80), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x2fa0)), f_q), result, f_q) -mstore(12224, result) + let result := mulmod(mload(0xc60), mload(0x3000), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x3020)), f_q), result, f_q) +mstore(12352, result) } -mstore(0x2fe0, mulmod(19102728315457599142069468034376470979900453007937332237837518576196438670602, mload(0x680), f_q)) -mstore(0x3000, mulmod(mload(0x2fe0), 1, f_q)) +mstore(0x3060, mulmod(19102728315457599142069468034376470979900453007937332237837518576196438670602, mload(0x700), f_q)) +mstore(0x3080, mulmod(mload(0x3060), 1, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x2fe0), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x3000)), f_q), result, f_q) -mstore(12320, result) + let result := mulmod(mload(0xc60), mload(0x3060), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x3080)), f_q), result, f_q) +mstore(12448, result) } -mstore(0x3040, mulmod(2785514556381676080176937710880804108647911392478702105860685610379369825015, mload(0x680), f_q)) -mstore(0x3060, mulmod(mload(0x3040), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) +mstore(0x30c0, mulmod(2785514556381676080176937710880804108647911392478702105860685610379369825015, mload(0x700), f_q)) +mstore(0x30e0, mulmod(mload(0x30c0), 2785514556381676080176937710880804108647911392478702105860685610379369825016, f_q)) { - let result := mulmod(mload(0xbe0), mload(0x3040), f_q) -result := addmod(mulmod(mload(0x680), sub(f_q, mload(0x3060)), f_q), result, f_q) -mstore(12416, result) + let result := mulmod(mload(0xc60), mload(0x30c0), f_q) +result := addmod(mulmod(mload(0x700), sub(f_q, mload(0x30e0)), f_q), result, f_q) +mstore(12544, result) } -mstore(0x30a0, mulmod(mload(0x2d40), mload(0x2aa0), f_q)) +mstore(0x3120, mulmod(mload(0x2dc0), mload(0x2b20), f_q)) { - let prod := mload(0x2c00) + let prod := mload(0x2c80) - prod := mulmod(mload(0x2c60), prod, f_q) - mstore(0x30c0, prod) - - prod := mulmod(mload(0x2cc0), prod, f_q) - mstore(0x30e0, prod) - - prod := mulmod(mload(0x2d20), prod, f_q) - mstore(0x3100, prod) - - prod := mulmod(mload(0x2dc0), prod, f_q) - mstore(0x3120, prod) - - prod := mulmod(mload(0x2d40), prod, f_q) + prod := mulmod(mload(0x2ce0), prod, f_q) mstore(0x3140, prod) - prod := mulmod(mload(0x2e20), prod, f_q) + prod := mulmod(mload(0x2d40), prod, f_q) mstore(0x3160, prod) - prod := mulmod(mload(0x2e80), prod, f_q) + prod := mulmod(mload(0x2da0), prod, f_q) mstore(0x3180, prod) - prod := mulmod(mload(0x2ee0), prod, f_q) + prod := mulmod(mload(0x2e40), prod, f_q) mstore(0x31a0, prod) - prod := mulmod(mload(0x2f00), prod, f_q) + prod := mulmod(mload(0x2dc0), prod, f_q) mstore(0x31c0, prod) - prod := mulmod(mload(0x2f60), prod, f_q) + prod := mulmod(mload(0x2ea0), prod, f_q) mstore(0x31e0, prod) - prod := mulmod(mload(0x2fc0), prod, f_q) + prod := mulmod(mload(0x2f00), prod, f_q) mstore(0x3200, prod) - prod := mulmod(mload(0x2d60), prod, f_q) + prod := mulmod(mload(0x2f60), prod, f_q) mstore(0x3220, prod) - prod := mulmod(mload(0x3020), prod, f_q) + prod := mulmod(mload(0x2f80), prod, f_q) mstore(0x3240, prod) - prod := mulmod(mload(0x3080), prod, f_q) + prod := mulmod(mload(0x2fe0), prod, f_q) mstore(0x3260, prod) - prod := mulmod(mload(0x30a0), prod, f_q) + prod := mulmod(mload(0x3040), prod, f_q) mstore(0x3280, prod) + prod := mulmod(mload(0x2de0), prod, f_q) + mstore(0x32a0, prod) + + prod := mulmod(mload(0x30a0), prod, f_q) + mstore(0x32c0, prod) + + prod := mulmod(mload(0x3100), prod, f_q) + mstore(0x32e0, prod) + + prod := mulmod(mload(0x3120), prod, f_q) + mstore(0x3300, prod) + } -mstore(0x32c0, 32) -mstore(0x32e0, 32) -mstore(0x3300, 32) -mstore(0x3320, mload(0x3280)) -mstore(0x3340, 21888242871839275222246405745257275088548364400416034343698204186575808495615) -mstore(0x3360, 21888242871839275222246405745257275088548364400416034343698204186575808495617) -success := and(eq(staticcall(gas(), 0x5, 0x32c0, 0xc0, 0x32a0, 0x20), 1), success) +mstore(0x3340, 32) +mstore(0x3360, 32) +mstore(0x3380, 32) +mstore(0x33a0, mload(0x3300)) +mstore(0x33c0, 21888242871839275222246405745257275088548364400416034343698204186575808495615) +mstore(0x33e0, 21888242871839275222246405745257275088548364400416034343698204186575808495617) +success := and(eq(staticcall(gas(), 0x5, 0x3340, 0xc0, 0x3320, 0x20), 1), success) { - let inv := mload(0x32a0) + let inv := mload(0x3320) let v - v := mload(0x30a0) - mstore(12448, mulmod(mload(0x3260), inv, f_q)) + v := mload(0x3120) + mstore(12576, mulmod(mload(0x32e0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x3080) - mstore(12416, mulmod(mload(0x3240), inv, f_q)) + v := mload(0x3100) + mstore(12544, mulmod(mload(0x32c0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x3020) - mstore(12320, mulmod(mload(0x3220), inv, f_q)) + v := mload(0x30a0) + mstore(12448, mulmod(mload(0x32a0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2d60) - mstore(11616, mulmod(mload(0x3200), inv, f_q)) + v := mload(0x2de0) + mstore(11744, mulmod(mload(0x3280), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2fc0) - mstore(12224, mulmod(mload(0x31e0), inv, f_q)) + v := mload(0x3040) + mstore(12352, mulmod(mload(0x3260), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2f60) - mstore(12128, mulmod(mload(0x31c0), inv, f_q)) + v := mload(0x2fe0) + mstore(12256, mulmod(mload(0x3240), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2f00) - mstore(12032, mulmod(mload(0x31a0), inv, f_q)) + v := mload(0x2f80) + mstore(12160, mulmod(mload(0x3220), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2ee0) - mstore(12000, mulmod(mload(0x3180), inv, f_q)) + v := mload(0x2f60) + mstore(12128, mulmod(mload(0x3200), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2e80) - mstore(11904, mulmod(mload(0x3160), inv, f_q)) + v := mload(0x2f00) + mstore(12032, mulmod(mload(0x31e0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2e20) - mstore(11808, mulmod(mload(0x3140), inv, f_q)) + v := mload(0x2ea0) + mstore(11936, mulmod(mload(0x31c0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2d40) - mstore(11584, mulmod(mload(0x3120), inv, f_q)) + v := mload(0x2dc0) + mstore(11712, mulmod(mload(0x31a0), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2dc0) - mstore(11712, mulmod(mload(0x3100), inv, f_q)) + v := mload(0x2e40) + mstore(11840, mulmod(mload(0x3180), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2d20) - mstore(11552, mulmod(mload(0x30e0), inv, f_q)) + v := mload(0x2da0) + mstore(11680, mulmod(mload(0x3160), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2cc0) - mstore(11456, mulmod(mload(0x30c0), inv, f_q)) + v := mload(0x2d40) + mstore(11584, mulmod(mload(0x3140), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x2c60) - mstore(11360, mulmod(mload(0x2c00), inv, f_q)) + v := mload(0x2ce0) + mstore(11488, mulmod(mload(0x2c80), inv, f_q)) inv := mulmod(v, inv, f_q) - mstore(0x2c00, inv) + mstore(0x2c80, inv) } { - let result := mload(0x2c00) -result := addmod(mload(0x2c60), result, f_q) -result := addmod(mload(0x2cc0), result, f_q) -result := addmod(mload(0x2d20), result, f_q) -mstore(13184, result) + let result := mload(0x2c80) +result := addmod(mload(0x2ce0), result, f_q) +result := addmod(mload(0x2d40), result, f_q) +result := addmod(mload(0x2da0), result, f_q) +mstore(13312, result) } -mstore(0x33a0, mulmod(mload(0x2da0), mload(0x2d40), f_q)) +mstore(0x3420, mulmod(mload(0x2e20), mload(0x2dc0), f_q)) { - let result := mload(0x2dc0) -mstore(13248, result) + let result := mload(0x2e40) +mstore(13376, result) } -mstore(0x33e0, mulmod(mload(0x2da0), mload(0x2f00), f_q)) +mstore(0x3460, mulmod(mload(0x2e20), mload(0x2f80), f_q)) { - let result := mload(0x2e20) -result := addmod(mload(0x2e80), result, f_q) -result := addmod(mload(0x2ee0), result, f_q) -mstore(13312, result) + let result := mload(0x2ea0) +result := addmod(mload(0x2f00), result, f_q) +result := addmod(mload(0x2f60), result, f_q) +mstore(13440, result) } -mstore(0x3420, mulmod(mload(0x2da0), mload(0x2d60), f_q)) +mstore(0x34a0, mulmod(mload(0x2e20), mload(0x2de0), f_q)) { - let result := mload(0x2f60) -result := addmod(mload(0x2fc0), result, f_q) -mstore(13376, result) + let result := mload(0x2fe0) +result := addmod(mload(0x3040), result, f_q) +mstore(13504, result) } -mstore(0x3460, mulmod(mload(0x2da0), mload(0x30a0), f_q)) +mstore(0x34e0, mulmod(mload(0x2e20), mload(0x3120), f_q)) { - let result := mload(0x3020) -result := addmod(mload(0x3080), result, f_q) -mstore(13440, result) + let result := mload(0x30a0) +result := addmod(mload(0x3100), result, f_q) +mstore(13568, result) } { - let prod := mload(0x3380) + let prod := mload(0x3400) - prod := mulmod(mload(0x33c0), prod, f_q) - mstore(0x34a0, prod) - - prod := mulmod(mload(0x3400), prod, f_q) - mstore(0x34c0, prod) - prod := mulmod(mload(0x3440), prod, f_q) - mstore(0x34e0, prod) + mstore(0x3520, prod) prod := mulmod(mload(0x3480), prod, f_q) - mstore(0x3500, prod) + mstore(0x3540, prod) + + prod := mulmod(mload(0x34c0), prod, f_q) + mstore(0x3560, prod) + + prod := mulmod(mload(0x3500), prod, f_q) + mstore(0x3580, prod) } -mstore(0x3540, 32) -mstore(0x3560, 32) -mstore(0x3580, 32) -mstore(0x35a0, mload(0x3500)) -mstore(0x35c0, 21888242871839275222246405745257275088548364400416034343698204186575808495615) -mstore(0x35e0, 21888242871839275222246405745257275088548364400416034343698204186575808495617) -success := and(eq(staticcall(gas(), 0x5, 0x3540, 0xc0, 0x3520, 0x20), 1), success) +mstore(0x35c0, 32) +mstore(0x35e0, 32) +mstore(0x3600, 32) +mstore(0x3620, mload(0x3580)) +mstore(0x3640, 21888242871839275222246405745257275088548364400416034343698204186575808495615) +mstore(0x3660, 21888242871839275222246405745257275088548364400416034343698204186575808495617) +success := and(eq(staticcall(gas(), 0x5, 0x35c0, 0xc0, 0x35a0, 0x20), 1), success) { - let inv := mload(0x3520) + let inv := mload(0x35a0) let v - v := mload(0x3480) - mstore(13440, mulmod(mload(0x34e0), inv, f_q)) + v := mload(0x3500) + mstore(13568, mulmod(mload(0x3560), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x3440) - mstore(13376, mulmod(mload(0x34c0), inv, f_q)) + v := mload(0x34c0) + mstore(13504, mulmod(mload(0x3540), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x3400) - mstore(13312, mulmod(mload(0x34a0), inv, f_q)) + v := mload(0x3480) + mstore(13440, mulmod(mload(0x3520), inv, f_q)) inv := mulmod(v, inv, f_q) - v := mload(0x33c0) - mstore(13248, mulmod(mload(0x3380), inv, f_q)) + v := mload(0x3440) + mstore(13376, mulmod(mload(0x3400), inv, f_q)) inv := mulmod(v, inv, f_q) - mstore(0x3380, inv) + mstore(0x3400, inv) } -mstore(0x3600, mulmod(mload(0x33a0), mload(0x33c0), f_q)) -mstore(0x3620, mulmod(mload(0x33e0), mload(0x3400), f_q)) -mstore(0x3640, mulmod(mload(0x3420), mload(0x3440), f_q)) -mstore(0x3660, mulmod(mload(0x3460), mload(0x3480), f_q)) -mstore(0x3680, mulmod(mload(0xae0), mload(0xae0), f_q)) -mstore(0x36a0, mulmod(mload(0x3680), mload(0xae0), f_q)) -mstore(0x36c0, mulmod(mload(0x36a0), mload(0xae0), f_q)) -mstore(0x36e0, mulmod(mload(0x36c0), mload(0xae0), f_q)) -mstore(0x3700, mulmod(mload(0x36e0), mload(0xae0), f_q)) -mstore(0x3720, mulmod(mload(0x3700), mload(0xae0), f_q)) -mstore(0x3740, mulmod(mload(0x3720), mload(0xae0), f_q)) -mstore(0x3760, mulmod(mload(0x3740), mload(0xae0), f_q)) -mstore(0x3780, mulmod(mload(0x3760), mload(0xae0), f_q)) -mstore(0x37a0, mulmod(mload(0x3780), mload(0xae0), f_q)) -mstore(0x37c0, mulmod(mload(0x37a0), mload(0xae0), f_q)) -mstore(0x37e0, mulmod(mload(0x37c0), mload(0xae0), f_q)) -mstore(0x3800, mulmod(mload(0xb40), mload(0xb40), f_q)) -mstore(0x3820, mulmod(mload(0x3800), mload(0xb40), f_q)) -mstore(0x3840, mulmod(mload(0x3820), mload(0xb40), f_q)) -mstore(0x3860, mulmod(mload(0x3840), mload(0xb40), f_q)) +mstore(0x3680, mulmod(mload(0x3420), mload(0x3440), f_q)) +mstore(0x36a0, mulmod(mload(0x3460), mload(0x3480), f_q)) +mstore(0x36c0, mulmod(mload(0x34a0), mload(0x34c0), f_q)) +mstore(0x36e0, mulmod(mload(0x34e0), mload(0x3500), f_q)) +mstore(0x3700, mulmod(mload(0xb60), mload(0xb60), f_q)) +mstore(0x3720, mulmod(mload(0x3700), mload(0xb60), f_q)) +mstore(0x3740, mulmod(mload(0x3720), mload(0xb60), f_q)) +mstore(0x3760, mulmod(mload(0x3740), mload(0xb60), f_q)) +mstore(0x3780, mulmod(mload(0x3760), mload(0xb60), f_q)) +mstore(0x37a0, mulmod(mload(0x3780), mload(0xb60), f_q)) +mstore(0x37c0, mulmod(mload(0x37a0), mload(0xb60), f_q)) +mstore(0x37e0, mulmod(mload(0x37c0), mload(0xb60), f_q)) +mstore(0x3800, mulmod(mload(0x37e0), mload(0xb60), f_q)) +mstore(0x3820, mulmod(mload(0x3800), mload(0xb60), f_q)) +mstore(0x3840, mulmod(mload(0x3820), mload(0xb60), f_q)) +mstore(0x3860, mulmod(mload(0x3840), mload(0xb60), f_q)) +mstore(0x3880, mulmod(mload(0xbc0), mload(0xbc0), f_q)) +mstore(0x38a0, mulmod(mload(0x3880), mload(0xbc0), f_q)) +mstore(0x38c0, mulmod(mload(0x38a0), mload(0xbc0), f_q)) +mstore(0x38e0, mulmod(mload(0x38c0), mload(0xbc0), f_q)) { - let result := mulmod(mload(0x6c0), mload(0x2c00), f_q) -result := addmod(mulmod(mload(0x6e0), mload(0x2c60), f_q), result, f_q) -result := addmod(mulmod(mload(0x700), mload(0x2cc0), f_q), result, f_q) -result := addmod(mulmod(mload(0x720), mload(0x2d20), f_q), result, f_q) -mstore(14464, result) - } -mstore(0x38a0, mulmod(mload(0x3880), mload(0x3380), f_q)) -mstore(0x38c0, mulmod(sub(f_q, mload(0x38a0)), 1, f_q)) + let result := mulmod(mload(0x740), mload(0x2c80), f_q) +result := addmod(mulmod(mload(0x760), mload(0x2ce0), f_q), result, f_q) +result := addmod(mulmod(mload(0x780), mload(0x2d40), f_q), result, f_q) +result := addmod(mulmod(mload(0x7a0), mload(0x2da0), f_q), result, f_q) +mstore(14592, result) + } +mstore(0x3920, mulmod(mload(0x3900), mload(0x3400), f_q)) +mstore(0x3940, mulmod(sub(f_q, mload(0x3920)), 1, f_q)) { - let result := mulmod(mload(0x740), mload(0x2c00), f_q) -result := addmod(mulmod(mload(0x760), mload(0x2c60), f_q), result, f_q) -result := addmod(mulmod(mload(0x780), mload(0x2cc0), f_q), result, f_q) -result := addmod(mulmod(mload(0x7a0), mload(0x2d20), f_q), result, f_q) -mstore(14560, result) - } -mstore(0x3900, mulmod(mload(0x38e0), mload(0x3380), f_q)) -mstore(0x3920, mulmod(sub(f_q, mload(0x3900)), mload(0xae0), f_q)) -mstore(0x3940, mulmod(1, mload(0xae0), f_q)) -mstore(0x3960, addmod(mload(0x38c0), mload(0x3920), f_q)) -mstore(0x3980, mulmod(mload(0x3960), 1, f_q)) -mstore(0x39a0, mulmod(mload(0x3940), 1, f_q)) -mstore(0x39c0, mulmod(1, mload(0x33a0), f_q)) -{ - let result := mulmod(mload(0x7c0), mload(0x2dc0), f_q) -mstore(14816, result) - } -mstore(0x3a00, mulmod(mload(0x39e0), mload(0x3600), f_q)) -mstore(0x3a20, mulmod(sub(f_q, mload(0x3a00)), 1, f_q)) -mstore(0x3a40, mulmod(mload(0x39c0), 1, f_q)) + let result := mulmod(mload(0x7c0), mload(0x2c80), f_q) +result := addmod(mulmod(mload(0x7e0), mload(0x2ce0), f_q), result, f_q) +result := addmod(mulmod(mload(0x800), mload(0x2d40), f_q), result, f_q) +result := addmod(mulmod(mload(0x820), mload(0x2da0), f_q), result, f_q) +mstore(14688, result) + } +mstore(0x3980, mulmod(mload(0x3960), mload(0x3400), f_q)) +mstore(0x39a0, mulmod(sub(f_q, mload(0x3980)), mload(0xb60), f_q)) +mstore(0x39c0, mulmod(1, mload(0xb60), f_q)) +mstore(0x39e0, addmod(mload(0x3940), mload(0x39a0), f_q)) +mstore(0x3a00, mulmod(mload(0x39e0), 1, f_q)) +mstore(0x3a20, mulmod(mload(0x39c0), 1, f_q)) +mstore(0x3a40, mulmod(1, mload(0x3420), f_q)) { - let result := mulmod(mload(0xaa0), mload(0x2dc0), f_q) + let result := mulmod(mload(0x840), mload(0x2e40), f_q) mstore(14944, result) } -mstore(0x3a80, mulmod(mload(0x3a60), mload(0x3600), f_q)) -mstore(0x3aa0, mulmod(sub(f_q, mload(0x3a80)), mload(0xae0), f_q)) -mstore(0x3ac0, mulmod(mload(0x39c0), mload(0xae0), f_q)) -mstore(0x3ae0, addmod(mload(0x3a20), mload(0x3aa0), f_q)) +mstore(0x3a80, mulmod(mload(0x3a60), mload(0x3680), f_q)) +mstore(0x3aa0, mulmod(sub(f_q, mload(0x3a80)), 1, f_q)) +mstore(0x3ac0, mulmod(mload(0x3a40), 1, f_q)) { - let result := mulmod(mload(0x7e0), mload(0x2dc0), f_q) -mstore(15104, result) + let result := mulmod(mload(0xb20), mload(0x2e40), f_q) +mstore(15072, result) } -mstore(0x3b20, mulmod(mload(0x3b00), mload(0x3600), f_q)) -mstore(0x3b40, mulmod(sub(f_q, mload(0x3b20)), mload(0x3680), f_q)) -mstore(0x3b60, mulmod(mload(0x39c0), mload(0x3680), f_q)) -mstore(0x3b80, addmod(mload(0x3ae0), mload(0x3b40), f_q)) +mstore(0x3b00, mulmod(mload(0x3ae0), mload(0x3680), f_q)) +mstore(0x3b20, mulmod(sub(f_q, mload(0x3b00)), mload(0xb60), f_q)) +mstore(0x3b40, mulmod(mload(0x3a40), mload(0xb60), f_q)) +mstore(0x3b60, addmod(mload(0x3aa0), mload(0x3b20), f_q)) { - let result := mulmod(mload(0x800), mload(0x2dc0), f_q) -mstore(15264, result) + let result := mulmod(mload(0x860), mload(0x2e40), f_q) +mstore(15232, result) } -mstore(0x3bc0, mulmod(mload(0x3ba0), mload(0x3600), f_q)) -mstore(0x3be0, mulmod(sub(f_q, mload(0x3bc0)), mload(0x36a0), f_q)) -mstore(0x3c00, mulmod(mload(0x39c0), mload(0x36a0), f_q)) -mstore(0x3c20, addmod(mload(0x3b80), mload(0x3be0), f_q)) +mstore(0x3ba0, mulmod(mload(0x3b80), mload(0x3680), f_q)) +mstore(0x3bc0, mulmod(sub(f_q, mload(0x3ba0)), mload(0x3700), f_q)) +mstore(0x3be0, mulmod(mload(0x3a40), mload(0x3700), f_q)) +mstore(0x3c00, addmod(mload(0x3b60), mload(0x3bc0), f_q)) { - let result := mulmod(mload(0x820), mload(0x2dc0), f_q) -mstore(15424, result) + let result := mulmod(mload(0x880), mload(0x2e40), f_q) +mstore(15392, result) } -mstore(0x3c60, mulmod(mload(0x3c40), mload(0x3600), f_q)) -mstore(0x3c80, mulmod(sub(f_q, mload(0x3c60)), mload(0x36c0), f_q)) -mstore(0x3ca0, mulmod(mload(0x39c0), mload(0x36c0), f_q)) -mstore(0x3cc0, addmod(mload(0x3c20), mload(0x3c80), f_q)) +mstore(0x3c40, mulmod(mload(0x3c20), mload(0x3680), f_q)) +mstore(0x3c60, mulmod(sub(f_q, mload(0x3c40)), mload(0x3720), f_q)) +mstore(0x3c80, mulmod(mload(0x3a40), mload(0x3720), f_q)) +mstore(0x3ca0, addmod(mload(0x3c00), mload(0x3c60), f_q)) { - let result := mulmod(mload(0x840), mload(0x2dc0), f_q) -mstore(15584, result) + let result := mulmod(mload(0x8a0), mload(0x2e40), f_q) +mstore(15552, result) } -mstore(0x3d00, mulmod(mload(0x3ce0), mload(0x3600), f_q)) -mstore(0x3d20, mulmod(sub(f_q, mload(0x3d00)), mload(0x36e0), f_q)) -mstore(0x3d40, mulmod(mload(0x39c0), mload(0x36e0), f_q)) -mstore(0x3d60, addmod(mload(0x3cc0), mload(0x3d20), f_q)) +mstore(0x3ce0, mulmod(mload(0x3cc0), mload(0x3680), f_q)) +mstore(0x3d00, mulmod(sub(f_q, mload(0x3ce0)), mload(0x3740), f_q)) +mstore(0x3d20, mulmod(mload(0x3a40), mload(0x3740), f_q)) +mstore(0x3d40, addmod(mload(0x3ca0), mload(0x3d00), f_q)) { - let result := mulmod(mload(0x880), mload(0x2dc0), f_q) -mstore(15744, result) + let result := mulmod(mload(0x8c0), mload(0x2e40), f_q) +mstore(15712, result) } -mstore(0x3da0, mulmod(mload(0x3d80), mload(0x3600), f_q)) -mstore(0x3dc0, mulmod(sub(f_q, mload(0x3da0)), mload(0x3700), f_q)) -mstore(0x3de0, mulmod(mload(0x39c0), mload(0x3700), f_q)) -mstore(0x3e00, addmod(mload(0x3d60), mload(0x3dc0), f_q)) +mstore(0x3d80, mulmod(mload(0x3d60), mload(0x3680), f_q)) +mstore(0x3da0, mulmod(sub(f_q, mload(0x3d80)), mload(0x3760), f_q)) +mstore(0x3dc0, mulmod(mload(0x3a40), mload(0x3760), f_q)) +mstore(0x3de0, addmod(mload(0x3d40), mload(0x3da0), f_q)) { - let result := mulmod(mload(0x8a0), mload(0x2dc0), f_q) -mstore(15904, result) + let result := mulmod(mload(0x900), mload(0x2e40), f_q) +mstore(15872, result) } -mstore(0x3e40, mulmod(mload(0x3e20), mload(0x3600), f_q)) -mstore(0x3e60, mulmod(sub(f_q, mload(0x3e40)), mload(0x3720), f_q)) -mstore(0x3e80, mulmod(mload(0x39c0), mload(0x3720), f_q)) -mstore(0x3ea0, addmod(mload(0x3e00), mload(0x3e60), f_q)) +mstore(0x3e20, mulmod(mload(0x3e00), mload(0x3680), f_q)) +mstore(0x3e40, mulmod(sub(f_q, mload(0x3e20)), mload(0x3780), f_q)) +mstore(0x3e60, mulmod(mload(0x3a40), mload(0x3780), f_q)) +mstore(0x3e80, addmod(mload(0x3de0), mload(0x3e40), f_q)) { - let result := mulmod(mload(0x8c0), mload(0x2dc0), f_q) -mstore(16064, result) + let result := mulmod(mload(0x920), mload(0x2e40), f_q) +mstore(16032, result) } -mstore(0x3ee0, mulmod(mload(0x3ec0), mload(0x3600), f_q)) -mstore(0x3f00, mulmod(sub(f_q, mload(0x3ee0)), mload(0x3740), f_q)) -mstore(0x3f20, mulmod(mload(0x39c0), mload(0x3740), f_q)) -mstore(0x3f40, addmod(mload(0x3ea0), mload(0x3f00), f_q)) +mstore(0x3ec0, mulmod(mload(0x3ea0), mload(0x3680), f_q)) +mstore(0x3ee0, mulmod(sub(f_q, mload(0x3ec0)), mload(0x37a0), f_q)) +mstore(0x3f00, mulmod(mload(0x3a40), mload(0x37a0), f_q)) +mstore(0x3f20, addmod(mload(0x3e80), mload(0x3ee0), f_q)) { - let result := mulmod(mload(0x8e0), mload(0x2dc0), f_q) -mstore(16224, result) + let result := mulmod(mload(0x940), mload(0x2e40), f_q) +mstore(16192, result) } -mstore(0x3f80, mulmod(mload(0x3f60), mload(0x3600), f_q)) -mstore(0x3fa0, mulmod(sub(f_q, mload(0x3f80)), mload(0x3760), f_q)) -mstore(0x3fc0, mulmod(mload(0x39c0), mload(0x3760), f_q)) -mstore(0x3fe0, addmod(mload(0x3f40), mload(0x3fa0), f_q)) +mstore(0x3f60, mulmod(mload(0x3f40), mload(0x3680), f_q)) +mstore(0x3f80, mulmod(sub(f_q, mload(0x3f60)), mload(0x37c0), f_q)) +mstore(0x3fa0, mulmod(mload(0x3a40), mload(0x37c0), f_q)) +mstore(0x3fc0, addmod(mload(0x3f20), mload(0x3f80), f_q)) { - let result := mulmod(mload(0x900), mload(0x2dc0), f_q) -mstore(16384, result) - } -mstore(0x4020, mulmod(mload(0x4000), mload(0x3600), f_q)) -mstore(0x4040, mulmod(sub(f_q, mload(0x4020)), mload(0x3780), f_q)) -mstore(0x4060, mulmod(mload(0x39c0), mload(0x3780), f_q)) -mstore(0x4080, addmod(mload(0x3fe0), mload(0x4040), f_q)) -mstore(0x40a0, mulmod(mload(0x29a0), mload(0x33a0), f_q)) -mstore(0x40c0, mulmod(mload(0x29c0), mload(0x33a0), f_q)) + let result := mulmod(mload(0x960), mload(0x2e40), f_q) +mstore(16352, result) + } +mstore(0x4000, mulmod(mload(0x3fe0), mload(0x3680), f_q)) +mstore(0x4020, mulmod(sub(f_q, mload(0x4000)), mload(0x37e0), f_q)) +mstore(0x4040, mulmod(mload(0x3a40), mload(0x37e0), f_q)) +mstore(0x4060, addmod(mload(0x3fc0), mload(0x4020), f_q)) { - let result := mulmod(mload(0x29e0), mload(0x2dc0), f_q) -mstore(16608, result) - } -mstore(0x4100, mulmod(mload(0x40e0), mload(0x3600), f_q)) -mstore(0x4120, mulmod(sub(f_q, mload(0x4100)), mload(0x37a0), f_q)) -mstore(0x4140, mulmod(mload(0x39c0), mload(0x37a0), f_q)) -mstore(0x4160, mulmod(mload(0x40a0), mload(0x37a0), f_q)) -mstore(0x4180, mulmod(mload(0x40c0), mload(0x37a0), f_q)) -mstore(0x41a0, addmod(mload(0x4080), mload(0x4120), f_q)) + let result := mulmod(mload(0x980), mload(0x2e40), f_q) +mstore(16512, result) + } +mstore(0x40a0, mulmod(mload(0x4080), mload(0x3680), f_q)) +mstore(0x40c0, mulmod(sub(f_q, mload(0x40a0)), mload(0x3800), f_q)) +mstore(0x40e0, mulmod(mload(0x3a40), mload(0x3800), f_q)) +mstore(0x4100, addmod(mload(0x4060), mload(0x40c0), f_q)) +mstore(0x4120, mulmod(mload(0x2a20), mload(0x3420), f_q)) +mstore(0x4140, mulmod(mload(0x2a40), mload(0x3420), f_q)) { - let result := mulmod(mload(0x860), mload(0x2dc0), f_q) -mstore(16832, result) - } -mstore(0x41e0, mulmod(mload(0x41c0), mload(0x3600), f_q)) -mstore(0x4200, mulmod(sub(f_q, mload(0x41e0)), mload(0x37c0), f_q)) -mstore(0x4220, mulmod(mload(0x39c0), mload(0x37c0), f_q)) -mstore(0x4240, addmod(mload(0x41a0), mload(0x4200), f_q)) -mstore(0x4260, mulmod(mload(0x4240), mload(0xb40), f_q)) -mstore(0x4280, mulmod(mload(0x3a40), mload(0xb40), f_q)) -mstore(0x42a0, mulmod(mload(0x3ac0), mload(0xb40), f_q)) -mstore(0x42c0, mulmod(mload(0x3b60), mload(0xb40), f_q)) -mstore(0x42e0, mulmod(mload(0x3c00), mload(0xb40), f_q)) -mstore(0x4300, mulmod(mload(0x3ca0), mload(0xb40), f_q)) -mstore(0x4320, mulmod(mload(0x3d40), mload(0xb40), f_q)) -mstore(0x4340, mulmod(mload(0x3de0), mload(0xb40), f_q)) -mstore(0x4360, mulmod(mload(0x3e80), mload(0xb40), f_q)) -mstore(0x4380, mulmod(mload(0x3f20), mload(0xb40), f_q)) -mstore(0x43a0, mulmod(mload(0x3fc0), mload(0xb40), f_q)) -mstore(0x43c0, mulmod(mload(0x4060), mload(0xb40), f_q)) -mstore(0x43e0, mulmod(mload(0x4140), mload(0xb40), f_q)) -mstore(0x4400, mulmod(mload(0x4160), mload(0xb40), f_q)) -mstore(0x4420, mulmod(mload(0x4180), mload(0xb40), f_q)) -mstore(0x4440, mulmod(mload(0x4220), mload(0xb40), f_q)) -mstore(0x4460, addmod(mload(0x3980), mload(0x4260), f_q)) -mstore(0x4480, mulmod(1, mload(0x33e0), f_q)) + let result := mulmod(mload(0x2a60), mload(0x2e40), f_q) +mstore(16736, result) + } +mstore(0x4180, mulmod(mload(0x4160), mload(0x3680), f_q)) +mstore(0x41a0, mulmod(sub(f_q, mload(0x4180)), mload(0x3820), f_q)) +mstore(0x41c0, mulmod(mload(0x3a40), mload(0x3820), f_q)) +mstore(0x41e0, mulmod(mload(0x4120), mload(0x3820), f_q)) +mstore(0x4200, mulmod(mload(0x4140), mload(0x3820), f_q)) +mstore(0x4220, addmod(mload(0x4100), mload(0x41a0), f_q)) { - let result := mulmod(mload(0x920), mload(0x2e20), f_q) -result := addmod(mulmod(mload(0x940), mload(0x2e80), f_q), result, f_q) -result := addmod(mulmod(mload(0x960), mload(0x2ee0), f_q), result, f_q) -mstore(17568, result) - } -mstore(0x44c0, mulmod(mload(0x44a0), mload(0x3620), f_q)) -mstore(0x44e0, mulmod(sub(f_q, mload(0x44c0)), 1, f_q)) -mstore(0x4500, mulmod(mload(0x4480), 1, f_q)) + let result := mulmod(mload(0x8e0), mload(0x2e40), f_q) +mstore(16960, result) + } +mstore(0x4260, mulmod(mload(0x4240), mload(0x3680), f_q)) +mstore(0x4280, mulmod(sub(f_q, mload(0x4260)), mload(0x3840), f_q)) +mstore(0x42a0, mulmod(mload(0x3a40), mload(0x3840), f_q)) +mstore(0x42c0, addmod(mload(0x4220), mload(0x4280), f_q)) +mstore(0x42e0, mulmod(mload(0x42c0), mload(0xbc0), f_q)) +mstore(0x4300, mulmod(mload(0x3ac0), mload(0xbc0), f_q)) +mstore(0x4320, mulmod(mload(0x3b40), mload(0xbc0), f_q)) +mstore(0x4340, mulmod(mload(0x3be0), mload(0xbc0), f_q)) +mstore(0x4360, mulmod(mload(0x3c80), mload(0xbc0), f_q)) +mstore(0x4380, mulmod(mload(0x3d20), mload(0xbc0), f_q)) +mstore(0x43a0, mulmod(mload(0x3dc0), mload(0xbc0), f_q)) +mstore(0x43c0, mulmod(mload(0x3e60), mload(0xbc0), f_q)) +mstore(0x43e0, mulmod(mload(0x3f00), mload(0xbc0), f_q)) +mstore(0x4400, mulmod(mload(0x3fa0), mload(0xbc0), f_q)) +mstore(0x4420, mulmod(mload(0x4040), mload(0xbc0), f_q)) +mstore(0x4440, mulmod(mload(0x40e0), mload(0xbc0), f_q)) +mstore(0x4460, mulmod(mload(0x41c0), mload(0xbc0), f_q)) +mstore(0x4480, mulmod(mload(0x41e0), mload(0xbc0), f_q)) +mstore(0x44a0, mulmod(mload(0x4200), mload(0xbc0), f_q)) +mstore(0x44c0, mulmod(mload(0x42a0), mload(0xbc0), f_q)) +mstore(0x44e0, addmod(mload(0x3a00), mload(0x42e0), f_q)) +mstore(0x4500, mulmod(1, mload(0x3460), f_q)) { - let result := mulmod(mload(0x980), mload(0x2e20), f_q) -result := addmod(mulmod(mload(0x9a0), mload(0x2e80), f_q), result, f_q) -result := addmod(mulmod(mload(0x9c0), mload(0x2ee0), f_q), result, f_q) + let result := mulmod(mload(0x9a0), mload(0x2ea0), f_q) +result := addmod(mulmod(mload(0x9c0), mload(0x2f00), f_q), result, f_q) +result := addmod(mulmod(mload(0x9e0), mload(0x2f60), f_q), result, f_q) mstore(17696, result) } -mstore(0x4540, mulmod(mload(0x4520), mload(0x3620), f_q)) -mstore(0x4560, mulmod(sub(f_q, mload(0x4540)), mload(0xae0), f_q)) -mstore(0x4580, mulmod(mload(0x4480), mload(0xae0), f_q)) -mstore(0x45a0, addmod(mload(0x44e0), mload(0x4560), f_q)) -mstore(0x45c0, mulmod(mload(0x45a0), mload(0x3800), f_q)) -mstore(0x45e0, mulmod(mload(0x4500), mload(0x3800), f_q)) -mstore(0x4600, mulmod(mload(0x4580), mload(0x3800), f_q)) -mstore(0x4620, addmod(mload(0x4460), mload(0x45c0), f_q)) -mstore(0x4640, mulmod(1, mload(0x3420), f_q)) +mstore(0x4540, mulmod(mload(0x4520), mload(0x36a0), f_q)) +mstore(0x4560, mulmod(sub(f_q, mload(0x4540)), 1, f_q)) +mstore(0x4580, mulmod(mload(0x4500), 1, f_q)) { - let result := mulmod(mload(0x9e0), mload(0x2f60), f_q) -result := addmod(mulmod(mload(0xa00), mload(0x2fc0), f_q), result, f_q) -mstore(18016, result) - } -mstore(0x4680, mulmod(mload(0x4660), mload(0x3640), f_q)) -mstore(0x46a0, mulmod(sub(f_q, mload(0x4680)), 1, f_q)) -mstore(0x46c0, mulmod(mload(0x4640), 1, f_q)) + let result := mulmod(mload(0xa00), mload(0x2ea0), f_q) +result := addmod(mulmod(mload(0xa20), mload(0x2f00), f_q), result, f_q) +result := addmod(mulmod(mload(0xa40), mload(0x2f60), f_q), result, f_q) +mstore(17824, result) + } +mstore(0x45c0, mulmod(mload(0x45a0), mload(0x36a0), f_q)) +mstore(0x45e0, mulmod(sub(f_q, mload(0x45c0)), mload(0xb60), f_q)) +mstore(0x4600, mulmod(mload(0x4500), mload(0xb60), f_q)) +mstore(0x4620, addmod(mload(0x4560), mload(0x45e0), f_q)) +mstore(0x4640, mulmod(mload(0x4620), mload(0x3880), f_q)) +mstore(0x4660, mulmod(mload(0x4580), mload(0x3880), f_q)) +mstore(0x4680, mulmod(mload(0x4600), mload(0x3880), f_q)) +mstore(0x46a0, addmod(mload(0x44e0), mload(0x4640), f_q)) +mstore(0x46c0, mulmod(1, mload(0x34a0), f_q)) { - let result := mulmod(mload(0xa20), mload(0x2f60), f_q) -result := addmod(mulmod(mload(0xa40), mload(0x2fc0), f_q), result, f_q) + let result := mulmod(mload(0xa60), mload(0x2fe0), f_q) +result := addmod(mulmod(mload(0xa80), mload(0x3040), f_q), result, f_q) mstore(18144, result) } -mstore(0x4700, mulmod(mload(0x46e0), mload(0x3640), f_q)) -mstore(0x4720, mulmod(sub(f_q, mload(0x4700)), mload(0xae0), f_q)) -mstore(0x4740, mulmod(mload(0x4640), mload(0xae0), f_q)) -mstore(0x4760, addmod(mload(0x46a0), mload(0x4720), f_q)) -mstore(0x4780, mulmod(mload(0x4760), mload(0x3820), f_q)) -mstore(0x47a0, mulmod(mload(0x46c0), mload(0x3820), f_q)) -mstore(0x47c0, mulmod(mload(0x4740), mload(0x3820), f_q)) -mstore(0x47e0, addmod(mload(0x4620), mload(0x4780), f_q)) -mstore(0x4800, mulmod(1, mload(0x3460), f_q)) +mstore(0x4700, mulmod(mload(0x46e0), mload(0x36c0), f_q)) +mstore(0x4720, mulmod(sub(f_q, mload(0x4700)), 1, f_q)) +mstore(0x4740, mulmod(mload(0x46c0), 1, f_q)) +{ + let result := mulmod(mload(0xaa0), mload(0x2fe0), f_q) +result := addmod(mulmod(mload(0xac0), mload(0x3040), f_q), result, f_q) +mstore(18272, result) + } +mstore(0x4780, mulmod(mload(0x4760), mload(0x36c0), f_q)) +mstore(0x47a0, mulmod(sub(f_q, mload(0x4780)), mload(0xb60), f_q)) +mstore(0x47c0, mulmod(mload(0x46c0), mload(0xb60), f_q)) +mstore(0x47e0, addmod(mload(0x4720), mload(0x47a0), f_q)) +mstore(0x4800, mulmod(mload(0x47e0), mload(0x38a0), f_q)) +mstore(0x4820, mulmod(mload(0x4740), mload(0x38a0), f_q)) +mstore(0x4840, mulmod(mload(0x47c0), mload(0x38a0), f_q)) +mstore(0x4860, addmod(mload(0x46a0), mload(0x4800), f_q)) +mstore(0x4880, mulmod(1, mload(0x34e0), f_q)) { - let result := mulmod(mload(0xa60), mload(0x3020), f_q) -result := addmod(mulmod(mload(0xa80), mload(0x3080), f_q), result, f_q) -mstore(18464, result) - } -mstore(0x4840, mulmod(mload(0x4820), mload(0x3660), f_q)) -mstore(0x4860, mulmod(sub(f_q, mload(0x4840)), 1, f_q)) -mstore(0x4880, mulmod(mload(0x4800), 1, f_q)) -mstore(0x48a0, mulmod(mload(0x4860), mload(0x3840), f_q)) -mstore(0x48c0, mulmod(mload(0x4880), mload(0x3840), f_q)) -mstore(0x48e0, addmod(mload(0x47e0), mload(0x48a0), f_q)) -mstore(0x4900, mulmod(1, mload(0x2da0), f_q)) -mstore(0x4920, mulmod(1, mload(0xbe0), f_q)) -mstore(0x4940, 0x0000000000000000000000000000000000000000000000000000000000000001) - mstore(0x4960, 0x0000000000000000000000000000000000000000000000000000000000000002) -mstore(0x4980, mload(0x48e0)) -success := and(eq(staticcall(gas(), 0x7, 0x4940, 0x60, 0x4940, 0x40), 1), success) -mstore(0x49a0, mload(0x4940)) - mstore(0x49c0, mload(0x4960)) -mstore(0x49e0, mload(0x1a0)) - mstore(0x4a00, mload(0x1c0)) -success := and(eq(staticcall(gas(), 0x6, 0x49a0, 0x80, 0x49a0, 0x40), 1), success) -mstore(0x4a20, mload(0x1e0)) - mstore(0x4a40, mload(0x200)) -mstore(0x4a60, mload(0x39a0)) -success := and(eq(staticcall(gas(), 0x7, 0x4a20, 0x60, 0x4a20, 0x40), 1), success) -mstore(0x4a80, mload(0x49a0)) - mstore(0x4aa0, mload(0x49c0)) -mstore(0x4ac0, mload(0x4a20)) - mstore(0x4ae0, mload(0x4a40)) -success := and(eq(staticcall(gas(), 0x6, 0x4a80, 0x80, 0x4a80, 0x40), 1), success) -mstore(0x4b00, mload(0x220)) - mstore(0x4b20, mload(0x240)) -mstore(0x4b40, mload(0x4280)) -success := and(eq(staticcall(gas(), 0x7, 0x4b00, 0x60, 0x4b00, 0x40), 1), success) -mstore(0x4b60, mload(0x4a80)) - mstore(0x4b80, mload(0x4aa0)) -mstore(0x4ba0, mload(0x4b00)) - mstore(0x4bc0, mload(0x4b20)) -success := and(eq(staticcall(gas(), 0x6, 0x4b60, 0x80, 0x4b60, 0x40), 1), success) -mstore(0x4be0, mload(0x300)) - mstore(0x4c00, mload(0x320)) -mstore(0x4c20, mload(0x42a0)) -success := and(eq(staticcall(gas(), 0x7, 0x4be0, 0x60, 0x4be0, 0x40), 1), success) -mstore(0x4c40, mload(0x4b60)) - mstore(0x4c60, mload(0x4b80)) -mstore(0x4c80, mload(0x4be0)) - mstore(0x4ca0, mload(0x4c00)) -success := and(eq(staticcall(gas(), 0x6, 0x4c40, 0x80, 0x4c40, 0x40), 1), success) -mstore(0x4cc0, 0x0a56bb24bdbd10b2ae380a0f6d2926afe21e55ef423d664a7093bdc47d7a970d) - mstore(0x4ce0, 0x3046067f3fbc66fb8322b30a454654489ad23370423a63caeab071e10143c65d) -mstore(0x4d00, mload(0x42c0)) -success := and(eq(staticcall(gas(), 0x7, 0x4cc0, 0x60, 0x4cc0, 0x40), 1), success) -mstore(0x4d20, mload(0x4c40)) - mstore(0x4d40, mload(0x4c60)) -mstore(0x4d60, mload(0x4cc0)) - mstore(0x4d80, mload(0x4ce0)) -success := and(eq(staticcall(gas(), 0x6, 0x4d20, 0x80, 0x4d20, 0x40), 1), success) -mstore(0x4da0, 0x165f42d12623508ec09f1a14ffe3841e636362840bcfe45fd4f0847a50968d91) - mstore(0x4dc0, 0x19664a50abfa10f51e0eb96bf39b959cd2ebd0ed52c60bc0d4e8535272a13ed9) -mstore(0x4de0, mload(0x42e0)) -success := and(eq(staticcall(gas(), 0x7, 0x4da0, 0x60, 0x4da0, 0x40), 1), success) -mstore(0x4e00, mload(0x4d20)) - mstore(0x4e20, mload(0x4d40)) -mstore(0x4e40, mload(0x4da0)) - mstore(0x4e60, mload(0x4dc0)) -success := and(eq(staticcall(gas(), 0x6, 0x4e00, 0x80, 0x4e00, 0x40), 1), success) -mstore(0x4e80, 0x0c7dc4e4516515f0050b10e6891a60f39ab7645bbf2134080574b9ae26a3fee2) - mstore(0x4ea0, 0x2ee3484a156715514bcc56f95e316bb23031b7460f679ebb427a7f8ad73aead2) -mstore(0x4ec0, mload(0x4300)) -success := and(eq(staticcall(gas(), 0x7, 0x4e80, 0x60, 0x4e80, 0x40), 1), success) -mstore(0x4ee0, mload(0x4e00)) - mstore(0x4f00, mload(0x4e20)) -mstore(0x4f20, mload(0x4e80)) - mstore(0x4f40, mload(0x4ea0)) -success := and(eq(staticcall(gas(), 0x6, 0x4ee0, 0x80, 0x4ee0, 0x40), 1), success) -mstore(0x4f60, 0x2fb1bc5dc1a8a163ac673f110c7ced2581955a8d47770fced15a66d8199a5c91) - mstore(0x4f80, 0x18f7802cf51055b658637bf93f53fcc4dbe4218c03cb54c9d3e74534e1b9cb8f) -mstore(0x4fa0, mload(0x4320)) -success := and(eq(staticcall(gas(), 0x7, 0x4f60, 0x60, 0x4f60, 0x40), 1), success) -mstore(0x4fc0, mload(0x4ee0)) - mstore(0x4fe0, mload(0x4f00)) -mstore(0x5000, mload(0x4f60)) - mstore(0x5020, mload(0x4f80)) -success := and(eq(staticcall(gas(), 0x6, 0x4fc0, 0x80, 0x4fc0, 0x40), 1), success) -mstore(0x5040, 0x2051ae2329a00ab4684564c9db909204379c6404686b9bb004253a0e87937c1a) - mstore(0x5060, 0x2228d27991956786c7b7ed829027a4268a8f57d342e507683aaaea7046a1721b) -mstore(0x5080, mload(0x4340)) -success := and(eq(staticcall(gas(), 0x7, 0x5040, 0x60, 0x5040, 0x40), 1), success) -mstore(0x50a0, mload(0x4fc0)) - mstore(0x50c0, mload(0x4fe0)) -mstore(0x50e0, mload(0x5040)) - mstore(0x5100, mload(0x5060)) -success := and(eq(staticcall(gas(), 0x6, 0x50a0, 0x80, 0x50a0, 0x40), 1), success) -mstore(0x5120, 0x144e8b5cd066532d7a019f3061d407aeb922b3a37125d39cee71a336088a8d57) - mstore(0x5140, 0x0465b8271620ef2988dbb05e0e32f58c14ee4aaec69263d36175afc35b129dc8) -mstore(0x5160, mload(0x4360)) -success := and(eq(staticcall(gas(), 0x7, 0x5120, 0x60, 0x5120, 0x40), 1), success) -mstore(0x5180, mload(0x50a0)) - mstore(0x51a0, mload(0x50c0)) -mstore(0x51c0, mload(0x5120)) - mstore(0x51e0, mload(0x5140)) -success := and(eq(staticcall(gas(), 0x6, 0x5180, 0x80, 0x5180, 0x40), 1), success) -mstore(0x5200, 0x2c5cb6e96533664432584b4373fc01286cb8aa2c8a7f05eac98fc5bc689e65bf) - mstore(0x5220, 0x2c6a00e02442db4548c0583842d7c460dfaba5a8ae3d86ca57b0d7c82d7090c8) -mstore(0x5240, mload(0x4380)) -success := and(eq(staticcall(gas(), 0x7, 0x5200, 0x60, 0x5200, 0x40), 1), success) -mstore(0x5260, mload(0x5180)) - mstore(0x5280, mload(0x51a0)) -mstore(0x52a0, mload(0x5200)) - mstore(0x52c0, mload(0x5220)) -success := and(eq(staticcall(gas(), 0x6, 0x5260, 0x80, 0x5260, 0x40), 1), success) -mstore(0x52e0, 0x2b737ba20cacc46db1394cb36a1cb92566946b943314b7037d038fbb83f233a8) - mstore(0x5300, 0x04dc42ddd6eb4c1c43a1175bc70c5b5c92577f968055708b4beeb22cea5cff99) -mstore(0x5320, mload(0x43a0)) -success := and(eq(staticcall(gas(), 0x7, 0x52e0, 0x60, 0x52e0, 0x40), 1), success) -mstore(0x5340, mload(0x5260)) - mstore(0x5360, mload(0x5280)) -mstore(0x5380, mload(0x52e0)) - mstore(0x53a0, mload(0x5300)) -success := and(eq(staticcall(gas(), 0x6, 0x5340, 0x80, 0x5340, 0x40), 1), success) -mstore(0x53c0, 0x0ff2ba345398269313967c25483b19e5e2de27f76a3a4357408c35dc42ddfec3) - mstore(0x53e0, 0x063d5c171abc02e7d09324a4f1bb6493d0584767678901f452ebc7f285037015) -mstore(0x5400, mload(0x43c0)) -success := and(eq(staticcall(gas(), 0x7, 0x53c0, 0x60, 0x53c0, 0x40), 1), success) -mstore(0x5420, mload(0x5340)) - mstore(0x5440, mload(0x5360)) -mstore(0x5460, mload(0x53c0)) - mstore(0x5480, mload(0x53e0)) -success := and(eq(staticcall(gas(), 0x6, 0x5420, 0x80, 0x5420, 0x40), 1), success) -mstore(0x54a0, mload(0x5a0)) - mstore(0x54c0, mload(0x5c0)) -mstore(0x54e0, mload(0x43e0)) -success := and(eq(staticcall(gas(), 0x7, 0x54a0, 0x60, 0x54a0, 0x40), 1), success) -mstore(0x5500, mload(0x5420)) - mstore(0x5520, mload(0x5440)) -mstore(0x5540, mload(0x54a0)) - mstore(0x5560, mload(0x54c0)) -success := and(eq(staticcall(gas(), 0x6, 0x5500, 0x80, 0x5500, 0x40), 1), success) -mstore(0x5580, mload(0x5e0)) - mstore(0x55a0, mload(0x600)) -mstore(0x55c0, mload(0x4400)) -success := and(eq(staticcall(gas(), 0x7, 0x5580, 0x60, 0x5580, 0x40), 1), success) -mstore(0x55e0, mload(0x5500)) - mstore(0x5600, mload(0x5520)) -mstore(0x5620, mload(0x5580)) - mstore(0x5640, mload(0x55a0)) -success := and(eq(staticcall(gas(), 0x6, 0x55e0, 0x80, 0x55e0, 0x40), 1), success) -mstore(0x5660, mload(0x620)) - mstore(0x5680, mload(0x640)) -mstore(0x56a0, mload(0x4420)) -success := and(eq(staticcall(gas(), 0x7, 0x5660, 0x60, 0x5660, 0x40), 1), success) -mstore(0x56c0, mload(0x55e0)) - mstore(0x56e0, mload(0x5600)) -mstore(0x5700, mload(0x5660)) - mstore(0x5720, mload(0x5680)) -success := and(eq(staticcall(gas(), 0x6, 0x56c0, 0x80, 0x56c0, 0x40), 1), success) -mstore(0x5740, mload(0x500)) - mstore(0x5760, mload(0x520)) -mstore(0x5780, mload(0x4440)) -success := and(eq(staticcall(gas(), 0x7, 0x5740, 0x60, 0x5740, 0x40), 1), success) -mstore(0x57a0, mload(0x56c0)) - mstore(0x57c0, mload(0x56e0)) -mstore(0x57e0, mload(0x5740)) - mstore(0x5800, mload(0x5760)) -success := and(eq(staticcall(gas(), 0x6, 0x57a0, 0x80, 0x57a0, 0x40), 1), success) -mstore(0x5820, mload(0x400)) - mstore(0x5840, mload(0x420)) -mstore(0x5860, mload(0x45e0)) -success := and(eq(staticcall(gas(), 0x7, 0x5820, 0x60, 0x5820, 0x40), 1), success) -mstore(0x5880, mload(0x57a0)) - mstore(0x58a0, mload(0x57c0)) -mstore(0x58c0, mload(0x5820)) - mstore(0x58e0, mload(0x5840)) -success := and(eq(staticcall(gas(), 0x6, 0x5880, 0x80, 0x5880, 0x40), 1), success) -mstore(0x5900, mload(0x440)) - mstore(0x5920, mload(0x460)) -mstore(0x5940, mload(0x4600)) -success := and(eq(staticcall(gas(), 0x7, 0x5900, 0x60, 0x5900, 0x40), 1), success) -mstore(0x5960, mload(0x5880)) - mstore(0x5980, mload(0x58a0)) -mstore(0x59a0, mload(0x5900)) - mstore(0x59c0, mload(0x5920)) -success := and(eq(staticcall(gas(), 0x6, 0x5960, 0x80, 0x5960, 0x40), 1), success) -mstore(0x59e0, mload(0x480)) - mstore(0x5a00, mload(0x4a0)) -mstore(0x5a20, mload(0x47a0)) -success := and(eq(staticcall(gas(), 0x7, 0x59e0, 0x60, 0x59e0, 0x40), 1), success) -mstore(0x5a40, mload(0x5960)) - mstore(0x5a60, mload(0x5980)) -mstore(0x5a80, mload(0x59e0)) - mstore(0x5aa0, mload(0x5a00)) -success := and(eq(staticcall(gas(), 0x6, 0x5a40, 0x80, 0x5a40, 0x40), 1), success) -mstore(0x5ac0, mload(0x4c0)) - mstore(0x5ae0, mload(0x4e0)) -mstore(0x5b00, mload(0x47c0)) -success := and(eq(staticcall(gas(), 0x7, 0x5ac0, 0x60, 0x5ac0, 0x40), 1), success) -mstore(0x5b20, mload(0x5a40)) - mstore(0x5b40, mload(0x5a60)) -mstore(0x5b60, mload(0x5ac0)) - mstore(0x5b80, mload(0x5ae0)) -success := and(eq(staticcall(gas(), 0x6, 0x5b20, 0x80, 0x5b20, 0x40), 1), success) -mstore(0x5ba0, mload(0x2c0)) - mstore(0x5bc0, mload(0x2e0)) -mstore(0x5be0, mload(0x48c0)) -success := and(eq(staticcall(gas(), 0x7, 0x5ba0, 0x60, 0x5ba0, 0x40), 1), success) -mstore(0x5c00, mload(0x5b20)) - mstore(0x5c20, mload(0x5b40)) -mstore(0x5c40, mload(0x5ba0)) - mstore(0x5c60, mload(0x5bc0)) -success := and(eq(staticcall(gas(), 0x6, 0x5c00, 0x80, 0x5c00, 0x40), 1), success) -mstore(0x5c80, mload(0xb80)) - mstore(0x5ca0, mload(0xba0)) -mstore(0x5cc0, sub(f_q, mload(0x4900))) -success := and(eq(staticcall(gas(), 0x7, 0x5c80, 0x60, 0x5c80, 0x40), 1), success) -mstore(0x5ce0, mload(0x5c00)) - mstore(0x5d00, mload(0x5c20)) -mstore(0x5d20, mload(0x5c80)) - mstore(0x5d40, mload(0x5ca0)) -success := and(eq(staticcall(gas(), 0x6, 0x5ce0, 0x80, 0x5ce0, 0x40), 1), success) -mstore(0x5d60, mload(0xc20)) - mstore(0x5d80, mload(0xc40)) -mstore(0x5da0, mload(0x4920)) -success := and(eq(staticcall(gas(), 0x7, 0x5d60, 0x60, 0x5d60, 0x40), 1), success) -mstore(0x5dc0, mload(0x5ce0)) - mstore(0x5de0, mload(0x5d00)) -mstore(0x5e00, mload(0x5d60)) - mstore(0x5e20, mload(0x5d80)) -success := and(eq(staticcall(gas(), 0x6, 0x5dc0, 0x80, 0x5dc0, 0x40), 1), success) -mstore(0x5e40, mload(0x5dc0)) - mstore(0x5e60, mload(0x5de0)) -mstore(0x5e80, mload(0xc20)) - mstore(0x5ea0, mload(0xc40)) -mstore(0x5ec0, mload(0xc60)) - mstore(0x5ee0, mload(0xc80)) + let result := mulmod(mload(0xae0), mload(0x30a0), f_q) +result := addmod(mulmod(mload(0xb00), mload(0x3100), f_q), result, f_q) +mstore(18592, result) + } +mstore(0x48c0, mulmod(mload(0x48a0), mload(0x36e0), f_q)) +mstore(0x48e0, mulmod(sub(f_q, mload(0x48c0)), 1, f_q)) +mstore(0x4900, mulmod(mload(0x4880), 1, f_q)) +mstore(0x4920, mulmod(mload(0x48e0), mload(0x38c0), f_q)) +mstore(0x4940, mulmod(mload(0x4900), mload(0x38c0), f_q)) +mstore(0x4960, addmod(mload(0x4860), mload(0x4920), f_q)) +mstore(0x4980, mulmod(1, mload(0x2e20), f_q)) +mstore(0x49a0, mulmod(1, mload(0xc60), f_q)) +mstore(0x49c0, 0x0000000000000000000000000000000000000000000000000000000000000001) + mstore(0x49e0, 0x0000000000000000000000000000000000000000000000000000000000000002) +mstore(0x4a00, mload(0x4960)) +success := and(eq(staticcall(gas(), 0x7, 0x49c0, 0x60, 0x49c0, 0x40), 1), success) +mstore(0x4a20, mload(0x49c0)) + mstore(0x4a40, mload(0x49e0)) +mstore(0x4a60, mload(0x220)) + mstore(0x4a80, mload(0x240)) +success := and(eq(staticcall(gas(), 0x6, 0x4a20, 0x80, 0x4a20, 0x40), 1), success) +mstore(0x4aa0, mload(0x260)) + mstore(0x4ac0, mload(0x280)) +mstore(0x4ae0, mload(0x3a20)) +success := and(eq(staticcall(gas(), 0x7, 0x4aa0, 0x60, 0x4aa0, 0x40), 1), success) +mstore(0x4b00, mload(0x4a20)) + mstore(0x4b20, mload(0x4a40)) +mstore(0x4b40, mload(0x4aa0)) + mstore(0x4b60, mload(0x4ac0)) +success := and(eq(staticcall(gas(), 0x6, 0x4b00, 0x80, 0x4b00, 0x40), 1), success) +mstore(0x4b80, mload(0x2a0)) + mstore(0x4ba0, mload(0x2c0)) +mstore(0x4bc0, mload(0x4300)) +success := and(eq(staticcall(gas(), 0x7, 0x4b80, 0x60, 0x4b80, 0x40), 1), success) +mstore(0x4be0, mload(0x4b00)) + mstore(0x4c00, mload(0x4b20)) +mstore(0x4c20, mload(0x4b80)) + mstore(0x4c40, mload(0x4ba0)) +success := and(eq(staticcall(gas(), 0x6, 0x4be0, 0x80, 0x4be0, 0x40), 1), success) +mstore(0x4c60, mload(0x380)) + mstore(0x4c80, mload(0x3a0)) +mstore(0x4ca0, mload(0x4320)) +success := and(eq(staticcall(gas(), 0x7, 0x4c60, 0x60, 0x4c60, 0x40), 1), success) +mstore(0x4cc0, mload(0x4be0)) + mstore(0x4ce0, mload(0x4c00)) +mstore(0x4d00, mload(0x4c60)) + mstore(0x4d20, mload(0x4c80)) +success := and(eq(staticcall(gas(), 0x6, 0x4cc0, 0x80, 0x4cc0, 0x40), 1), success) +mstore(0x4d40, 0x0a56bb24bdbd10b2ae380a0f6d2926afe21e55ef423d664a7093bdc47d7a970d) + mstore(0x4d60, 0x3046067f3fbc66fb8322b30a454654489ad23370423a63caeab071e10143c65d) +mstore(0x4d80, mload(0x4340)) +success := and(eq(staticcall(gas(), 0x7, 0x4d40, 0x60, 0x4d40, 0x40), 1), success) +mstore(0x4da0, mload(0x4cc0)) + mstore(0x4dc0, mload(0x4ce0)) +mstore(0x4de0, mload(0x4d40)) + mstore(0x4e00, mload(0x4d60)) +success := and(eq(staticcall(gas(), 0x6, 0x4da0, 0x80, 0x4da0, 0x40), 1), success) +mstore(0x4e20, 0x165f42d12623508ec09f1a14ffe3841e636362840bcfe45fd4f0847a50968d91) + mstore(0x4e40, 0x19664a50abfa10f51e0eb96bf39b959cd2ebd0ed52c60bc0d4e8535272a13ed9) +mstore(0x4e60, mload(0x4360)) +success := and(eq(staticcall(gas(), 0x7, 0x4e20, 0x60, 0x4e20, 0x40), 1), success) +mstore(0x4e80, mload(0x4da0)) + mstore(0x4ea0, mload(0x4dc0)) +mstore(0x4ec0, mload(0x4e20)) + mstore(0x4ee0, mload(0x4e40)) +success := and(eq(staticcall(gas(), 0x6, 0x4e80, 0x80, 0x4e80, 0x40), 1), success) +mstore(0x4f00, 0x0c7dc4e4516515f0050b10e6891a60f39ab7645bbf2134080574b9ae26a3fee2) + mstore(0x4f20, 0x2ee3484a156715514bcc56f95e316bb23031b7460f679ebb427a7f8ad73aead2) +mstore(0x4f40, mload(0x4380)) +success := and(eq(staticcall(gas(), 0x7, 0x4f00, 0x60, 0x4f00, 0x40), 1), success) +mstore(0x4f60, mload(0x4e80)) + mstore(0x4f80, mload(0x4ea0)) +mstore(0x4fa0, mload(0x4f00)) + mstore(0x4fc0, mload(0x4f20)) +success := and(eq(staticcall(gas(), 0x6, 0x4f60, 0x80, 0x4f60, 0x40), 1), success) +mstore(0x4fe0, 0x2fb1bc5dc1a8a163ac673f110c7ced2581955a8d47770fced15a66d8199a5c91) + mstore(0x5000, 0x18f7802cf51055b658637bf93f53fcc4dbe4218c03cb54c9d3e74534e1b9cb8f) +mstore(0x5020, mload(0x43a0)) +success := and(eq(staticcall(gas(), 0x7, 0x4fe0, 0x60, 0x4fe0, 0x40), 1), success) +mstore(0x5040, mload(0x4f60)) + mstore(0x5060, mload(0x4f80)) +mstore(0x5080, mload(0x4fe0)) + mstore(0x50a0, mload(0x5000)) +success := and(eq(staticcall(gas(), 0x6, 0x5040, 0x80, 0x5040, 0x40), 1), success) +mstore(0x50c0, 0x2051ae2329a00ab4684564c9db909204379c6404686b9bb004253a0e87937c1a) + mstore(0x50e0, 0x2228d27991956786c7b7ed829027a4268a8f57d342e507683aaaea7046a1721b) +mstore(0x5100, mload(0x43c0)) +success := and(eq(staticcall(gas(), 0x7, 0x50c0, 0x60, 0x50c0, 0x40), 1), success) +mstore(0x5120, mload(0x5040)) + mstore(0x5140, mload(0x5060)) +mstore(0x5160, mload(0x50c0)) + mstore(0x5180, mload(0x50e0)) +success := and(eq(staticcall(gas(), 0x6, 0x5120, 0x80, 0x5120, 0x40), 1), success) +mstore(0x51a0, 0x144e8b5cd066532d7a019f3061d407aeb922b3a37125d39cee71a336088a8d57) + mstore(0x51c0, 0x0465b8271620ef2988dbb05e0e32f58c14ee4aaec69263d36175afc35b129dc8) +mstore(0x51e0, mload(0x43e0)) +success := and(eq(staticcall(gas(), 0x7, 0x51a0, 0x60, 0x51a0, 0x40), 1), success) +mstore(0x5200, mload(0x5120)) + mstore(0x5220, mload(0x5140)) +mstore(0x5240, mload(0x51a0)) + mstore(0x5260, mload(0x51c0)) +success := and(eq(staticcall(gas(), 0x6, 0x5200, 0x80, 0x5200, 0x40), 1), success) +mstore(0x5280, 0x2c5cb6e96533664432584b4373fc01286cb8aa2c8a7f05eac98fc5bc689e65bf) + mstore(0x52a0, 0x2c6a00e02442db4548c0583842d7c460dfaba5a8ae3d86ca57b0d7c82d7090c8) +mstore(0x52c0, mload(0x4400)) +success := and(eq(staticcall(gas(), 0x7, 0x5280, 0x60, 0x5280, 0x40), 1), success) +mstore(0x52e0, mload(0x5200)) + mstore(0x5300, mload(0x5220)) +mstore(0x5320, mload(0x5280)) + mstore(0x5340, mload(0x52a0)) +success := and(eq(staticcall(gas(), 0x6, 0x52e0, 0x80, 0x52e0, 0x40), 1), success) +mstore(0x5360, 0x2b737ba20cacc46db1394cb36a1cb92566946b943314b7037d038fbb83f233a8) + mstore(0x5380, 0x04dc42ddd6eb4c1c43a1175bc70c5b5c92577f968055708b4beeb22cea5cff99) +mstore(0x53a0, mload(0x4420)) +success := and(eq(staticcall(gas(), 0x7, 0x5360, 0x60, 0x5360, 0x40), 1), success) +mstore(0x53c0, mload(0x52e0)) + mstore(0x53e0, mload(0x5300)) +mstore(0x5400, mload(0x5360)) + mstore(0x5420, mload(0x5380)) +success := and(eq(staticcall(gas(), 0x6, 0x53c0, 0x80, 0x53c0, 0x40), 1), success) +mstore(0x5440, 0x0ff2ba345398269313967c25483b19e5e2de27f76a3a4357408c35dc42ddfec3) + mstore(0x5460, 0x063d5c171abc02e7d09324a4f1bb6493d0584767678901f452ebc7f285037015) +mstore(0x5480, mload(0x4440)) +success := and(eq(staticcall(gas(), 0x7, 0x5440, 0x60, 0x5440, 0x40), 1), success) +mstore(0x54a0, mload(0x53c0)) + mstore(0x54c0, mload(0x53e0)) +mstore(0x54e0, mload(0x5440)) + mstore(0x5500, mload(0x5460)) +success := and(eq(staticcall(gas(), 0x6, 0x54a0, 0x80, 0x54a0, 0x40), 1), success) +mstore(0x5520, mload(0x620)) + mstore(0x5540, mload(0x640)) +mstore(0x5560, mload(0x4460)) +success := and(eq(staticcall(gas(), 0x7, 0x5520, 0x60, 0x5520, 0x40), 1), success) +mstore(0x5580, mload(0x54a0)) + mstore(0x55a0, mload(0x54c0)) +mstore(0x55c0, mload(0x5520)) + mstore(0x55e0, mload(0x5540)) +success := and(eq(staticcall(gas(), 0x6, 0x5580, 0x80, 0x5580, 0x40), 1), success) +mstore(0x5600, mload(0x660)) + mstore(0x5620, mload(0x680)) +mstore(0x5640, mload(0x4480)) +success := and(eq(staticcall(gas(), 0x7, 0x5600, 0x60, 0x5600, 0x40), 1), success) +mstore(0x5660, mload(0x5580)) + mstore(0x5680, mload(0x55a0)) +mstore(0x56a0, mload(0x5600)) + mstore(0x56c0, mload(0x5620)) +success := and(eq(staticcall(gas(), 0x6, 0x5660, 0x80, 0x5660, 0x40), 1), success) +mstore(0x56e0, mload(0x6a0)) + mstore(0x5700, mload(0x6c0)) +mstore(0x5720, mload(0x44a0)) +success := and(eq(staticcall(gas(), 0x7, 0x56e0, 0x60, 0x56e0, 0x40), 1), success) +mstore(0x5740, mload(0x5660)) + mstore(0x5760, mload(0x5680)) +mstore(0x5780, mload(0x56e0)) + mstore(0x57a0, mload(0x5700)) +success := and(eq(staticcall(gas(), 0x6, 0x5740, 0x80, 0x5740, 0x40), 1), success) +mstore(0x57c0, mload(0x580)) + mstore(0x57e0, mload(0x5a0)) +mstore(0x5800, mload(0x44c0)) +success := and(eq(staticcall(gas(), 0x7, 0x57c0, 0x60, 0x57c0, 0x40), 1), success) +mstore(0x5820, mload(0x5740)) + mstore(0x5840, mload(0x5760)) +mstore(0x5860, mload(0x57c0)) + mstore(0x5880, mload(0x57e0)) +success := and(eq(staticcall(gas(), 0x6, 0x5820, 0x80, 0x5820, 0x40), 1), success) +mstore(0x58a0, mload(0x480)) + mstore(0x58c0, mload(0x4a0)) +mstore(0x58e0, mload(0x4660)) +success := and(eq(staticcall(gas(), 0x7, 0x58a0, 0x60, 0x58a0, 0x40), 1), success) +mstore(0x5900, mload(0x5820)) + mstore(0x5920, mload(0x5840)) +mstore(0x5940, mload(0x58a0)) + mstore(0x5960, mload(0x58c0)) +success := and(eq(staticcall(gas(), 0x6, 0x5900, 0x80, 0x5900, 0x40), 1), success) +mstore(0x5980, mload(0x4c0)) + mstore(0x59a0, mload(0x4e0)) +mstore(0x59c0, mload(0x4680)) +success := and(eq(staticcall(gas(), 0x7, 0x5980, 0x60, 0x5980, 0x40), 1), success) +mstore(0x59e0, mload(0x5900)) + mstore(0x5a00, mload(0x5920)) +mstore(0x5a20, mload(0x5980)) + mstore(0x5a40, mload(0x59a0)) +success := and(eq(staticcall(gas(), 0x6, 0x59e0, 0x80, 0x59e0, 0x40), 1), success) +mstore(0x5a60, mload(0x500)) + mstore(0x5a80, mload(0x520)) +mstore(0x5aa0, mload(0x4820)) +success := and(eq(staticcall(gas(), 0x7, 0x5a60, 0x60, 0x5a60, 0x40), 1), success) +mstore(0x5ac0, mload(0x59e0)) + mstore(0x5ae0, mload(0x5a00)) +mstore(0x5b00, mload(0x5a60)) + mstore(0x5b20, mload(0x5a80)) +success := and(eq(staticcall(gas(), 0x6, 0x5ac0, 0x80, 0x5ac0, 0x40), 1), success) +mstore(0x5b40, mload(0x540)) + mstore(0x5b60, mload(0x560)) +mstore(0x5b80, mload(0x4840)) +success := and(eq(staticcall(gas(), 0x7, 0x5b40, 0x60, 0x5b40, 0x40), 1), success) +mstore(0x5ba0, mload(0x5ac0)) + mstore(0x5bc0, mload(0x5ae0)) +mstore(0x5be0, mload(0x5b40)) + mstore(0x5c00, mload(0x5b60)) +success := and(eq(staticcall(gas(), 0x6, 0x5ba0, 0x80, 0x5ba0, 0x40), 1), success) +mstore(0x5c20, mload(0x340)) + mstore(0x5c40, mload(0x360)) +mstore(0x5c60, mload(0x4940)) +success := and(eq(staticcall(gas(), 0x7, 0x5c20, 0x60, 0x5c20, 0x40), 1), success) +mstore(0x5c80, mload(0x5ba0)) + mstore(0x5ca0, mload(0x5bc0)) +mstore(0x5cc0, mload(0x5c20)) + mstore(0x5ce0, mload(0x5c40)) +success := and(eq(staticcall(gas(), 0x6, 0x5c80, 0x80, 0x5c80, 0x40), 1), success) +mstore(0x5d00, mload(0xc00)) + mstore(0x5d20, mload(0xc20)) +mstore(0x5d40, sub(f_q, mload(0x4980))) +success := and(eq(staticcall(gas(), 0x7, 0x5d00, 0x60, 0x5d00, 0x40), 1), success) +mstore(0x5d60, mload(0x5c80)) + mstore(0x5d80, mload(0x5ca0)) +mstore(0x5da0, mload(0x5d00)) + mstore(0x5dc0, mload(0x5d20)) +success := and(eq(staticcall(gas(), 0x6, 0x5d60, 0x80, 0x5d60, 0x40), 1), success) +mstore(0x5de0, mload(0xca0)) + mstore(0x5e00, mload(0xcc0)) +mstore(0x5e20, mload(0x49a0)) +success := and(eq(staticcall(gas(), 0x7, 0x5de0, 0x60, 0x5de0, 0x40), 1), success) +mstore(0x5e40, mload(0x5d60)) + mstore(0x5e60, mload(0x5d80)) +mstore(0x5e80, mload(0x5de0)) + mstore(0x5ea0, mload(0x5e00)) +success := and(eq(staticcall(gas(), 0x6, 0x5e40, 0x80, 0x5e40, 0x40), 1), success) +mstore(0x5ec0, mload(0x5e40)) + mstore(0x5ee0, mload(0x5e60)) mstore(0x5f00, mload(0xca0)) mstore(0x5f20, mload(0xcc0)) -mstore(0x5f40, keccak256(0x5e40, 256)) -mstore(24416, mod(mload(24384), f_q)) -mstore(0x5f80, mulmod(mload(0x5f60), mload(0x5f60), f_q)) -mstore(0x5fa0, mulmod(1, mload(0x5f60), f_q)) -mstore(0x5fc0, mload(0x5ec0)) - mstore(0x5fe0, mload(0x5ee0)) -mstore(0x6000, mload(0x5fa0)) -success := and(eq(staticcall(gas(), 0x7, 0x5fc0, 0x60, 0x5fc0, 0x40), 1), success) -mstore(0x6020, mload(0x5e40)) - mstore(0x6040, mload(0x5e60)) -mstore(0x6060, mload(0x5fc0)) - mstore(0x6080, mload(0x5fe0)) -success := and(eq(staticcall(gas(), 0x6, 0x6020, 0x80, 0x6020, 0x40), 1), success) -mstore(0x60a0, mload(0x5f00)) - mstore(0x60c0, mload(0x5f20)) -mstore(0x60e0, mload(0x5fa0)) -success := and(eq(staticcall(gas(), 0x7, 0x60a0, 0x60, 0x60a0, 0x40), 1), success) -mstore(0x6100, mload(0x5e80)) - mstore(0x6120, mload(0x5ea0)) -mstore(0x6140, mload(0x60a0)) - mstore(0x6160, mload(0x60c0)) -success := and(eq(staticcall(gas(), 0x6, 0x6100, 0x80, 0x6100, 0x40), 1), success) -mstore(0x6180, mload(0x6020)) - mstore(0x61a0, mload(0x6040)) -mstore(0x61c0, 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2) - mstore(0x61e0, 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed) - mstore(0x6200, 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b) - mstore(0x6220, 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa) -mstore(0x6240, mload(0x6100)) - mstore(0x6260, mload(0x6120)) -mstore(0x6280, 0x138d5863615c12d3bd7d3fd007776d281a337f9d7f6dce23532100bb4bb5839d) - mstore(0x62a0, 0x0a3bb881671ee4e9238366e87f6598f0de356372ed3dc870766ec8ac005211e4) - mstore(0x62c0, 0x19c9d7d9c6e7ad2d9a0d5847ebdd2687c668939a202553ded2760d3eb8dbf559) - mstore(0x62e0, 0x198adb441818c42721c88c532ed13a5da1ebb78b85574d0b7326d8e6f4c1e25a) -success := and(eq(staticcall(gas(), 0x8, 0x6180, 0x180, 0x6180, 0x20), 1), success) -success := and(eq(mload(0x6180), 1), success) +mstore(0x5f40, mload(0xce0)) + mstore(0x5f60, mload(0xd00)) +mstore(0x5f80, mload(0xd20)) + mstore(0x5fa0, mload(0xd40)) +mstore(0x5fc0, keccak256(0x5ec0, 256)) +mstore(24544, mod(mload(24512), f_q)) +mstore(0x6000, mulmod(mload(0x5fe0), mload(0x5fe0), f_q)) +mstore(0x6020, mulmod(1, mload(0x5fe0), f_q)) +mstore(0x6040, mload(0x5f40)) + mstore(0x6060, mload(0x5f60)) +mstore(0x6080, mload(0x6020)) +success := and(eq(staticcall(gas(), 0x7, 0x6040, 0x60, 0x6040, 0x40), 1), success) +mstore(0x60a0, mload(0x5ec0)) + mstore(0x60c0, mload(0x5ee0)) +mstore(0x60e0, mload(0x6040)) + mstore(0x6100, mload(0x6060)) +success := and(eq(staticcall(gas(), 0x6, 0x60a0, 0x80, 0x60a0, 0x40), 1), success) +mstore(0x6120, mload(0x5f80)) + mstore(0x6140, mload(0x5fa0)) +mstore(0x6160, mload(0x6020)) +success := and(eq(staticcall(gas(), 0x7, 0x6120, 0x60, 0x6120, 0x40), 1), success) +mstore(0x6180, mload(0x5f00)) + mstore(0x61a0, mload(0x5f20)) +mstore(0x61c0, mload(0x6120)) + mstore(0x61e0, mload(0x6140)) +success := and(eq(staticcall(gas(), 0x6, 0x6180, 0x80, 0x6180, 0x40), 1), success) +mstore(0x6200, mload(0x60a0)) + mstore(0x6220, mload(0x60c0)) +mstore(0x6240, 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2) + mstore(0x6260, 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed) + mstore(0x6280, 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b) + mstore(0x62a0, 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa) +mstore(0x62c0, mload(0x6180)) + mstore(0x62e0, mload(0x61a0)) +mstore(0x6300, 0x138d5863615c12d3bd7d3fd007776d281a337f9d7f6dce23532100bb4bb5839d) + mstore(0x6320, 0x0a3bb881671ee4e9238366e87f6598f0de356372ed3dc870766ec8ac005211e4) + mstore(0x6340, 0x19c9d7d9c6e7ad2d9a0d5847ebdd2687c668939a202553ded2760d3eb8dbf559) + mstore(0x6360, 0x198adb441818c42721c88c532ed13a5da1ebb78b85574d0b7326d8e6f4c1e25a) +success := and(eq(staticcall(gas(), 0x8, 0x6200, 0x180, 0x6200, 0x20), 1), success) +success := and(eq(mload(0x6200), 1), success) // Revert if anything fails if iszero(success) { revert(0, 0) } diff --git a/snark-verifier/src/loader/evm/code.rs b/snark-verifier/src/loader/evm/code.rs index 193b66e9..7744ab35 100644 --- a/snark-verifier/src/loader/evm/code.rs +++ b/snark-verifier/src/loader/evm/code.rs @@ -25,7 +25,13 @@ pragma solidity >=0.8.19 <0.8.21; contract Halo2Verifier {{ fallback(bytes calldata) external returns (bytes memory) {{ - assembly {{ + assembly (\"memory-safe\") {{ + // Enforce that Solidity memory layout is respected + let data := mload(0x40) + if iszero(eq(data, 0x80)) {{ + revert(0, 0) + }} + let success := true let f_p := {base_modulus} let f_q := {scalar_modulus} diff --git a/snark-verifier/src/loader/evm/loader.rs b/snark-verifier/src/loader/evm/loader.rs index 3bf49baf..af2795c1 100644 --- a/snark-verifier/src/loader/evm/loader.rs +++ b/snark-verifier/src/loader/evm/loader.rs @@ -21,6 +21,9 @@ use std::{ rc::Rc, }; +/// Memory pointer starts at 0x80, which is the end of the Solidity memory layout scratch space. +pub const MEM_PTR_START: usize = 0x80; + #[derive(Clone, Debug)] pub enum Value { Constant(T), @@ -76,7 +79,7 @@ impl EvmLoader { base_modulus, scalar_modulus, code: RefCell::new(code), - ptr: Default::default(), + ptr: RefCell::new(MEM_PTR_START), cache: Default::default(), }) } diff --git a/snark-verifier/src/system/halo2/transcript/evm.rs b/snark-verifier/src/system/halo2/transcript/evm.rs index da2c09c2..372b1388 100644 --- a/snark-verifier/src/system/halo2/transcript/evm.rs +++ b/snark-verifier/src/system/halo2/transcript/evm.rs @@ -1,6 +1,7 @@ //! Transcript for verifier on EVM. use crate::halo2_proofs; +use crate::loader::evm::loader::MEM_PTR_START; use crate::{ loader::{ evm::{loader::Value, u256_to_fe, util::MemoryChunk, EcPoint, EvmLoader, Scalar, U256}, @@ -41,7 +42,7 @@ where /// u256 for `transcript_initial_state`. pub fn new(loader: &Rc) -> Self { let ptr = loader.allocate(0x20); - assert_eq!(ptr, 0); + assert_eq!(ptr, MEM_PTR_START); let mut buf = MemoryChunk::new(ptr); buf.extend(0x20); Self { loader: loader.clone(), stream: 0, buf, _marker: PhantomData } @@ -116,7 +117,7 @@ where fn common_scalar(&mut self, scalar: &Scalar) -> Result<(), Error> { match scalar.value() { - Value::Constant(_) if self.buf.ptr() == 0 => { + Value::Constant(_) if self.buf.ptr() == MEM_PTR_START => { self.loader.copy_scalar(scalar, self.buf.ptr()); } Value::Memory(ptr) => {