diff --git a/README.md b/README.md index 7b7743667..b1da042e6 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,31 @@ + + + + @zk-kit/groth16 + + + + + + NPM version + + + + + + Downloads + + + + + + npm bundle size (scoped) + + + diff --git a/packages/groth16/LICENSE b/packages/groth16/LICENSE new file mode 100644 index 000000000..ef7e7efc0 --- /dev/null +++ b/packages/groth16/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is 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. + + This program 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 this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/packages/groth16/README.md b/packages/groth16/README.md new file mode 100644 index 000000000..9ee19e40b --- /dev/null +++ b/packages/groth16/README.md @@ -0,0 +1,125 @@ +

+

+ SnarkJS Groth16 +

+

A snippet of SnarkJS code for verifying and generating Groth16 proofs only.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ +
+

+ + 🗣️ Chat & Support + +   |   + + 📘 Docs + +

+
+ +| This package contains [SnarkJS](https://github.com/iden3/snarkjs) functions for generating and verifying zero knowledge proofs with Groth16 specifically. In addition to the original code it also uses the cached `bn128` curve if it already exists, making verification and generation of consecutive proofs faster. | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + +Some advantages of using this package instead of `snarkjs` directly are: +* It only includes code to verify and generate Groth16 proofs, making your final bundle lighter. +* It doesn't call the [ffjavascript](https://github.com/iden3/ffjavascript) `buildBn128` function if a `bn128` cached curve already exists, making verification and generation of consecutive proofs much faster (e.g. verification seems to be ~9 times faster after the first one). +* It includes TS types. +* It provides an ESM bundle that is compatible with browsers. So there is no need to add any polyfill or additional configuration. + +## 🛠 Install + +### npm or yarn + +Install the `@zk-kit/groth16` package and its peer dependencies with npm: + +```bash +npm i @zk-kit/groth16 +``` + +or yarn: + +```bash +yarn add @zk-kit/groth16 +``` + +## 📜 Usage + +\# **prove**(input: _CircuitSignals_, wasmFile: _ZKArtifact_, zkeyFile: _ZKArtifact_): Promise\<_{ +proof: Groth16Proof +publicSignals: PublicSignals +}_> + +```typescript +import { prove } from "@zk-kit/groth16" + +const input = { + message: 12, + scope: 122 +} + +const proof = await prove(input, "./circuit.zkey", "./circuit.wasm") + +console.log(proof) +/* +{ + proof: { + pi_a: [ + '8259885706934172848141475422209230656096448508815982888010519325096632035723', + '3142099172052192611205205328157407975469005554072266974009053708782134081166', + '1' + ], + pi_b: [ [Array], [Array], [Array] ], + pi_c: [ + '13863804425308906943736719856399634046638544298517159271373916818387594277305', + '21340646707244019956779928177502771923632450548108204371058275686712196195969', + '1' + ], + protocol: 'groth16', + curve: 'bn128' + }, + publicSignals: [ + '527758365153958423212195330785598453331596731388181860789801455413116800554', + '19104626566001952573667666924569656871967113105870778077087237826253896482830', + '122' + ] +} +*/ +``` + +\# **verify**(verificationKey: _any_, proof: _{ +proof: Groth16Proof +publicSignals: PublicSignals +}_): Promise\<_boolean_> + +```typescript +import { verify } from "@zk-kit/groth16" +import verificationKey from "./circuit.json" + +const response = await verify(verificationKey, proof) + +console.log(response) // true +``` diff --git a/packages/groth16/build.tsconfig.json b/packages/groth16/build.tsconfig.json new file mode 100644 index 000000000..2d4a1d6da --- /dev/null +++ b/packages/groth16/build.tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "declarationDir": "dist/types" + }, + "include": ["src"] +} diff --git a/packages/groth16/package.json b/packages/groth16/package.json new file mode 100644 index 000000000..22ecb348d --- /dev/null +++ b/packages/groth16/package.json @@ -0,0 +1,52 @@ +{ + "name": "@zk-kit/groth16", + "version": "0.2.0", + "description": "A snippet of SnarkJS code for verifying and generating Groth16 proofs only.", + "license": "MIT", + "main": "dist/index.node.js", + "exports": { + "node": { + "import": "./dist/index.node.mjs", + "require": "./dist/index.node.js" + }, + "browser": "./dist/index.browser.mjs", + "default": "./dist/index.browser.mjs" + }, + "types": "dist/types/index.d.ts", + "files": [ + "dist/", + "src/", + "LICENSE", + "README.md" + ], + "repository": "https://github.com/privacy-scaling-explorations/zk-kit", + "homepage": "https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/groth16", + "bugs": { + "url": "https://github.com/privacy-scaling-explorations/zk-kit.git/issues" + }, + "scripts": { + "build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript", + "build": "rimraf dist && yarn build:browser && yarn build:node", + "build:browser": "rollup -c rollup.browser.config.ts --configPlugin typescript", + "build:node": "rollup -c rollup.node.config.ts --configPlugin typescript", + "prepublishOnly": "yarn build" + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@iden3/binfileutils": "0.0.11", + "@rollup/plugin-commonjs": "^24.1.0", + "@rollup/plugin-node-resolve": "^15.0.2", + "@rollup/plugin-virtual": "^3.0.2", + "fastfile": "0.0.20", + "rimraf": "^5.0.5", + "rollup": "^4.0.2", + "rollup-plugin-cleanup": "^3.2.1", + "rollup-plugin-typescript2": "^0.31.2" + }, + "dependencies": { + "circom_runtime": "0.1.24", + "ffjavascript": "0.2.60" + } +} diff --git a/packages/groth16/rollup.browser.config.ts b/packages/groth16/rollup.browser.config.ts new file mode 100644 index 000000000..058143451 --- /dev/null +++ b/packages/groth16/rollup.browser.config.ts @@ -0,0 +1,56 @@ +import commonjs from "@rollup/plugin-commonjs" +import { nodeResolve } from "@rollup/plugin-node-resolve" +import virtual from "@rollup/plugin-virtual" +import * as fs from "fs" +import cleanup from "rollup-plugin-cleanup" +import typescript from "rollup-plugin-typescript2" + +// Needed by fastfile. +import { O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC } from "constants" + +const constants = ` +export const O_TRUNC = ${O_TRUNC}; +export const O_CREAT = ${O_CREAT}; +export const O_RDWR = ${O_RDWR}; +export const O_EXCL = ${O_EXCL}; +export const O_RDONLY = ${O_RDONLY} +` + +const empty = "export default {}" + +const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8")) +const banner = `/** + * @module ${pkg.name} + * @version ${pkg.version} + * @file ${pkg.description} + * @copyright Ethereum Foundation 2023 + * @license ${pkg.license} + * @see [Github]{@link ${pkg.homepage}} +*/` + +export default { + input: "src/index.ts", + output: [ + { + file: pkg.exports.browser, + format: "es", + banner + } + ], + external: Object.keys(pkg.dependencies), + plugins: [ + typescript({ + tsconfig: "./build.tsconfig.json", + useTsconfigDeclarationDir: true + }), + virtual({ + fs: empty, + constants + }), + nodeResolve(), + commonjs({ + esmExternals: true + }), + cleanup({ comments: "jsdoc" }) + ] +} diff --git a/packages/groth16/rollup.node.config.ts b/packages/groth16/rollup.node.config.ts new file mode 100644 index 000000000..66f4a02cb --- /dev/null +++ b/packages/groth16/rollup.node.config.ts @@ -0,0 +1,44 @@ +import commonjs from "@rollup/plugin-commonjs" +import { nodeResolve } from "@rollup/plugin-node-resolve" +import * as fs from "fs" +import cleanup from "rollup-plugin-cleanup" +import typescript from "rollup-plugin-typescript2" + +const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8")) +const banner = `/** + * @module ${pkg.name} + * @version ${pkg.version} + * @file ${pkg.description} + * @copyright Ethereum Foundation 2023 + * @license ${pkg.license} + * @see [Github]{@link ${pkg.homepage}} +*/` + +export default { + input: "src/index.ts", + output: [ + { + file: pkg.exports.node.require, + format: "cjs", + banner, + exports: "auto" + }, + { + file: pkg.exports.node.import, + format: "es", + banner + } + ], + external: Object.keys(pkg.dependencies), + plugins: [ + typescript({ + tsconfig: "./build.tsconfig.json", + useTsconfigDeclarationDir: true + }), + nodeResolve(), + commonjs({ + esmExternals: true + }), + cleanup({ comments: "jsdoc" }) + ] +} diff --git a/packages/groth16/snark-artifacts/index.json b/packages/groth16/snark-artifacts/index.json new file mode 100644 index 000000000..874031cd3 --- /dev/null +++ b/packages/groth16/snark-artifacts/index.json @@ -0,0 +1,95 @@ +{ + "protocol": "groth16", + "curve": "bn128", + "nPublic": 3, + "vk_alpha_1": [ + "20491192805390485299153009773594534940189261866228447918068658471970481763042", + "9383485363053290200918347156157836566562967994039712273449902621266178545958", + "1" + ], + "vk_beta_2": [ + [ + "6375614351688725206403948262868962793625744043794305715222011528459656738731", + "4252822878758300859123897981450591353533073413197771768651442665752259397132" + ], + [ + "10505242626370262277552901082094356697409835680220590971873171140371331206856", + "21847035105528745403288232691147584728191162732299865338377159692350059136679" + ], + ["1", "0"] + ], + "vk_gamma_2": [ + [ + "10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634" + ], + [ + "8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531" + ], + ["1", "0"] + ], + "vk_delta_2": [ + [ + "17546152771742044890128665170773308307706885904145171368861289731338407120726", + "21635289475723704811498602453116541869848271742675656134593605133653559871988" + ], + [ + "12208424286857750236404959484429248934995357114248145547240410687755355066198", + "19321625097082563598592975631421044551870980615218660051914871088320678365555" + ], + ["1", "0"] + ], + "vk_alphabeta_12": [ + [ + [ + "2029413683389138792403550203267699914886160938906632433982220835551125967885", + "21072700047562757817161031222997517981543347628379360635925549008442030252106" + ], + [ + "5940354580057074848093997050200682056184807770593307860589430076672439820312", + "12156638873931618554171829126792193045421052652279363021382169897324752428276" + ], + [ + "7898200236362823042373859371574133993780991612861777490112507062703164551277", + "7074218545237549455313236346927434013100842096812539264420499035217050630853" + ] + ], + [ + [ + "7077479683546002997211712695946002074877511277312570035766170199895071832130", + "10093483419865920389913245021038182291233451549023025229112148274109565435465" + ], + [ + "4595479056700221319381530156280926371456704509942304414423590385166031118820", + "19831328484489333784475432780421641293929726139240675179672856274388269393268" + ], + [ + "11934129596455521040620786944827826205713621633706285934057045369193958244500", + "8037395052364110730298837004334506829870972346962140206007064471173334027475" + ] + ] + ], + "IC": [ + [ + "10540353245037691655240058832465935071147222378795512774896416883563614389198", + "20042286059857913285646233979306226083538103143380748863555356103197961213823", + "1" + ], + [ + "12178048393484805922448151297512780036777540315506565788645040495931277621130", + "9697539656531822741576184528195082340044862873578980581504958946888585254425", + "1" + ], + [ + "20991907493060125430185038723439696392069163847357524165903787100018954817952", + "12348708907766483529401318577288191297476103087328423321867414316726183562292", + "1" + ], + [ + "6823739927950557742246913693052072220213742766782370219666937126411380340633", + "19878777316727584245579797737044924949420447706770682437221414501064053790692", + "1" + ] + ] +} diff --git a/packages/groth16/snark-artifacts/index.wasm b/packages/groth16/snark-artifacts/index.wasm new file mode 100644 index 000000000..7a67220dc Binary files /dev/null and b/packages/groth16/snark-artifacts/index.wasm differ diff --git a/packages/groth16/snark-artifacts/index.zkey b/packages/groth16/snark-artifacts/index.zkey new file mode 100644 index 000000000..3d37f26c1 Binary files /dev/null and b/packages/groth16/snark-artifacts/index.zkey differ diff --git a/packages/groth16/src/index.ts b/packages/groth16/src/index.ts new file mode 100644 index 000000000..d2ac9dc31 --- /dev/null +++ b/packages/groth16/src/index.ts @@ -0,0 +1,5 @@ +import prove from "./prove" +import verify from "./verify" + +export { prove, verify } +export * from "./types" diff --git a/packages/groth16/src/prove.ts b/packages/groth16/src/prove.ts new file mode 100644 index 000000000..285c8ba7c --- /dev/null +++ b/packages/groth16/src/prove.ts @@ -0,0 +1,235 @@ +/* eslint-disable no-plusplus */ +/* eslint-disable eqeqeq */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* istanbul ignore file */ + +// @ts-ignore +import * as binFileUtils from "@iden3/binfileutils" +import { BigBuffer, Scalar, utils } from "ffjavascript" +import { log2 } from "./utils" +import * as zkeyUtils from "./zkey-utils" +import * as wtnsUtils from "./wtns-utils" +import wtnsCalculate from "./wtns-calculate" +import { CircuitSignals, Groth16Proof, PublicSignals, ZKArtifact } from "./types" + +const { stringifyBigInts, unstringifyBigInts } = utils + +async function buildABC1(curve: any, zkey: any, witness: any, coeffs: any) { + const { n8 } = curve.Fr + const sCoef = 4 * 3 + zkey.n8r + const nCoef = (coeffs.byteLength - 4) / sCoef + + const outBuffA = new BigBuffer(zkey.domainSize * n8) + const outBuffB = new BigBuffer(zkey.domainSize * n8) + const outBuffC = new BigBuffer(zkey.domainSize * n8) + + const outBuf = [outBuffA, outBuffB] + for (let i = 0; i < nCoef; i++) { + const buffCoef = coeffs.slice(4 + i * sCoef, 4 + i * sCoef + sCoef) + const buffCoefV = new DataView(buffCoef.buffer) + const m = buffCoefV.getUint32(0, true) + const c = buffCoefV.getUint32(4, true) + const s = buffCoefV.getUint32(8, true) + const coef = buffCoef.slice(12, 12 + n8) + outBuf[m].set( + curve.Fr.add(outBuf[m].slice(c * n8, c * n8 + n8), curve.Fr.mul(coef, witness.slice(s * n8, s * n8 + n8))), + c * n8 + ) + } + + for (let i = 0; i < zkey.domainSize; i++) { + outBuffC.set(curve.Fr.mul(outBuffA.slice(i * n8, i * n8 + n8), outBuffB.slice(i * n8, i * n8 + n8)), i * n8) + } + + return [outBuffA, outBuffB, outBuffC] +} + +async function joinABC(curve: any, _zkey: any, a: any, b: any, c: any) { + const MAX_CHUNK_SIZE = 1 << 22 + + const { n8 } = curve.Fr + const nElements = Math.floor(a.byteLength / curve.Fr.n8) + + const promises = [] + + for (let i = 0; i < nElements; i += MAX_CHUNK_SIZE) { + const n = Math.min(nElements - i, MAX_CHUNK_SIZE) + + const task = [] + + const aChunk = a.slice(i * n8, (i + n) * n8) + const bChunk = b.slice(i * n8, (i + n) * n8) + const cChunk = c.slice(i * n8, (i + n) * n8) + + task.push({ cmd: "ALLOCSET", var: 0, buff: aChunk }) + task.push({ cmd: "ALLOCSET", var: 1, buff: bChunk }) + task.push({ cmd: "ALLOCSET", var: 2, buff: cChunk }) + task.push({ cmd: "ALLOC", var: 3, len: n * n8 }) + task.push({ + cmd: "CALL", + fnName: "qap_joinABC", + params: [{ var: 0 }, { var: 1 }, { var: 2 }, { val: n }, { var: 3 }] + }) + task.push({ cmd: "CALL", fnName: "frm_batchFromMontgomery", params: [{ var: 3 }, { val: n }, { var: 3 }] }) + task.push({ cmd: "GET", out: 0, var: 3, len: n * n8 }) + promises.push(curve.tm.queueAction(task)) + } + + const result = await Promise.all(promises) + + let outBuff + if (a instanceof BigBuffer) { + // @ts-ignore + outBuff = new BigBuffer(a.byteLength) + } else { + outBuff = new Uint8Array(a.byteLength) + } + + let p = 0 + for (let i = 0; i < result.length; i++) { + outBuff.set(result[i][0], p) + p += result[i][0].byteLength + } + + return outBuff +} + +/** + * Creates a Groth16 proof composed of public signals and zero-knowledge parameters. + * @param input Input signals of the circuit. + * @param wasmFile WASM file of the circuit. + * @param zkeyFile ZKey file of the circuit. + * @returns A proof containing public signals and zero-knowledge parameters. + */ +export default async function prove( + input: CircuitSignals, + wasmFile: ZKArtifact, + zkeyFile: ZKArtifact +): Promise<{ + proof: Groth16Proof + publicSignals: PublicSignals +}> { + input = unstringifyBigInts(input) + + const witnessFileName = { + type: "mem" + } + + await wtnsCalculate(input, wasmFile, witnessFileName) + + const { fd: fdWtns, sections: sectionsWtns } = await binFileUtils.readBinFile( + witnessFileName, + "wtns", + 2, + 1 << 25, + 1 << 23 + ) + + const wtns = await wtnsUtils.readHeader(fdWtns, sectionsWtns) + + const { fd: fdZKey, sections: sectionsZKey } = await binFileUtils.readBinFile(zkeyFile, "zkey", 2, 1 << 25, 1 << 23) + + const zkey = await zkeyUtils.readHeader(fdZKey, sectionsZKey, undefined) + + if (zkey.protocol !== "groth16") { + throw new Error("zkey file is not groth16") + } + + if (!Scalar.eq(zkey.r, wtns.q)) { + throw new Error("Curve of the witness does not match the curve of the proving key") + } + + if (wtns.nWitness !== zkey.nVars) { + throw new Error(`Invalid witness length. Circuit: ${zkey.nVars}, witness: ${wtns.nWitness}`) + } + + const { curve } = zkey + const { Fr } = curve + const { G1 } = curve + const { G2 } = curve + + const power = log2(zkey.domainSize) + + const buffWitness = await binFileUtils.readSection(fdWtns, sectionsWtns, 2) + const buffCoeffs = await binFileUtils.readSection(fdZKey, sectionsZKey, 4) + + const [buffA_T, buffB_T, buffC_T] = await buildABC1(curve, zkey, buffWitness, buffCoeffs) + + const inc = power == Fr.s ? curve.Fr.shift : curve.Fr.w[power + 1] + + const buffA = await Fr.ifft(buffA_T, "", "", undefined, "IFFT_A") + const buffAodd = await Fr.batchApplyKey(buffA, Fr.e(1), inc) + const buffAodd_T = await Fr.fft(buffAodd, "", "", undefined, "FFT_A") + + const buffB = await Fr.ifft(buffB_T, "", "", undefined, "IFFT_B") + const buffBodd = await Fr.batchApplyKey(buffB, Fr.e(1), inc) + const buffBodd_T = await Fr.fft(buffBodd, "", "", undefined, "FFT_B") + + const buffC = await Fr.ifft(buffC_T, "", "", undefined, "IFFT_C") + const buffCodd = await Fr.batchApplyKey(buffC, Fr.e(1), inc) + const buffCodd_T = await Fr.fft(buffCodd, "", "", undefined, "FFT_C") + + const buffPodd_T = await joinABC(curve, zkey, buffAodd_T, buffBodd_T, buffCodd_T) + + let proof: any = {} + + const buffBasesA = await binFileUtils.readSection(fdZKey, sectionsZKey, 5) + proof.pi_a = await curve.G1.multiExpAffine(buffBasesA, buffWitness, undefined, "multiexp A") + + const buffBasesB1 = await binFileUtils.readSection(fdZKey, sectionsZKey, 6) + let pib1 = await curve.G1.multiExpAffine(buffBasesB1, buffWitness, undefined, "multiexp B1") + + const buffBasesB2 = await binFileUtils.readSection(fdZKey, sectionsZKey, 7) + proof.pi_b = await curve.G2.multiExpAffine(buffBasesB2, buffWitness, undefined, "multiexp B2") + + const buffBasesC = await binFileUtils.readSection(fdZKey, sectionsZKey, 8) + proof.pi_c = await curve.G1.multiExpAffine( + buffBasesC, + buffWitness.slice((zkey.nPublic + 1) * curve.Fr.n8), + undefined, + "multiexp C" + ) + + const buffBasesH = await binFileUtils.readSection(fdZKey, sectionsZKey, 9) + const resH = await curve.G1.multiExpAffine(buffBasesH, buffPodd_T, undefined, "multiexp H") + + const r = curve.Fr.random() + const s = curve.Fr.random() + + proof.pi_a = G1.add(proof.pi_a, zkey.vk_alpha_1) + proof.pi_a = G1.add(proof.pi_a, G1.timesFr(zkey.vk_delta_1, r)) + + proof.pi_b = G2.add(proof.pi_b, zkey.vk_beta_2) + proof.pi_b = G2.add(proof.pi_b, G2.timesFr(zkey.vk_delta_2, s)) + + pib1 = G1.add(pib1, zkey.vk_beta_1) + pib1 = G1.add(pib1, G1.timesFr(zkey.vk_delta_1, s)) + + proof.pi_c = G1.add(proof.pi_c, resH) + + proof.pi_c = G1.add(proof.pi_c, G1.timesFr(proof.pi_a, s)) + proof.pi_c = G1.add(proof.pi_c, G1.timesFr(pib1, r)) + proof.pi_c = G1.add(proof.pi_c, G1.timesFr(zkey.vk_delta_1, Fr.neg(Fr.mul(r, s)))) + + let publicSignals = [] + + for (let i = 1; i <= zkey.nPublic; i++) { + const b = buffWitness.slice(i * Fr.n8, i * Fr.n8 + Fr.n8) + publicSignals.push(Scalar.fromRprLE(b, undefined, undefined)) + } + + proof.pi_a = G1.toObject(G1.toAffine(proof.pi_a)) + proof.pi_b = G2.toObject(G2.toAffine(proof.pi_b)) + proof.pi_c = G1.toObject(G1.toAffine(proof.pi_c)) + + proof.protocol = "groth16" + proof.curve = curve.name + + await fdZKey.close() + await fdWtns.close() + + proof = stringifyBigInts(proof) + publicSignals = stringifyBigInts(publicSignals) + + return { proof, publicSignals } +} diff --git a/packages/groth16/src/types/index.ts b/packages/groth16/src/types/index.ts new file mode 100644 index 000000000..0583a0377 --- /dev/null +++ b/packages/groth16/src/types/index.ts @@ -0,0 +1,19 @@ +export type ZKArtifact = string | Uint8Array + +export type NumericString = `${number}` | string + +export type SignalValueType = NumericString | number | bigint | SignalValueType[] + +export interface CircuitSignals { + [signal: string]: SignalValueType +} + +export interface Groth16Proof { + pi_a: NumericString[] + pi_b: NumericString[][] + pi_c: NumericString[] + protocol: string + curve: string +} + +export type PublicSignals = NumericString[] diff --git a/packages/groth16/src/utils.ts b/packages/groth16/src/utils.ts new file mode 100644 index 000000000..198edd1d3 --- /dev/null +++ b/packages/groth16/src/utils.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/prefer-default-export */ +/* eslint-disable no-return-assign */ +/* istanbul ignore file */ + +export function log2(V: any) { + return ( + ((V & 0xffff0000) !== 0 ? ((V &= 0xffff0000), 16) : 0) | + ((V & 0xff00ff00) !== 0 ? ((V &= 0xff00ff00), 8) : 0) | + ((V & 0xf0f0f0f0) !== 0 ? ((V &= 0xf0f0f0f0), 4) : 0) | + ((V & 0xcccccccc) !== 0 ? ((V &= 0xcccccccc), 2) : 0) | + // @ts-ignore + ((V & 0xaaaaaaaa) !== 0) + ) +} diff --git a/packages/groth16/src/verify.ts b/packages/groth16/src/verify.ts new file mode 100644 index 000000000..016ee202e --- /dev/null +++ b/packages/groth16/src/verify.ts @@ -0,0 +1,90 @@ +/* eslint-disable no-plusplus */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* istanbul ignore file */ + +import { Scalar, utils, buildBn128 } from "ffjavascript" +import { Groth16Proof, PublicSignals } from "./types" + +const { unstringifyBigInts } = utils + +function isWellConstructed(curve: any, proof: any) { + const { G1 } = curve + const { G2 } = curve + + return G1.isValid(proof.pi_a) && G2.isValid(proof.pi_b) && G1.isValid(proof.pi_c) +} + +function publicInputsAreValid(curve: any, publicInputs: any) { + for (let i = 0; i < publicInputs.length; i++) { + if (!Scalar.lt(publicInputs[i], curve.r)) { + return false + } + } + return true +} + +/** + * Verifies if a Groth16 proof is valid or not. + * @param verificationKey The verification key used to verify the proof. + * @param proof The proof containing public signals and zero-knowledge parameters. + * @returns True if the proof is valid, and false otherwise. + */ +export default async function verify( + verificationKey: any, + { + proof, + publicSignals + }: { + proof: Groth16Proof + publicSignals: PublicSignals + } +): Promise { + verificationKey = unstringifyBigInts(verificationKey) + proof = unstringifyBigInts(proof) + publicSignals = unstringifyBigInts(publicSignals) + + // @ts-ignore + const curve = globalThis.curve_bn128 ?? (await buildBn128(undefined, undefined)) + + const IC0 = curve.G1.fromObject(verificationKey.IC[0]) + const IC = new Uint8Array(curve.G1.F.n8 * 2 * publicSignals.length) + const w = new Uint8Array(curve.Fr.n8 * publicSignals.length) + + if (!publicInputsAreValid(curve, publicSignals)) { + return false + } + + for (let i = 0; i < publicSignals.length; i++) { + const buffP = curve.G1.fromObject(verificationKey.IC[i + 1]) + IC.set(buffP, i * curve.G1.F.n8 * 2) + Scalar.toRprLE(w, curve.Fr.n8 * i, publicSignals[i], curve.Fr.n8) + } + + let cpub = await curve.G1.multiExpAffine(IC, w) + cpub = curve.G1.add(cpub, IC0) + + const pi_a = curve.G1.fromObject(proof.pi_a) + const pi_b = curve.G2.fromObject(proof.pi_b) + const pi_c = curve.G1.fromObject(proof.pi_c) + + if (!isWellConstructed(curve, { pi_a, pi_b, pi_c })) { + return false + } + + const vk_gamma_2 = curve.G2.fromObject(verificationKey.vk_gamma_2) + const vk_delta_2 = curve.G2.fromObject(verificationKey.vk_delta_2) + const vk_alpha_1 = curve.G1.fromObject(verificationKey.vk_alpha_1) + const vk_beta_2 = curve.G2.fromObject(verificationKey.vk_beta_2) + + return curve.pairingEq( + curve.G1.neg(pi_a), + pi_b, + cpub, + vk_gamma_2, + pi_c, + vk_delta_2, + + vk_alpha_1, + vk_beta_2 + ) +} diff --git a/packages/groth16/src/wtns-calculate.ts b/packages/groth16/src/wtns-calculate.ts new file mode 100644 index 000000000..263f7e91e --- /dev/null +++ b/packages/groth16/src/wtns-calculate.ts @@ -0,0 +1,39 @@ +/* eslint-disable eqeqeq */ +/* istanbul ignore file */ + +// @ts-ignore +import * as binFileUtils from "@iden3/binfileutils" +// @ts-ignore +import { WitnessCalculatorBuilder } from "circom_runtime" +// @ts-ignore +import * as fastFile from "fastfile" +import { utils } from "ffjavascript" +import * as wtnsUtils from "./wtns-utils" + +const { unstringifyBigInts } = utils + +export default async function wtnsCalculate(_input: any, wasmFileName: any, wtnsFileName: any) { + const input = unstringifyBigInts(_input) + + const fdWasm = await fastFile.readExisting(wasmFileName) + const wasm = await fdWasm.read(fdWasm.totalSize) + await fdWasm.close() + + const wc = await WitnessCalculatorBuilder(wasm) + + if (wc.circom_version() == 1) { + const w = await wc.calculateBinWitness(input) + + const fdWtns = await binFileUtils.createBinFile(wtnsFileName, "wtns", 2, 2) + + await wtnsUtils.writeBin(fdWtns, w, wc.prime) + await fdWtns.close() + } else { + const fdWtns = await fastFile.createOverride(wtnsFileName) + + const w = await wc.calculateWTNSBin(input) + + await fdWtns.write(w) + await fdWtns.close() + } +} diff --git a/packages/groth16/src/wtns-utils.ts b/packages/groth16/src/wtns-utils.ts new file mode 100644 index 000000000..cadca43b2 --- /dev/null +++ b/packages/groth16/src/wtns-utils.ts @@ -0,0 +1,32 @@ +/* eslint-disable eqeqeq */ +/* istanbul ignore file */ + +// @ts-ignore +import * as binFileUtils from "@iden3/binfileutils" +import { Scalar } from "ffjavascript" + +export async function writeBin(fd: any, witnessBin: any, prime: any) { + await binFileUtils.startWriteSection(fd, 1) + const n8 = (Math.floor((Scalar.bitLength(prime) - 1) / 64) + 1) * 8 + await fd.writeULE32(n8) + await binFileUtils.writeBigInt(fd, prime, n8) + if (witnessBin.byteLength % n8 != 0) { + throw new Error("Invalid witness length") + } + await fd.writeULE32(witnessBin.byteLength / n8) + await binFileUtils.endWriteSection(fd) + + await binFileUtils.startWriteSection(fd, 2) + await fd.write(witnessBin) + await binFileUtils.endWriteSection(fd) +} + +export async function readHeader(fd: any, sections: any) { + await binFileUtils.startReadUniqueSection(fd, sections, 1) + const n8 = await fd.readULE32() + const q = await binFileUtils.readBigInt(fd, n8) + const nWitness = await fd.readULE32() + await binFileUtils.endReadSection(fd) + + return { n8, q, nWitness } +} diff --git a/packages/groth16/src/zkey-utils.ts b/packages/groth16/src/zkey-utils.ts new file mode 100644 index 000000000..c3b245a28 --- /dev/null +++ b/packages/groth16/src/zkey-utils.ts @@ -0,0 +1,63 @@ +/* eslint-disable import/prefer-default-export */ +/* istanbul ignore file */ + +// @ts-ignore +import * as binFileUtils from "@iden3/binfileutils" +import { buildBn128 } from "ffjavascript" +import { log2 } from "./utils" + +async function readG1(fd: any, curve: any, toObject: any) { + const buff = await fd.read(curve.G1.F.n8 * 2) + const res = curve.G1.fromRprLEM(buff, 0) + return toObject ? curve.G1.toObject(res) : res +} + +async function readG2(fd: any, curve: any, toObject: any) { + const buff = await fd.read(curve.G2.F.n8 * 2) + const res = curve.G2.fromRprLEM(buff, 0) + return toObject ? curve.G2.toObject(res) : res +} + +async function readHeaderGroth16(fd: any, sections: any, toObject: any) { + const zkey: any = {} + + zkey.protocol = "groth16" + + await binFileUtils.startReadUniqueSection(fd, sections, 2) + const n8q = await fd.readULE32() + zkey.n8q = n8q + zkey.q = await binFileUtils.readBigInt(fd, n8q) + + const n8r = await fd.readULE32() + zkey.n8r = n8r + zkey.r = await binFileUtils.readBigInt(fd, n8r) + + // @ts-ignore + zkey.curve = globalThis.curve_bn128 ?? (await buildBn128(undefined, undefined)) + + zkey.nVars = await fd.readULE32() + zkey.nPublic = await fd.readULE32() + zkey.domainSize = await fd.readULE32() + zkey.power = log2(zkey.domainSize) + zkey.vk_alpha_1 = await readG1(fd, zkey.curve, toObject) + zkey.vk_beta_1 = await readG1(fd, zkey.curve, toObject) + zkey.vk_beta_2 = await readG2(fd, zkey.curve, toObject) + zkey.vk_gamma_2 = await readG2(fd, zkey.curve, toObject) + zkey.vk_delta_1 = await readG1(fd, zkey.curve, toObject) + zkey.vk_delta_2 = await readG2(fd, zkey.curve, toObject) + await binFileUtils.endReadSection(fd) + + return zkey +} + +export async function readHeader(fd: any, sections: any, toObject: any) { + await binFileUtils.startReadUniqueSection(fd, sections, 1) + const protocolId = await fd.readULE32() + await binFileUtils.endReadSection(fd) + + if (protocolId === 1) { + return readHeaderGroth16(fd, sections, toObject) + } + + throw new Error("Protocol not supported: ") +} diff --git a/packages/groth16/tests/index.test.ts b/packages/groth16/tests/index.test.ts new file mode 100644 index 000000000..c2f04e379 --- /dev/null +++ b/packages/groth16/tests/index.test.ts @@ -0,0 +1,46 @@ +import { getCurveFromName } from "ffjavascript" +import { verify, prove } from "../src" +import verificationKey from "../snark-artifacts/index.json" + +describe("Groth16", () => { + const wasmFilePath = "./packages/groth16/snark-artifacts/index.wasm" + const zkeyFilePath = "./packages/groth16/snark-artifacts/index.zkey" + + let curve: any + let proof: any + + beforeAll(async () => { + curve = await getCurveFromName("bn128") + }) + + afterAll(async () => { + await curve.terminate() + }) + + it("Should generate a proof", async () => { + proof = await prove( + { + message: 12, + scope: 122 + }, + wasmFilePath, + zkeyFilePath + ) + + expect(typeof proof).toBe("object") + }, 20000) + + it("Should verify a valid proof", async () => { + const response = await verify(verificationKey, proof) + + expect(response).toBe(true) + }) + + it("Should verify an invalid proof", async () => { + proof.publicSignals[0] = 0 + + const response = await verify(verificationKey, proof) + + expect(response).toBe(false) + }) +}) diff --git a/packages/groth16/tsconfig.json b/packages/groth16/tsconfig.json new file mode 100644 index 000000000..d90026c5a --- /dev/null +++ b/packages/groth16/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "resolveJsonModule": true + }, + "include": ["src", "tests", "rollup.browser.config.ts", "rollup.node.config.ts"] +} diff --git a/packages/groth16/typedoc.json b/packages/groth16/typedoc.json new file mode 100644 index 000000000..77a471c91 --- /dev/null +++ b/packages/groth16/typedoc.json @@ -0,0 +1,3 @@ +{ + "entryPoints": ["src/index.ts"] +} diff --git a/types/ffjavascript/index.d.ts b/types/ffjavascript/index.d.ts new file mode 100644 index 000000000..f754ad716 --- /dev/null +++ b/types/ffjavascript/index.d.ts @@ -0,0 +1,509 @@ +/** Declaration file generated by dts-gen */ + +declare module "ffjavascript" { + export class BigBuffer { + constructor(...args: any[]) + + set(...args: any[]): void + + slice(...args: any[]): void + } + + export class ChaCha { + constructor(...args: any[]) + + nextBool(...args: any[]): void + + nextU32(...args: any[]): void + + nextU64(...args: any[]): void + + update(...args: any[]): void + } + + export class EC { + constructor(...args: any[]) + + add(...args: any[]): void + + affine(...args: any[]): void + + double(...args: any[]): void + + eq(...args: any[]): void + + fromRng(...args: any[]): void + + fromRprBE(...args: any[]): void + + fromRprBEM(...args: any[]): void + + fromRprCompressed(...args: any[]): void + + fromRprLE(...args: any[]): void + + fromRprLEJM(...args: any[]): void + + fromRprLEM(...args: any[]): void + + fromRprUncompressed(...args: any[]): void + + isZero(...args: any[]): void + + mulScalar(...args: any[]): void + + multiAffine(...args: any[]): void + + neg(...args: any[]): void + + sub(...args: any[]): void + + timesScalar(...args: any[]): void + + toRprBE(...args: any[]): void + + toRprBEM(...args: any[]): void + + toRprCompressed(...args: any[]): void + + toRprLE(...args: any[]): void + + toRprLEJM(...args: any[]): void + + toRprLEM(...args: any[]): void + + toRprUncompressed(...args: any[]): void + + toString(...args: any[]): void + } + + export class F1Field { + constructor(...args: any[]) + + e(...args: any[]): any + add(...args: any[]): any + sub(...args: any[]): any + neg(...args: any[]): any + mul(...args: any[]): any + mulScalar(...args: any[]): any + square(...args: any[]): any + eq(...args: any[]): any + neq(...args: any[]): any + lt(...args: any[]): any + gt(...args: any[]): any + leq(...args: any[]): any + geq(...args: any[]): any + div(...args: any[]): any + idiv(...args: any[]): any + inv(...args: any[]): any + mod(...args: any[]): any + pow(...args: any[]): any + exp(...args: any[]): any + band(...args: any[]): any + bor(...args: any[]): any + bxor(...args: any[]): any + bnot(...args: any[]): any + shl(...args: any[]): any + shr(...args: any[]): any + land(...args: any[]): any + lor(...args: any[]): any + lnot(...args: any[]): any + sqrt_old(...args: any[]): any + normalize(...args: any[]): any + random(...args: any[]): any + toString(...args: any[]): any + isZero(...args: any[]): any + fromRng(...args: any[]): any + + fromRprBE(...args: any[]): void + + fromRprBEM(...args: any[]): void + + fromRprLE(...args: any[]): void + + fromRprLEM(...args: any[]): void + + toRprBE(...args: any[]): void + + toRprBEM(...args: any[]): void + + toRprLE(...args: any[]): void + + toRprLEM(...args: any[]): void + } + + export class F2Field { + constructor(...args: any[]) + + add(...args: any[]): void + + conjugate(...args: any[]): void + + copy(...args: any[]): void + + div(...args: any[]): void + + double(...args: any[]): void + + eq(...args: any[]): void + + exp(...args: any[]): void + + fromRng(...args: any[]): void + + fromRprBE(...args: any[]): void + + fromRprBEM(...args: any[]): void + + fromRprLE(...args: any[]): void + + fromRprLEM(...args: any[]): void + + geq(...args: any[]): void + + gt(...args: any[]): void + + inv(...args: any[]): void + + isZero(...args: any[]): void + + leq(...args: any[]): void + + lt(...args: any[]): void + + mul(...args: any[]): void + + mulScalar(...args: any[]): void + + neg(...args: any[]): void + + neq(...args: any[]): void + + pow(...args: any[]): void + + random(...args: any[]): void + + square(...args: any[]): void + + sub(...args: any[]): void + + toRprBE(...args: any[]): void + + toRprBEM(...args: any[]): void + + toRprLE(...args: any[]): void + + toRprLEM(...args: any[]): void + + toString(...args: any[]): void + } + + export class F3Field { + constructor(...args: any[]) + + add(...args: any[]): void + + affine(...args: any[]): void + + copy(...args: any[]): void + + div(...args: any[]): void + + double(...args: any[]): void + + eq(...args: any[]): void + + exp(...args: any[]): void + + fromRng(...args: any[]): void + + fromRprBE(...args: any[]): void + + fromRprBEM(...args: any[]): void + + fromRprLE(...args: any[]): void + + fromRprLEM(...args: any[]): void + + geq(...args: any[]): void + + gt(...args: any[]): void + + inv(...args: any[]): void + + isZero(...args: any[]): void + + leq(...args: any[]): void + + lt(...args: any[]): void + + mul(...args: any[]): void + + mulScalar(...args: any[]): void + + neg(...args: any[]): void + + neq(...args: any[]): void + + pow(...args: any[]): void + + random(...args: any[]): void + + square(...args: any[]): void + + sub(...args: any[]): void + + toRprBE(...args: any[]): void + + toRprBEM(...args: any[]): void + + toRprLE(...args: any[]): void + + toRprLEM(...args: any[]): void + + toString(...args: any[]): void + } + + export class PolField { + constructor(...args: any[]) + + add(...args: any[]): void + + computeVanishingPolinomial(...args: any[]): void + + div(...args: any[]): void + + double(...args: any[]): void + + eq(...args: any[]): void + + eval(...args: any[]): void + + eval2(...args: any[]): void + + evaluateLagrangePolynomials(...args: any[]): void + + extend(...args: any[]): void + + fft(...args: any[]): void + + fft2(...args: any[]): void + + ifft(...args: any[]): void + + ifft2(...args: any[]): void + + lagrange(...args: any[]): void + + log2(...args: any[]): void + + mul(...args: any[]): void + + mulFFT(...args: any[]): void + + mulNormal(...args: any[]): void + + mulScalar(...args: any[]): void + + normalize(...args: any[]): void + + oneRoot(...args: any[]): void + + reduce(...args: any[]): void + + ruffini(...args: any[]): void + + scaleX(...args: any[]): void + + square(...args: any[]): void + + sub(...args: any[]): void + + toString(...args: any[]): void + } + + export class ZqField { + constructor(...args: any[]) + + e(...args: any[]): any + add(...args: any[]): any + sub(...args: any[]): any + neg(...args: any[]): any + mul(...args: any[]): any + mulScalar(...args: any[]): any + square(...args: any[]): any + eq(...args: any[]): any + neq(...args: any[]): any + lt(...args: any[]): any + gt(...args: any[]): any + leq(...args: any[]): any + geq(...args: any[]): any + div(...args: any[]): any + idiv(...args: any[]): any + inv(...args: any[]): any + mod(...args: any[]): any + pow(...args: any[]): any + exp(...args: any[]): any + band(...args: any[]): any + bor(...args: any[]): any + bxor(...args: any[]): any + bnot(...args: any[]): any + shl(...args: any[]): any + shr(...args: any[]): any + land(...args: any[]): any + lor(...args: any[]): any + lnot(...args: any[]): any + sqrt_old(...args: any[]): any + normalize(...args: any[]): any + random(...args: any[]): any + toString(...args: any[]): any + isZero(...args: any[]): any + fromRng(...args: any[]): any + + fromRprBE(...args: any[]): void + + fromRprBEM(...args: any[]): void + + fromRprLE(...args: any[]): void + + fromRprLEM(...args: any[]): void + + toRprBE(...args: any[]): void + + toRprBEM(...args: any[]): void + + toRprLE(...args: any[]): void + + toRprLEM(...args: any[]): void + } + + export function buildBls12381(singleThread: any, plugins: any): any + + export function buildBn128(singleThread: any, plugins: any): any + + export function getCurveFromName(name: any, singleThread?: any, plugins?: any): any + + export function getCurveFromQ(q: any, singleThread: any, plugins: any): any + + export function getCurveFromR(r: any, singleThread: any, plugins: any): any + + export namespace Scalar { + const one: any + + const zero: any + + function abs(a: any): any + + function add(a: any, b: any): any + + function band(a: any, b: any): any + + function bitLength(a: any): any + + function bits(n: any): any + + function bor(a: any, b: any): any + + function bxor(a: any, b: any): any + + function div(a: any, b: any): any + + function e(s: any, radix: any): any + + function eq(a: any, b: any): any + + function exp(a: any, b: any): any + + function fromArray(a: any, radix: any): any + + function fromRprBE(buff: any, o: any, n8: any): any + + function fromRprLE(buff: any, o: any, n8: any): any + + function fromString(s: any, radix: any): any + + function geq(a: any, b: any): any + + function gt(a: any, b: any): any + + function isNegative(a: any): any + + function isOdd(a: any): any + + function isZero(a: any): any + + function land(a: any, b: any): any + + function leq(a: any, b: any): any + + function lnot(a: any): any + + function lor(a: any, b: any): any + + function lt(a: any, b: any): any + + function mod(a: any, b: any): any + + function mul(a: any, b: any): any + + function naf(n: any): any + + function neg(a: any): any + + function neq(a: any, b: any): any + + function pow(a: any, b: any): any + + function shiftLeft(a: any, n: any): any + + function shiftRight(a: any, n: any): any + + function shl(a: any, n: any): any + + function shr(a: any, n: any): any + + function square(a: any): any + + function sub(a: any, b: any): any + + function toArray(s: any, radix: any): any + + function toLEBuff(a: any): any + + function toNumber(s: any): any + + function toRprBE(buff: any, o: any, e: any, n8: any): void + + function toRprLE(buff: any, o: any, e: any, n8: any): void + + function toString(a: any, radix: any): any + } + + export namespace utils { + function array2buffer(arr: any, sG: any): any + + function beBuff2int(buff: any): any + + function beInt2Buff(n: any, len: any): any + + function bitReverse(idx: any, bits: any): any + + function buffReverseBits(buff: any, eSize: any): void + + function buffer2array(buff: any, sG: any): any + + function leBuff2int(buff: any): any + + function leInt2Buff(n: any, len: any): any + + function log2(V: any): any + + function stringifyBigInts(o: any): any + + function stringifyFElements(F: any, o: any): any + + function unstringifyBigInts(o: any): any + + function unstringifyFElements(F: any, o: any): any + } +} diff --git a/yarn.lock b/yarn.lock index 1f534753e..0d4ead41b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2402,6 +2402,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@istanbuljs/load-nyc-config@npm:^1.0.0": version: 1.1.0 resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" @@ -2870,6 +2884,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.13": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:0.3.9": version: 0.3.9 resolution: "@jridgewell/trace-mapping@npm:0.3.9" @@ -3358,6 +3379,51 @@ __metadata: languageName: node linkType: hard +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f + languageName: node + linkType: hard + +"@rollup/plugin-commonjs@npm:^24.1.0": + version: 24.1.0 + resolution: "@rollup/plugin-commonjs@npm:24.1.0" + dependencies: + "@rollup/pluginutils": ^5.0.1 + commondir: ^1.0.1 + estree-walker: ^2.0.2 + glob: ^8.0.3 + is-reference: 1.2.1 + magic-string: ^0.27.0 + peerDependencies: + rollup: ^2.68.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 42faafc9bc8e04d75c86bb50d693ebb9c5eee19bf9ab3c09780b872547d12ff5ea85cfec7da75f5176d0aa4b5233101f667f44b85b331450a7bb14c95180852e + languageName: node + linkType: hard + +"@rollup/plugin-node-resolve@npm:^15.0.2": + version: 15.2.3 + resolution: "@rollup/plugin-node-resolve@npm:15.2.3" + dependencies: + "@rollup/pluginutils": ^5.0.1 + "@types/resolve": 1.20.2 + deepmerge: ^4.2.2 + is-builtin-module: ^3.2.1 + is-module: ^1.0.0 + resolve: ^1.22.1 + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 730f32c2f8fdddff07cf0fca86a5dac7c475605fb96930197a868c066e62eb6388c557545e4f7d99b7a283411754c9fbf98944ab086b6074e04fc1292e234aa8 + languageName: node + linkType: hard + "@rollup/plugin-typescript@npm:^8.3.0, @rollup/plugin-typescript@npm:^8.3.3": version: 8.3.3 resolution: "@rollup/plugin-typescript@npm:8.3.3" @@ -3375,6 +3441,18 @@ __metadata: languageName: node linkType: hard +"@rollup/plugin-virtual@npm:^3.0.2": + version: 3.0.2 + resolution: "@rollup/plugin-virtual@npm:3.0.2" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 962bc9efece57a07c328a3d093bd1a62b9b4396a88640ac79cfc04181e06b31c4b37726ca27ded71178ace27db9b0085b43c4de823378773bb44cb233ea1340e + languageName: node + linkType: hard + "@rollup/pluginutils@npm:^3.1.0": version: 3.1.0 resolution: "@rollup/pluginutils@npm:3.1.0" @@ -3398,6 +3476,106 @@ __metadata: languageName: node linkType: hard +"@rollup/pluginutils@npm:^5.0.1": + version: 5.0.5 + resolution: "@rollup/pluginutils@npm:5.0.5" + dependencies: + "@types/estree": ^1.0.0 + estree-walker: ^2.0.2 + picomatch: ^2.3.1 + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: dcd4d6e3cb6047f18c465a5f2bcd29995c565f083fb6ca5505bcf2018ae0c16634fd38d99538fbb7dcef4e1b491cf4b4465f8845b5666778a925a27e9202dbab + languageName: node + linkType: hard + +"@rollup/rollup-android-arm-eabi@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.0.2" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-android-arm64@npm:4.0.2" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-darwin-arm64@npm:4.0.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-darwin-x64@npm:4.0.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.0.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.0.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.0.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.0.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.0.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.0.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.0.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.0.2": + version: 4.0.2 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.0.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@scure/base@npm:~1.1.0": version: 1.1.1 resolution: "@scure/base@npm:1.1.1" @@ -3749,6 +3927,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:*, @types/estree@npm:^1.0.0": + version: 1.0.2 + resolution: "@types/estree@npm:1.0.2" + checksum: aeedb1b2fe20cbe06f44b99b562bf9703e360bfcdf5bb3d61d248182ee1dd63500f2474e12f098ffe1f5ac3202b43b3e18ec99902d9328d5374f5512fa077e45 + languageName: node + linkType: hard + "@types/estree@npm:0.0.39": version: 0.0.39 resolution: "@types/estree@npm:0.0.39" @@ -3984,6 +4169,13 @@ __metadata: languageName: node linkType: hard +"@types/resolve@npm:1.20.2": + version: 1.20.2 + resolution: "@types/resolve@npm:1.20.2" + checksum: 61c2cad2499ffc8eab36e3b773945d337d848d3ac6b7b0a87c805ba814bc838ef2f262fc0f109bfd8d2e0898ff8bd80ad1025f9ff64f1f71d3d4294c9f14e5f6 + languageName: node + linkType: hard + "@types/responselike@npm:^1.0.0": version: 1.0.0 resolution: "@types/responselike@npm:1.0.0" @@ -4179,6 +4371,35 @@ __metadata: languageName: node linkType: hard +"@yarn-tool/resolve-package@npm:^1.0.40": + version: 1.0.47 + resolution: "@yarn-tool/resolve-package@npm:1.0.47" + dependencies: + pkg-dir: < 6 >= 5 + tslib: ^2 + upath2: ^3.1.13 + checksum: 86208b0881c9b262ee9545cc99deec7764f268d4b2fd82b4555d9ef3ec8cdc00a27c81e2c4fb01377052648353d40a515530caf319431637e1146bdd948947a6 + languageName: node + linkType: hard + +"@zk-kit/groth16@workspace:packages/groth16": + version: 0.0.0-use.local + resolution: "@zk-kit/groth16@workspace:packages/groth16" + dependencies: + "@iden3/binfileutils": 0.0.11 + "@rollup/plugin-commonjs": ^24.1.0 + "@rollup/plugin-node-resolve": ^15.0.2 + "@rollup/plugin-virtual": ^3.0.2 + circom_runtime: 0.1.24 + fastfile: 0.0.20 + ffjavascript: 0.2.60 + rimraf: ^5.0.5 + rollup: ^4.0.2 + rollup-plugin-cleanup: ^3.2.1 + rollup-plugin-typescript2: ^0.31.2 + languageName: unknown + linkType: soft + "@zk-kit/incremental-merkle-tree@npm:^0.4.1": version: 0.4.3 resolution: "@zk-kit/incremental-merkle-tree@npm:0.4.3" @@ -4596,6 +4817,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "antlr4@npm:4.7.1": version: 4.7.1 resolution: "antlr4@npm:4.7.1" @@ -5662,6 +5890,13 @@ __metadata: languageName: node linkType: hard +"builtin-modules@npm:^3.3.0": + version: 3.3.0 + resolution: "builtin-modules@npm:3.3.0" + checksum: db021755d7ed8be048f25668fe2117620861ef6703ea2c65ed2779c9e3636d5c3b82325bd912244293959ff3ae303afa3471f6a15bf5060c103e4cc3a839749d + languageName: node + linkType: hard + "busboy@npm:^1.6.0": version: 1.6.0 resolution: "busboy@npm:1.6.0" @@ -6199,6 +6434,17 @@ __metadata: languageName: node linkType: hard +"circom_runtime@npm:0.1.24": + version: 0.1.24 + resolution: "circom_runtime@npm:0.1.24" + dependencies: + ffjavascript: 0.2.60 + bin: + calcwit: calcwit.js + checksum: 0654649ed64ace5562cec025648422970df885e79048b7942e283ef50f43142673acfd752ac2851917a81c43d4d42d37f5fdfc8df71d59ee81b873c19ea81a31 + languageName: node + linkType: hard + "circom_runtime@npm:0.1.8": version: 0.1.8 resolution: "circom_runtime@npm:0.1.8" @@ -8341,7 +8587,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^2.0.1": +"estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc @@ -9057,6 +9303,17 @@ __metadata: languageName: node linkType: hard +"ffjavascript@npm:0.2.60": + version: 0.2.60 + resolution: "ffjavascript@npm:0.2.60" + dependencies: + wasmbuilder: 0.0.16 + wasmcurves: 0.2.2 + web-worker: ^1.2.0 + checksum: 5dbd597ee108373af1ba1877757a08b47db4bcd7b3b043b260d4475a0b1125454de00fb214224f85d9e6e6a6c0a1cfabd1ba9a2b68279b99c581404266e78138 + languageName: node + linkType: hard + "ffjavascript@npm:^0.2.30, ffjavascript@npm:^0.2.35, ffjavascript@npm:^0.2.38": version: 0.2.55 resolution: "ffjavascript@npm:0.2.55" @@ -9344,6 +9601,16 @@ __metadata: languageName: node linkType: hard +"foreground-child@npm:^3.1.0": + version: 3.1.1 + resolution: "foreground-child@npm:3.1.1" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 + languageName: node + linkType: hard + "forever-agent@npm:~0.6.1": version: 0.6.1 resolution: "forever-agent@npm:0.6.1" @@ -9839,6 +10106,21 @@ __metadata: languageName: node linkType: hard +"glob@npm:^10.3.7": + version: 10.3.10 + resolution: "glob@npm:10.3.10" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^2.3.5 + minimatch: ^9.0.1 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + path-scurry: ^1.10.1 + bin: + glob: dist/esm/bin.mjs + checksum: 4f2fe2511e157b5a3f525a54092169a5f92405f24d2aed3142f4411df328baca13059f4182f1db1bf933e2c69c0bd89e57ae87edd8950cba8c7ccbe84f721cf3 + languageName: node + linkType: hard + "glob@npm:^5.0.15": version: 5.0.15 resolution: "glob@npm:5.0.15" @@ -9879,6 +10161,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.0.3": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^5.0.1 + once: ^1.3.0 + checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47 + languageName: node + linkType: hard + "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -11098,6 +11393,15 @@ __metadata: languageName: node linkType: hard +"is-builtin-module@npm:^3.2.1": + version: 3.2.1 + resolution: "is-builtin-module@npm:3.2.1" + dependencies: + builtin-modules: ^3.3.0 + checksum: e8f0ffc19a98240bda9c7ada84d846486365af88d14616e737d280d378695c8c448a621dcafc8332dbf0fcd0a17b0763b845400709963fa9151ddffece90ae88 + languageName: node + linkType: hard + "is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.4": version: 1.2.4 resolution: "is-callable@npm:1.2.4" @@ -11123,6 +11427,15 @@ __metadata: languageName: node linkType: hard +"is-core-module@npm:^2.13.0": + version: 2.13.0 + resolution: "is-core-module@npm:2.13.0" + dependencies: + has: ^1.0.3 + checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355 + languageName: node + linkType: hard + "is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.9.0 resolution: "is-core-module@npm:2.9.0" @@ -11287,6 +11600,13 @@ __metadata: languageName: node linkType: hard +"is-module@npm:^1.0.0": + version: 1.0.0 + resolution: "is-module@npm:1.0.0" + checksum: 8cd5390730c7976fb4e8546dd0b38865ee6f7bacfa08dfbb2cc07219606755f0b01709d9361e01f13009bbbd8099fa2927a8ed665118a6105d66e40f1b838c3f + languageName: node + linkType: hard + "is-nan@npm:^1.2.1": version: 1.3.2 resolution: "is-nan@npm:1.3.2" @@ -11373,6 +11693,15 @@ __metadata: languageName: node linkType: hard +"is-reference@npm:1.2.1": + version: 1.2.1 + resolution: "is-reference@npm:1.2.1" + dependencies: + "@types/estree": "*" + checksum: e7b48149f8abda2c10849ea51965904d6a714193d68942ad74e30522231045acf06cbfae5a4be2702fede5d232e61bf50b3183acdc056e6e3afe07fcf4f4b2bc + languageName: node + linkType: hard + "is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" @@ -11623,6 +11952,19 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^2.3.5": + version: 2.3.6 + resolution: "jackspeak@npm:2.3.6" + dependencies: + "@isaacs/cliui": ^8.0.2 + "@pkgjs/parseargs": ^0.11.0 + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 57d43ad11eadc98cdfe7496612f6bbb5255ea69fe51ea431162db302c2a11011642f50cfad57288bd0aea78384a0612b16e131944ad8ecd09d619041c8531b54 + languageName: node + linkType: hard + "jake@npm:^10.8.5": version: 10.8.5 resolution: "jake@npm:10.8.5" @@ -13449,6 +13791,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 + languageName: node + linkType: hard + "lru_map@npm:^0.3.3": version: 0.3.3 resolution: "lru_map@npm:0.3.3" @@ -13479,6 +13828,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.27.0": + version: 0.27.0 + resolution: "magic-string@npm:0.27.0" + dependencies: + "@jridgewell/sourcemap-codec": ^1.4.13 + checksum: 273faaa50baadb7a2df6e442eac34ad611304fc08fe16e24fe2e472fd944bfcb73ffb50d2dc972dc04e92784222002af46868cb9698b1be181c81830fd95a13e + languageName: node + linkType: hard + "make-dir@npm:^3.0.0, make-dir@npm:^3.0.2": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -13863,7 +14221,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.3": +"minimatch@npm:^9.0.1, minimatch@npm:^9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3" dependencies: @@ -13974,6 +14332,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": + version: 7.0.4 + resolution: "minipass@npm:7.0.4" + checksum: 87585e258b9488caf2e7acea242fd7856bbe9a2c84a7807643513a338d66f368c7d518200ad7b70a508664d408aa000517647b2930c259a8b1f9f0984f344a21 + languageName: node + linkType: hard + "minizlib@npm:^1.3.3": version: 1.3.3 resolution: "minizlib@npm:1.3.3" @@ -15164,6 +15529,15 @@ __metadata: languageName: node linkType: hard +"path-is-network-drive@npm:^1.0.20": + version: 1.0.20 + resolution: "path-is-network-drive@npm:1.0.20" + dependencies: + tslib: ^2 + checksum: 4281a5b79cc6aa2837d25643a579d7abfb2a6c57fcb640a45c82abb9d459e9f04cd194fe8efb146d9835fcd1758e32e16c2826a34e59d63764af46928ebaa9c2 + languageName: node + linkType: hard + "path-key@npm:^2.0.0, path-key@npm:^2.0.1": version: 2.0.1 resolution: "path-key@npm:2.0.1" @@ -15185,6 +15559,25 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^1.10.1": + version: 1.10.1 + resolution: "path-scurry@npm:1.10.1" + dependencies: + lru-cache: ^9.1.1 || ^10.0.0 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 + languageName: node + linkType: hard + +"path-strip-sep@npm:^1.0.17": + version: 1.0.17 + resolution: "path-strip-sep@npm:1.0.17" + dependencies: + tslib: ^2 + checksum: 79b257bd208b196476109cc82dbc60fc8b62fa77f1d9d7a248f9d87e086805c53854def6e5f3ff8cc9616d87827c3c4a005984809cbd7f41bdd91d3bc7bb888a + languageName: node + linkType: hard + "path-to-regexp@npm:0.1.7": version: 0.1.7 resolution: "path-to-regexp@npm:0.1.7" @@ -15270,6 +15663,15 @@ __metadata: languageName: node linkType: hard +"pkg-dir@npm:< 6 >= 5": + version: 5.0.0 + resolution: "pkg-dir@npm:5.0.0" + dependencies: + find-up: ^5.0.0 + checksum: b167bb8dac7bbf22b1d5e30ec223e6b064b84b63010c9d49384619a36734caf95ed23ad23d4f9bd975e8e8082b60a83395f43a89bb192df53a7c25a38ecb57d9 + languageName: node + linkType: hard + "pkg-dir@npm:^4.1.0, pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -16103,6 +16505,19 @@ __metadata: languageName: node linkType: hard +"resolve@npm:^1.22.1": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c + languageName: node + linkType: hard + "resolve@patch:resolve@1.1.x#~builtin": version: 1.1.7 resolution: "resolve@patch:resolve@npm%3A1.1.7#~builtin::version=1.1.7&hash=07638b" @@ -16132,6 +16547,19 @@ __metadata: languageName: node linkType: hard +"resolve@patch:resolve@^1.22.1#~builtin": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=07638b" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 + languageName: node + linkType: hard + "responselike@npm:^1.0.2": version: 1.0.2 resolution: "responselike@npm:1.0.2" @@ -16222,6 +16650,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.5": + version: 5.0.5 + resolution: "rimraf@npm:5.0.5" + dependencies: + glob: ^10.3.7 + bin: + rimraf: dist/esm/bin.mjs + checksum: d66eef829b2e23b16445f34e73d75c7b7cf4cbc8834b04720def1c8f298eb0753c3d76df77325fad79d0a2c60470525d95f89c2475283ad985fd7441c32732d1 + languageName: node + linkType: hard + "ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" @@ -16269,6 +16708,23 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-typescript2@npm:^0.31.2": + version: 0.31.2 + resolution: "rollup-plugin-typescript2@npm:0.31.2" + dependencies: + "@rollup/pluginutils": ^4.1.2 + "@yarn-tool/resolve-package": ^1.0.40 + find-cache-dir: ^3.3.2 + fs-extra: ^10.0.0 + resolve: ^1.20.0 + tslib: ^2.3.1 + peerDependencies: + rollup: ">=1.26.3" + typescript: ">=2.4.0" + checksum: ceebc686195f8140ee64b89cbd3a284bda50435081bea8f55f404ea293c02ec9787e9147e33f8e078b2c4772d9f198e66f900f54ca77ccda63db9ec2511db665 + languageName: node + linkType: hard + "rollup-plugin-typescript2@npm:^0.32.1": version: 0.32.1 resolution: "rollup-plugin-typescript2@npm:0.32.1" @@ -16308,6 +16764,56 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.0.2": + version: 4.0.2 + resolution: "rollup@npm:4.0.2" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.0.2 + "@rollup/rollup-android-arm64": 4.0.2 + "@rollup/rollup-darwin-arm64": 4.0.2 + "@rollup/rollup-darwin-x64": 4.0.2 + "@rollup/rollup-linux-arm-gnueabihf": 4.0.2 + "@rollup/rollup-linux-arm64-gnu": 4.0.2 + "@rollup/rollup-linux-arm64-musl": 4.0.2 + "@rollup/rollup-linux-x64-gnu": 4.0.2 + "@rollup/rollup-linux-x64-musl": 4.0.2 + "@rollup/rollup-win32-arm64-msvc": 4.0.2 + "@rollup/rollup-win32-ia32-msvc": 4.0.2 + "@rollup/rollup-win32-x64-msvc": 4.0.2 + fsevents: ~2.3.2 + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 29ada628da893964b238466053e81750a9e0339e2a933fe6b100d0de2cb68c493f6cc4af558f5bbdafdfcd085e7d8d06da025776ef54fdd46447c3244053fb41 + languageName: node + linkType: hard + "rsvp@npm:^4.8.4": version: 4.8.5 resolution: "rsvp@npm:4.8.5" @@ -16746,6 +17252,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "simple-concat@npm:^1.0.0": version: 1.0.1 resolution: "simple-concat@npm:1.0.1" @@ -17271,7 +17784,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -17303,7 +17816,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^5.0.0": +"string-width@npm:^5.0.0, string-width@npm:^5.0.1, string-width@npm:^5.1.2": version: 5.1.2 resolution: "string-width@npm:5.1.2" dependencies: @@ -17387,6 +17900,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + "strip-ansi@npm:^4.0.0": version: 4.0.0 resolution: "strip-ansi@npm:4.0.0" @@ -17405,15 +17927,6 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" - dependencies: - ansi-regex: ^5.0.1 - checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c - languageName: node - linkType: hard - "strip-ansi@npm:^7.0.1": version: 7.0.1 resolution: "strip-ansi@npm:7.0.1" @@ -18044,6 +18557,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + "tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0": version: 2.4.0 resolution: "tslib@npm:2.4.0" @@ -18432,6 +18952,18 @@ __metadata: languageName: node linkType: hard +"upath2@npm:^3.1.13": + version: 3.1.19 + resolution: "upath2@npm:3.1.19" + dependencies: + "@types/node": "*" + path-is-network-drive: ^1.0.20 + path-strip-sep: ^1.0.17 + tslib: ^2 + checksum: 043e48f161af8bc246512e19695366959a7ce617ccf4b89527b7736b90c275eef9dc20a82eea091021c18deed31c5ab34f0cfc5924917fa2babfc6bcecd5786e + languageName: node + linkType: hard + "update-browserslist-db@npm:^1.0.0": version: 1.0.4 resolution: "update-browserslist-db@npm:1.0.4" @@ -18810,6 +19342,15 @@ __metadata: languageName: node linkType: hard +"wasmcurves@npm:0.2.2": + version: 0.2.2 + resolution: "wasmcurves@npm:0.2.2" + dependencies: + wasmbuilder: 0.0.16 + checksum: 95ca8afe3816862f16d4f8f4cbed4a4fb522be03a41af3cf7d65429bcac9ff4ccbc6e02762dd14933f0e5903cfb93d15cf31fc4acc953f3fcdb31190eba969e8 + languageName: node + linkType: hard + "web-worker@npm:^1.0.0, web-worker@npm:^1.2.0": version: 1.2.0 resolution: "web-worker@npm:1.2.0" @@ -19297,6 +19838,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + "wrap-ansi@npm:^5.1.0": version: 5.1.0 resolution: "wrap-ansi@npm:5.1.0" @@ -19319,14 +19871,14 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^7.0.0": - version: 7.0.0 - resolution: "wrap-ansi@npm:7.0.0" +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" dependencies: - ansi-styles: ^4.0.0 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 languageName: node linkType: hard