Skip to content

Commit

Permalink
Refactor circom files to maximize re-use
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Zhang <[email protected]>
  • Loading branch information
jimthematrix committed Jul 31, 2024
1 parent 4639313 commit a68dae5
Show file tree
Hide file tree
Showing 67 changed files with 665,633 additions and 651,229 deletions.
34 changes: 15 additions & 19 deletions solidity/contracts/lib/verifier_anon.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand Down
34 changes: 15 additions & 19 deletions solidity/contracts/lib/verifier_anon_enc.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand Down
54 changes: 25 additions & 29 deletions solidity/contracts/lib/verifier_anon_enc_nullifier.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand All @@ -43,8 +39,8 @@ contract Groth16Verifier_AnonEncNullifier {
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;


uint256 constant IC0x = 1132180179491441538738452273651946883461412832203743112811118844473379442028;
uint256 constant IC0y = 5390783026485963433523207720053244289587838204839623860596474298081543088585;
uint256 constant IC0x = 4568570755632788643394533153911199637393845847987729293464981238980340214701;
uint256 constant IC0y = 15128319276870423050909157626275409799208340368213199411576816383311184129195;

uint256 constant IC1x = 9479671548635182258434953602646699552143280379254562789430654117067623065154;
uint256 constant IC1y = 4513875910577591187417669244456597493215594361393034699197432847781635817944;
Expand All @@ -58,23 +54,23 @@ contract Groth16Verifier_AnonEncNullifier {
uint256 constant IC4x = 8045706817285648122335493621835686579889910526627484670178299244569350873337;
uint256 constant IC4y = 14703212748037329834343212171120394526601085625912333793516662767512116840031;

uint256 constant IC5x = 17557824284863559227631182945646272910505435334053056722808626217521393289128;
uint256 constant IC5y = 16307615047799173365519895850598694329138770383868524034358007080013608669085;
uint256 constant IC5x = 12289213637181054892282624823702301699573523320936692431552214952203040411410;
uint256 constant IC5y = 16455438753606683924006591564176938596063251993144033301210430323087499194482;

uint256 constant IC6x = 5415585987138244191813990034208825389253432804629600554497141813191469438492;
uint256 constant IC6y = 17755870055831490788712008393346742047905432267237159229825629073030204324527;
uint256 constant IC6x = 14303047076752096755721879884111868337074094864491631063458708071696569838284;
uint256 constant IC6y = 5911949370715042191384217137312039273992455050421022652157649670332806294542;

uint256 constant IC7x = 8677981225322796966854381897381189421248711504209293881165286829150524884164;
uint256 constant IC7y = 12816796872832476519349268616267285968398279397067849918595558738184610770874;
uint256 constant IC7x = 15841884851029529902011697322996410384031024289464678913047883869169350568208;
uint256 constant IC7y = 21520807340471527261351700326658280597567437458476043915147723227393128763810;

uint256 constant IC8x = 15740540576184573386354609430256689221677491143833514512062380094508866796269;
uint256 constant IC8y = 2340484610103666557078136629597674107756904443534921271417989072923691667449;

uint256 constant IC9x = 3726988392811514450533313378412430039053796082573590843909105394276411441536;
uint256 constant IC9y = 7347033125306979340056255923745117502907380131073815888051201665421460725544;

uint256 constant IC10x = 6619094542081504921297870625144079235409984730673107107299279901988791810356;
uint256 constant IC10y = 10549347737329626943980590291223696927409993218357923512265036708353601601743;
uint256 constant IC10x = 4371277742931522011055134703913097482787808225431324421232573076499659150767;
uint256 constant IC10y = 11516411764009653445050545510250621675398241508987088025760029722333645258716;


// Memory data
Expand Down
50 changes: 23 additions & 27 deletions solidity/contracts/lib/verifier_anon_nullifier.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand All @@ -43,23 +39,23 @@ contract Groth16Verifier_AnonNullifier {
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;


uint256 constant IC0x = 7831194482890201907912813708954693484499937202778946556314791150355497052838;
uint256 constant IC0y = 17214367048578530654688121231520081865319465732684236954806278278486355045687;
uint256 constant IC0x = 5484373638915608486871020804166539520782909040345505335019959652136228862082;
uint256 constant IC0y = 16138277411069907720477228076440687453311854575356818231417756272310801661588;

uint256 constant IC1x = 657611904883114148980717005767820105315776575523580933462233892133390721686;
uint256 constant IC1y = 3690011531716382218745803104163270083920150842903711282044842015835943598950;

uint256 constant IC2x = 13247301284400305330080530887135251465329343308345822132754291671475418335661;
uint256 constant IC2y = 6878027108417593313264947615215679812389458074470859941986417727720332868266;

uint256 constant IC3x = 4393308877038816112044751113703161046884042023529143670482606285253407357318;
uint256 constant IC3y = 10861402902194208967056892862272521752290820790123718158389295013478034329376;
uint256 constant IC3x = 12122806794972194128212202542170444918567562037253242662728390689220136089417;
uint256 constant IC3y = 9885901744875470674355026551458972605308247499314156850898233682886130241050;

uint256 constant IC4x = 20567726645522252344842011251254616164566067019107949894642154009522868698126;
uint256 constant IC4y = 13058332362792856027058697122630683468388748189437006630731046361022666962675;
uint256 constant IC4x = 14497189114754949587485834175427788983830001040470111882678218991459557006481;
uint256 constant IC4y = 20830021231156123029529082857782030827870844726616623033674403796120242993032;

uint256 constant IC5x = 11519149396981714918708162608439765519813165816162067214356117934500928163278;
uint256 constant IC5y = 4896357293383145162082835572689841388496488666220683242957098534343617845489;
uint256 constant IC5x = 15185920369074896375657194229340428184369591270326493422044278017722304487940;
uint256 constant IC5y = 19431411716277310851795675028059565579151437630225658811235304233499648067653;

uint256 constant IC6x = 13045447923950887968308059891638935794209679677588887793771333234932902547512;
uint256 constant IC6y = 1960124371120172285328335936511540489447355418368729402128803121783956301995;
Expand Down
34 changes: 15 additions & 19 deletions solidity/contracts/lib/verifier_check_hashes_value.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand Down
34 changes: 15 additions & 19 deletions solidity/contracts/lib/verifier_check_inputs_outputs_value.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand Down
50 changes: 23 additions & 27 deletions solidity/contracts/lib/verifier_check_nullifier_value.sol
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// SPDX-License-Identifier: GPL-3.0
/*
Copyright 2021 0KIMS association.
This file is generated with [snarkJS](https://github.com/iden3/snarkjs).
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pragma solidity >=0.7.0 <0.9.0;

Expand All @@ -43,8 +39,8 @@ contract Groth16Verifier_CheckNullifierValue {
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;


uint256 constant IC0x = 15492418976489076016744712039228991049119912955688524102804299454656267186009;
uint256 constant IC0y = 6683516575201125125993199841635988477061644803076780133772345536623987263585;
uint256 constant IC0x = 17689341276400528038881094913477316584601794141371778409863013039635850173207;
uint256 constant IC0y = 2558369427026425384949906416503547088831210779110621106606440952169504206690;

uint256 constant IC1x = 20388809982110581159758837462045964857853052490510219178487821131497955197485;
uint256 constant IC1y = 11559017693629947025935312317037014128873998602028720842466005215803981949488;
Expand All @@ -55,14 +51,14 @@ contract Groth16Verifier_CheckNullifierValue {
uint256 constant IC3x = 9101308846546712061385480237991349242785040605257963609786960558441532043575;
uint256 constant IC3y = 20162065319211808084372980649366363483528315362920428034950134764348551061576;

uint256 constant IC4x = 1862728518597969644991754874217991793768978626842292905952230489753317456943;
uint256 constant IC4y = 13827959089691652056820043159766605451401208772931308660944601538220427688001;
uint256 constant IC4x = 18501642606042950780794159845742882415192620379623303973226676116663683279831;
uint256 constant IC4y = 4035817123127101809036107026908494398248571792522913686551956478049624862954;

uint256 constant IC5x = 12595562902478113608580909807915007505100194716952840137066159851175855515947;
uint256 constant IC5y = 20219788329832744328203670585885257301041964037877146487338583938337874848685;
uint256 constant IC5x = 9901268858925160759276937645092909569288103654642798134621446572955859297610;
uint256 constant IC5y = 17808153853093791337220101848650791727823424169638249340100930096702897113053;

uint256 constant IC6x = 15493536898701008011127294879458488796153705332302588952751125522877852961647;
uint256 constant IC6y = 1788009749667942434387844456635362080454534277559959103723491751055982698041;
uint256 constant IC6x = 9156914356337812564179538349866550161346357705322438631065343069946111924902;
uint256 constant IC6y = 16282373888516307308471083478224742458495059270728361213537123807614765466293;

uint256 constant IC7x = 2534369505154061360258866279946256857360053453543228810913826185688221321445;
uint256 constant IC7y = 15777401174389130350272102012636311458122823507269563590772434670217407958669;
Expand Down
Loading

0 comments on commit a68dae5

Please sign in to comment.