diff --git a/rustdoc/latest/.lock b/rustdoc/latest/.lock new file mode 100755 index 00000000..e69de29b diff --git a/rustdoc/latest/COPYRIGHT.txt b/rustdoc/latest/COPYRIGHT.txt new file mode 100644 index 00000000..c2629a83 --- /dev/null +++ b/rustdoc/latest/COPYRIGHT.txt @@ -0,0 +1,50 @@ +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2, + FiraSans-Regular.woff, FiraSans-Medium.woff): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2, + SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff, + SourceCodePro-It.ttf.woff): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff, + SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. diff --git a/rustdoc/latest/FiraSans-LICENSE.txt b/rustdoc/latest/FiraSans-LICENSE.txt new file mode 100644 index 00000000..ff9afab0 --- /dev/null +++ b/rustdoc/latest/FiraSans-LICENSE.txt @@ -0,0 +1,94 @@ +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/rustdoc/latest/FiraSans-Medium.woff b/rustdoc/latest/FiraSans-Medium.woff new file mode 100644 index 00000000..7d742c5f Binary files /dev/null and b/rustdoc/latest/FiraSans-Medium.woff differ diff --git a/rustdoc/latest/FiraSans-Medium.woff2 b/rustdoc/latest/FiraSans-Medium.woff2 new file mode 100644 index 00000000..7a1e5fc5 Binary files /dev/null and b/rustdoc/latest/FiraSans-Medium.woff2 differ diff --git a/rustdoc/latest/FiraSans-Regular.woff b/rustdoc/latest/FiraSans-Regular.woff new file mode 100644 index 00000000..d8e0363f Binary files /dev/null and b/rustdoc/latest/FiraSans-Regular.woff differ diff --git a/rustdoc/latest/FiraSans-Regular.woff2 b/rustdoc/latest/FiraSans-Regular.woff2 new file mode 100644 index 00000000..e766e06c Binary files /dev/null and b/rustdoc/latest/FiraSans-Regular.woff2 differ diff --git a/rustdoc/latest/LICENSE-APACHE.txt b/rustdoc/latest/LICENSE-APACHE.txt new file mode 100644 index 00000000..16fe87b0 --- /dev/null +++ b/rustdoc/latest/LICENSE-APACHE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/rustdoc/latest/LICENSE-MIT.txt b/rustdoc/latest/LICENSE-MIT.txt new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/rustdoc/latest/LICENSE-MIT.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/rustdoc/latest/SourceCodePro-It.ttf.woff b/rustdoc/latest/SourceCodePro-It.ttf.woff new file mode 100644 index 00000000..8d68f2fe Binary files /dev/null and b/rustdoc/latest/SourceCodePro-It.ttf.woff differ diff --git a/rustdoc/latest/SourceCodePro-It.ttf.woff2 b/rustdoc/latest/SourceCodePro-It.ttf.woff2 new file mode 100644 index 00000000..462c34ef Binary files /dev/null and b/rustdoc/latest/SourceCodePro-It.ttf.woff2 differ diff --git a/rustdoc/latest/SourceCodePro-LICENSE.txt b/rustdoc/latest/SourceCodePro-LICENSE.txt new file mode 100644 index 00000000..07542572 --- /dev/null +++ b/rustdoc/latest/SourceCodePro-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/rustdoc/latest/SourceCodePro-Regular.ttf.woff b/rustdoc/latest/SourceCodePro-Regular.ttf.woff new file mode 100644 index 00000000..7be076e1 Binary files /dev/null and b/rustdoc/latest/SourceCodePro-Regular.ttf.woff differ diff --git a/rustdoc/latest/SourceCodePro-Regular.ttf.woff2 b/rustdoc/latest/SourceCodePro-Regular.ttf.woff2 new file mode 100644 index 00000000..10b558e0 Binary files /dev/null and b/rustdoc/latest/SourceCodePro-Regular.ttf.woff2 differ diff --git a/rustdoc/latest/SourceCodePro-Semibold.ttf.woff b/rustdoc/latest/SourceCodePro-Semibold.ttf.woff new file mode 100644 index 00000000..61bc67b8 Binary files /dev/null and b/rustdoc/latest/SourceCodePro-Semibold.ttf.woff differ diff --git a/rustdoc/latest/SourceCodePro-Semibold.ttf.woff2 b/rustdoc/latest/SourceCodePro-Semibold.ttf.woff2 new file mode 100644 index 00000000..5ec64eef Binary files /dev/null and b/rustdoc/latest/SourceCodePro-Semibold.ttf.woff2 differ diff --git a/rustdoc/latest/SourceSerif4-Bold.ttf.woff b/rustdoc/latest/SourceSerif4-Bold.ttf.woff new file mode 100644 index 00000000..8ad41888 Binary files /dev/null and b/rustdoc/latest/SourceSerif4-Bold.ttf.woff differ diff --git a/rustdoc/latest/SourceSerif4-Bold.ttf.woff2 b/rustdoc/latest/SourceSerif4-Bold.ttf.woff2 new file mode 100644 index 00000000..db57d214 Binary files /dev/null and b/rustdoc/latest/SourceSerif4-Bold.ttf.woff2 differ diff --git a/rustdoc/latest/SourceSerif4-It.ttf.woff b/rustdoc/latest/SourceSerif4-It.ttf.woff new file mode 100644 index 00000000..2a34b5c4 Binary files /dev/null and b/rustdoc/latest/SourceSerif4-It.ttf.woff differ diff --git a/rustdoc/latest/SourceSerif4-It.ttf.woff2 b/rustdoc/latest/SourceSerif4-It.ttf.woff2 new file mode 100644 index 00000000..1cbc021a Binary files /dev/null and b/rustdoc/latest/SourceSerif4-It.ttf.woff2 differ diff --git a/rustdoc/latest/SourceSerif4-LICENSE.md b/rustdoc/latest/SourceSerif4-LICENSE.md new file mode 100644 index 00000000..68ea1892 --- /dev/null +++ b/rustdoc/latest/SourceSerif4-LICENSE.md @@ -0,0 +1,93 @@ +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/rustdoc/latest/SourceSerif4-Regular.ttf.woff b/rustdoc/latest/SourceSerif4-Regular.ttf.woff new file mode 100644 index 00000000..45a5521a Binary files /dev/null and b/rustdoc/latest/SourceSerif4-Regular.ttf.woff differ diff --git a/rustdoc/latest/SourceSerif4-Regular.ttf.woff2 b/rustdoc/latest/SourceSerif4-Regular.ttf.woff2 new file mode 100644 index 00000000..2db73fe2 Binary files /dev/null and b/rustdoc/latest/SourceSerif4-Regular.ttf.woff2 differ diff --git a/rustdoc/latest/ayu.css b/rustdoc/latest/ayu.css new file mode 100644 index 00000000..25ae9525 --- /dev/null +++ b/rustdoc/latest/ayu.css @@ -0,0 +1 @@ + body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}code{color:#ffb454;}h3>code,h4>code,h5>code{color:#e6e1cf;}pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 transparent;}.sidebar{scrollbar-color:#5c6773 transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#5c6773;}.docblock table,.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a span.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#c5c5c5;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#39AFD7;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.search-input:disabled{background-color:#3e3e3e;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help>div>span{border-bottom-color:#5c6773;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target,:target*{background:rgba(255,236,164,0.06);}:target{border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;} \ No newline at end of file diff --git a/rustdoc/latest/brush.svg b/rustdoc/latest/brush.svg new file mode 100644 index 00000000..ea266e85 --- /dev/null +++ b/rustdoc/latest/brush.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/rustdoc/latest/clipboard.svg b/rustdoc/latest/clipboard.svg new file mode 100644 index 00000000..8adbd996 --- /dev/null +++ b/rustdoc/latest/clipboard.svg @@ -0,0 +1 @@ + diff --git a/rustdoc/latest/crates.js b/rustdoc/latest/crates.js new file mode 100644 index 00000000..98e653eb --- /dev/null +++ b/rustdoc/latest/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["halo2"]; \ No newline at end of file diff --git a/rustdoc/latest/dark.css b/rustdoc/latest/dark.css new file mode 100644 index 00000000..474fd9c6 --- /dev/null +++ b/rustdoc/latest/dark.css @@ -0,0 +1 @@ +body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#DDD;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-mod:focus{background-color:#803a1b;}a.result-externcrate:focus{background-color:#396bac;}a.result-enum:focus{background-color:#5b4e68;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#38902c;}a.result-foreigntype:focus{background-color:#b200d6;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#0063cc;}a.result-primitive:focus{background-color:#00708a;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#D2991D;}a.test-arrow{color:#dedede;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-input:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help>div>span{border-bottom-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target*{background-color:#494a3d;}:target{border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} \ No newline at end of file diff --git a/rustdoc/latest/down-arrow.svg b/rustdoc/latest/down-arrow.svg new file mode 100644 index 00000000..35437e77 --- /dev/null +++ b/rustdoc/latest/down-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/rustdoc/latest/favicon-16x16.png b/rustdoc/latest/favicon-16x16.png new file mode 100644 index 00000000..7cfe6c13 Binary files /dev/null and b/rustdoc/latest/favicon-16x16.png differ diff --git a/rustdoc/latest/favicon-32x32.png b/rustdoc/latest/favicon-32x32.png new file mode 100644 index 00000000..5109c1de Binary files /dev/null and b/rustdoc/latest/favicon-32x32.png differ diff --git a/rustdoc/latest/favicon.svg b/rustdoc/latest/favicon.svg new file mode 100644 index 00000000..8b34b511 --- /dev/null +++ b/rustdoc/latest/favicon.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/rustdoc/latest/halo2/all.html b/rustdoc/latest/halo2/all.html new file mode 100644 index 00000000..53825dc3 --- /dev/null +++ b/rustdoc/latest/halo2/all.html @@ -0,0 +1,20 @@ +List of all items in this crate + + + +

List of all items[] + +

Structs

Enums

Traits

Functions

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.best_fft.html b/rustdoc/latest/halo2/arithmetic/fn.best_fft.html new file mode 100644 index 00000000..626e8636 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.best_fft.html @@ -0,0 +1,27 @@ +best_fft in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::best_fft[][src]

pub fn best_fft<G: Group>(a: &mut [G], omega: G::Scalar, log_n: u32)
Expand description

Performs a radix-$2$ Fast-Fourier Transformation (FFT) on a vector of size +$n = 2^k$, when provided log_n = $k$ and an element of multiplicative +order $n$ called omega ($\omega$). The result is that the vector a, when +interpreted as the coefficients of a polynomial of degree $n - 1$, is +transformed into the evaluations of this polynomial at each of the $n$ +distinct powers of $\omega$. This transformation is invertible by providing +$\omega^{-1}$ in place of $\omega$ and dividing each resulting field element +by $n$.

+

This will use multithreading if beneficial.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.best_multiexp.html b/rustdoc/latest/halo2/arithmetic/fn.best_multiexp.html new file mode 100644 index 00000000..9df10682 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.best_multiexp.html @@ -0,0 +1,21 @@ +best_multiexp in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::best_multiexp[][src]

pub fn best_multiexp<C: CurveAffine>(
    coeffs: &[C::Scalar],
    bases: &[C]
) -> C::Curve
Expand description

Performs a multi-exponentiation operation.

+

This function will panic if coeffs and bases have a different length.

+

This will use multithreading if beneficial.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.compute_inner_product.html b/rustdoc/latest/halo2/arithmetic/fn.compute_inner_product.html new file mode 100644 index 00000000..9a12a024 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.compute_inner_product.html @@ -0,0 +1,20 @@ +compute_inner_product in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::compute_inner_product[][src]

pub fn compute_inner_product<F: Field>(a: &[F], b: &[F]) -> F
Expand description

This computes the inner product of two vectors a and b.

+

This function will panic if the two vectors are not the same size.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.eval_polynomial.html b/rustdoc/latest/halo2/arithmetic/fn.eval_polynomial.html new file mode 100644 index 00000000..6ae0b895 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.eval_polynomial.html @@ -0,0 +1,19 @@ +eval_polynomial in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::eval_polynomial[][src]

pub fn eval_polynomial<F: Field>(poly: &[F], point: F) -> F
Expand description

This evaluates a provided polynomial (in coefficient form) at point.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.kate_division.html b/rustdoc/latest/halo2/arithmetic/fn.kate_division.html new file mode 100644 index 00000000..5feffd68 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.kate_division.html @@ -0,0 +1,20 @@ +kate_division in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::kate_division[][src]

pub fn kate_division<'a, F: Field, I: IntoIterator<Item = &'a F>>(
    a: I,
    b: F
) -> Vec<F> where
    I::IntoIter: DoubleEndedIterator + ExactSizeIterator
Expand description

Divides polynomial a in X by X - b with +no remainder.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.lagrange_interpolate.html b/rustdoc/latest/halo2/arithmetic/fn.lagrange_interpolate.html new file mode 100644 index 00000000..17d53d67 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.lagrange_interpolate.html @@ -0,0 +1,21 @@ +lagrange_interpolate in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::lagrange_interpolate[][src]

pub fn lagrange_interpolate<F: FieldExt>(points: &[F], evals: &[F]) -> Vec<F>
Expand description

Returns coefficients of an n - 1 degree polynomial given a set of n points +and their evaluations. This function will panic if two values in points +are the same.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.parallelize.html b/rustdoc/latest/halo2/arithmetic/fn.parallelize.html new file mode 100644 index 00000000..0e6ef4fd --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.parallelize.html @@ -0,0 +1,20 @@ +parallelize in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::parallelize[][src]

pub fn parallelize<T: Send, F: Fn(&mut [T], usize) + Send + Sync + Clone>(
    v: &mut [T],
    f: F
)
Expand description

This simple utility function will parallelize an operation that is to be +performed over a mutable slice.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/fn.small_multiexp.html b/rustdoc/latest/halo2/arithmetic/fn.small_multiexp.html new file mode 100644 index 00000000..cc9e9432 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/fn.small_multiexp.html @@ -0,0 +1,20 @@ +small_multiexp in halo2::arithmetic - Rust + + + +

Function halo2::arithmetic::small_multiexp[][src]

pub fn small_multiexp<C: CurveAffine>(
    coeffs: &[C::Scalar],
    bases: &[C]
) -> C::Curve
Expand description

Performs a small multi-exponentiation operation. +Uses the double-and-add algorithm with doublings shared across points.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/index.html b/rustdoc/latest/halo2/arithmetic/index.html new file mode 100644 index 00000000..8bd94472 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/index.html @@ -0,0 +1,58 @@ +halo2::arithmetic - Rust + + + +

Module halo2::arithmetic[][src]

Expand description

This module provides common utilities, traits and structures for group, +field and polynomial arithmetic.

+

Structs

+

The affine coordinates of a point on an elliptic curve.

+

Tables used for square root computation.

+

Traits

+

Extension trait for iterators over mutable field elements which allows those +field elements to be inverted in a batch.

+

This trait is the affine counterpart to Curve and is used for +serialization, storage in memory, and inspection of $x$ and $y$ coordinates.

+

This trait is a common interface for dealing with elements of an elliptic +curve group in a “projective” form, where that arithmetic is usually more +efficient.

+

This trait represents an element of a field.

+

This trait is a common interface for dealing with elements of a finite +field.

+

This represents an element of a group with basic operations that can be +performed. This allows an FFT implementation (for example) to operate +generically over either a field or elliptic curve group.

+

Functions

+

Performs a radix-$2$ Fast-Fourier Transformation (FFT) on a vector of size +$n = 2^k$, when provided log_n = $k$ and an element of multiplicative +order $n$ called omega ($\omega$). The result is that the vector a, when +interpreted as the coefficients of a polynomial of degree $n - 1$, is +transformed into the evaluations of this polynomial at each of the $n$ +distinct powers of $\omega$. This transformation is invertible by providing +$\omega^{-1}$ in place of $\omega$ and dividing each resulting field element +by $n$.

+

Performs a multi-exponentiation operation.

+

This computes the inner product of two vectors a and b.

+

This evaluates a provided polynomial (in coefficient form) at point.

+

Divides polynomial a in X by X - b with +no remainder.

+

Returns coefficients of an n - 1 degree polynomial given a set of n points +and their evaluations. This function will panic if two values in points +are the same.

+

This simple utility function will parallelize an operation that is to be +performed over a mutable slice.

+

Performs a small multi-exponentiation operation. +Uses the double-and-add algorithm with doublings shared across points.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/sidebar-items.js b/rustdoc/latest/halo2/arithmetic/sidebar-items.js new file mode 100644 index 00000000..229fbe92 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["best_fft","Performs a radix-$2$ Fast-Fourier Transformation (FFT) on a vector of size $n = 2^k$, when provided `log_n` = $k$ and an element of multiplicative order $n$ called `omega` ($\\omega$). The result is that the vector `a`, when interpreted as the coefficients of a polynomial of degree $n - 1$, is transformed into the evaluations of this polynomial at each of the $n$ distinct powers of $\\omega$. This transformation is invertible by providing $\\omega^{-1}$ in place of $\\omega$ and dividing each resulting field element by $n$."],["best_multiexp","Performs a multi-exponentiation operation."],["compute_inner_product","This computes the inner product of two vectors `a` and `b`."],["eval_polynomial","This evaluates a provided polynomial (in coefficient form) at `point`."],["kate_division","Divides polynomial `a` in `X` by `X - b` with no remainder."],["lagrange_interpolate","Returns coefficients of an n - 1 degree polynomial given a set of n points and their evaluations. This function will panic if two values in `points` are the same."],["parallelize","This simple utility function will parallelize an operation that is to be performed over a mutable slice."],["small_multiexp","Performs a small multi-exponentiation operation. Uses the double-and-add algorithm with doublings shared across points."]],"struct":[["Coordinates","The affine coordinates of a point on an elliptic curve."],["SqrtTables","Tables used for square root computation."]],"trait":[["BatchInvert","Extension trait for iterators over mutable field elements which allows those field elements to be inverted in a batch."],["CurveAffine","This trait is the affine counterpart to `Curve` and is used for serialization, storage in memory, and inspection of $x$ and $y$ coordinates."],["CurveExt","This trait is a common interface for dealing with elements of an elliptic curve group in a “projective” form, where that arithmetic is usually more efficient."],["Field","This trait represents an element of a field."],["Field","This trait represents an element of a field."],["FieldExt","This trait is a common interface for dealing with elements of a finite field."],["Group","This represents an element of a group with basic operations that can be performed. This allows an FFT implementation (for example) to operate generically over either a field or elliptic curve group."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/struct.Coordinates.html b/rustdoc/latest/halo2/arithmetic/struct.Coordinates.html new file mode 100644 index 00000000..1d897cc6 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/struct.Coordinates.html @@ -0,0 +1,105 @@ +Coordinates in halo2::arithmetic - Rust + + + +

Struct halo2::arithmetic::Coordinates[]

pub struct Coordinates<C> where
    C: CurveAffine
{ /* fields omitted */ }
Expand description

The affine coordinates of a point on an elliptic curve.

+

Implementations

Returns the x-coordinate.

+

Equivalent to Coordinates::u.

+

Returns the y-coordinate.

+

Equivalent to Coordinates::v.

+

Returns the u-coordinate.

+

Equivalent to Coordinates::x.

+

Returns the v-coordinate.

+

Equivalent to Coordinates::y.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Select a or b according to choice. Read more

+

Conditionally assign other to self, according to choice. Read more

+

Conditionally swap self and other if choice == 1; otherwise, +reassign both unto themselves. Read more

+

Formats the value using the given formatter. Read more

+

Returns the “default value” for a type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/struct.SqrtTables.html b/rustdoc/latest/halo2/arithmetic/struct.SqrtTables.html new file mode 100644 index 00000000..b1999b33 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/struct.SqrtTables.html @@ -0,0 +1,97 @@ +SqrtTables in halo2::arithmetic - Rust + + + +

Struct halo2::arithmetic::SqrtTables[]

pub struct SqrtTables<F> where
    F: FieldExt
{ /* fields omitted */ }
Expand description

Tables used for square root computation.

+

Implementations

Build tables given parameters for the perfect hash.

+

Computes:

+
    +
  • (true, sqrt(num/div)), if num and div are nonzero and num/div is a square in the field;
  • +
  • (true, 0), if num is zero;
  • +
  • (false, 0), if num is nonzero and div is zero;
  • +
  • (false, sqrt(ROOT_OF_UNITY * num/div)), if num and div are nonzero and num/div is a nonsquare in the field;
  • +
+

where ROOT_OF_UNITY is a generator of the order 2^n subgroup (and therefore a nonsquare).

+

The choice of root from sqrt is unspecified.

+

Same as sqrt_ratio(u, one()) but more efficient.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.BatchInvert.html b/rustdoc/latest/halo2/arithmetic/trait.BatchInvert.html new file mode 100644 index 00000000..3bbaf661 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.BatchInvert.html @@ -0,0 +1,25 @@ +BatchInvert in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::BatchInvert[][src]

pub trait BatchInvert<F: Field> {
+    fn batch_invert(self) -> F;
+}
Expand description

Extension trait for iterators over mutable field elements which allows those +field elements to be inverted in a batch.

+

Required methods

Consume this iterator and invert each field element (when nonzero), +returning the inverse of all nonzero field elements. Zero elements +are left as zero.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.CurveAffine.html b/rustdoc/latest/halo2/arithmetic/trait.CurveAffine.html new file mode 100644 index 00000000..ea715ef0 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.CurveAffine.html @@ -0,0 +1,48 @@ +CurveAffine in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::CurveAffine[]

pub trait CurveAffine: PrimeCurveAffine<Scalar = Self::ScalarExt, Curve = Self::CurveExt> + Default + Add<Self, Output = Self::Curve> + Sub<Self, Output = Self::Curve> + ConditionallySelectable + ConstantTimeEq + From<Self::Curve> {
+    type ScalarExt: FieldExt;
+    type Base: FieldExt;
+    type CurveExt: CurveExt;
+    fn coordinates(&self) -> CtOption<Coordinates<Self>>;
+
fn from_xy(x: Self::Base, y: Self::Base) -> CtOption<Self>; +
fn is_on_curve(&self) -> Choice; +
fn a() -> Self::Base; +
fn b() -> Self::Base; + + fn read<R>(reader: &mut R) -> Result<Self, Error>
    where
        R: Read
, + { ... } +
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
    where
        W: Write
, + { ... } +}
Expand description

This trait is the affine counterpart to Curve and is used for +serialization, storage in memory, and inspection of $x$ and $y$ coordinates.

+

Associated Types

The scalar field of this elliptic curve.

+

The base field over which this elliptic curve is constructed.

+

The projective form of the curve

+

Required methods

Gets the coordinates of this point.

+

Returns None if this is the identity.

+

Obtains a point given $(x, y)$, failing if it is not on the +curve.

+

Returns whether or not this element is on the curve; should +always be true unless an “unchecked” API was used.

+

Returns the curve constant $a$.

+

Returns the curve constant $b$.

+

Provided methods

Reads a compressed element from the buffer and attempts to parse it +using from_bytes.

+

Writes an element in compressed form to the buffer.

+

Implementations on Foreign Types

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.CurveExt.html b/rustdoc/latest/halo2/arithmetic/trait.CurveExt.html new file mode 100644 index 00000000..7f2b84b7 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.CurveExt.html @@ -0,0 +1,67 @@ +CurveExt in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::CurveExt[]

pub trait CurveExt: PrimeCurve<Affine = Self::AffineExt, Scalar = Self::ScalarExt> + Group + Default + PartialEq<Self> + Eq + ConditionallySelectable + ConstantTimeEq + From<Self::Affine> + Group<Scalar = Self::Scalar> {
+    type ScalarExt: FieldExt;
+    type Base: FieldExt;
+    type AffineExt: CurveAffine + Mul<Self::ScalarExt>;
+
+    const CURVE_ID: &'static str;
+
+    fn endo(&self) -> Self;
+
fn jacobian_coordinates(&self) -> (Self::Base, Self::Base, Self::Base); +
fn hash_to_curve(domain_prefix: &'a str) -> Box<dyn Fn(&[u8]) + 'a, Global>; +
fn is_on_curve(&self) -> Choice; +
fn a() -> Self::Base; +
fn b() -> Self::Base; +
fn new_jacobian(
        x: Self::Base,
        y: Self::Base,
        z: Self::Base
    ) -> CtOption<Self>; +}
Expand description

This trait is a common interface for dealing with elements of an elliptic +curve group in a “projective” form, where that arithmetic is usually more +efficient.

+

Associated Types

The scalar field of this elliptic curve.

+

The base field over which this elliptic curve is constructed.

+

The affine version of the curve

+

Associated Constants

CURVE_ID used for hash-to-curve.

+

Required methods

Apply the curve endomorphism by multiplying the x-coordinate +by an element of multiplicative order 3.

+

Return the Jacobian coordinates of this point.

+

Requests a hasher that accepts messages and returns near-uniformly +distributed elements in the group, given domain prefix domain_prefix.

+

This method is suitable for use as a random oracle.

+

Example

+
+use pasta_curves::arithmetic::CurveExt;
+fn pedersen_commitment<C: CurveExt>(
+    x: C::ScalarExt,
+    r: C::ScalarExt,
+) -> C::Affine {
+    let hasher = C::hash_to_curve("z.cash:example_pedersen_commitment");
+    let g = hasher(b"g");
+    let h = hasher(b"h");
+    (g * x + &(h * r)).to_affine()
+}
+

Returns whether or not this element is on the curve; should +always be true unless an “unchecked” API was used.

+

Returns the curve constant a.

+

Returns the curve constant b.

+

Obtains a point given Jacobian coordinates $X : Y : Z$, failing +if the coordinates are not on the curve.

+

Implementations on Foreign Types

Apply the curve endomorphism by multiplying the x-coordinate +by an element of multiplicative order 3.

+

Apply the curve endomorphism by multiplying the x-coordinate +by an element of multiplicative order 3.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.Field.html b/rustdoc/latest/halo2/arithmetic/trait.Field.html new file mode 100644 index 00000000..e16df7f6 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.Field.html @@ -0,0 +1,53 @@ +Field in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::Field[]

pub trait Field: 'static + Eq + Copy + Clone + Default + Send + Sync + Debug + ConditionallySelectable + Add<Self, Output = Self, Output = Self> + Sub<Self, Output = Self, Output = Self> + Mul<Self, Output = Self, Output = Self> + Neg<Output = Self> + for<'a> Add<&'a Self> + for<'a> Mul<&'a Self> + for<'a> Sub<&'a Self> + MulAssign<Self> + AddAssign<Self> + SubAssign<Self> + for<'a> MulAssign<&'a Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> {
+    fn random(rng: impl RngCore) -> Self;
+
fn zero() -> Self; +
fn one() -> Self; +
fn is_zero(&self) -> bool; +
fn square(&self) -> Self; +
fn double(&self) -> Self; +
fn invert(&self) -> CtOption<Self>; +
fn sqrt(&self) -> CtOption<Self>; + + fn cube(&self) -> Self { ... } +
fn pow_vartime<S>(&self, exp: S) -> Self
    where
        S: AsRef<[u64]>
, + { ... } +}
Expand description

This trait represents an element of a field.

+

Required methods

Returns an element chosen uniformly at random using a user-provided RNG.

+

Returns the zero element of the field, the additive identity.

+

Returns the one element of the field, the multiplicative identity.

+

Returns true iff this element is zero.

+

Squares this element.

+

Doubles this element.

+

Computes the multiplicative inverse of this element, +failing if the element is zero.

+

Returns the square root of the field element, if it is +quadratic residue.

+

Provided methods

Cubes this element.

+

Exponentiates self by exp, where exp is a little-endian order +integer exponent.

+

This operation is variable time with respect to the exponent. If the +exponent is fixed, this operation is effectively constant time.

+

Implementations on Foreign Types

Computes the square root of this element, if it exists.

+

Computes the multiplicative inverse of this element, +failing if the element is zero.

+

Computes the square root of this element, if it exists.

+

Computes the multiplicative inverse of this element, +failing if the element is zero.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.FieldExt.html b/rustdoc/latest/halo2/arithmetic/trait.FieldExt.html new file mode 100644 index 00000000..3b898e5a --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.FieldExt.html @@ -0,0 +1,105 @@ +FieldExt in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::FieldExt[]

pub trait FieldExt: PrimeField + From<bool> + Ord + ConstantTimeEq + Group<Scalar = Self> {
+    const MODULUS: &'static str;
+    const ROOT_OF_UNITY: Self;
+    const ROOT_OF_UNITY_INV: Self;
+    const T_MINUS1_OVER2: [u64; 4];
+    const DELTA: Self;
+    const TWO_INV: Self;
+    const RESCUE_ALPHA: u64;
+    const RESCUE_INVALPHA: [u64; 4];
+    const ZETA: Self;
+
Show methods + fn sqrt_ratio(num: &Self, div: &Self) -> (Choice, Self); +
fn ct_is_zero(&self) -> Choice; +
fn from_u64(v: u64) -> Self; +
fn from_u128(v: u128) -> Self; +
fn to_bytes(&self) -> [u8; 32]; +
fn from_bytes(bytes: &[u8; 32]) -> CtOption<Self>; +
fn from_bytes_wide(bytes: &[u8; 64]) -> Self; +
fn get_lower_128(&self) -> u128; +
fn get_lower_32(&self) -> u32; + + fn sqrt_alt(&self) -> (Choice, Self) { ... } +
fn rand() -> Self { ... } +
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
    where
        W: Write
, + { ... } +
fn read<R>(reader: &mut R) -> Result<Self, Error>
    where
        R: Read
, + { ... } +
fn pow(&self, by: &[u64; 4]) -> Self { ... } +
fn pow_by_t_minus1_over2(&self) -> Self { ... } +
fn batch_invert(v: &mut [Self]) -> Self { ... } +
}
Expand description

This trait is a common interface for dealing with elements of a finite +field.

+

Associated Constants

Modulus of the field written as a string for display purposes

+

Generator of the $2^S$ multiplicative subgroup

+

Inverse of ROOT_OF_UNITY

+

The value $(T-1)/2$ such that $2^S \cdot T = p - 1$ with $T$ odd.

+

Generator of the $t-order$ multiplicative subgroup

+

Inverse of $2$ in the field.

+

Ideally the smallest prime $\alpha$ such that gcd($p - 1$, $\alpha$) = $1$

+

$RESCUE_INVALPHA \cdot RESCUE_ALPHA = 1 \mod p - 1$ such that +(a^RESCUE_ALPHA)^RESCUE_INVALPHA = a.

+

Element of multiplicative order $3$.

+

Required methods

Computes:

+
    +
  • (true, sqrt(num/div)), if num and div are nonzero and num/div is a square in the field;
  • +
  • (true, 0), if num is zero;
  • +
  • (false, 0), if num is nonzero and div is zero;
  • +
  • (false, sqrt(ROOT_OF_UNITY * num/div)), if num and div are nonzero and num/div is a nonsquare in the field;
  • +
+

where ROOT_OF_UNITY is a generator of the order 2^n subgroup (and therefore a nonsquare).

+

The choice of root from sqrt is unspecified.

+

Returns whether or not this element is zero.

+

Obtains a field element congruent to the integer v.

+

Obtains a field element congruent to the integer v.

+

Converts this field element to its normalized, little endian byte +representation.

+

Attempts to obtain a field element from its normalized, little endian +byte representation.

+

Obtains a field element that is congruent to the provided little endian +byte representation of an integer.

+

Gets the lower 128 bits of this field element when expressed +canonically.

+

Gets the lower 32 bits of this field element when expressed +canonically.

+

Provided methods

Equivalent to sqrt_ratio(self, one()).

+

This computes a random element of the field using system randomness.

+

Writes this element in its normalized, little endian form into a buffer.

+

Reads a normalized, little endian represented field element from a +buffer.

+

Exponentiates self by by, where by is a little-endian order +integer exponent.

+

Raise this field element to the power T_MINUS1_OVER2. +Field implementations may override this to use an efficient addition chain.

+

Performs a batch inversion using Montgomery’s trick, returns the product +of every inverse. Zero inputs are ignored.

+

Implementations on Foreign Types

Attempts to convert a little-endian byte representation of +a scalar into a Fp, failing if the input is not canonical.

+

Converts an element of Fp into a byte representation in +little-endian byte order.

+

Converts a 512-bit little endian integer into +a Fp by reducing by the modulus.

+

Attempts to convert a little-endian byte representation of +a scalar into a Fq, failing if the input is not canonical.

+

Converts an element of Fq into a byte representation in +little-endian byte order.

+

Converts a 512-bit little endian integer into +a Fq by reducing by the modulus.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/arithmetic/trait.Group.html b/rustdoc/latest/halo2/arithmetic/trait.Group.html new file mode 100644 index 00000000..06975a44 --- /dev/null +++ b/rustdoc/latest/halo2/arithmetic/trait.Group.html @@ -0,0 +1,33 @@ +Group in halo2::arithmetic - Rust + + + +

Trait halo2::arithmetic::Group[]

pub trait Group: 'static + Copy + Clone + Send + Sync {
+    type Scalar: FieldExt;
+    fn group_zero() -> Self;
+
fn group_add(&mut self, rhs: &Self); +
fn group_sub(&mut self, rhs: &Self); +
fn group_scale(&mut self, by: &Self::Scalar); +}
Expand description

This represents an element of a group with basic operations that can be +performed. This allows an FFT implementation (for example) to operate +generically over either a field or elliptic curve group.

+

Associated Types

The group is assumed to be of prime order $p$. Scalar is the +associated scalar field of size $p$.

+

Required methods

Returns the additive identity of the group.

+

Adds rhs to this group element.

+

Subtracts rhs from this group element.

+

Scales this group element by a scalar.

+

Implementations on Foreign Types

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/index.html b/rustdoc/latest/halo2/circuit/floor_planner/index.html new file mode 100644 index 00000000..26f7c19c --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/index.html @@ -0,0 +1,22 @@ +halo2::circuit::floor_planner - Rust + + + +

Module halo2::circuit::floor_planner[][src]

Expand description

Implementations of common circuit floor planners.

+

Structs

+

The version 1 FloorPlanner provided by halo2.

+

A single pass of the V1 layouter.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/sidebar-items.js b/rustdoc/latest/halo2/circuit/floor_planner/sidebar-items.js new file mode 100644 index 00000000..9dccb789 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["V1","The version 1 [`FloorPlanner`] provided by `halo2`."],["V1Pass","A single pass of the [`V1`] layouter."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/single_pass/struct.SimpleFloorPlanner.html b/rustdoc/latest/halo2/circuit/floor_planner/single_pass/struct.SimpleFloorPlanner.html new file mode 100644 index 00000000..1be0dd17 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/single_pass/struct.SimpleFloorPlanner.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/circuit/struct.SimpleFloorPlanner.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/struct.V1.html b/rustdoc/latest/halo2/circuit/floor_planner/struct.V1.html new file mode 100644 index 00000000..e8684df9 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/struct.V1.html @@ -0,0 +1,95 @@ +V1 in halo2::circuit::floor_planner - Rust + + + +

Struct halo2::circuit::floor_planner::V1[][src]

pub struct V1;
Expand description

The version 1 FloorPlanner provided by halo2.

+
    +
  • No column optimizations are performed. Circuit configuration is left entirely to the +circuit designer.
  • +
  • A dual-pass layouter is used to measures regions prior to assignment.
  • +
  • Regions are measured as rectangles, bounded on the cells they assign.
  • +
  • Regions are layed out using a greedy first-fit strategy, after sorting regions by +their “advice area” (number of advice columns * rows).
  • +
+

Trait Implementations

Formats the value using the given formatter. Read more

+

Given the provided cs, synthesize the given circuit. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/struct.V1Pass.html b/rustdoc/latest/halo2/circuit/floor_planner/struct.V1Pass.html new file mode 100644 index 00000000..c43e1f52 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/struct.V1Pass.html @@ -0,0 +1,93 @@ +V1Pass in halo2::circuit::floor_planner - Rust + + + +

Struct halo2::circuit::floor_planner::V1Pass[][src]

pub struct V1Pass<'p, 'a, F: Field, CS: Assignment<F> + 'a>(_);
Expand description

A single pass of the V1 layouter.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Represents the type of the “root” of this layouter, so that nested namespaces +can minimize indirection. Read more

+

Assign a region of gates to an absolute row number. Read more

+

Gets the “root” of this assignment, bypassing the namespacing. Read more

+

Creates a new (sub)namespace and enters into it. Read more

+

Exits out of the existing namespace. Read more

+

Enters into a namespace.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1.html b/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1.html new file mode 100644 index 00000000..ae88c66f --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/circuit/floor_planner/struct.V1.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1Pass.html b/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1Pass.html new file mode 100644 index 00000000..208c96ab --- /dev/null +++ b/rustdoc/latest/halo2/circuit/floor_planner/v1/struct.V1Pass.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/circuit/floor_planner/struct.V1Pass.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/index.html b/rustdoc/latest/halo2/circuit/index.html new file mode 100644 index 00000000..47dfbd66 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/index.html @@ -0,0 +1,34 @@ +halo2::circuit - Rust + + + +

Module halo2::circuit[][src]

Expand description

Traits and structs for implementing circuit components.

+

Modules

+

Implementations of common circuit floor planners.

+

Implementations of common circuit layouters.

+

Structs

+

A pointer to a cell within a circuit.

+

This is a “namespaced” layouter which borrows a Layouter (pushing a namespace +context) and, when dropped, pops out of the namespace context.

+

A region of the circuit in which a Chip can assign cells.

+

Index of a region in a layouter

+

Starting row of a region in a layouter

+

A simple FloorPlanner that performs minimal optimizations.

+

Traits

+

A chip implements a set of instructions that can be used by gadgets.

+

A layout strategy within a circuit. The layouter is chip-agnostic and applies its +strategy to the context and config it is given.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/layouter/index.html b/rustdoc/latest/halo2/circuit/layouter/index.html new file mode 100644 index 00000000..0795f11b --- /dev/null +++ b/rustdoc/latest/halo2/circuit/layouter/index.html @@ -0,0 +1,24 @@ +halo2::circuit::layouter - Rust + + + +

Module halo2::circuit::layouter[][src]

Expand description

Implementations of common circuit layouters.

+

Structs

+

The shape of a region. For a region at a certain index, we track +the set of columns it uses as well as the number of rows it uses.

+

Traits

+

Helper trait for implementing a custom Layouter.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/layouter/sidebar-items.js b/rustdoc/latest/halo2/circuit/layouter/sidebar-items.js new file mode 100644 index 00000000..ce30755b --- /dev/null +++ b/rustdoc/latest/halo2/circuit/layouter/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["RegionShape","The shape of a region. For a region at a certain index, we track the set of columns it uses as well as the number of rows it uses."]],"trait":[["RegionLayouter","Helper trait for implementing a custom `Layouter`."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/layouter/struct.RegionShape.html b/rustdoc/latest/halo2/circuit/layouter/struct.RegionShape.html new file mode 100644 index 00000000..267c5cbe --- /dev/null +++ b/rustdoc/latest/halo2/circuit/layouter/struct.RegionShape.html @@ -0,0 +1,101 @@ +RegionShape in halo2::circuit::layouter - Rust + + + +

Struct halo2::circuit::layouter::RegionShape[][src]

pub struct RegionShape { /* fields omitted */ }
Expand description

The shape of a region. For a region at a certain index, we track +the set of columns it uses as well as the number of rows it uses.

+

Implementations

Create a new RegionShape for a region at region_index.

+

Get the region_index of a RegionShape.

+

Get a reference to the set of columns used in a RegionShape.

+

Get the row_count of a RegionShape.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Enables a selector at the given offset.

+

Assign an advice column value (witness)

+

Assign a fixed value

+

Constraint two cells to have the same value. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/layouter/trait.RegionLayouter.html b/rustdoc/latest/halo2/circuit/layouter/trait.RegionLayouter.html new file mode 100644 index 00000000..7f5133d8 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/layouter/trait.RegionLayouter.html @@ -0,0 +1,54 @@ +RegionLayouter in halo2::circuit::layouter - Rust + + + +

Trait halo2::circuit::layouter::RegionLayouter[][src]

pub trait RegionLayouter<F: Field>: Debug {
+    fn enable_selector<'v>(
        &'v mut self,
        annotation: &'v (dyn Fn() -> String + 'v),
        selector: &Selector,
        offset: usize
    ) -> Result<(), Error>; +
fn assign_advice<'v>(
        &'v mut self,
        annotation: &'v (dyn Fn() -> String + 'v),
        column: Column<Advice>,
        offset: usize,
        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v)
    ) -> Result<Cell, Error>; +
fn assign_fixed<'v>(
        &'v mut self,
        annotation: &'v (dyn Fn() -> String + 'v),
        column: Column<Fixed>,
        offset: usize,
        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v)
    ) -> Result<Cell, Error>; +
fn constrain_equal(
        &mut self,
        permutation: &Permutation,
        left: Cell,
        right: Cell
    ) -> Result<(), Error>; +}
Expand description

Helper trait for implementing a custom Layouter.

+

This trait is used for implementing region assignments:

+ +
+impl<'a, F: FieldExt, C: Chip<F>, CS: Assignment<F> + 'a> Layouter<C> for MyLayouter<'a, C, CS> {
+    fn assign_region(
+        &mut self,
+        assignment: impl FnOnce(Region<'_, F, C>) -> Result<(), Error>,
+    ) -> Result<(), Error> {
+        let region_index = self.regions.len();
+        self.regions.push(self.current_gate);
+
+        let mut region = MyRegion::new(self, region_index);
+        {
+            let region: &mut dyn RegionLayouter<F> = &mut region;
+            assignment(region.into())?;
+        }
+        self.current_gate += region.row_count;
+
+        Ok(())
+    }
+}
+

TODO: It would be great if we could constrain the columns in these types to be +“logical” columns that are guaranteed to correspond to the chip (and have come from +Chip::Config).

+

Required methods

Enables a selector at the given offset.

+

Assign an advice column value (witness)

+

Assign a fixed value

+

Constraint two cells to have the same value.

+

Returns an error if either of the cells is not within the given permutation.

+

Trait Implementations

Performs the conversion.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/sidebar-items.js b/rustdoc/latest/halo2/circuit/sidebar-items.js new file mode 100644 index 00000000..25600aaa --- /dev/null +++ b/rustdoc/latest/halo2/circuit/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"mod":[["floor_planner","Implementations of common circuit floor planners."],["layouter","Implementations of common circuit layouters."]],"struct":[["Cell","A pointer to a cell within a circuit."],["NamespacedLayouter","This is a “namespaced” layouter which borrows a `Layouter` (pushing a namespace context) and, when dropped, pops out of the namespace context."],["Region","A region of the circuit in which a [`Chip`] can assign cells."],["RegionIndex","Index of a region in a layouter"],["RegionStart","Starting row of a region in a layouter"],["SimpleFloorPlanner","A simple [`FloorPlanner`] that performs minimal optimizations."]],"trait":[["Chip","A chip implements a set of instructions that can be used by gadgets."],["Layouter","A layout strategy within a circuit. The layouter is chip-agnostic and applies its strategy to the context and config it is given."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.Cell.html b/rustdoc/latest/halo2/circuit/struct.Cell.html new file mode 100644 index 00000000..b3c543a5 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.Cell.html @@ -0,0 +1,92 @@ +Cell in halo2::circuit - Rust + + + +

Struct halo2::circuit::Cell[][src]

pub struct Cell { /* fields omitted */ }
Expand description

A pointer to a cell within a circuit.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.NamespacedLayouter.html b/rustdoc/latest/halo2/circuit/struct.NamespacedLayouter.html new file mode 100644 index 00000000..ca870a2b --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.NamespacedLayouter.html @@ -0,0 +1,95 @@ +NamespacedLayouter in halo2::circuit - Rust + + + +

Struct halo2::circuit::NamespacedLayouter[][src]

pub struct NamespacedLayouter<'a, F: Field, L: Layouter<F> + 'a>(_, _);
Expand description

This is a “namespaced” layouter which borrows a Layouter (pushing a namespace +context) and, when dropped, pops out of the namespace context.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Executes the destructor for this type. Read more

+

Represents the type of the “root” of this layouter, so that nested namespaces +can minimize indirection. Read more

+

Assign a region of gates to an absolute row number. Read more

+

Gets the “root” of this assignment, bypassing the namespacing. Read more

+

Creates a new (sub)namespace and enters into it. Read more

+

Exits out of the existing namespace. Read more

+

Enters into a namespace.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.Region.html b/rustdoc/latest/halo2/circuit/struct.Region.html new file mode 100644 index 00000000..3c156bbf --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.Region.html @@ -0,0 +1,100 @@ +Region in halo2::circuit - Rust + + + +

Struct halo2::circuit::Region[][src]

pub struct Region<'r, F: Field> { /* fields omitted */ }
Expand description

A region of the circuit in which a Chip can assign cells.

+

Inside a region, the chip may freely use relative offsets; the Layouter will +treat these assignments as a single “region” within the circuit.

+

The Layouter is allowed to optimise between regions as it sees fit. Chips must use +Region::constrain_equal to copy in variables assigned in other regions.

+

TODO: It would be great if we could constrain the columns in these types to be +“logical” columns that are guaranteed to correspond to the chip (and have come from +Chip::Config).

+

Implementations

Assign an advice column value (witness).

+

Even though to has FnMut bounds, it is guaranteed to be called at most once.

+

Assign a fixed value.

+

Even though to has FnMut bounds, it is guaranteed to be called at most once.

+

Constraint two cells to have the same value.

+

Returns an error if either of the cells is not within the given permutation.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.RegionIndex.html b/rustdoc/latest/halo2/circuit/struct.RegionIndex.html new file mode 100644 index 00000000..d797d157 --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.RegionIndex.html @@ -0,0 +1,95 @@ +RegionIndex in halo2::circuit - Rust + + + +

Struct halo2::circuit::RegionIndex[][src]

pub struct RegionIndex(_);
Expand description

Index of a region in a layouter

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

The resulting type after dereferencing.

+

Dereferences the value.

+

Performs the conversion.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.RegionStart.html b/rustdoc/latest/halo2/circuit/struct.RegionStart.html new file mode 100644 index 00000000..49c332ae --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.RegionStart.html @@ -0,0 +1,98 @@ +RegionStart in halo2::circuit - Rust + + + +

Struct halo2::circuit::RegionStart[][src]

pub struct RegionStart(_);
Expand description

Starting row of a region in a layouter

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

The resulting type after dereferencing.

+

Dereferences the value.

+

Performs the conversion.

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/struct.SimpleFloorPlanner.html b/rustdoc/latest/halo2/circuit/struct.SimpleFloorPlanner.html new file mode 100644 index 00000000..cd8d8d9f --- /dev/null +++ b/rustdoc/latest/halo2/circuit/struct.SimpleFloorPlanner.html @@ -0,0 +1,90 @@ +SimpleFloorPlanner in halo2::circuit - Rust + + + +

Struct halo2::circuit::SimpleFloorPlanner[][src]

pub struct SimpleFloorPlanner;
Expand description

A simple FloorPlanner that performs minimal optimizations.

+

This floor planner is suitable for debugging circuits. It aims to reflect the circuit +“business logic” in the circuit layout as closely as possible. It uses a single-pass +layouter that does not reorder regions for optimal packing.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Given the provided cs, synthesize the given circuit. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/trait.Chip.html b/rustdoc/latest/halo2/circuit/trait.Chip.html new file mode 100644 index 00000000..4cfdd75e --- /dev/null +++ b/rustdoc/latest/halo2/circuit/trait.Chip.html @@ -0,0 +1,37 @@ +Chip in halo2::circuit - Rust + + + +

Trait halo2::circuit::Chip[][src]

pub trait Chip<F: FieldExt>: Sized {
+    type Config: Debug + Clone;
+    type Loaded: Debug + Clone;
+    fn config(&self) -> &Self::Config;
+
fn loaded(&self) -> &Self::Loaded; +}
Expand description

A chip implements a set of instructions that can be used by gadgets.

+

The chip stores state that is required at circuit synthesis time in +Chip::Config, which can be fetched via Chip::config.

+

The chip also loads any fixed configuration needed at synthesis time +using its own implementation of load, and stores it in Chip::Loaded. +This can be accessed via Chip::loaded.

+

Associated Types

A type that holds the configuration for this chip, and any other state it may need +during circuit synthesis, that can be derived during Circuit::configure.

+

A type that holds any general chip state that needs to be loaded at the start of +Circuit::synthesize. This might simply be () for some chips.

+

Required methods

The chip holds its own configuration.

+

Provides access to general chip state loaded at the beginning of circuit +synthesis.

+

Panics if called before Chip::load.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/circuit/trait.Layouter.html b/rustdoc/latest/halo2/circuit/trait.Layouter.html new file mode 100644 index 00000000..23e6c69c --- /dev/null +++ b/rustdoc/latest/halo2/circuit/trait.Layouter.html @@ -0,0 +1,49 @@ +Layouter in halo2::circuit - Rust + + + +

Trait halo2::circuit::Layouter[][src]

pub trait Layouter<F: Field> {
+    type Root: Layouter<F>;
+    fn assign_region<A, AR, N, NR>(
        &mut self,
        name: N,
        assignment: A
    ) -> Result<AR, Error>
    where
        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
        N: Fn() -> NR,
        NR: Into<String>
; +
fn get_root(&mut self) -> &mut Self::Root; +
fn push_namespace<NR, N>(&mut self, name_fn: N)
    where
        NR: Into<String>,
        N: FnOnce() -> NR
; +
fn pop_namespace(&mut self, gadget_name: Option<String>); + + fn namespace<NR, N>(
        &mut self,
        name_fn: N
    ) -> NamespacedLayouter<'_, F, Self::Root>
    where
        NR: Into<String>,
        N: FnOnce() -> NR
, + { ... } +}
Expand description

A layout strategy within a circuit. The layouter is chip-agnostic and applies its +strategy to the context and config it is given.

+

This abstracts over the circuit assignments, handling row indices etc.

+

Associated Types

Represents the type of the “root” of this layouter, so that nested namespaces +can minimize indirection.

+

Required methods

Assign a region of gates to an absolute row number.

+

Inside the closure, the chip may freely use relative offsets; the Layouter will +treat these assignments as a single “region” within the circuit. Outside this +closure, the Layouter is allowed to optimise as it sees fit.

+ +
+fn assign_region(&mut self, || "region name", |region| {
+    let config = chip.config();
+    region.assign_advice(config.a, offset, || { Some(value)});
+});
+

Gets the “root” of this assignment, bypassing the namespacing.

+

Not intended for downstream consumption; use Layouter::namespace instead.

+

Creates a new (sub)namespace and enters into it.

+

Not intended for downstream consumption; use Layouter::namespace instead.

+

Exits out of the existing namespace.

+

Not intended for downstream consumption; use Layouter::namespace instead.

+

Provided methods

Enters into a namespace.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/enum.VerifyFailure.html b/rustdoc/latest/halo2/dev/enum.VerifyFailure.html new file mode 100644 index 00000000..8183b5a1 --- /dev/null +++ b/rustdoc/latest/halo2/dev/enum.VerifyFailure.html @@ -0,0 +1,132 @@ +VerifyFailure in halo2::dev - Rust + + + +

Enum halo2::dev::VerifyFailure[][src]

pub enum VerifyFailure {
+    Cell {
+        gate: Gate,
+        region: Region,
+        column: Column<Any>,
+        offset: isize,
+    },
+    Constraint {
+        constraint: Constraint,
+        row: usize,
+    },
+    Lookup {
+        lookup_index: usize,
+        row: usize,
+    },
+    Permutation {
+        perm_index: usize,
+        column: usize,
+        row: usize,
+    },
+}
Expand description

The reasons why a particular circuit is not satisfied.

+

Variants

Cell

A cell used in an active gate was not assigned to.

+
Show fields

Fields of Cell

gate: Gate

The index of the active gate.

+
region: Region

The region in which this cell should be assigned.

+
column: Column<Any>

The column in which this cell should be assigned.

+
offset: isize

The offset (relative to the start of the region) at which this cell should be +assigned. This may be negative (for example, if a selector enables a gate at +offset 0, but the gate uses Rotation::prev()).

+
Constraint

A constraint was not satisfied for a particular row.

+
Show fields

Fields of Constraint

constraint: Constraint

The polynomial constraint that is not satisfied.

+
row: usize

The row on which this constraint is not satisfied.

+
Lookup

A lookup input did not exist in its corresponding table.

+
Show fields

Fields of Lookup

lookup_index: usize

The index of the lookup that is not satisfied. These indices are assigned in +the order in which ConstraintSystem::lookup is called during +Circuit::configure.

+
row: usize

The row on which this lookup is not satisfied.

+
Permutation

A permutation did not preserve the original value of a cell.

+
Show fields

Fields of Permutation

perm_index: usize

The index of the permutation that is not satisfied. These indices are assigned +in the order in which ConstraintSystem::lookup is called during +Circuit::configure.

+
column: usize

The column in which this permutation is not satisfied.

+
row: usize

The row on which this permutation is not satisfied.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Converts the given value to a String. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/index.html b/rustdoc/latest/halo2/dev/index.html new file mode 100644 index 00000000..eb6e3fcf --- /dev/null +++ b/rustdoc/latest/halo2/dev/index.html @@ -0,0 +1,25 @@ +halo2::dev - Rust + + + +

Module halo2::dev[][src]

Expand description

Tools for developing circuits.

+

Modules

+

Metadata about circuits.

+

Structs

+

A test prover for debugging circuits.

+

Enums

+

The reasons why a particular circuit is not satisfied.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/metadata/index.html b/rustdoc/latest/halo2/dev/metadata/index.html new file mode 100644 index 00000000..c8964f3f --- /dev/null +++ b/rustdoc/latest/halo2/dev/metadata/index.html @@ -0,0 +1,23 @@ +halo2::dev::metadata - Rust + + + +

Module halo2::dev::metadata[][src]

Expand description

Metadata about circuits.

+

Structs

+

Metadata about a configured constraint within a circuit.

+

Metadata about a configured gate within a circuit.

+

Metadata about an assigned region within a circuit.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/metadata/sidebar-items.js b/rustdoc/latest/halo2/dev/metadata/sidebar-items.js new file mode 100644 index 00000000..01188025 --- /dev/null +++ b/rustdoc/latest/halo2/dev/metadata/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Constraint","Metadata about a configured constraint within a circuit."],["Gate","Metadata about a configured gate within a circuit."],["Region","Metadata about an assigned region within a circuit."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/metadata/struct.Constraint.html b/rustdoc/latest/halo2/dev/metadata/struct.Constraint.html new file mode 100644 index 00000000..d5e9b961 --- /dev/null +++ b/rustdoc/latest/halo2/dev/metadata/struct.Constraint.html @@ -0,0 +1,92 @@ +Constraint in halo2::dev::metadata - Rust + + + +

Struct halo2::dev::metadata::Constraint[][src]

pub struct Constraint { /* fields omitted */ }
Expand description

Metadata about a configured constraint within a circuit.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Converts the given value to a String. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/metadata/struct.Gate.html b/rustdoc/latest/halo2/dev/metadata/struct.Gate.html new file mode 100644 index 00000000..bbff2316 --- /dev/null +++ b/rustdoc/latest/halo2/dev/metadata/struct.Gate.html @@ -0,0 +1,92 @@ +Gate in halo2::dev::metadata - Rust + + + +

Struct halo2::dev::metadata::Gate[][src]

pub struct Gate { /* fields omitted */ }
Expand description

Metadata about a configured gate within a circuit.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Converts the given value to a String. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/metadata/struct.Region.html b/rustdoc/latest/halo2/dev/metadata/struct.Region.html new file mode 100644 index 00000000..56232ad8 --- /dev/null +++ b/rustdoc/latest/halo2/dev/metadata/struct.Region.html @@ -0,0 +1,92 @@ +Region in halo2::dev::metadata - Rust + + + +

Struct halo2::dev::metadata::Region[][src]

pub struct Region { /* fields omitted */ }
Expand description

Metadata about an assigned region within a circuit.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Converts the given value to a String. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/sidebar-items.js b/rustdoc/latest/halo2/dev/sidebar-items.js new file mode 100644 index 00000000..096174e6 --- /dev/null +++ b/rustdoc/latest/halo2/dev/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["VerifyFailure","The reasons why a particular circuit is not satisfied."]],"mod":[["metadata","Metadata about circuits."]],"struct":[["MockProver","A test prover for debugging circuits."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/dev/struct.MockProver.html b/rustdoc/latest/halo2/dev/struct.MockProver.html new file mode 100644 index 00000000..095b1b9d --- /dev/null +++ b/rustdoc/latest/halo2/dev/struct.MockProver.html @@ -0,0 +1,188 @@ +MockProver in halo2::dev - Rust + + + +

Struct halo2::dev::MockProver[][src]

pub struct MockProver<F: Group + Field> { /* fields omitted */ }
Expand description

A test prover for debugging circuits.

+

The normal proving process, when applied to a buggy circuit implementation, might +return proofs that do not validate when they should, but it can’t indicate anything +other than “something is invalid”. MockProver can be used to figure out why these +are invalid: it stores all the private inputs along with the circuit internals, and +then checks every constraint manually.

+

Examples

+
+use halo2::{
+    arithmetic::FieldExt,
+    circuit::{Layouter, SimpleFloorPlanner},
+    dev::{MockProver, VerifyFailure},
+    pasta::Fp,
+    plonk::{Advice, Circuit, Column, ConstraintSystem, Error},
+    poly::Rotation,
+};
+const K: u32 = 5;
+
+#[derive(Copy, Clone)]
+struct MyConfig {
+    a: Column<Advice>,
+    b: Column<Advice>,
+    c: Column<Advice>,
+}
+
+#[derive(Clone, Default)]
+struct MyCircuit {
+    a: Option<u64>,
+    b: Option<u64>,
+}
+
+impl<F: FieldExt> Circuit<F> for MyCircuit {
+    type Config = MyConfig;
+    type FloorPlanner = SimpleFloorPlanner;
+
+    fn without_witnesses(&self) -> Self {
+        Self::default()
+    }
+
+    fn configure(meta: &mut ConstraintSystem<F>) -> MyConfig {
+        let a = meta.advice_column();
+        let b = meta.advice_column();
+        let c = meta.advice_column();
+
+        meta.create_gate("R1CS constraint", |meta| {
+            let a = meta.query_advice(a, Rotation::cur());
+            let b = meta.query_advice(b, Rotation::cur());
+            let c = meta.query_advice(c, Rotation::cur());
+
+            // BUG: Should be a * b - c
+            Some(("buggy R1CS", a * b + c))
+        });
+
+        MyConfig { a, b, c }
+    }
+
+    fn synthesize(&self, config: MyConfig, mut layouter: impl Layouter<F>) -> Result<(), Error> {
+        layouter.assign_region(|| "Example region", |mut region| {
+            region.assign_advice(|| "a", config.a, 0, || {
+                self.a.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
+            })?;
+            region.assign_advice(|| "b", config.b, 0, || {
+                self.b.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
+            })?;
+            region.assign_advice(|| "c", config.c, 0, || {
+                self.a
+                    .and_then(|a| self.b.map(|b| F::from_u64(a * b)))
+                    .ok_or(Error::SynthesisError)
+            })?;
+            Ok(())
+        })
+    }
+}
+
+// Assemble the private inputs to the circuit.
+let circuit = MyCircuit {
+    a: Some(2),
+    b: Some(4),
+};
+
+// This circuit has no public inputs.
+let instance = vec![];
+
+let prover = MockProver::<Fp>::run(K, &circuit, instance).unwrap();
+assert_eq!(
+    prover.verify(),
+    Err(vec![VerifyFailure::Constraint {
+        constraint: ((0, "R1CS constraint").into(), 0, "buggy R1CS").into(),
+        row: 0
+    }])
+);
+

Implementations

Runs a synthetic keygen-and-prove operation on the given circuit, collecting data +about the constraints and their assignments.

+

Returns Ok(()) if this MockProver is satisfied, or a list of errors indicating +the reasons that the circuit is not satisfied.

+

Trait Implementations

Creates a new region and enters into it. Read more

+

Exits the current region. Read more

+

Enables a selector at the given row.

+

Assign an advice column value (witness)

+

Assign a fixed value

+

Assign two cells to have the same value

+

Creates a new (sub)namespace and enters into it. Read more

+

Exits out of the existing namespace. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/index.html b/rustdoc/latest/halo2/index.html new file mode 100644 index 00000000..56108688 --- /dev/null +++ b/rustdoc/latest/halo2/index.html @@ -0,0 +1,32 @@ +halo2 - Rust + + + +

Crate halo2[][src]

Expand description

Re-exports

+
pub use pasta_curves as pasta;

Modules

+

This module provides common utilities, traits and structures for group, +field and polynomial arithmetic.

+

Traits and structs for implementing circuit components.

+

Tools for developing circuits.

+

This module provides an implementation of a variant of (Turbo)PLONK +that is designed specifically for the polynomial commitment scheme described +in the Halo paper.

+

Contains utilities for performing arithmetic over univariate polynomials in +various forms, including computing commitments to them and provably opening +the committed polynomials at arbitrary points.

+

This module contains utilities and traits for dealing with Fiat-Shamir +transcripts.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/enum.Any.html b/rustdoc/latest/halo2/plonk/circuit/enum.Any.html new file mode 100644 index 00000000..d952dad7 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/enum.Any.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/enum.Any.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/enum.Assigned.html b/rustdoc/latest/halo2/plonk/circuit/enum.Assigned.html new file mode 100644 index 00000000..443e147c --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/enum.Assigned.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/enum.Assigned.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/enum.Expression.html b/rustdoc/latest/halo2/plonk/circuit/enum.Expression.html new file mode 100644 index 00000000..b2f5989f --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/enum.Expression.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/enum.Expression.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Advice.html b/rustdoc/latest/halo2/plonk/circuit/struct.Advice.html new file mode 100644 index 00000000..83dc59b4 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Advice.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Advice.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Column.html b/rustdoc/latest/halo2/plonk/circuit/struct.Column.html new file mode 100644 index 00000000..f06325ea --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Column.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Column.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Constraint.html b/rustdoc/latest/halo2/plonk/circuit/struct.Constraint.html new file mode 100644 index 00000000..7fc23934 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Constraint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Constraint.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.ConstraintSystem.html b/rustdoc/latest/halo2/plonk/circuit/struct.ConstraintSystem.html new file mode 100644 index 00000000..8e0f44fa --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.ConstraintSystem.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.ConstraintSystem.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Fixed.html b/rustdoc/latest/halo2/plonk/circuit/struct.Fixed.html new file mode 100644 index 00000000..dd063ce0 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Fixed.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Fixed.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Instance.html b/rustdoc/latest/halo2/plonk/circuit/struct.Instance.html new file mode 100644 index 00000000..e4140f4b --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Instance.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Instance.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Permutation.html b/rustdoc/latest/halo2/plonk/circuit/struct.Permutation.html new file mode 100644 index 00000000..a8b66898 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Permutation.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Permutation.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.PinnedConstraintSystem.html b/rustdoc/latest/halo2/plonk/circuit/struct.PinnedConstraintSystem.html new file mode 100644 index 00000000..dc18e511 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.PinnedConstraintSystem.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.PinnedConstraintSystem.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.Selector.html b/rustdoc/latest/halo2/plonk/circuit/struct.Selector.html new file mode 100644 index 00000000..3f1b8a4e --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.Selector.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.Selector.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/struct.VirtualCells.html b/rustdoc/latest/halo2/plonk/circuit/struct.VirtualCells.html new file mode 100644 index 00000000..ed43edf9 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/struct.VirtualCells.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/struct.VirtualCells.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/trait.Assignment.html b/rustdoc/latest/halo2/plonk/circuit/trait.Assignment.html new file mode 100644 index 00000000..3b071b44 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/trait.Assignment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/trait.Assignment.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/trait.Circuit.html b/rustdoc/latest/halo2/plonk/circuit/trait.Circuit.html new file mode 100644 index 00000000..476ae5fa --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/trait.Circuit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/trait.Circuit.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/trait.ColumnType.html b/rustdoc/latest/halo2/plonk/circuit/trait.ColumnType.html new file mode 100644 index 00000000..2a15f8b5 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/trait.ColumnType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/trait.ColumnType.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/circuit/trait.FloorPlanner.html b/rustdoc/latest/halo2/plonk/circuit/trait.FloorPlanner.html new file mode 100644 index 00000000..a291db85 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/circuit/trait.FloorPlanner.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/trait.FloorPlanner.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/enum.Any.html b/rustdoc/latest/halo2/plonk/enum.Any.html new file mode 100644 index 00000000..0a64cb95 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/enum.Any.html @@ -0,0 +1,107 @@ +Any in halo2::plonk - Rust + + + +

Enum halo2::plonk::Any[][src]

pub enum Any {
+    Advice,
+    Fixed,
+    Instance,
+}
Expand description

An enum over the Advice, Fixed, Instance structs

+

Variants

Advice

An Advice variant

+
Fixed

A Fixed variant

+
Instance

An Instance variant

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Performs the conversion.

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/enum.Assigned.html b/rustdoc/latest/halo2/plonk/enum.Assigned.html new file mode 100644 index 00000000..5d69f192 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/enum.Assigned.html @@ -0,0 +1,123 @@ +Assigned in halo2::plonk - Rust + + + +

Enum halo2::plonk::Assigned[][src]

pub enum Assigned<F> {
+    Zero,
+    Trivial(F),
+    Rational(F, F),
+}
Expand description

A value assigned to a cell within a circuit.

+

Stored as a fraction, so the backend can use batch inversion.

+

A denominator of zero maps to an assigned value of zero.

+

Variants

Zero

The field element zero.

+
Trivial(F)

A value that does not require inversion to evaluate.

+
Rational(F, F)

A value stored as a fraction to enable batch inversion.

+

Implementations

Returns the numerator.

+

Returns the denominator, if non-trivial.

+

Inverts this assigned value.

+

Evaluates this assigned value directly, performing an unbatched inversion if +necessary.

+

If the denominator is zero, this returns zero.

+

Trait Implementations

The resulting type after applying the + operator.

+

Performs the + operation. Read more

+

The resulting type after applying the + operator.

+

Performs the + operation. Read more

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the - operator.

+

Performs the unary - operation. Read more

+

The resulting type after applying the - operator.

+

Performs the - operation. Read more

+

The resulting type after applying the - operator.

+

Performs the - operation. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/enum.Error.html b/rustdoc/latest/halo2/plonk/enum.Error.html new file mode 100644 index 00000000..777ac02d --- /dev/null +++ b/rustdoc/latest/halo2/plonk/enum.Error.html @@ -0,0 +1,101 @@ +Error in halo2::plonk - Rust + + + +

Enum halo2::plonk::Error[][src]

pub enum Error {
+    SynthesisError,
+    IncompatibleParams,
+    ConstraintSystemFailure,
+    BoundsFailure,
+    OpeningError,
+    TranscriptError,
+}
Expand description

This is an error that could occur during proving or circuit synthesis.

+

Variants

SynthesisError

This is an error that can occur during synthesis of the circuit, for +example, when the witness is not present.

+
IncompatibleParams

The structured reference string or the parameters are not compatible +with the circuit being synthesized.

+
ConstraintSystemFailure

The constraint system is not satisfied.

+
BoundsFailure

Out of bounds index passed to a backend

+
OpeningError

Opening error

+
TranscriptError

Transcript error

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/enum.Expression.html b/rustdoc/latest/halo2/plonk/enum.Expression.html new file mode 100644 index 00000000..0f1db692 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/enum.Expression.html @@ -0,0 +1,123 @@ +Expression in halo2::plonk - Rust + + + +

Enum halo2::plonk::Expression[][src]

pub enum Expression<F> {
+    Constant(F),
+    Fixed(usize),
+    Advice(usize),
+    Instance(usize),
+    Sum(Box<Expression<F>>, Box<Expression<F>>),
+    Product(Box<Expression<F>>, Box<Expression<F>>),
+    Scaled(Box<Expression<F>>, F),
+}
Expand description

Low-degree expression representing an identity that must hold over the committed columns.

+

Variants

Constant(F)

This is a constant polynomial

+
Fixed(usize)

This is a fixed column queried at a certain relative location

+
Advice(usize)

This is an advice (witness) column queried at a certain relative location

+
Instance(usize)

This is an instance (external) column queried at a certain relative location

+
Sum(Box<Expression<F>>, Box<Expression<F>>)

This is the sum of two polynomials

+
Product(Box<Expression<F>>, Box<Expression<F>>)

This is the product of two polynomials

+
Scaled(Box<Expression<F>>, F)

This is a scaled polynomial

+

Implementations

Evaluate the polynomial using the provided closures to perform the +operations.

+

Compute the degree of this polynomial

+

Square this expression.

+

Trait Implementations

The resulting type after applying the + operator.

+

Performs the + operation. Read more

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the - operator.

+

Performs the unary - operation. Read more

+

The resulting type after applying the - operator.

+

Performs the - operation. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/fn.create_proof.html b/rustdoc/latest/halo2/plonk/fn.create_proof.html new file mode 100644 index 00000000..1aa1b3b9 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/fn.create_proof.html @@ -0,0 +1,21 @@ +create_proof in halo2::plonk - Rust + + + +

Function halo2::plonk::create_proof[][src]

pub fn create_proof<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>, ConcreteCircuit: Circuit<C::Scalar>>(
    params: &Params<C>,
    pk: &ProvingKey<C>,
    circuits: &[ConcreteCircuit],
    instances: &[&[Polynomial<C::Scalar, LagrangeCoeff>]],
    transcript: &mut T
) -> Result<(), Error>
Expand description

This creates a proof for the provided circuit when given the public +parameters params and the proving key ProvingKey that was +generated previously for the same circuit.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/fn.keygen_pk.html b/rustdoc/latest/halo2/plonk/fn.keygen_pk.html new file mode 100644 index 00000000..91a5cbed --- /dev/null +++ b/rustdoc/latest/halo2/plonk/fn.keygen_pk.html @@ -0,0 +1,19 @@ +keygen_pk in halo2::plonk - Rust + + + +

Function halo2::plonk::keygen_pk[][src]

pub fn keygen_pk<C, ConcreteCircuit>(
    params: &Params<C>,
    vk: VerifyingKey<C>,
    circuit: &ConcreteCircuit
) -> Result<ProvingKey<C>, Error> where
    C: CurveAffine,
    ConcreteCircuit: Circuit<C::Scalar>, 
Expand description

Generate a ProvingKey from a VerifyingKey and an instance of Circuit.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/fn.keygen_vk.html b/rustdoc/latest/halo2/plonk/fn.keygen_vk.html new file mode 100644 index 00000000..26303fa5 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/fn.keygen_vk.html @@ -0,0 +1,19 @@ +keygen_vk in halo2::plonk - Rust + + + +

Function halo2::plonk::keygen_vk[][src]

pub fn keygen_vk<C, ConcreteCircuit>(
    params: &Params<C>,
    circuit: &ConcreteCircuit
) -> Result<VerifyingKey<C>, Error> where
    C: CurveAffine,
    ConcreteCircuit: Circuit<C::Scalar>, 
Expand description

Generate a VerifyingKey from an instance of Circuit.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/fn.verify_proof.html b/rustdoc/latest/halo2/plonk/fn.verify_proof.html new file mode 100644 index 00000000..a1b5f9db --- /dev/null +++ b/rustdoc/latest/halo2/plonk/fn.verify_proof.html @@ -0,0 +1,19 @@ +verify_proof in halo2::plonk - Rust + + + +

Function halo2::plonk::verify_proof[][src]

pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
    params: &'a Params<C>,
    vk: &VerifyingKey<C>,
    msm: MSM<'a, C>,
    instance_commitments: &[&[C]],
    transcript: &mut T
) -> Result<Guard<'a, C, E>, Error>
Expand description

Returns a boolean indicating whether or not the proof is valid

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/index.html b/rustdoc/latest/halo2/plonk/index.html new file mode 100644 index 00000000..04a2fcc1 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/index.html @@ -0,0 +1,60 @@ +halo2::plonk - Rust + + + +

Module halo2::plonk[][src]

Expand description

This module provides an implementation of a variant of (Turbo)PLONK +that is designed specifically for the polynomial commitment scheme described +in the Halo paper.

+

Structs

+

An advice column

+

A column with an index and type

+

An individual polynomial constraint.

+

This is a description of the circuit environment, such as the gate, column and +permutation arrangements.

+

A fixed column

+

An instance column

+

A permutation.

+

Represents the minimal parameters that determine a ConstraintSystem.

+

Minimal representation of a verification key that can be used to identify +its active contents.

+

This is a proving key which allows for the creation of proofs for a +particular circuit.

+

A selector, representing a fixed boolean value per row of the circuit.

+

This is a verifying key which allows for the verification of proofs for a +particular circuit.

+

Exposes the “virtual cells” that can be queried while creating a custom gate or lookup +table.

+

Enums

+

An enum over the Advice, Fixed, Instance structs

+

A value assigned to a cell within a circuit.

+

This is an error that could occur during proving or circuit synthesis.

+

Low-degree expression representing an identity that must hold over the committed columns.

+

Traits

+

This trait allows a Circuit to direct some backend to assign a witness +for a constraint system.

+

This is a trait that circuits provide implementations for so that the +backend prover can ask the circuit to synthesize using some given +ConstraintSystem implementation.

+

A column type

+

A floor planning strategy for a circuit.

+

Functions

+

This creates a proof for the provided circuit when given the public +parameters params and the proving key ProvingKey that was +generated previously for the same circuit.

+

Generate a ProvingKey from a VerifyingKey and an instance of Circuit.

+

Generate a VerifyingKey from an instance of Circuit.

+

Returns a boolean indicating whether or not the proof is valid

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/keygen/fn.keygen_pk.html b/rustdoc/latest/halo2/plonk/keygen/fn.keygen_pk.html new file mode 100644 index 00000000..1fa3c4bf --- /dev/null +++ b/rustdoc/latest/halo2/plonk/keygen/fn.keygen_pk.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/fn.keygen_pk.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/keygen/fn.keygen_vk.html b/rustdoc/latest/halo2/plonk/keygen/fn.keygen_vk.html new file mode 100644 index 00000000..0b5cea3e --- /dev/null +++ b/rustdoc/latest/halo2/plonk/keygen/fn.keygen_vk.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/fn.keygen_vk.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/prover/fn.create_proof.html b/rustdoc/latest/halo2/plonk/prover/fn.create_proof.html new file mode 100644 index 00000000..1fed9860 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/prover/fn.create_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/fn.create_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/sidebar-items.js b/rustdoc/latest/halo2/plonk/sidebar-items.js new file mode 100644 index 00000000..81d67f73 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Any","An enum over the Advice, Fixed, Instance structs"],["Assigned","A value assigned to a cell within a circuit."],["Error","This is an error that could occur during proving or circuit synthesis."],["Expression","Low-degree expression representing an identity that must hold over the committed columns."]],"fn":[["create_proof","This creates a proof for the provided `circuit` when given the public parameters `params` and the proving key [`ProvingKey`] that was generated previously for the same circuit."],["keygen_pk","Generate a `ProvingKey` from a `VerifyingKey` and an instance of `Circuit`."],["keygen_vk","Generate a `VerifyingKey` from an instance of `Circuit`."],["verify_proof","Returns a boolean indicating whether or not the proof is valid"]],"struct":[["Advice","An advice column"],["Column","A column with an index and type"],["Constraint","An individual polynomial constraint."],["ConstraintSystem","This is a description of the circuit environment, such as the gate, column and permutation arrangements."],["Fixed","A fixed column"],["Instance","An instance column"],["Permutation","A permutation."],["PinnedConstraintSystem","Represents the minimal parameters that determine a `ConstraintSystem`."],["PinnedVerificationKey","Minimal representation of a verification key that can be used to identify its active contents."],["ProvingKey","This is a proving key which allows for the creation of proofs for a particular circuit."],["Selector","A selector, representing a fixed boolean value per row of the circuit."],["VerifyingKey","This is a verifying key which allows for the verification of proofs for a particular circuit."],["VirtualCells","Exposes the “virtual cells” that can be queried while creating a custom gate or lookup table."]],"trait":[["Assignment","This trait allows a [`Circuit`] to direct some backend to assign a witness for a constraint system."],["Circuit","This is a trait that circuits provide implementations for so that the backend prover can ask the circuit to synthesize using some given [`ConstraintSystem`] implementation."],["ColumnType","A column type"],["FloorPlanner","A floor planning strategy for a circuit."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Advice.html b/rustdoc/latest/halo2/plonk/struct.Advice.html new file mode 100644 index 00000000..4a6c2112 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Advice.html @@ -0,0 +1,98 @@ +Advice in halo2::plonk - Rust + + + +

Struct halo2::plonk::Advice[][src]

pub struct Advice;
Expand description

An advice column

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Column.html b/rustdoc/latest/halo2/plonk/struct.Column.html new file mode 100644 index 00000000..86fb7a2e --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Column.html @@ -0,0 +1,117 @@ +Column in halo2::plonk - Rust + + + +

Struct halo2::plonk::Column[][src]

pub struct Column<C: ColumnType> { /* fields omitted */ }
Expand description

A column with an index and type

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Performs the conversion.

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Constraint.html b/rustdoc/latest/halo2/plonk/struct.Constraint.html new file mode 100644 index 00000000..9597b9fc --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Constraint.html @@ -0,0 +1,89 @@ +Constraint in halo2::plonk - Rust + + + +

Struct halo2::plonk::Constraint[][src]

pub struct Constraint<F: Field> { /* fields omitted */ }
Expand description

An individual polynomial constraint.

+

These are returned by the closures passed to ConstraintSystem::create_gate.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.ConstraintSystem.html b/rustdoc/latest/halo2/plonk/struct.ConstraintSystem.html new file mode 100644 index 00000000..8ed5286f --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.ConstraintSystem.html @@ -0,0 +1,111 @@ +ConstraintSystem in halo2::plonk - Rust + + + +

Struct halo2::plonk::ConstraintSystem[][src]

pub struct ConstraintSystem<F: Field> { /* fields omitted */ }
Expand description

This is a description of the circuit environment, such as the gate, column and +permutation arrangements.

+

Implementations

Obtain a pinned version of this constraint system; a structure with the +minimal parameters needed to determine the rest of the constraint +system.

+

Add a permutation argument for some columns

+

Add a lookup argument for some input expressions and table expressions.

+

table_map returns a map between input expressions and the table expressions +they need to match.

+

Creates a new gate.

+

Panics

+

A gate is required to contain polynomial constraints. This method will panic if +constraints returns an empty iterator.

+

Allocate a new selector.

+

Allocate a new fixed column

+

Allocate a new advice column

+

Allocate a new instance column

+

Compute the degree of the constraint system (the maximum degree of all +constraints).

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Returns the “default value” for a type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Fixed.html b/rustdoc/latest/halo2/plonk/struct.Fixed.html new file mode 100644 index 00000000..1e941198 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Fixed.html @@ -0,0 +1,98 @@ +Fixed in halo2::plonk - Rust + + + +

Struct halo2::plonk::Fixed[][src]

pub struct Fixed;
Expand description

A fixed column

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Instance.html b/rustdoc/latest/halo2/plonk/struct.Instance.html new file mode 100644 index 00000000..c2baf1e3 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Instance.html @@ -0,0 +1,98 @@ +Instance in halo2::plonk - Rust + + + +

Struct halo2::plonk::Instance[][src]

pub struct Instance;
Expand description

An instance column

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Permutation.html b/rustdoc/latest/halo2/plonk/struct.Permutation.html new file mode 100644 index 00000000..46142b08 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Permutation.html @@ -0,0 +1,98 @@ +Permutation in halo2::plonk - Rust + + + +

Struct halo2::plonk::Permutation[][src]

pub struct Permutation { /* fields omitted */ }
Expand description

A permutation.

+

Implementations

Configures a new permutation for the given columns.

+

Returns index of permutation

+

Returns mapping of permutation

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.PinnedConstraintSystem.html b/rustdoc/latest/halo2/plonk/struct.PinnedConstraintSystem.html new file mode 100644 index 00000000..4d886c29 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.PinnedConstraintSystem.html @@ -0,0 +1,86 @@ +PinnedConstraintSystem in halo2::plonk - Rust + + + +

Struct halo2::plonk::PinnedConstraintSystem[][src]

pub struct PinnedConstraintSystem<'a, F: Field> { /* fields omitted */ }
Expand description

Represents the minimal parameters that determine a ConstraintSystem.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.PinnedVerificationKey.html b/rustdoc/latest/halo2/plonk/struct.PinnedVerificationKey.html new file mode 100644 index 00000000..be1d8ad2 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.PinnedVerificationKey.html @@ -0,0 +1,87 @@ +PinnedVerificationKey in halo2::plonk - Rust + + + +

Struct halo2::plonk::PinnedVerificationKey[][src]

pub struct PinnedVerificationKey<'a, C: CurveAffine> { /* fields omitted */ }
Expand description

Minimal representation of a verification key that can be used to identify +its active contents.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.ProvingKey.html b/rustdoc/latest/halo2/plonk/struct.ProvingKey.html new file mode 100644 index 00000000..42ffca21 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.ProvingKey.html @@ -0,0 +1,88 @@ +ProvingKey in halo2::plonk - Rust + + + +

Struct halo2::plonk::ProvingKey[][src]

pub struct ProvingKey<C: CurveAffine> { /* fields omitted */ }
Expand description

This is a proving key which allows for the creation of proofs for a +particular circuit.

+

Implementations

Get the underlying VerifyingKey.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.Selector.html b/rustdoc/latest/halo2/plonk/struct.Selector.html new file mode 100644 index 00000000..b01be373 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.Selector.html @@ -0,0 +1,137 @@ +Selector in halo2::plonk - Rust + + + +

Struct halo2::plonk::Selector[][src]

pub struct Selector(_);
Expand description

A selector, representing a fixed boolean value per row of the circuit.

+

Selectors can be used to conditionally enable (portions of) gates:

+ +
+use halo2::poly::Rotation;
+
+let a = meta.advice_column();
+let b = meta.advice_column();
+let s = meta.selector();
+
+meta.create_gate("foo", |meta| {
+    let a = meta.query_advice(a, Rotation::prev());
+    let b = meta.query_advice(b, Rotation::cur());
+    let s = meta.query_selector(s);
+
+    // On rows where the selector is enabled, a is constrained to equal b.
+    // On rows where the selector is disabled, a and b can take any value.
+    vec![s * (a - b)]
+});
+

Selectors are disabled on all rows by default, and must be explicitly enabled on each +row when required:

+ +
+use halo2::{arithmetic::FieldExt, circuit::{Chip, Layouter}, plonk::{Advice, Column, Error, Selector}};
+
+struct Config {
+    a: Column<Advice>,
+    b: Column<Advice>,
+    s: Selector,
+}
+
+fn circuit_logic<F: FieldExt, C: Chip<F>>(chip: C, mut layouter: impl Layouter<F>) -> Result<(), Error> {
+    let config = chip.config();
+    layouter.assign_region(|| "bar", |mut region| {
+        region.assign_advice(|| "a", config.a, 0, || Ok(F::one()))?;
+        region.assign_advice(|| "a", config.b, 1, || Ok(F::one()))?;
+        config.s.enable(&mut region, 1)
+    })?;
+    Ok(())
+}
+

Implementations

Enable this selector at the given offset within the given region.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.VerifyingKey.html b/rustdoc/latest/halo2/plonk/struct.VerifyingKey.html new file mode 100644 index 00000000..728496fe --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.VerifyingKey.html @@ -0,0 +1,93 @@ +VerifyingKey in halo2::plonk - Rust + + + +

Struct halo2::plonk::VerifyingKey[][src]

pub struct VerifyingKey<C: CurveAffine> { /* fields omitted */ }
Expand description

This is a verifying key which allows for the verification of proofs for a +particular circuit.

+

Implementations

Writes a verifying key to a buffer.

+

Reads a verification key from a buffer.

+

Hashes a verification key into a transcript.

+

Obtains a pinned representation of this verification key that contains +the minimal information necessary to reconstruct the verification key.

+

Get the underlying EvaluationDomain.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/struct.VirtualCells.html b/rustdoc/latest/halo2/plonk/struct.VirtualCells.html new file mode 100644 index 00000000..e9d8ea15 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/struct.VirtualCells.html @@ -0,0 +1,92 @@ +VirtualCells in halo2::plonk - Rust + + + +

Struct halo2::plonk::VirtualCells[][src]

pub struct VirtualCells<'a, F: Field> { /* fields omitted */ }
Expand description

Exposes the “virtual cells” that can be queried while creating a custom gate or lookup +table.

+

Implementations

Query a selector at the current position.

+

Query a fixed column at a relative position

+

Query an advice column at a relative position

+

Query an instance column at a relative position

+

Query an Any column at a relative position

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/trait.Assignment.html b/rustdoc/latest/halo2/plonk/trait.Assignment.html new file mode 100644 index 00000000..d70f38ed --- /dev/null +++ b/rustdoc/latest/halo2/plonk/trait.Assignment.html @@ -0,0 +1,43 @@ +Assignment in halo2::plonk - Rust + + + +

Trait halo2::plonk::Assignment[][src]

pub trait Assignment<F: Field> {
+    fn enter_region<NR, N>(&mut self, name_fn: N)
    where
        NR: Into<String>,
        N: FnOnce() -> NR
; +
fn exit_region(&mut self); +
fn enable_selector<A, AR>(
        &mut self,
        annotation: A,
        selector: &Selector,
        row: usize
    ) -> Result<(), Error>
    where
        A: FnOnce() -> AR,
        AR: Into<String>
; +
fn assign_advice<V, VR, A, AR>(
        &mut self,
        annotation: A,
        column: Column<Advice>,
        row: usize,
        to: V
    ) -> Result<(), Error>
    where
        V: FnOnce() -> Result<VR, Error>,
        VR: Into<Assigned<F>>,
        A: FnOnce() -> AR,
        AR: Into<String>
; +
fn assign_fixed<V, VR, A, AR>(
        &mut self,
        annotation: A,
        column: Column<Fixed>,
        row: usize,
        to: V
    ) -> Result<(), Error>
    where
        V: FnOnce() -> Result<VR, Error>,
        VR: Into<Assigned<F>>,
        A: FnOnce() -> AR,
        AR: Into<String>
; +
fn copy(
        &mut self,
        permutation: &Permutation,
        left_column: Column<Any>,
        left_row: usize,
        right_column: Column<Any>,
        right_row: usize
    ) -> Result<(), Error>; +
fn push_namespace<NR, N>(&mut self, name_fn: N)
    where
        NR: Into<String>,
        N: FnOnce() -> NR
; +
fn pop_namespace(&mut self, gadget_name: Option<String>); +}
Expand description

This trait allows a Circuit to direct some backend to assign a witness +for a constraint system.

+

Required methods

Creates a new region and enters into it.

+

Panics if we are currently in a region (if exit_region was not called).

+

Not intended for downstream consumption; use Layouter::assign_region instead.

+

Exits the current region.

+

Panics if we are not currently in a region (if enter_region was not called).

+

Not intended for downstream consumption; use Layouter::assign_region instead.

+

Enables a selector at the given row.

+

Assign an advice column value (witness)

+

Assign a fixed value

+

Assign two cells to have the same value

+

Creates a new (sub)namespace and enters into it.

+

Not intended for downstream consumption; use Layouter::namespace instead.

+

Exits out of the existing namespace.

+

Not intended for downstream consumption; use Layouter::namespace instead.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/trait.Circuit.html b/rustdoc/latest/halo2/plonk/trait.Circuit.html new file mode 100644 index 00000000..2299a17a --- /dev/null +++ b/rustdoc/latest/halo2/plonk/trait.Circuit.html @@ -0,0 +1,37 @@ +Circuit in halo2::plonk - Rust + + + +

Trait halo2::plonk::Circuit[][src]

pub trait Circuit<F: Field> {
+    type Config: Clone;
+    type FloorPlanner: FloorPlanner;
+    fn without_witnesses(&self) -> Self;
+
fn configure(meta: &mut ConstraintSystem<F>) -> Self::Config; +
fn synthesize(
        &self,
        config: Self::Config,
        layouter: impl Layouter<F>
    ) -> Result<(), Error>; +}
Expand description

This is a trait that circuits provide implementations for so that the +backend prover can ask the circuit to synthesize using some given +ConstraintSystem implementation.

+

Associated Types

This is a configuration object that stores things like columns.

+

The floor planner used for this circuit. This is an associated type of the +Circuit trait because its behaviour is circuit-critical.

+

Required methods

Returns a copy of this circuit with no witness values (i.e. all witnesses set to +None). For most circuits, this will be equal to Self::default().

+

The circuit is given an opportunity to describe the exact gate +arrangement, column arrangement, etc.

+

Given the provided cs, synthesize the circuit. The concrete type of +the caller will be different depending on the context, and they may or +may not expect to have a witness present.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/trait.ColumnType.html b/rustdoc/latest/halo2/plonk/trait.ColumnType.html new file mode 100644 index 00000000..44b99da8 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/trait.ColumnType.html @@ -0,0 +1,19 @@ +ColumnType in halo2::plonk - Rust + + + +

Trait halo2::plonk::ColumnType[][src]

pub trait ColumnType: 'static + Sized + Copy + Debug + PartialEq + Eq + Into<Any> { }
Expand description

A column type

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/trait.FloorPlanner.html b/rustdoc/latest/halo2/plonk/trait.FloorPlanner.html new file mode 100644 index 00000000..229ae81b --- /dev/null +++ b/rustdoc/latest/halo2/plonk/trait.FloorPlanner.html @@ -0,0 +1,31 @@ +FloorPlanner in halo2::plonk - Rust + + + +

Trait halo2::plonk::FloorPlanner[][src]

pub trait FloorPlanner {
+    fn synthesize<F: Field, CS: Assignment<F>, C: Circuit<F>>(
        cs: &mut CS,
        circuit: &C,
        config: C::Config
    ) -> Result<(), Error>; +}
Expand description

A floor planning strategy for a circuit.

+

The floor planner is chip-agnostic and applies its strategy to the circuit it is used +within.

+

Required methods

Given the provided cs, synthesize the given circuit.

+

Internally, a floor planner will perform the following operations:

+
    +
  • Instantiate a Layouter for this floor planner.
  • +
  • Perform any necessary setup or measurement tasks, which may involve one or more +calls to Circuit::default().synthesize(config, &mut layouter).
  • +
  • Call circuit.synthesize(config, &mut layouter) exactly once.
  • +
+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/plonk/verifier/fn.verify_proof.html b/rustdoc/latest/halo2/plonk/verifier/fn.verify_proof.html new file mode 100644 index 00000000..310b9543 --- /dev/null +++ b/rustdoc/latest/halo2/plonk/verifier/fn.verify_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/plonk/fn.verify_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/fn.create_proof.html b/rustdoc/latest/halo2/poly/commitment/fn.create_proof.html new file mode 100644 index 00000000..e0c17581 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/fn.create_proof.html @@ -0,0 +1,29 @@ +create_proof in halo2::poly::commitment - Rust + + + +

Function halo2::poly::commitment::create_proof[][src]

pub fn create_proof<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
    params: &Params<C>,
    transcript: &mut T,
    px: &Polynomial<C::Scalar, Coeff>,
    blind: Blind<C::Scalar>,
    x: C::Scalar
) -> Result<()>
Expand description

Create a polynomial commitment opening proof for the polynomial defined +by the coefficients px, the blinding factor blind used for the +polynomial commitment, and the point x that the polynomial is +evaluated at.

+

This function will panic if the provided polynomial is too large with +respect to the polynomial commitment parameters.

+

Important: This function assumes that the provided transcript has +already seen the common inputs: the polynomial commitment P, the claimed +opening v, and the point x. It’s probably also nice for the transcript +to have seen the elliptic curve description and the URS, if you want to +be rigorous.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/fn.verify_proof.html b/rustdoc/latest/halo2/poly/commitment/fn.verify_proof.html new file mode 100644 index 00000000..1fd08d42 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/fn.verify_proof.html @@ -0,0 +1,21 @@ +verify_proof in halo2::poly::commitment - Rust + + + +

Function halo2::poly::commitment::verify_proof[][src]

pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
    params: &'a Params<C>,
    msm: MSM<'a, C>,
    transcript: &mut T,
    x: C::Scalar,
    v: C::Scalar
) -> Result<Guard<'a, C, E>, Error>
Expand description

Checks to see if the proof represented within transcript is valid, and a +point x that the polynomial commitment P opens purportedly to the value +v. The provided msm should evaluate to the commitment P being opened.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/index.html b/rustdoc/latest/halo2/poly/commitment/index.html new file mode 100644 index 00000000..3a560e0a --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/index.html @@ -0,0 +1,34 @@ +halo2::poly::commitment - Rust + + + +

Module halo2::poly::commitment[][src]

Expand description

This module contains an implementation of the polynomial commitment scheme +described in the Halo paper.

+

Structs

+

An accumulator instance consisting of an evaluation claim and a proof.

+

Wrapper type around a blinding factor.

+

A guard returned by the verifier

+

A multiscalar multiplication in the polynomial commitment scheme

+

These are the public parameters for the polynomial commitment scheme.

+

Functions

+

Create a polynomial commitment opening proof for the polynomial defined +by the coefficients px, the blinding factor blind used for the +polynomial commitment, and the point x that the polynomial is +evaluated at.

+

Checks to see if the proof represented within transcript is valid, and a +point x that the polynomial commitment P opens purportedly to the value +v. The provided msm should evaluate to the commitment P being opened.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/msm/struct.MSM.html b/rustdoc/latest/halo2/poly/commitment/msm/struct.MSM.html new file mode 100644 index 00000000..c8d7c557 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/msm/struct.MSM.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/commitment/struct.MSM.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/prover/fn.create_proof.html b/rustdoc/latest/halo2/poly/commitment/prover/fn.create_proof.html new file mode 100644 index 00000000..b8da806f --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/prover/fn.create_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/commitment/fn.create_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/sidebar-items.js b/rustdoc/latest/halo2/poly/commitment/sidebar-items.js new file mode 100644 index 00000000..73268145 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["create_proof","Create a polynomial commitment opening proof for the polynomial defined by the coefficients `px`, the blinding factor `blind` used for the polynomial commitment, and the point `x` that the polynomial is evaluated at."],["verify_proof","Checks to see if the proof represented within `transcript` is valid, and a point `x` that the polynomial commitment `P` opens purportedly to the value `v`. The provided `msm` should evaluate to the commitment `P` being opened."]],"struct":[["Accumulator","An accumulator instance consisting of an evaluation claim and a proof."],["Blind","Wrapper type around a blinding factor."],["Guard","A guard returned by the verifier"],["MSM","A multiscalar multiplication in the polynomial commitment scheme"],["Params","These are the public parameters for the polynomial commitment scheme."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/struct.Accumulator.html b/rustdoc/latest/halo2/poly/commitment/struct.Accumulator.html new file mode 100644 index 00000000..6bfdc68c --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/struct.Accumulator.html @@ -0,0 +1,98 @@ +Accumulator in halo2::poly::commitment - Rust + + + +

Struct halo2::poly::commitment::Accumulator[][src]

pub struct Accumulator<C: CurveAffine, E: EncodedChallenge<C>> {
+    pub g: C,
+    pub challenges_packed: Vec<E>,
+}
Expand description

An accumulator instance consisting of an evaluation claim and a proof.

+

Fields

g: C

The claimed output of the linear-time polycommit opening protocol

+
challenges_packed: Vec<E>

A vector of 128-bit challenges sampled by the verifier, to be used in +computing g.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/struct.Blind.html b/rustdoc/latest/halo2/poly/commitment/struct.Blind.html new file mode 100644 index 00000000..e018ae4e --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/struct.Blind.html @@ -0,0 +1,104 @@ +Blind in halo2::poly::commitment - Rust + + + +

Struct halo2::poly::commitment::Blind[][src]

pub struct Blind<F>(pub F);
Expand description

Wrapper type around a blinding factor.

+

Trait Implementations

The resulting type after applying the + operator.

+

Performs the + operation. Read more

+

Performs the += operation. Read more

+

Performs the += operation. Read more

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Returns the “default value” for a type. Read more

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

Performs the *= operation. Read more

+

Performs the *= operation. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/struct.Guard.html b/rustdoc/latest/halo2/poly/commitment/struct.Guard.html new file mode 100644 index 00000000..a2092b8e --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/struct.Guard.html @@ -0,0 +1,97 @@ +Guard in halo2::poly::commitment - Rust + + + +

Struct halo2::poly::commitment::Guard[][src]

pub struct Guard<'a, C: CurveAffine, E: EncodedChallenge<C>> { /* fields omitted */ }
Expand description

A guard returned by the verifier

+

Implementations

Lets caller supply the challenges and obtain an MSM with updated +scalars and points.

+

Lets caller supply the purported G point and simply appends +[-a] G to return an updated MSM.

+

Computes G + H, where G = ⟨s, params.g⟩ and H is used for blinding

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/struct.MSM.html b/rustdoc/latest/halo2/poly/commitment/struct.MSM.html new file mode 100644 index 00000000..99a8f059 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/struct.MSM.html @@ -0,0 +1,102 @@ +MSM in halo2::poly::commitment - Rust + + + +

Struct halo2::poly::commitment::MSM[][src]

pub struct MSM<'a, C: CurveAffine> { /* fields omitted */ }
Expand description

A multiscalar multiplication in the polynomial commitment scheme

+

Implementations

Create a new, empty MSM using the provided parameters.

+

Add another multiexp into this one

+

Add arbitrary term (the scalar and the point)

+

Add a value to the first entry of g_scalars.

+

Add a vector of scalars to g_scalars. This function will panic if the +caller provides a slice of scalars that is not of length params.n.

+

Add to h_scalar

+

Add to u_scalar

+

Scale all scalars in the MSM by some scaling factor

+

Perform multiexp and check that it results in zero

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/struct.Params.html b/rustdoc/latest/halo2/poly/commitment/struct.Params.html new file mode 100644 index 00000000..4fce5586 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/struct.Params.html @@ -0,0 +1,99 @@ +Params in halo2::poly::commitment - Rust + + + +

Struct halo2::poly::commitment::Params[][src]

pub struct Params<C: CurveAffine> { /* fields omitted */ }
Expand description

These are the public parameters for the polynomial commitment scheme.

+

Implementations

Initializes parameters for the curve, given a random oracle to draw +points from.

+

This computes a commitment to a polynomial described by the provided +slice of coefficients. The commitment will be blinded by the blinding +factor r.

+

This commits to a polynomial using its evaluations over the $2^k$ size +evaluation domain. The commitment will be blinded by the blinding factor +r.

+

Generates an empty multiscalar multiplication struct using the +appropriate params.

+

Getter for g generators

+

Writes params to a buffer.

+

Reads params from a buffer.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/verifier/fn.verify_proof.html b/rustdoc/latest/halo2/poly/commitment/verifier/fn.verify_proof.html new file mode 100644 index 00000000..0b072b8a --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/verifier/fn.verify_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/commitment/fn.verify_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/verifier/struct.Accumulator.html b/rustdoc/latest/halo2/poly/commitment/verifier/struct.Accumulator.html new file mode 100644 index 00000000..786f56c6 --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/verifier/struct.Accumulator.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/commitment/struct.Accumulator.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/commitment/verifier/struct.Guard.html b/rustdoc/latest/halo2/poly/commitment/verifier/struct.Guard.html new file mode 100644 index 00000000..31a42b1f --- /dev/null +++ b/rustdoc/latest/halo2/poly/commitment/verifier/struct.Guard.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/commitment/struct.Guard.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/domain/struct.EvaluationDomain.html b/rustdoc/latest/halo2/poly/domain/struct.EvaluationDomain.html new file mode 100644 index 00000000..62bf894d --- /dev/null +++ b/rustdoc/latest/halo2/poly/domain/struct.EvaluationDomain.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/poly/struct.EvaluationDomain.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/domain/struct.PinnedEvaluationDomain.html b/rustdoc/latest/halo2/poly/domain/struct.PinnedEvaluationDomain.html new file mode 100644 index 00000000..df3f0f9f --- /dev/null +++ b/rustdoc/latest/halo2/poly/domain/struct.PinnedEvaluationDomain.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../halo2/poly/struct.PinnedEvaluationDomain.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/enum.Error.html b/rustdoc/latest/halo2/poly/enum.Error.html new file mode 100644 index 00000000..68f70fc1 --- /dev/null +++ b/rustdoc/latest/halo2/poly/enum.Error.html @@ -0,0 +1,91 @@ +Error in halo2::poly - Rust + + + +

Enum halo2::poly::Error[][src]

pub enum Error {
+    OpeningError,
+    SamplingError,
+}
Expand description

This is an error that could occur during proving or circuit synthesis.

+

Variants

OpeningError

OpeningProof is not well-formed

+
SamplingError

Caller needs to re-sample a point

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/index.html b/rustdoc/latest/halo2/poly/index.html new file mode 100644 index 00000000..314c82d0 --- /dev/null +++ b/rustdoc/latest/halo2/poly/index.html @@ -0,0 +1,44 @@ +halo2::poly - Rust + + + +

Module halo2::poly[][src]

Expand description

Contains utilities for performing arithmetic over univariate polynomials in +various forms, including computing commitments to them and provably opening +the committed polynomials at arbitrary points.

+

Modules

+

This module contains an implementation of the polynomial commitment scheme +described in the Halo paper.

+

This module contains an optimisation of the polynomial commitment opening +scheme described in the Halo paper.

+

Structs

+

The polynomial is defined as coefficients

+

This structure contains precomputed constants and other details needed for +performing operations on an evaluation domain of size $2^k$ and an extended +domain of size $2^{k} * j$ with $j \neq 0$.

+

The polynomial is defined as coefficients of Lagrange basis polynomials in +an extended size domain which supports multiplication

+

The polynomial is defined as coefficients of Lagrange basis polynomials

+

Represents the minimal parameters that determine an EvaluationDomain.

+

Represents a univariate polynomial defined over a field and a particular +basis.

+

Describes the relative rotation of a vector. Negative numbers represent +reverse (leftmost) rotations and positive numbers represent forward (rightmost) +rotations. Zero represents no rotation.

+

Enums

+

This is an error that could occur during proving or circuit synthesis.

+

Traits

+

The basis over which a polynomial is described.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/fn.create_proof.html b/rustdoc/latest/halo2/poly/multiopen/fn.create_proof.html new file mode 100644 index 00000000..fade525f --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/fn.create_proof.html @@ -0,0 +1,19 @@ +create_proof in halo2::poly::multiopen - Rust + + + +

Function halo2::poly::multiopen::create_proof[][src]

pub fn create_proof<'a, I, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
    params: &Params<C>,
    transcript: &mut T,
    queries: I
) -> Result<()> where
    I: IntoIterator<Item = ProverQuery<'a, C>> + Clone
Expand description

Create a multi-opening proof

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/fn.verify_proof.html b/rustdoc/latest/halo2/poly/multiopen/fn.verify_proof.html new file mode 100644 index 00000000..011140f9 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/fn.verify_proof.html @@ -0,0 +1,19 @@ +verify_proof in halo2::poly::multiopen - Rust + + + +

Function halo2::poly::multiopen::verify_proof[][src]

pub fn verify_proof<'b, 'a: 'b, I, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
    params: &'a Params<C>,
    transcript: &mut T,
    queries: I,
    msm: MSM<'a, C>
) -> Result<Guard<'a, C, E>, Error> where
    I: IntoIterator<Item = VerifierQuery<'b, C>> + Clone
Expand description

Verify a multi-opening proof

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/index.html b/rustdoc/latest/halo2/poly/multiopen/index.html new file mode 100644 index 00000000..d79c7474 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/index.html @@ -0,0 +1,26 @@ +halo2::poly::multiopen - Rust + + + +

Module halo2::poly::multiopen[][src]

Expand description

This module contains an optimisation of the polynomial commitment opening +scheme described in the Halo paper.

+

Structs

+

A polynomial query at a point

+

A polynomial query at a point

+

Functions

+

Create a multi-opening proof

+

Verify a multi-opening proof

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/prover/fn.create_proof.html b/rustdoc/latest/halo2/poly/multiopen/prover/fn.create_proof.html new file mode 100644 index 00000000..8ef8c5d2 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/prover/fn.create_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/multiopen/fn.create_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/sidebar-items.js b/rustdoc/latest/halo2/poly/multiopen/sidebar-items.js new file mode 100644 index 00000000..cdb02cc7 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["create_proof","Create a multi-opening proof"],["verify_proof","Verify a multi-opening proof"]],"struct":[["ProverQuery","A polynomial query at a point"],["VerifierQuery","A polynomial query at a point"]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/struct.ProverQuery.html b/rustdoc/latest/halo2/poly/multiopen/struct.ProverQuery.html new file mode 100644 index 00000000..f4506183 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/struct.ProverQuery.html @@ -0,0 +1,99 @@ +ProverQuery in halo2::poly::multiopen - Rust + + + +

Struct halo2::poly::multiopen::ProverQuery[][src]

pub struct ProverQuery<'a, C: CurveAffine> {
+    pub point: C::Scalar,
+    pub poly: &'a Polynomial<C::Scalar, Coeff>,
+    pub blind: Blind<C::Scalar>,
+}
Expand description

A polynomial query at a point

+

Fields

point: C::Scalar

point at which polynomial is queried

+
poly: &'a Polynomial<C::Scalar, Coeff>

coefficients of polynomial

+
blind: Blind<C::Scalar>

blinding factor of polynomial

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/struct.VerifierQuery.html b/rustdoc/latest/halo2/poly/multiopen/struct.VerifierQuery.html new file mode 100644 index 00000000..5614f9c7 --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/struct.VerifierQuery.html @@ -0,0 +1,99 @@ +VerifierQuery in halo2::poly::multiopen - Rust + + + +

Struct halo2::poly::multiopen::VerifierQuery[][src]

pub struct VerifierQuery<'a, C: CurveAffine> {
+    pub point: C::Scalar,
+    pub commitment: &'a C,
+    pub eval: C::Scalar,
+}
Expand description

A polynomial query at a point

+

Fields

point: C::Scalar

point at which polynomial is queried

+
commitment: &'a C

commitment to polynomial

+
eval: C::Scalar

evaluation of polynomial at query point

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/multiopen/verifier/fn.verify_proof.html b/rustdoc/latest/halo2/poly/multiopen/verifier/fn.verify_proof.html new file mode 100644 index 00000000..738abbfe --- /dev/null +++ b/rustdoc/latest/halo2/poly/multiopen/verifier/fn.verify_proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../halo2/poly/multiopen/fn.verify_proof.html...

+ + + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/sidebar-items.js b/rustdoc/latest/halo2/poly/sidebar-items.js new file mode 100644 index 00000000..19edd6a1 --- /dev/null +++ b/rustdoc/latest/halo2/poly/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Error","This is an error that could occur during proving or circuit synthesis."]],"mod":[["commitment","This module contains an implementation of the polynomial commitment scheme described in the Halo paper."],["multiopen","This module contains an optimisation of the polynomial commitment opening scheme described in the Halo paper."]],"struct":[["Coeff","The polynomial is defined as coefficients"],["EvaluationDomain","This structure contains precomputed constants and other details needed for performing operations on an evaluation domain of size $2^k$ and an extended domain of size $2^{k} * j$ with $j \\neq 0$."],["ExtendedLagrangeCoeff","The polynomial is defined as coefficients of Lagrange basis polynomials in an extended size domain which supports multiplication"],["LagrangeCoeff","The polynomial is defined as coefficients of Lagrange basis polynomials"],["PinnedEvaluationDomain","Represents the minimal parameters that determine an `EvaluationDomain`."],["Polynomial","Represents a univariate polynomial defined over a field and a particular basis."],["Rotation","Describes the relative rotation of a vector. Negative numbers represent reverse (leftmost) rotations and positive numbers represent forward (rightmost) rotations. Zero represents no rotation."]],"trait":[["Basis","The basis over which a polynomial is described."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.Coeff.html b/rustdoc/latest/halo2/poly/struct.Coeff.html new file mode 100644 index 00000000..2fc32233 --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.Coeff.html @@ -0,0 +1,92 @@ +Coeff in halo2::poly - Rust + + + +

Struct halo2::poly::Coeff[][src]

pub struct Coeff;
Expand description

The polynomial is defined as coefficients

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.EvaluationDomain.html b/rustdoc/latest/halo2/poly/struct.EvaluationDomain.html new file mode 100644 index 00000000..891465fa --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.EvaluationDomain.html @@ -0,0 +1,126 @@ +EvaluationDomain in halo2::poly - Rust + + + +

Struct halo2::poly::EvaluationDomain[][src]

pub struct EvaluationDomain<G: Group> { /* fields omitted */ }
Expand description

This structure contains precomputed constants and other details needed for +performing operations on an evaluation domain of size $2^k$ and an extended +domain of size $2^{k} * j$ with $j \neq 0$.

+

Implementations

This constructs a new evaluation domain object based on the provided +values $j, k$.

+

Obtains a polynomial in Lagrange form when given a vector of Lagrange +coefficients of size n; panics if the provided vector is the wrong +length.

+

Obtains a polynomial in coefficient form when given a vector of +coefficients of size n; panics if the provided vector is the wrong +length.

+

Returns an empty (zero) polynomial in the coefficient basis

+

Returns an empty (zero) polynomial in the Lagrange coefficient basis

+

Returns a constant polynomial in the Lagrange coefficient basis

+

Returns an empty (zero) polynomial in the extended Lagrange coefficient +basis

+

Returns a constant polynomial in the extended Lagrange coefficient +basis

+

This takes us from an n-length vector into the coefficient form.

+

This function will panic if the provided vector is not the correct +length.

+

This takes us from an n-length coefficient vector into a coset of the extended +evaluation domain, rotating by rotation if desired.

+

This takes us from the extended evaluation domain and gets us the +quotient polynomial coefficients.

+

This function will panic if the provided vector is not the correct +length.

+

This divides the polynomial (in the extended domain) by the vanishing +polynomial of the $2^k$ size domain.

+

Get the size of the extended domain

+

Get $\omega$, the generator of the $2^k$ order multiplicative subgroup.

+

Get $\omega^{-1}$, the inverse of the generator of the $2^k$ order +multiplicative subgroup.

+

Get the generator of the extended domain’s multiplicative subgroup.

+

Multiplies a value by some power of $\omega$, essentially rotating over +the domain.

+

Gets the barycentric weight of $1$ over the $2^k$ size domain.

+

Gets the quotient polynomial’s degree (as a multiple of n)

+

Obtain a pinned version of this evaluation domain; a structure with the +minimal parameters needed to determine the rest of the evaluation +domain.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.ExtendedLagrangeCoeff.html b/rustdoc/latest/halo2/poly/struct.ExtendedLagrangeCoeff.html new file mode 100644 index 00000000..9512d662 --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.ExtendedLagrangeCoeff.html @@ -0,0 +1,93 @@ +ExtendedLagrangeCoeff in halo2::poly - Rust + + + +

Struct halo2::poly::ExtendedLagrangeCoeff[][src]

pub struct ExtendedLagrangeCoeff;
Expand description

The polynomial is defined as coefficients of Lagrange basis polynomials in +an extended size domain which supports multiplication

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.LagrangeCoeff.html b/rustdoc/latest/halo2/poly/struct.LagrangeCoeff.html new file mode 100644 index 00000000..f94bf5a9 --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.LagrangeCoeff.html @@ -0,0 +1,92 @@ +LagrangeCoeff in halo2::poly - Rust + + + +

Struct halo2::poly::LagrangeCoeff[][src]

pub struct LagrangeCoeff;
Expand description

The polynomial is defined as coefficients of Lagrange basis polynomials

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.PinnedEvaluationDomain.html b/rustdoc/latest/halo2/poly/struct.PinnedEvaluationDomain.html new file mode 100644 index 00000000..f9980404 --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.PinnedEvaluationDomain.html @@ -0,0 +1,86 @@ +PinnedEvaluationDomain in halo2::poly - Rust + + + +

Struct halo2::poly::PinnedEvaluationDomain[][src]

pub struct PinnedEvaluationDomain<'a, G: Group> { /* fields omitted */ }
Expand description

Represents the minimal parameters that determine an EvaluationDomain.

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.Polynomial.html b/rustdoc/latest/halo2/poly/struct.Polynomial.html new file mode 100644 index 00000000..5950d141 --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.Polynomial.html @@ -0,0 +1,121 @@ +Polynomial in halo2::poly - Rust + + + +

Struct halo2::poly::Polynomial[][src]

pub struct Polynomial<F, B> { /* fields omitted */ }
Expand description

Represents a univariate polynomial defined over a field and a particular +basis.

+

Implementations

Iterate over the values, which are either in coefficient or evaluation +form depending on the basis B.

+

Iterate over the values mutably, which are either in coefficient or +evaluation form depending on the basis B.

+

Gets the size of this polynomial in terms of the number of +coefficients used to describe it.

+

Maps every coefficient c in p to 1 - c.

+

Rotates the values in a Lagrange basis polynomial by Rotation

+

Trait Implementations

The resulting type after applying the + operator.

+

Performs the + operation. Read more

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

The resulting type after dereferencing.

+

Dereferences the value.

+

Mutably dereferences the value.

+

The returned type after indexing.

+

Performs the indexing (container[index]) operation. Read more

+

The returned type after indexing.

+

Performs the indexing (container[index]) operation. Read more

+

The returned type after indexing.

+

Performs the indexing (container[index]) operation. Read more

+

Performs the mutable indexing (container[index]) operation. Read more

+

Performs the mutable indexing (container[index]) operation. Read more

+

Performs the mutable indexing (container[index]) operation. Read more

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the * operator.

+

Performs the * operation. Read more

+

The resulting type after applying the - operator.

+

Performs the - operation. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/struct.Rotation.html b/rustdoc/latest/halo2/poly/struct.Rotation.html new file mode 100644 index 00000000..3ae982bc --- /dev/null +++ b/rustdoc/latest/halo2/poly/struct.Rotation.html @@ -0,0 +1,101 @@ +Rotation in halo2::poly - Rust + + + +

Struct halo2::poly::Rotation[][src]

pub struct Rotation(pub i32);
Expand description

Describes the relative rotation of a vector. Negative numbers represent +reverse (leftmost) rotations and positive numbers represent forward (rightmost) +rotations. Zero represents no rotation.

+

Implementations

The current location in the evaluation domain

+

The previous location in the evaluation domain

+

The next location in the evaluation domain

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Returns the “default value” for a type. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/poly/trait.Basis.html b/rustdoc/latest/halo2/poly/trait.Basis.html new file mode 100644 index 00000000..7d8a9d27 --- /dev/null +++ b/rustdoc/latest/halo2/poly/trait.Basis.html @@ -0,0 +1,19 @@ +Basis in halo2::poly - Rust + + + +

Trait halo2::poly::Basis[][src]

pub trait Basis: Clone + Debug + Send + Sync { }
Expand description

The basis over which a polynomial is described.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/sidebar-items.js b/rustdoc/latest/halo2/sidebar-items.js new file mode 100644 index 00000000..ce89e3d4 --- /dev/null +++ b/rustdoc/latest/halo2/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"mod":[["arithmetic","This module provides common utilities, traits and structures for group, field and polynomial arithmetic."],["circuit","Traits and structs for implementing circuit components."],["dev","Tools for developing circuits."],["plonk","This module provides an implementation of a variant of (Turbo)PLONK that is designed specifically for the polynomial commitment scheme described in the Halo paper."],["poly","Contains utilities for performing arithmetic over univariate polynomials in various forms, including computing commitments to them and provably opening the committed polynomials at arbitrary points."],["transcript","This module contains utilities and traits for dealing with Fiat-Shamir transcripts."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/index.html b/rustdoc/latest/halo2/transcript/index.html new file mode 100644 index 00000000..4b3592a5 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/index.html @@ -0,0 +1,34 @@ +halo2::transcript - Rust + + + +

Module halo2::transcript[][src]

Expand description

This module contains utilities and traits for dealing with Fiat-Shamir +transcripts.

+

Structs

+

We will replace BLAKE2b with an algebraic hash function in a later version.

+

We will replace BLAKE2b with an algebraic hash function in a later version.

+

A 255-bit challenge.

+

The scalar representation of a verifier challenge.

+

Traits

+

EncodedChallenge<C> defines a challenge encoding with a Self::Input +that is used to derive the challenge encoding and get_challenge obtains +the real C::Scalar that the challenge encoding represents.

+

Generic transcript view (from either the prover or verifier’s perspective)

+

Transcript view from the perspective of a verifier that has access to an +input stream of data from the prover to the verifier.

+

Transcript view from the perspective of a prover that has access to an +output stream of messages from the prover to the verifier.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/sidebar-items.js b/rustdoc/latest/halo2/transcript/sidebar-items.js new file mode 100644 index 00000000..8d31a035 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Blake2bRead","We will replace BLAKE2b with an algebraic hash function in a later version."],["Blake2bWrite","We will replace BLAKE2b with an algebraic hash function in a later version."],["Challenge255","A 255-bit challenge."],["ChallengeScalar","The scalar representation of a verifier challenge."]],"trait":[["EncodedChallenge","`EncodedChallenge` defines a challenge encoding with a [`Self::Input`] that is used to derive the challenge encoding and `get_challenge` obtains the real `C::Scalar` that the challenge encoding represents."],["Transcript","Generic transcript view (from either the prover or verifier’s perspective)"],["TranscriptRead","Transcript view from the perspective of a verifier that has access to an input stream of data from the prover to the verifier."],["TranscriptWrite","Transcript view from the perspective of a prover that has access to an output stream of messages from the prover to the verifier."]]}); \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/struct.Blake2bRead.html b/rustdoc/latest/halo2/transcript/struct.Blake2bRead.html new file mode 100644 index 00000000..3b0e154a --- /dev/null +++ b/rustdoc/latest/halo2/transcript/struct.Blake2bRead.html @@ -0,0 +1,101 @@ +Blake2bRead in halo2::transcript - Rust + + + +

Struct halo2::transcript::Blake2bRead[][src]

pub struct Blake2bRead<R: Read, C: CurveAffine, E: EncodedChallenge<C>> { /* fields omitted */ }
Expand description

We will replace BLAKE2b with an algebraic hash function in a later version.

+

Implementations

Initialize a transcript given an input buffer.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Squeeze an encoded verifier challenge from the transcript.

+

Writing the point to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Writing the scalar to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Squeeze a typed challenge (in the scalar field) from the transcript.

+

Read a curve point from the prover.

+

Read a curve scalar from the prover.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/struct.Blake2bWrite.html b/rustdoc/latest/halo2/transcript/struct.Blake2bWrite.html new file mode 100644 index 00000000..30480305 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/struct.Blake2bWrite.html @@ -0,0 +1,102 @@ +Blake2bWrite in halo2::transcript - Rust + + + +

Struct halo2::transcript::Blake2bWrite[][src]

pub struct Blake2bWrite<W: Write, C: CurveAffine, E: EncodedChallenge<C>> { /* fields omitted */ }
Expand description

We will replace BLAKE2b with an algebraic hash function in a later version.

+

Implementations

Initialize a transcript given an output buffer.

+

Conclude the interaction and return the output buffer (writer).

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Squeeze an encoded verifier challenge from the transcript.

+

Writing the point to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Writing the scalar to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Squeeze a typed challenge (in the scalar field) from the transcript.

+

Write a curve point to the proof and the transcript.

+

Write a scalar to the proof and the transcript.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/struct.Challenge255.html b/rustdoc/latest/halo2/transcript/struct.Challenge255.html new file mode 100644 index 00000000..bd9271a0 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/struct.Challenge255.html @@ -0,0 +1,116 @@ +Challenge255 in halo2::transcript - Rust + + + +

Struct halo2::transcript::Challenge255[][src]

pub struct Challenge255<C: CurveAffine>(_, _);
Expand description

A 255-bit challenge.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

The resulting type after dereferencing.

+

Dereferences the value.

+

The Input type used to derive the challenge encoding. For example, +an input from the Poseidon hash would be a base field element; +an input from the Blake2b hash would be a [u8; 64]. Read more

+

Get an encoded challenge from a given input challenge.

+

Get a scalar field element from an encoded challenge.

+

Cast an encoded challenge as a typed ChallengeScalar.

+

Squeeze an encoded verifier challenge from the transcript.

+

Writing the point to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Writing the scalar to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Squeeze a typed challenge (in the scalar field) from the transcript.

+

Squeeze an encoded verifier challenge from the transcript.

+

Writing the point to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Writing the scalar to the transcript without writing it to the proof, +treating it as a common input. Read more

+

Squeeze a typed challenge (in the scalar field) from the transcript.

+

Read a curve point from the prover.

+

Read a curve scalar from the prover.

+

Write a curve point to the proof and the transcript.

+

Write a scalar to the proof and the transcript.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/struct.ChallengeScalar.html b/rustdoc/latest/halo2/transcript/struct.ChallengeScalar.html new file mode 100644 index 00000000..dc42c809 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/struct.ChallengeScalar.html @@ -0,0 +1,96 @@ +ChallengeScalar in halo2::transcript - Rust + + + +

Struct halo2::transcript::ChallengeScalar[][src]

pub struct ChallengeScalar<C: CurveAffine, T> { /* fields omitted */ }
Expand description

The scalar representation of a verifier challenge.

+

The Type type can be used to scope the challenge to a specific context, or +set to () if no context is required.

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Converts self into T using Into<T>. Read more

+

Causes self to use its Binary implementation when Debug-formatted.

+

Causes self to use its Display implementation when +Debug-formatted. Read more

+

Causes self to use its LowerExp implementation when +Debug-formatted. Read more

+

Causes self to use its LowerHex implementation when +Debug-formatted. Read more

+

Causes self to use its Octal implementation when Debug-formatted.

+

Causes self to use its Pointer implementation when +Debug-formatted. Read more

+

Causes self to use its UpperExp implementation when +Debug-formatted. Read more

+

Causes self to use its UpperHex implementation when +Debug-formatted. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Pipes by value. This is generally the method you want to use. Read more

+

Borrows self and passes that borrow into the pipe function. Read more

+

Mutably borrows self and passes that borrow into the pipe function. Read more

+

Borrows self, then passes self.borrow() into the pipe function. Read more

+

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more

+

Borrows self, then passes self.as_ref() into the pipe function.

+

Mutably borrows self, then passes self.as_mut() into the pipe +function. Read more

+

Borrows self, then passes self.deref() into the pipe function.

+

Mutably borrows self, then passes self.deref_mut() into the pipe +function. Read more

+

The alignment of pointer.

+

The type for initializers.

+

Initializes a with the given initializer. Read more

+

Dereferences the given pointer. Read more

+

Mutably dereferences the given pointer. Read more

+

Drops the object pointed to by the given pointer. Read more

+

Immutable access to a value. Read more

+

Mutable access to a value. Read more

+

Immutable access to the Borrow<B> of a value. Read more

+

Mutable access to the BorrowMut<B> of a value. Read more

+

Immutable access to the AsRef<R> view of a value. Read more

+

Mutable access to the AsMut<R> view of a value. Read more

+

Immutable access to the Deref::Target of a value. Read more

+

Mutable access to the Deref::Target of a value. Read more

+

Calls .tap() only in debug builds, and is erased in release builds.

+

Calls .tap_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref() only in debug builds, and is erased in release +builds. Read more

+

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds. Read more

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Attempts to convert self into T using TryInto<T>. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/trait.EncodedChallenge.html b/rustdoc/latest/halo2/transcript/trait.EncodedChallenge.html new file mode 100644 index 00000000..00c68ce5 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/trait.EncodedChallenge.html @@ -0,0 +1,33 @@ +EncodedChallenge in halo2::transcript - Rust + + + +

Trait halo2::transcript::EncodedChallenge[][src]

pub trait EncodedChallenge<C: CurveAffine> {
+    type Input;
+    fn new(challenge_input: &Self::Input) -> Self;
+
fn get_scalar(&self) -> C::Scalar; + + fn as_challenge_scalar<T>(&self) -> ChallengeScalar<C, T> { ... } +}
Expand description

EncodedChallenge<C> defines a challenge encoding with a Self::Input +that is used to derive the challenge encoding and get_challenge obtains +the real C::Scalar that the challenge encoding represents.

+

Associated Types

The Input type used to derive the challenge encoding. For example, +an input from the Poseidon hash would be a base field element; +an input from the Blake2b hash would be a [u8; 64].

+

Required methods

Get an encoded challenge from a given input challenge.

+

Get a scalar field element from an encoded challenge.

+

Provided methods

Cast an encoded challenge as a typed ChallengeScalar.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/trait.Transcript.html b/rustdoc/latest/halo2/transcript/trait.Transcript.html new file mode 100644 index 00000000..dd22f56e --- /dev/null +++ b/rustdoc/latest/halo2/transcript/trait.Transcript.html @@ -0,0 +1,31 @@ +Transcript in halo2::transcript - Rust + + + +

Trait halo2::transcript::Transcript[][src]

pub trait Transcript<C: CurveAffine, E: EncodedChallenge<C>> {
+    fn squeeze_challenge(&mut self) -> E;
+
fn common_point(&mut self, point: C) -> Result<()>; +
fn common_scalar(&mut self, scalar: C::Scalar) -> Result<()>; + + fn squeeze_challenge_scalar<T>(&mut self) -> ChallengeScalar<C, T> { ... } +}
Expand description

Generic transcript view (from either the prover or verifier’s perspective)

+

Required methods

Squeeze an encoded verifier challenge from the transcript.

+

Writing the point to the transcript without writing it to the proof, +treating it as a common input.

+

Writing the scalar to the transcript without writing it to the proof, +treating it as a common input.

+

Provided methods

Squeeze a typed challenge (in the scalar field) from the transcript.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/trait.TranscriptRead.html b/rustdoc/latest/halo2/transcript/trait.TranscriptRead.html new file mode 100644 index 00000000..9932af4a --- /dev/null +++ b/rustdoc/latest/halo2/transcript/trait.TranscriptRead.html @@ -0,0 +1,25 @@ +TranscriptRead in halo2::transcript - Rust + + + +

Trait halo2::transcript::TranscriptRead[][src]

pub trait TranscriptRead<C: CurveAffine, E: EncodedChallenge<C>>: Transcript<C, E> {
+    fn read_point(&mut self) -> Result<C>;
+
fn read_scalar(&mut self) -> Result<C::Scalar>; +}
Expand description

Transcript view from the perspective of a verifier that has access to an +input stream of data from the prover to the verifier.

+

Required methods

Read a curve point from the prover.

+

Read a curve scalar from the prover.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/halo2/transcript/trait.TranscriptWrite.html b/rustdoc/latest/halo2/transcript/trait.TranscriptWrite.html new file mode 100644 index 00000000..f005e616 --- /dev/null +++ b/rustdoc/latest/halo2/transcript/trait.TranscriptWrite.html @@ -0,0 +1,25 @@ +TranscriptWrite in halo2::transcript - Rust + + + +

Trait halo2::transcript::TranscriptWrite[][src]

pub trait TranscriptWrite<C: CurveAffine, E: EncodedChallenge<C>>: Transcript<C, E> {
+    fn write_point(&mut self, point: C) -> Result<()>;
+
fn write_scalar(&mut self, scalar: C::Scalar) -> Result<()>; +}
Expand description

Transcript view from the perspective of a prover that has access to an +output stream of messages from the prover to the verifier.

+

Required methods

Write a curve point to the proof and the transcript.

+

Write a scalar to the proof and the transcript.

+

Implementors

+ + \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/clone/trait.Clone.js b/rustdoc/latest/implementors/core/clone/trait.Clone.js new file mode 100644 index 00000000..ba18455d --- /dev/null +++ b/rustdoc/latest/implementors/core/clone/trait.Clone.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Clone for RegionShape","synthetic":false,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Clone for RegionIndex","synthetic":false,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Clone for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl Clone for Cell","synthetic":false,"types":["halo2::circuit::Cell"]},{"text":"impl<C: Clone + ColumnType> Clone for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Clone for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Clone for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Clone for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Clone for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Clone for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Clone for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F: Clone> Clone for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Clone> Clone for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F: Clone + Field> Clone for ConstraintSystem<F>","synthetic":false,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, C: Clone + CurveAffine> Clone for MSM<'a, C> where
    C::Scalar: Clone,
    C::Scalar: Clone,
    C::Scalar: Clone,
    C::Scalar: Clone
","synthetic":false,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C: Clone + CurveAffine, E: Clone + EncodedChallenge<C>> Clone for Guard<'a, C, E> where
    C::Scalar: Clone,
    C::Scalar: Clone
","synthetic":false,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C: Clone + CurveAffine, E: Clone + EncodedChallenge<C>> Clone for Accumulator<C, E>","synthetic":false,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<F: Clone> Clone for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<'a, C: Clone + CurveAffine> Clone for ProverQuery<'a, C> where
    C::Scalar: Clone,
    C::Scalar: Clone,
    C::Scalar: Clone
","synthetic":false,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C: Clone + CurveAffine> Clone for VerifierQuery<'a, C> where
    C::Scalar: Clone,
    C::Scalar: Clone
","synthetic":false,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Clone for Coeff","synthetic":false,"types":["halo2::poly::Coeff"]},{"text":"impl Clone for LagrangeCoeff","synthetic":false,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Clone for ExtendedLagrangeCoeff","synthetic":false,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F: Clone, B: Clone> Clone for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl Clone for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]},{"text":"impl<R: Clone + Read, C: Clone + CurveAffine, E: Clone + EncodedChallenge<C>> Clone for Blake2bRead<R, C, E>","synthetic":false,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W: Clone + Write, C: Clone + CurveAffine, E: Clone + EncodedChallenge<C>> Clone for Blake2bWrite<W, C, E>","synthetic":false,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C: Clone + CurveAffine, T: Clone> Clone for ChallengeScalar<C, T> where
    C::Scalar: Clone
","synthetic":false,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C: Clone + CurveAffine> Clone for Challenge255<C>","synthetic":false,"types":["halo2::transcript::Challenge255"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/cmp/trait.Eq.js b/rustdoc/latest/implementors/core/cmp/trait.Eq.js new file mode 100644 index 00000000..f640956c --- /dev/null +++ b/rustdoc/latest/implementors/core/cmp/trait.Eq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Eq for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<C: Eq + ColumnType> Eq for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Eq for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Eq for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Eq for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Eq for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Eq for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Eq for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F: Eq> Eq for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/cmp/trait.Ord.js b/rustdoc/latest/implementors/core/cmp/trait.Ord.js new file mode 100644 index 00000000..6bec7a67 --- /dev/null +++ b/rustdoc/latest/implementors/core/cmp/trait.Ord.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<C: ColumnType> Ord for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/cmp/trait.PartialEq.js b/rustdoc/latest/implementors/core/cmp/trait.PartialEq.js new file mode 100644 index 00000000..60767fd6 --- /dev/null +++ b/rustdoc/latest/implementors/core/cmp/trait.PartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl PartialEq<RegionStart> for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<C: PartialEq + ColumnType> PartialEq<Column<C>> for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl PartialEq<Advice> for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl PartialEq<Fixed> for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl PartialEq<Instance> for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl PartialEq<Any> for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl PartialEq<Selector> for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl PartialEq<Permutation> for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F: PartialEq> PartialEq<Blind<F>> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl PartialEq<Rotation> for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]},{"text":"impl PartialEq<Gate> for Gate","synthetic":false,"types":["halo2::dev::metadata::Gate"]},{"text":"impl PartialEq<Constraint> for Constraint","synthetic":false,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl PartialEq<Region> for Region","synthetic":false,"types":["halo2::dev::metadata::Region"]},{"text":"impl PartialEq<VerifyFailure> for VerifyFailure","synthetic":false,"types":["halo2::dev::VerifyFailure"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/cmp/trait.PartialOrd.js b/rustdoc/latest/implementors/core/cmp/trait.PartialOrd.js new file mode 100644 index 00000000..1fcd684a --- /dev/null +++ b/rustdoc/latest/implementors/core/cmp/trait.PartialOrd.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<C: ColumnType> PartialOrd<Column<C>> for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/convert/trait.From.js b/rustdoc/latest/implementors/core/convert/trait.From.js new file mode 100644 index 00000000..8183fc48 --- /dev/null +++ b/rustdoc/latest/implementors/core/convert/trait.From.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl From<usize> for RegionIndex","synthetic":false,"types":["halo2::circuit::RegionIndex"]},{"text":"impl From<usize> for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<'r, F: Field> From<&'r mut (dyn RegionLayouter<F> + 'r)> for Region<'r, F>","synthetic":false,"types":["halo2::circuit::Region"]},{"text":"impl From<Advice> for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl From<Fixed> for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl From<Instance> for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl From<Column<Advice>> for Column<Any>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl From<Column<Fixed>> for Column<Any>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl From<Column<Instance>> for Column<Any>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl<F: Field> From<F> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> From<(F, F)> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> From<Expression<F>> for Constraint<F>","synthetic":false,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F: Field> From<(&'static str, Expression<F>)> for Constraint<F>","synthetic":false,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F: Field> From<Expression<F>> for Vec<Constraint<F>>","synthetic":false,"types":["alloc::vec::Vec"]},{"text":"impl From<(usize, &'static str)> for Gate","synthetic":false,"types":["halo2::dev::metadata::Gate"]},{"text":"impl From<(Gate, usize, &'static str)> for Constraint","synthetic":false,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl From<(usize, String)> for Region","synthetic":false,"types":["halo2::dev::metadata::Region"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/convert/trait.TryFrom.js b/rustdoc/latest/implementors/core/convert/trait.TryFrom.js new file mode 100644 index 00000000..46be9bdb --- /dev/null +++ b/rustdoc/latest/implementors/core/convert/trait.TryFrom.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl TryFrom<Column<Any>> for Column<Advice>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl TryFrom<Column<Any>> for Column<Fixed>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl TryFrom<Column<Any>> for Column<Instance>","synthetic":false,"types":["halo2::plonk::circuit::Column"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/default/trait.Default.js b/rustdoc/latest/implementors/core/default/trait.Default.js new file mode 100644 index 00000000..d54fd4d1 --- /dev/null +++ b/rustdoc/latest/implementors/core/default/trait.Default.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: Field> Default for ConstraintSystem<F>","synthetic":false,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<F: FieldExt> Default for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl Default for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/fmt/trait.Debug.js b/rustdoc/latest/implementors/core/fmt/trait.Debug.js new file mode 100644 index 00000000..110ff70b --- /dev/null +++ b/rustdoc/latest/implementors/core/fmt/trait.Debug.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Debug for SimpleFloorPlanner","synthetic":false,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl Debug for V1","synthetic":false,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F: Debug + Field, CS: Debug + Assignment<F> + 'a> Debug for V1Pass<'p, 'a, F, CS>","synthetic":false,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl Debug for RegionShape","synthetic":false,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Debug for RegionIndex","synthetic":false,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Debug for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl Debug for Cell","synthetic":false,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F: Debug + Field> Debug for Region<'r, F>","synthetic":false,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F: Debug + Field, L: Debug + Layouter<F> + 'a> Debug for NamespacedLayouter<'a, F, L>","synthetic":false,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C: Debug + ColumnType> Debug for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Debug for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Debug for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Debug for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Debug for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Debug for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Debug for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F: Debug> Debug for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Debug> Debug for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F: Debug + Field> Debug for Constraint<F>","synthetic":false,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F: Debug + Field> Debug for ConstraintSystem<F>","synthetic":false,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F: Debug + Field> Debug for PinnedConstraintSystem<'a, F>","synthetic":false,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F: Debug + Field> Debug for VirtualCells<'a, F>","synthetic":false,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C: Debug + CurveAffine> Debug for VerifyingKey<C> where
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C: Debug + CurveAffine> Debug for PinnedVerificationKey<'a, C> where
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C: Debug + CurveAffine> Debug for ProvingKey<C> where
    C::Scalar: Debug,
    C::Scalar: Debug,
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::plonk::ProvingKey"]},{"text":"impl Debug for Error","synthetic":false,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C: Debug + CurveAffine> Debug for MSM<'a, C> where
    C::Scalar: Debug,
    C::Scalar: Debug,
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C: Debug + CurveAffine, E: Debug + EncodedChallenge<C>> Debug for Guard<'a, C, E> where
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C: Debug + CurveAffine, E: Debug + EncodedChallenge<C>> Debug for Accumulator<C, E>","synthetic":false,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C: Debug + CurveAffine> Debug for Params<C>","synthetic":false,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F: Debug> Debug for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G: Debug + Group> Debug for EvaluationDomain<G> where
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug,
    G::Scalar: Debug
","synthetic":false,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G: Debug + Group> Debug for PinnedEvaluationDomain<'a, G> where
    G::Scalar: Debug
","synthetic":false,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C: Debug + CurveAffine> Debug for ProverQuery<'a, C> where
    C::Scalar: Debug,
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C: Debug + CurveAffine> Debug for VerifierQuery<'a, C> where
    C::Scalar: Debug,
    C::Scalar: Debug
","synthetic":false,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Debug for Error","synthetic":false,"types":["halo2::poly::Error"]},{"text":"impl Debug for Coeff","synthetic":false,"types":["halo2::poly::Coeff"]},{"text":"impl Debug for LagrangeCoeff","synthetic":false,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Debug for ExtendedLagrangeCoeff","synthetic":false,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F: Debug, B: Debug> Debug for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl Debug for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]},{"text":"impl<R: Debug + Read, C: Debug + CurveAffine, E: Debug + EncodedChallenge<C>> Debug for Blake2bRead<R, C, E>","synthetic":false,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W: Debug + Write, C: Debug + CurveAffine, E: Debug + EncodedChallenge<C>> Debug for Blake2bWrite<W, C, E>","synthetic":false,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C: Debug + CurveAffine, T: Debug> Debug for ChallengeScalar<C, T> where
    C::Scalar: Debug
","synthetic":false,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C: Debug + CurveAffine> Debug for Challenge255<C>","synthetic":false,"types":["halo2::transcript::Challenge255"]},{"text":"impl Debug for Gate","synthetic":false,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Debug for Constraint","synthetic":false,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Debug for Region","synthetic":false,"types":["halo2::dev::metadata::Region"]},{"text":"impl Debug for VerifyFailure","synthetic":false,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F: Debug + Group + Field> Debug for MockProver<F>","synthetic":false,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/fmt/trait.Display.js b/rustdoc/latest/implementors/core/fmt/trait.Display.js new file mode 100644 index 00000000..69ea5237 --- /dev/null +++ b/rustdoc/latest/implementors/core/fmt/trait.Display.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Display for Gate","synthetic":false,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Display for Constraint","synthetic":false,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Display for Region","synthetic":false,"types":["halo2::dev::metadata::Region"]},{"text":"impl Display for VerifyFailure","synthetic":false,"types":["halo2::dev::VerifyFailure"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/hash/trait.Hash.js b/rustdoc/latest/implementors/core/hash/trait.Hash.js new file mode 100644 index 00000000..638936e3 --- /dev/null +++ b/rustdoc/latest/implementors/core/hash/trait.Hash.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<C: Hash + ColumnType> Hash for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Hash for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Hash for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Hash for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Hash for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Hash for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.Copy.js b/rustdoc/latest/implementors/core/marker/trait.Copy.js new file mode 100644 index 00000000..1e7c2fb5 --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.Copy.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Copy for RegionIndex","synthetic":false,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Copy for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl Copy for Cell","synthetic":false,"types":["halo2::circuit::Cell"]},{"text":"impl<C: Copy + ColumnType> Copy for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Copy for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Copy for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Copy for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Copy for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Copy for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl<F: Copy> Copy for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Copy> Copy for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl Copy for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]},{"text":"impl<C: Copy + CurveAffine, T: Copy> Copy for ChallengeScalar<C, T> where
    C::Scalar: Copy
","synthetic":false,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C: Copy + CurveAffine> Copy for Challenge255<C>","synthetic":false,"types":["halo2::transcript::Challenge255"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.Freeze.js b/rustdoc/latest/implementors/core/marker/trait.Freeze.js new file mode 100644 index 00000000..2a13e32a --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Freeze for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl Freeze for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> Freeze for V1Pass<'p, 'a, F, CS>","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl Freeze for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Freeze for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Freeze for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl Freeze for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> Freeze for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> Freeze for NamespacedLayouter<'a, F, L>","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> Freeze for Column<C> where
    C: Freeze, 
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Freeze for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Freeze for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Freeze for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Freeze for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Freeze for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Freeze for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> Freeze for Assigned<F> where
    F: Freeze, 
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Freeze for Expression<F> where
    F: Freeze, 
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> Freeze for Constraint<F> where
    F: Freeze, 
","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> Freeze for ConstraintSystem<F>","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> Freeze for PinnedConstraintSystem<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> Freeze for VirtualCells<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> Freeze for VerifyingKey<C> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> Freeze for PinnedVerificationKey<'a, C>","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> Freeze for ProvingKey<C> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl Freeze for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> Freeze for MSM<'a, C> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> Freeze for Guard<'a, C, E> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> Freeze for Accumulator<C, E> where
    C: Freeze, 
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> Freeze for Params<C> where
    C: Freeze, 
","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> Freeze for Blind<F> where
    F: Freeze, 
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> Freeze for EvaluationDomain<G> where
    <G as Group>::Scalar: Freeze, 
","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> Freeze for PinnedEvaluationDomain<'a, G>","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> Freeze for ProverQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> Freeze for VerifierQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Freeze for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl Freeze for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl Freeze for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Freeze for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> Freeze for Polynomial<F, B>","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl Freeze for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> Freeze for Blake2bRead<R, C, E> where
    R: Freeze, 
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> Freeze for Blake2bWrite<W, C, E> where
    W: Freeze, 
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> Freeze for ChallengeScalar<C, T> where
    <C as CurveAffine>::ScalarExt: Freeze, 
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> Freeze for Challenge255<C>","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl Freeze for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Freeze for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Freeze for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl Freeze for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> Freeze for MockProver<F>","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.Send.js b/rustdoc/latest/implementors/core/marker/trait.Send.js new file mode 100644 index 00000000..4de2fcd5 --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Send for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl Send for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> Send for V1Pass<'p, 'a, F, CS> where
    CS: Send
","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl Send for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Send for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Send for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl Send for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> !Send for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> Send for NamespacedLayouter<'a, F, L> where
    L: Send
","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> Send for Column<C> where
    C: Send
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Send for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Send for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Send for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Send for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Send for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Send for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> Send for Assigned<F> where
    F: Send
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Send for Expression<F> where
    F: Send
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> Send for Constraint<F>","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> Send for ConstraintSystem<F>","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> Send for PinnedConstraintSystem<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> Send for VirtualCells<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> Send for VerifyingKey<C>","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> Send for PinnedVerificationKey<'a, C>","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> Send for ProvingKey<C>","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl Send for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> Send for MSM<'a, C>","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> Send for Guard<'a, C, E> where
    E: Send
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> Send for Accumulator<C, E> where
    E: Send
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> Send for Params<C>","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> Send for Blind<F> where
    F: Send
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> Send for EvaluationDomain<G>","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> Send for PinnedEvaluationDomain<'a, G>","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> Send for ProverQuery<'a, C>","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> Send for VerifierQuery<'a, C>","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Send for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl Send for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl Send for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Send for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> Send for Polynomial<F, B> where
    B: Send,
    F: Send
","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl Send for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> Send for Blake2bRead<R, C, E> where
    E: Send,
    R: Send
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> Send for Blake2bWrite<W, C, E> where
    E: Send,
    W: Send
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> Send for ChallengeScalar<C, T> where
    T: Send
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> Send for Challenge255<C>","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl Send for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Send for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Send for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl Send for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> Send for MockProver<F>","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.StructuralEq.js b/rustdoc/latest/implementors/core/marker/trait.StructuralEq.js new file mode 100644 index 00000000..199d0182 --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.StructuralEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl StructuralEq for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<C: ColumnType> StructuralEq for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl StructuralEq for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl StructuralEq for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl StructuralEq for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl StructuralEq for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl StructuralEq for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl StructuralEq for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> StructuralEq for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.StructuralPartialEq.js b/rustdoc/latest/implementors/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 00000000..792e6499 --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl StructuralPartialEq for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<C: ColumnType> StructuralPartialEq for Column<C>","synthetic":false,"types":["halo2::plonk::circuit::Column"]},{"text":"impl StructuralPartialEq for Advice","synthetic":false,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl StructuralPartialEq for Fixed","synthetic":false,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl StructuralPartialEq for Instance","synthetic":false,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl StructuralPartialEq for Any","synthetic":false,"types":["halo2::plonk::circuit::Any"]},{"text":"impl StructuralPartialEq for Selector","synthetic":false,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl StructuralPartialEq for Permutation","synthetic":false,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> StructuralPartialEq for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl StructuralPartialEq for Rotation","synthetic":false,"types":["halo2::poly::Rotation"]},{"text":"impl StructuralPartialEq for Gate","synthetic":false,"types":["halo2::dev::metadata::Gate"]},{"text":"impl StructuralPartialEq for Constraint","synthetic":false,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl StructuralPartialEq for Region","synthetic":false,"types":["halo2::dev::metadata::Region"]},{"text":"impl StructuralPartialEq for VerifyFailure","synthetic":false,"types":["halo2::dev::VerifyFailure"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.Sync.js b/rustdoc/latest/implementors/core/marker/trait.Sync.js new file mode 100644 index 00000000..0fca9eab --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Sync for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl Sync for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> Sync for V1Pass<'p, 'a, F, CS> where
    CS: Sync
","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl Sync for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Sync for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Sync for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl Sync for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> !Sync for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> Sync for NamespacedLayouter<'a, F, L> where
    L: Sync
","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> Sync for Column<C> where
    C: Sync
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Sync for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Sync for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Sync for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Sync for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Sync for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Sync for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> Sync for Assigned<F> where
    F: Sync
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Sync for Expression<F> where
    F: Sync
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> Sync for Constraint<F>","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> Sync for ConstraintSystem<F>","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> Sync for PinnedConstraintSystem<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> Sync for VirtualCells<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> Sync for VerifyingKey<C>","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> Sync for PinnedVerificationKey<'a, C>","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> Sync for ProvingKey<C>","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl Sync for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> Sync for MSM<'a, C>","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> Sync for Guard<'a, C, E> where
    E: Sync
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> Sync for Accumulator<C, E> where
    E: Sync
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> Sync for Params<C>","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> Sync for Blind<F> where
    F: Sync
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> Sync for EvaluationDomain<G>","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> Sync for PinnedEvaluationDomain<'a, G>","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> Sync for ProverQuery<'a, C>","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> Sync for VerifierQuery<'a, C>","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Sync for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl Sync for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl Sync for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Sync for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> Sync for Polynomial<F, B> where
    B: Sync,
    F: Sync
","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl Sync for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> Sync for Blake2bRead<R, C, E> where
    E: Sync,
    R: Sync
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> Sync for Blake2bWrite<W, C, E> where
    E: Sync,
    W: Sync
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> Sync for ChallengeScalar<C, T> where
    T: Sync
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> Sync for Challenge255<C>","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl Sync for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Sync for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Sync for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl Sync for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> Sync for MockProver<F>","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/marker/trait.Unpin.js b/rustdoc/latest/implementors/core/marker/trait.Unpin.js new file mode 100644 index 00000000..7738369c --- /dev/null +++ b/rustdoc/latest/implementors/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Unpin for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl Unpin for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> Unpin for V1Pass<'p, 'a, F, CS> where
    'a: 'p, 
","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl Unpin for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl Unpin for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Unpin for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl Unpin for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> Unpin for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> Unpin for NamespacedLayouter<'a, F, L> where
    F: Unpin
","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> Unpin for Column<C> where
    C: Unpin
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl Unpin for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl Unpin for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl Unpin for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl Unpin for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl Unpin for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl Unpin for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> Unpin for Assigned<F> where
    F: Unpin
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Unpin for Expression<F> where
    F: Unpin
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> Unpin for Constraint<F> where
    F: Unpin
","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> Unpin for ConstraintSystem<F> where
    F: Unpin
","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> Unpin for PinnedConstraintSystem<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> Unpin for VirtualCells<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> Unpin for VerifyingKey<C> where
    C: Unpin,
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> Unpin for PinnedVerificationKey<'a, C>","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> Unpin for ProvingKey<C> where
    C: Unpin,
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl Unpin for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> Unpin for MSM<'a, C> where
    C: Unpin,
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> Unpin for Guard<'a, C, E> where
    C: Unpin,
    E: Unpin,
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> Unpin for Accumulator<C, E> where
    C: Unpin,
    E: Unpin
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> Unpin for Params<C> where
    C: Unpin
","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> Unpin for Blind<F> where
    F: Unpin
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> Unpin for EvaluationDomain<G> where
    <G as Group>::Scalar: Unpin
","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> Unpin for PinnedEvaluationDomain<'a, G>","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> Unpin for ProverQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> Unpin for VerifierQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl Unpin for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl Unpin for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl Unpin for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl Unpin for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> Unpin for Polynomial<F, B> where
    B: Unpin,
    F: Unpin
","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl Unpin for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> Unpin for Blake2bRead<R, C, E> where
    C: Unpin,
    E: Unpin,
    R: Unpin
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> Unpin for Blake2bWrite<W, C, E> where
    C: Unpin,
    E: Unpin,
    W: Unpin
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> Unpin for ChallengeScalar<C, T> where
    T: Unpin,
    <C as CurveAffine>::ScalarExt: Unpin
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> Unpin for Challenge255<C> where
    C: Unpin
","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl Unpin for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl Unpin for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl Unpin for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl Unpin for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> Unpin for MockProver<F> where
    F: Unpin
","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.Add.js b/rustdoc/latest/implementors/core/ops/arith/trait.Add.js new file mode 100644 index 00000000..9cb59040 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.Add.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: Field> Add<Assigned<F>> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> Add<F> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Add<Expression<F>> for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F: FieldExt> Add<Blind<F>> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<'a, F: Field, B: Basis> Add<&'a Polynomial<F, B>> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.AddAssign.js b/rustdoc/latest/implementors/core/ops/arith/trait.AddAssign.js new file mode 100644 index 00000000..803930f4 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.AddAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: FieldExt> AddAssign<Blind<F>> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<F: FieldExt> AddAssign<F> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.Mul.js b/rustdoc/latest/implementors/core/ops/arith/trait.Mul.js new file mode 100644 index 00000000..a839b73c --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.Mul.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: Field> Mul<Assigned<F>> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> Mul<F> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> Mul<Expression<F>> for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> Mul<F> for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F: FieldExt> Mul<Blind<F>> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<'a, F: Field> Mul<&'a Polynomial<F, ExtendedLagrangeCoeff>> for Polynomial<F, ExtendedLagrangeCoeff>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<'a, F: Field, B: Basis> Mul<F> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.MulAssign.js b/rustdoc/latest/implementors/core/ops/arith/trait.MulAssign.js new file mode 100644 index 00000000..46ed4eaf --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.MulAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: FieldExt> MulAssign<Blind<F>> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<F: FieldExt> MulAssign<F> for Blind<F>","synthetic":false,"types":["halo2::poly::commitment::Blind"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.Neg.js b/rustdoc/latest/implementors/core/ops/arith/trait.Neg.js new file mode 100644 index 00000000..e0224420 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.Neg.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: Field> Neg for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> Neg for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/arith/trait.Sub.js b/rustdoc/latest/implementors/core/ops/arith/trait.Sub.js new file mode 100644 index 00000000..36024232 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F: Field> Sub<Assigned<F>> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> Sub<F> for Assigned<F>","synthetic":false,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F: Field> Sub<Expression<F>> for Expression<F>","synthetic":false,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<'a, F: Field, B: Basis> Sub<&'a Polynomial<F, B>> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/deref/trait.Deref.js b/rustdoc/latest/implementors/core/ops/deref/trait.Deref.js new file mode 100644 index 00000000..e9c8c0dc --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl Deref for RegionIndex","synthetic":false,"types":["halo2::circuit::RegionIndex"]},{"text":"impl Deref for RegionStart","synthetic":false,"types":["halo2::circuit::RegionStart"]},{"text":"impl<F, B> Deref for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<C: CurveAffine, T> Deref for ChallengeScalar<C, T>","synthetic":false,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C: CurveAffine> Deref for Challenge255<C>","synthetic":false,"types":["halo2::transcript::Challenge255"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/deref/trait.DerefMut.js b/rustdoc/latest/implementors/core/ops/deref/trait.DerefMut.js new file mode 100644 index 00000000..d9c0326e --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F, B> DerefMut for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/drop/trait.Drop.js b/rustdoc/latest/implementors/core/ops/drop/trait.Drop.js new file mode 100644 index 00000000..3cd03710 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<'a, F: Field, L: Layouter<F> + 'a> Drop for NamespacedLayouter<'a, F, L>","synthetic":false,"types":["halo2::circuit::NamespacedLayouter"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/index/trait.Index.js b/rustdoc/latest/implementors/core/ops/index/trait.Index.js new file mode 100644 index 00000000..37bad446 --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/index/trait.Index.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F, B> Index<usize> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<F, B> Index<RangeFrom<usize>> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<F, B> Index<RangeFull> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/core/ops/index/trait.IndexMut.js b/rustdoc/latest/implementors/core/ops/index/trait.IndexMut.js new file mode 100644 index 00000000..2cf170ff --- /dev/null +++ b/rustdoc/latest/implementors/core/ops/index/trait.IndexMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl<F, B> IndexMut<usize> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<F, B> IndexMut<RangeFrom<usize>> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]},{"text":"impl<F, B> IndexMut<RangeFull> for Polynomial<F, B>","synthetic":false,"types":["halo2::poly::Polynomial"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.BatchInvert.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.BatchInvert.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.BatchInvert.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveAffine.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveAffine.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveAffine.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveExt.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveExt.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.CurveExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.Field.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.Field.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.Field.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.FieldExt.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.FieldExt.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.FieldExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/arithmetic/trait.Group.js b/rustdoc/latest/implementors/halo2/arithmetic/trait.Group.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/arithmetic/trait.Group.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/circuit/layouter/trait.RegionLayouter.js b/rustdoc/latest/implementors/halo2/circuit/layouter/trait.RegionLayouter.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/circuit/layouter/trait.RegionLayouter.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/circuit/trait.Layouter.js b/rustdoc/latest/implementors/halo2/circuit/trait.Layouter.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/circuit/trait.Layouter.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/plonk/trait.Assignment.js b/rustdoc/latest/implementors/halo2/plonk/trait.Assignment.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/plonk/trait.Assignment.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/plonk/trait.ColumnType.js b/rustdoc/latest/implementors/halo2/plonk/trait.ColumnType.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/plonk/trait.ColumnType.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/plonk/trait.FloorPlanner.js b/rustdoc/latest/implementors/halo2/plonk/trait.FloorPlanner.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/plonk/trait.FloorPlanner.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/poly/trait.Basis.js b/rustdoc/latest/implementors/halo2/poly/trait.Basis.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/poly/trait.Basis.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/transcript/trait.EncodedChallenge.js b/rustdoc/latest/implementors/halo2/transcript/trait.EncodedChallenge.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/transcript/trait.EncodedChallenge.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/transcript/trait.Transcript.js b/rustdoc/latest/implementors/halo2/transcript/trait.Transcript.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/transcript/trait.Transcript.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptRead.js b/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptRead.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptRead.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptWrite.js b/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptWrite.js new file mode 100644 index 00000000..fb673cff --- /dev/null +++ b/rustdoc/latest/implementors/halo2/transcript/trait.TranscriptWrite.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/std/panic/trait.RefUnwindSafe.js b/rustdoc/latest/implementors/std/panic/trait.RefUnwindSafe.js new file mode 100644 index 00000000..31349cc5 --- /dev/null +++ b/rustdoc/latest/implementors/std/panic/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl RefUnwindSafe for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl RefUnwindSafe for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> RefUnwindSafe for V1Pass<'p, 'a, F, CS> where
    CS: RefUnwindSafe,
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl RefUnwindSafe for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl RefUnwindSafe for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl RefUnwindSafe for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl RefUnwindSafe for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> !RefUnwindSafe for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> RefUnwindSafe for NamespacedLayouter<'a, F, L> where
    F: RefUnwindSafe,
    L: RefUnwindSafe
","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> RefUnwindSafe for Column<C> where
    C: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl RefUnwindSafe for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl RefUnwindSafe for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl RefUnwindSafe for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl RefUnwindSafe for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl RefUnwindSafe for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl RefUnwindSafe for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> RefUnwindSafe for Assigned<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> RefUnwindSafe for Expression<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> RefUnwindSafe for Constraint<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> RefUnwindSafe for ConstraintSystem<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> RefUnwindSafe for PinnedConstraintSystem<'a, F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> RefUnwindSafe for VirtualCells<'a, F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> RefUnwindSafe for VerifyingKey<C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> RefUnwindSafe for PinnedVerificationKey<'a, C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> RefUnwindSafe for ProvingKey<C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl RefUnwindSafe for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> RefUnwindSafe for MSM<'a, C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> RefUnwindSafe for Guard<'a, C, E> where
    C: RefUnwindSafe,
    E: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> RefUnwindSafe for Accumulator<C, E> where
    C: RefUnwindSafe,
    E: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> RefUnwindSafe for Params<C> where
    C: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> RefUnwindSafe for Blind<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> RefUnwindSafe for EvaluationDomain<G> where
    <G as Group>::Scalar: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> RefUnwindSafe for PinnedEvaluationDomain<'a, G> where
    <G as Group>::Scalar: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> RefUnwindSafe for ProverQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> RefUnwindSafe for VerifierQuery<'a, C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl RefUnwindSafe for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl RefUnwindSafe for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl RefUnwindSafe for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl RefUnwindSafe for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> RefUnwindSafe for Polynomial<F, B> where
    B: RefUnwindSafe,
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl RefUnwindSafe for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> RefUnwindSafe for Blake2bRead<R, C, E> where
    C: RefUnwindSafe,
    E: RefUnwindSafe,
    R: RefUnwindSafe
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> RefUnwindSafe for Blake2bWrite<W, C, E> where
    C: RefUnwindSafe,
    E: RefUnwindSafe,
    W: RefUnwindSafe
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> RefUnwindSafe for ChallengeScalar<C, T> where
    T: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> RefUnwindSafe for Challenge255<C> where
    C: RefUnwindSafe
","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl RefUnwindSafe for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl RefUnwindSafe for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl RefUnwindSafe for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl RefUnwindSafe for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> RefUnwindSafe for MockProver<F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/implementors/std/panic/trait.UnwindSafe.js b/rustdoc/latest/implementors/std/panic/trait.UnwindSafe.js new file mode 100644 index 00000000..47db02af --- /dev/null +++ b/rustdoc/latest/implementors/std/panic/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["halo2"] = [{"text":"impl UnwindSafe for SimpleFloorPlanner","synthetic":true,"types":["halo2::circuit::floor_planner::single_pass::SimpleFloorPlanner"]},{"text":"impl UnwindSafe for V1","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1"]},{"text":"impl<'p, 'a, F, CS> !UnwindSafe for V1Pass<'p, 'a, F, CS>","synthetic":true,"types":["halo2::circuit::floor_planner::v1::V1Pass"]},{"text":"impl UnwindSafe for RegionShape","synthetic":true,"types":["halo2::circuit::layouter::RegionShape"]},{"text":"impl UnwindSafe for RegionIndex","synthetic":true,"types":["halo2::circuit::RegionIndex"]},{"text":"impl UnwindSafe for RegionStart","synthetic":true,"types":["halo2::circuit::RegionStart"]},{"text":"impl UnwindSafe for Cell","synthetic":true,"types":["halo2::circuit::Cell"]},{"text":"impl<'r, F> !UnwindSafe for Region<'r, F>","synthetic":true,"types":["halo2::circuit::Region"]},{"text":"impl<'a, F, L> !UnwindSafe for NamespacedLayouter<'a, F, L>","synthetic":true,"types":["halo2::circuit::NamespacedLayouter"]},{"text":"impl<C> UnwindSafe for Column<C> where
    C: UnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Column"]},{"text":"impl UnwindSafe for Advice","synthetic":true,"types":["halo2::plonk::circuit::Advice"]},{"text":"impl UnwindSafe for Fixed","synthetic":true,"types":["halo2::plonk::circuit::Fixed"]},{"text":"impl UnwindSafe for Instance","synthetic":true,"types":["halo2::plonk::circuit::Instance"]},{"text":"impl UnwindSafe for Any","synthetic":true,"types":["halo2::plonk::circuit::Any"]},{"text":"impl UnwindSafe for Selector","synthetic":true,"types":["halo2::plonk::circuit::Selector"]},{"text":"impl UnwindSafe for Permutation","synthetic":true,"types":["halo2::plonk::circuit::Permutation"]},{"text":"impl<F> UnwindSafe for Assigned<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Assigned"]},{"text":"impl<F> UnwindSafe for Expression<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Expression"]},{"text":"impl<F> UnwindSafe for Constraint<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::Constraint"]},{"text":"impl<F> UnwindSafe for ConstraintSystem<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::ConstraintSystem"]},{"text":"impl<'a, F> UnwindSafe for PinnedConstraintSystem<'a, F> where
    F: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::circuit::PinnedConstraintSystem"]},{"text":"impl<'a, F> !UnwindSafe for VirtualCells<'a, F>","synthetic":true,"types":["halo2::plonk::circuit::VirtualCells"]},{"text":"impl<C> UnwindSafe for VerifyingKey<C> where
    C: UnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::plonk::VerifyingKey"]},{"text":"impl<'a, C> UnwindSafe for PinnedVerificationKey<'a, C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: RefUnwindSafe
","synthetic":true,"types":["halo2::plonk::PinnedVerificationKey"]},{"text":"impl<C> UnwindSafe for ProvingKey<C> where
    C: UnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::plonk::ProvingKey"]},{"text":"impl UnwindSafe for Error","synthetic":true,"types":["halo2::plonk::Error"]},{"text":"impl<'a, C> UnwindSafe for MSM<'a, C> where
    C: RefUnwindSafe + UnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::msm::MSM"]},{"text":"impl<'a, C, E> UnwindSafe for Guard<'a, C, E> where
    C: RefUnwindSafe + UnwindSafe,
    E: UnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::verifier::Guard"]},{"text":"impl<C, E> UnwindSafe for Accumulator<C, E> where
    C: UnwindSafe,
    E: UnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::verifier::Accumulator"]},{"text":"impl<C> UnwindSafe for Params<C> where
    C: UnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::Params"]},{"text":"impl<F> UnwindSafe for Blind<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::poly::commitment::Blind"]},{"text":"impl<G> UnwindSafe for EvaluationDomain<G> where
    <G as Group>::Scalar: UnwindSafe
","synthetic":true,"types":["halo2::poly::domain::EvaluationDomain"]},{"text":"impl<'a, G> UnwindSafe for PinnedEvaluationDomain<'a, G> where
    <G as Group>::Scalar: RefUnwindSafe
","synthetic":true,"types":["halo2::poly::domain::PinnedEvaluationDomain"]},{"text":"impl<'a, C> UnwindSafe for ProverQuery<'a, C> where
    <C as CurveAffine>::ScalarExt: RefUnwindSafe + UnwindSafe
","synthetic":true,"types":["halo2::poly::multiopen::ProverQuery"]},{"text":"impl<'a, C> UnwindSafe for VerifierQuery<'a, C> where
    C: RefUnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::poly::multiopen::VerifierQuery"]},{"text":"impl UnwindSafe for Error","synthetic":true,"types":["halo2::poly::Error"]},{"text":"impl UnwindSafe for Coeff","synthetic":true,"types":["halo2::poly::Coeff"]},{"text":"impl UnwindSafe for LagrangeCoeff","synthetic":true,"types":["halo2::poly::LagrangeCoeff"]},{"text":"impl UnwindSafe for ExtendedLagrangeCoeff","synthetic":true,"types":["halo2::poly::ExtendedLagrangeCoeff"]},{"text":"impl<F, B> UnwindSafe for Polynomial<F, B> where
    B: UnwindSafe,
    F: UnwindSafe
","synthetic":true,"types":["halo2::poly::Polynomial"]},{"text":"impl UnwindSafe for Rotation","synthetic":true,"types":["halo2::poly::Rotation"]},{"text":"impl<R, C, E> UnwindSafe for Blake2bRead<R, C, E> where
    C: UnwindSafe,
    E: UnwindSafe,
    R: UnwindSafe
","synthetic":true,"types":["halo2::transcript::Blake2bRead"]},{"text":"impl<W, C, E> UnwindSafe for Blake2bWrite<W, C, E> where
    C: UnwindSafe,
    E: UnwindSafe,
    W: UnwindSafe
","synthetic":true,"types":["halo2::transcript::Blake2bWrite"]},{"text":"impl<C, T> UnwindSafe for ChallengeScalar<C, T> where
    T: UnwindSafe,
    <C as CurveAffine>::ScalarExt: UnwindSafe
","synthetic":true,"types":["halo2::transcript::ChallengeScalar"]},{"text":"impl<C> UnwindSafe for Challenge255<C> where
    C: UnwindSafe
","synthetic":true,"types":["halo2::transcript::Challenge255"]},{"text":"impl UnwindSafe for Gate","synthetic":true,"types":["halo2::dev::metadata::Gate"]},{"text":"impl UnwindSafe for Constraint","synthetic":true,"types":["halo2::dev::metadata::Constraint"]},{"text":"impl UnwindSafe for Region","synthetic":true,"types":["halo2::dev::metadata::Region"]},{"text":"impl UnwindSafe for VerifyFailure","synthetic":true,"types":["halo2::dev::VerifyFailure"]},{"text":"impl<F> UnwindSafe for MockProver<F> where
    F: UnwindSafe
","synthetic":true,"types":["halo2::dev::MockProver"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rustdoc/latest/light.css b/rustdoc/latest/light.css new file mode 100644 index 00000000..4554f2b5 --- /dev/null +++ b/rustdoc/latest/light.css @@ -0,0 +1 @@ + body{background-color:white;color:black;}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#ddd;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#b4d1b9;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#ffc891;}a.result-foreigntype:focus{background-color:#f5c4ff;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#c3e0ff;}a.result-primitive:focus{background-color:#9aecff;}a.result-keyword:focus{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#3873AD;}a.test-arrow{color:#f5f5f5;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-input:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help>div>span{border-bottom-color:#bfbfbf;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target*{background:#FDFFD3;}:target{border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} \ No newline at end of file diff --git a/rustdoc/latest/main.js b/rustdoc/latest/main.js new file mode 100644 index 00000000..eaae31ed --- /dev/null +++ b/rustdoc/latest/main.js @@ -0,0 +1,8 @@ +if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}(function(){var rustdocVars=document.getElementById("rustdoc-vars");if(rustdocVars){window.rootPath=rustdocVars.attributes["data-root-path"].value;window.currentCrate=rustdocVars.attributes["data-current-crate"].value;window.searchJS=rustdocVars.attributes["data-search-js"].value;window.searchIndexJS=rustdocVars.attributes["data-search-index-js"].value}var sidebarVars=document.getElementById("sidebar-vars");if(sidebarVars){window.sidebarCurrent={name:sidebarVars.attributes["data-name"].value,ty:sidebarVars.attributes["data-ty"].value,relpath:sidebarVars.attributes["data-relpath"].value,}}}());function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}var THEME_PICKER_ELEMENT_ID="theme-picker";var THEMES_ELEMENT_ID="theme-choices";function getThemesElement(){return document.getElementById(THEMES_ELEMENT_ID)}function getThemePickerElement(){return document.getElementById(THEME_PICKER_ELEMENT_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function showThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}(function(){var themeChoices=getThemesElement();var themePicker=getThemePickerElement();var availableThemes=["ayu","dark","light"];function switchThemeButtonState(){if(themeChoices.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}}function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!==THEME_PICKER_ELEMENT_ID&&(!active.parentNode||active.parentNode.id!==THEMES_ELEMENT_ID)&&(!related||(related.id!==THEME_PICKER_ELEMENT_ID&&(!related.parentNode||related.parentNode.id!==THEMES_ELEMENT_ID)))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;availableThemes.forEach(function(item){var but=document.createElement("button");but.textContent=item;but.onclick=function(){switchTheme(window.currentTheme,window.mainTheme,item,true);useSystemTheme(false)};but.onblur=handleThemeButtonsBlur;themeChoices.appendChild(but)})}());(function(){"use strict";window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:function(){return document.getElementById("search")},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:function(){if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},focus:function(){searchState.input.focus()},defocus:function(){searchState.input.blur()},showResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(main,"hidden");removeClass(search,"hidden");searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(search,"hidden");removeClass(main,"hidden");document.title=searchState.titleBeforeSearch;if(searchState.browserSupportsHistoryApi()){history.replaceState("",window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:function(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},putBackSearch:function(search_input){var search=searchState.outputElement();if(search_input.value!==""&&hasClass(search,"hidden")){searchState.showResults(search);if(searchState.browserSupportsHistoryApi()){var extra="?search="+encodeURIComponent(search_input.value);history.replaceState(search_input.value,"",getNakedUrl()+extra+window.location.hash)}document.title=searchState.title}},browserSupportsHistoryApi:function(){return window.history&&typeof window.history.pushState==="function"},setup:function(){var search_input=searchState.input;if(!searchState.input){return}function loadScript(url){var script=document.createElement('script');script.src=url;document.head.append(script)}var searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(window.searchJS);loadScript(window.searchIndexJS)}}search_input.addEventListener("focus",function(){searchState.putBackSearch(this);search_input.origPlaceholder=searchState.input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});search_input.addEventListener("blur",function(){search_input.placeholder=searchState.input.origPlaceholder});search_input.removeAttribute('disabled');searchState.addCrateDropdown(window.ALL_CRATES);var params=searchState.getQueryStringParams();if(params.search!==undefined){var search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},addCrateDropdown:function(crates){var elem=document.getElementById("crate-search");if(!elem){return}var savedCrate=getSettingValue("saved-filter-crate");for(var i=0,len=crates.length;i0){return tmp}}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop=""}var toggleAllDocsId="toggle-all-docs";var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var elem;var search=searchState.outputElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){searchState.hideResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(searchState.browserSupportsHistoryApi()){history.replaceState(hash,"",getNakedUrl()+window.location.search+"#"+hash)}elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}expandSection(savedHash.slice(1))}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function getHelpElement(build){if(build){buildHelperPopup()}return document.getElementById("help")}function displayHelp(display,ev,help){if(display){help=help?help:getHelpElement(true);if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else{help=help?help:getHelpElement(false);if(help&&!hasClass(help,"hidden")){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}}function handleEscape(ev){var help=getHelpElement(false);var search=searchState.outputElement();if(help&&!hasClass(help,"hidden")){displayHelp(false,ev,help)}else if(search&&!hasClass(search,"hidden")){searchState.clearInputTimeout();ev.preventDefault();searchState.hideResults(search)}searchState.defocus();hideThemeButtonState()}var disableShortcuts=getSettingValue("disable-shortcuts")==="true";function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":displayHelp(true,ev);break;case"t":case"T":displayHelp(false,ev);ev.preventDefault();var themePicker=getThemePickerElement();themePicker.click();themePicker.focus();break;default:if(getThemePickerElement().parentNode.contains(ev.target)){handleThemeKeyDown(ev)}}}}function handleThemeKeyDown(ev){var active=document.activeElement;var themes=getThemesElement();switch(getVirtualKey(ev)){case"ArrowUp":ev.preventDefault();if(active.previousElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.previousElementSibling.focus()}else{showThemeButtonState();themes.lastElementChild.focus()}break;case"ArrowDown":ev.preventDefault();if(active.nextElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.nextElementSibling.focus()}else{showThemeButtonState();themes.firstElementChild.focus()}break;case"Enter":case"Return":case"Space":if(ev.target.id===THEME_PICKER_ELEMENT_ID&&themes.style.display==="none"){ev.preventDefault();showThemeButtonState();themes.firstElementChild.focus()}break;case"Home":ev.preventDefault();themes.firstElementChild.focus();break;case"End":ev.preventDefault();themes.lastElementChild.focus();break}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);(function(){var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=window.rootPath.match(/\.\.\//g).length+1;for(i=0;i"+""+"
"+code.outerHTML+"
";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function toggleAllDocs(){var innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}var sectionIsCollapsed=false;if(hasClass(innerToggle,"will-expand")){removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),function(e){if(!hasClass(e,"type-contents-toggle")){e.open=true}});innerToggle.title="collapse all docs"}else{addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),function(e){if(e.parentNode.id!=="main"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});sectionIsCollapsed=true;innerToggle.title="expand all docs"}innerToggle.children[0].innerText=labelForToggleButton(sectionIsCollapsed)}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}(function(){var toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}var hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";var hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";var hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){var list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),function(e){e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("rustdoc-toggle"),function(e){if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}});var pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){var lineNumbersFunc=function(){};if(getSettingValue("line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;ithe rustdoc book.";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["T","Focus the theme picker menu"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(function(x){return"
"+x[0].split(" ").map(function(y,index){return(index&1)===0?""+y+"":" "+y+" "}).join("")+"
"+x[1]+"
"}).join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";var infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + * -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ + str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(function(x){return"

"+x+"

"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;container.appendChild(book_info);container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,searchState.outputElement());buildHelperPopup=function(){}};onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){var reset_button_timeout=null;window.copy_path=function(but){var parent=but.parentElement;var path=[];onEach(parent.childNodes,function(child){if(child.tagName==='A'){path.push(child.textContent)}});var el=document.createElement('textarea');el.value='use '+path.join('::')+';';el.setAttribute('readonly','');el.style.position='absolute';el.style.left='-9999px';document.body.appendChild(el);el.select();document.execCommand('copy');document.body.removeChild(el);but.children[0].style.display='none';var tmp;if(but.childNodes.length<2){tmp=document.createTextNode('✓');but.appendChild(tmp)}else{onEachLazy(but.childNodes,function(e){if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent='✓'}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent='';reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/rustdoc/latest/normalize.css b/rustdoc/latest/normalize.css new file mode 100644 index 00000000..469959f1 --- /dev/null +++ b/rustdoc/latest/normalize.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/rustdoc/latest/noscript.css b/rustdoc/latest/noscript.css new file mode 100644 index 00000000..aea68efb --- /dev/null +++ b/rustdoc/latest/noscript.css @@ -0,0 +1 @@ + #main .attributes{margin-left:0 !important;}#copy-path{display:none;} \ No newline at end of file diff --git a/rustdoc/latest/noto-sans-kr-v13-korean-regular-LICENSE.txt b/rustdoc/latest/noto-sans-kr-v13-korean-regular-LICENSE.txt new file mode 100644 index 00000000..922d5fdc --- /dev/null +++ b/rustdoc/latest/noto-sans-kr-v13-korean-regular-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2014, 2015 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/rustdoc/latest/noto-sans-kr-v13-korean-regular.woff b/rustdoc/latest/noto-sans-kr-v13-korean-regular.woff new file mode 100644 index 00000000..01d6b6b5 Binary files /dev/null and b/rustdoc/latest/noto-sans-kr-v13-korean-regular.woff differ diff --git a/rustdoc/latest/rust-logo.png b/rustdoc/latest/rust-logo.png new file mode 100644 index 00000000..74b4bd69 Binary files /dev/null and b/rustdoc/latest/rust-logo.png differ diff --git a/rustdoc/latest/rustdoc.css b/rustdoc/latest/rustdoc.css new file mode 100644 index 00000000..143f3226 --- /dev/null +++ b/rustdoc/latest/rustdoc.css @@ -0,0 +1 @@ + @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2"),url("FiraSans-Regular.woff") format('woff');font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2"),url("FiraSans-Medium.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2"),url("SourceSerif4-Regular.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2"),url("SourceSerif4-It.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2"),url("SourceSerif4-Bold.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2"),url("SourceCodePro-Regular.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2"),url("SourceCodePro-It.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),url("SourceCodePro-Semibold.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Noto Sans KR';src:url("noto-sans-kr-v13-korean-regular.woff") format("woff");font-display:swap;unicode-range:U+A960-A97F,U+AC00-D7AF,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif 4","Noto Sans KR",serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3,h4{font-weight:500;margin:20px 0 15px 0;padding-bottom:6px;}h1.fqn{display:flex;border-bottom:1px dashed;margin-top:0;padding-left:1px;}h1.fqn>.in-band>a:hover{text-decoration:underline;}h2,h3,h4{border-bottom:1px solid;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}.impl,.method.trait-impl,.type.trait-impl,.associatedconstant.trait-impl,.associatedtype.trait-impl{padding-left:15px;}div.impl-items>div{padding-left:0;}h1,h2,h3,h4,.sidebar,a.source,.search-input,.search-results .result-name,.content table td:first-child>a,.item-left>a,div.item-list .out-of-band,span.since,#source-sidebar,#sidebar-toggle,details.rustdoc-toggle>summary::before,details.undocumented>summary::before,div.impl-items>div:not(.docblock):not(.item-info),.content ul.crate a.crate,a.srclink,#main>ul.docblock>li>a{font-family:"Fira Sans",Arial,sans-serif;}.content ul.crate a.crate{font-size:16px/1.6;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;padding-right:1ex;}pre{padding:14px;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow:auto;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.location a:hover{text-decoration:underline;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.rustdoc:not(.source) .example-wrap>pre.rust{width:100%;overflow-x:auto;}.rustdoc .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results>table{width:100%;table-layout:fixed;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom:1px solid;}.top-doc .docblock h1{font-size:1.3em;}.top-doc .docblock h2{font-size:1.15em;}.top-doc .docblock h3,.top-doc .docblock h4,.top-doc .docblock h5{font-size:1em;}.docblock h1{font-size:1em;}.docblock h2{font-size:0.95em;}.docblock h3,.docblock h4,.docblock h5{font-size:0.9em;}.docblock{margin-left:24px;position:relative;}.content .out-of-band{flex-grow:0;text-align:right;font-size:23px;margin:0px;padding:0 0 0 12px;font-weight:normal;}.method>code,.trait-impl>code,.invisible>code{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;}.in-band>code{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",Arial,sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);border:1px dashed;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content>.methods>.method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div:not(.notable-traits):not(.method){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .item-info code{font-size:90%;}.content .item-info{position:relative;margin-left:33px;}.sub-variant>div>.item-info{margin-top:initial;}.content .item-info::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant,.impl-items>.associatedtype,.content .impl-items details>summary>.type,.impl-items details>summary>.associatedconstant,.impl-items details>summary>.associatedtype{margin-left:20px;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.item-info{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-7px;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-28px;padding-right:10px;}.anchor:before{content:'\2002\00a7\2002';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.item-info a{text-decoration:underline;}.invisible>.srclink,.method>code+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.item-table{display:grid;column-gap:1.2rem;row-gap:0.0rem;grid-template-columns:auto 1fr;justify-items:start;}.item-left,.item-right{display:block;}.item-left{grid-column:1;}.item-right{grid-column:2;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 63px);}#crate-search{min-width:115px;margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;width:100%;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.search-results .result-name>span{display:inline-block;margin:0;font-weight:normal;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help>div>span{text-align:center;display:block;margin:10px 0;font-size:18px;border-bottom:1px solid #ccc;padding-bottom:4px;margin-bottom:6px;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:0 20px 20px 17px;;}.stab{border-width:1px;border-style:solid;padding:3px;margin-bottom:5px;font-size:90%;font-weight:normal;}.stab p{display:inline;}.stab .emoji{font-size:1.5em;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-left:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.impl-items .since,.impl .since,.methods .since{padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{font-size:17px;font-weight:normal;}.rightside{float:right;}.has-srclink{font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.section-header a{color:inherit;}.code-attribute{font-weight:300;}.since+.srclink{padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}.sub-variant,.sub-variant>h3{margin-top:0px !important;padding-top:1px;}#main>details>.sub-variant>h3{font-size:15px;margin-left:25px;margin-bottom:5px;}.sub-variant>div{margin-left:20px;margin-bottom:10px;}.sub-variant>div>span{display:block;position:relative;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.docblock>.section-header:first-child{margin-left:15px;margin-top:0;}.docblock>.section-header:first-child:hover>a:before{left:-10px;}:target>code{opacity:1;}:target{padding-right:3px;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:16px;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:20px;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:16px;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:19px;font-weight:600;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:20px;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border:0;border-top:2px solid;}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:16px;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu,#help-button{position:absolute;top:10px;}#settings-menu{right:0;outline:none;}#theme-picker,#settings-menu,#help-button,#copy-path{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}#help-button{right:30px;font-family:"Fira Sans",Arial,sans-serif;text-align:center;font-size:17px;padding-top:2px;}#copy-path{background:initial;margin-left:10px;padding:0;padding-left:2px;border:0;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary,details.undocumented>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker,details.undocumented>summary::-webkit-details-marker,details.undocumented>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"[+]";font-weight:300;font-size:0.8em;letter-spacing:1px;cursor:pointer;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-family:'Fira Sans';font-size:16px;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-23px;top:3px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before,.undocumented>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-2px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle,details.undocumented{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before{content:"[−]";display:inline;}details.undocumented>summary::before{content:"[+] Show hidden undocumented items";cursor:pointer;font-size:16px;font-weight:300;}details.undocumented[open] >summary::before{content:"[−] Hide undocumented items";}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;left:0;top:45px;bottom:0;overflow-y:auto;border-right:1px solid;display:none;}.sidebar>.block.version{overflow:hidden;border-bottom:none;margin-bottom:0;height:100%;padding-left:12px;}.sidebar>.block.version>div.narrow-helper{float:left;width:1px;height:100%;}.sidebar>.block.version>p{margin:0;min-width:55px;display:flex;align-items:center;height:100%;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main,#search{margin-top:45px;padding:0;}#search{margin-left:0;}.anchor{display:none !important;}.theme-picker{left:10px;top:54px;z-index:1;}.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar.mobile>div.version{overflow:hidden;max-height:33px;}.sidebar{width:calc(100% + 30px);}.show-it{display:block;width:246px;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main>details.rustdoc-toggle>summary::before,#main>div>details.rustdoc-toggle>summary::before{left:-11px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-container>div{width:calc(100% - 32px);}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}}@media print{nav.sub,.content .out-of-band{display:none;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main,#search{margin-top:100px;}#main>table:not(.table-display) td{word-break:break-word;width:50%;}.search-container>div{display:block;width:calc(100% - 37px);}#crate-search{width:100%;border-radius:4px;border:0;}#crate-search+.search-input{width:calc(100% + 71px);margin-left:-36px;}#theme-picker,#settings-menu{padding:5px;width:31px;height:31px;}#theme-picker{margin-top:-2px;}#settings-menu{top:7px;}.docblock{margin-left:12px;}} \ No newline at end of file diff --git a/rustdoc/latest/search-index.js b/rustdoc/latest/search-index.js new file mode 100644 index 00000000..a3a2cd07 --- /dev/null +++ b/rustdoc/latest/search-index.js @@ -0,0 +1,4 @@ +var searchIndex = JSON.parse('{\ +"halo2":{"doc":"halo2","t":[0,0,0,0,0,0,16,16,16,8,18,3,8,8,16,18,8,8,8,8,18,18,18,18,18,16,16,16,3,18,18,18,10,10,10,10,10,11,5,5,11,11,11,11,11,11,5,11,10,10,11,11,11,11,11,11,11,10,10,11,11,10,5,11,11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,10,10,10,10,10,10,10,5,5,11,10,10,10,5,11,11,11,11,11,10,10,11,11,5,10,10,11,11,10,11,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,3,8,16,8,16,3,3,3,3,16,3,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,0,10,11,11,10,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,3,10,11,10,11,11,11,11,11,11,10,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,13,13,13,3,13,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,13,13,4,4,8,13,8,3,8,16,13,3,3,13,4,4,3,13,13,8,16,13,3,13,13,13,3,3,3,13,3,13,13,3,13,13,13,13,3,3,13,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,12,8,3,4,3,3,3,13,3,3,3,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,3,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,3,3,12,11,11,11,11,11,11,11,11,12,5,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,12,12,12,11,11,11,11,11,11,11,11,5,11,11,3,3,3,3,8,16,8,8,8,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,10,11,10,11,10,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,10,11],"n":["arithmetic","circuit","dev","plonk","poly","transcript","AffineExt","Base","Base","BatchInvert","CURVE_ID","Coordinates","CurveAffine","CurveExt","CurveExt","DELTA","Field","Field","FieldExt","Group","MODULUS","RESCUE_ALPHA","RESCUE_INVALPHA","ROOT_OF_UNITY","ROOT_OF_UNITY_INV","Scalar","ScalarExt","ScalarExt","SqrtTables","TWO_INV","T_MINUS1_OVER2","ZETA","a","a","b","b","batch_invert","batch_invert","best_fft","best_multiexp","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","compute_inner_product","conditional_select","coordinates","ct_is_zero","cube","cube","default","deref","deref","deref_mut","deref_mut","double","double","drop","drop","endo","eval_polynomial","fmt","fmt","from","from","from_bytes","from_bytes_wide","from_u128","from_u64","from_xy","get_lower_128","get_lower_32","group_add","group_scale","group_sub","group_zero","hash_to_curve","init","init","into","into","invert","invert","is_on_curve","is_on_curve","is_zero","is_zero","jacobian_coordinates","kate_division","lagrange_interpolate","new","new_jacobian","one","one","parallelize","pow","pow_by_t_minus1_over2","pow_vartime","pow_vartime","rand","random","random","read","read","small_multiexp","sqrt","sqrt","sqrt_alt","sqrt_alt","sqrt_ratio","sqrt_ratio","square","square","to_bytes","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","u","v","vzip","vzip","write","write","x","y","zero","zero","Cell","Chip","Config","Layouter","Loaded","NamespacedLayouter","Region","RegionIndex","RegionStart","Root","SimpleFloorPlanner","assign_advice","assign_fixed","assign_region","assign_region","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","config","constrain_equal","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","eq","floor_planner","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_root","get_root","init","init","init","init","init","init","into","into","into","into","into","into","layouter","loaded","namespace","ne","pop_namespace","pop_namespace","push_namespace","push_namespace","synthesize","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","V1","V1Pass","assign_region","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","get_root","init","init","into","into","pop_namespace","push_namespace","synthesize","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","RegionLayouter","RegionShape","assign_advice","assign_advice","assign_fixed","assign_fixed","borrow","borrow_mut","clone","clone_into","columns","constrain_equal","constrain_equal","deref","deref_mut","drop","enable_selector","enable_selector","fmt","from","init","into","new","region_index","row_count","to_owned","try_from","try_into","type_id","vzip","Cell","Constraint","Lookup","MockProver","Permutation","VerifyFailure","assign_advice","assign_fixed","borrow","borrow","borrow_mut","borrow_mut","copy","deref","deref","deref_mut","deref_mut","drop","drop","enable_selector","enter_region","eq","exit_region","fmt","fmt","fmt","from","from","init","init","into","into","metadata","ne","pop_namespace","push_namespace","run","to_string","try_from","try_from","try_into","try_into","type_id","type_id","verify","vzip","vzip","column","column","constraint","gate","lookup_index","offset","perm_index","region","row","row","row","Constraint","Gate","Region","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","init","init","init","into","into","into","ne","ne","ne","to_string","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","Advice","Advice","Advice","Any","Assigned","Assignment","BoundsFailure","Circuit","Column","ColumnType","Config","Constant","Constraint","ConstraintSystem","ConstraintSystemFailure","Error","Expression","Fixed","Fixed","Fixed","FloorPlanner","FloorPlanner","IncompatibleParams","Instance","Instance","Instance","OpeningError","Permutation","PinnedConstraintSystem","PinnedVerificationKey","Product","ProvingKey","Rational","Scaled","Selector","Sum","SynthesisError","TranscriptError","Trivial","VerifyingKey","VirtualCells","Zero","add","add","add","advice_column","assign_advice","assign_fixed","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","configure","copy","create_gate","create_proof","default","degree","degree","denominator","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","enable","enable_selector","enter_region","eq","eq","eq","eq","eq","eq","eq","evaluate","evaluate","exit_region","fixed_column","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_domain","get_vk","hash","hash","hash","hash","hash","hash","hash_into","index","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","instance_column","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","invert","keygen_pk","keygen_vk","lookup","mapping","mul","mul","mul","mul","ne","ne","ne","neg","neg","new","numerator","partial_cmp","permutation","pinned","pinned","pop_namespace","push_namespace","query_advice","query_any","query_fixed","query_instance","query_selector","read","selector","square","sub","sub","sub","synthesize","synthesize","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","verify_proof","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","without_witnesses","write","0","Basis","Coeff","Error","EvaluationDomain","ExtendedLagrangeCoeff","LagrangeCoeff","OpeningError","PinnedEvaluationDomain","Polynomial","Rotation","SamplingError","add","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","coeff_from_vec","coeff_to_extended","commitment","constant_extended","constant_lagrange","cur","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","divide_by_vanishing_poly","drop","drop","drop","drop","drop","drop","drop","drop","empty_coeff","empty_extended","empty_lagrange","eq","extended_len","extended_to_coeff","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","get_barycentric_weight","get_extended_omega","get_omega","get_omega_inv","get_quotient_poly_degree","index","index","index","index_mut","index_mut","index_mut","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","iter","iter_mut","lagrange_from_vec","lagrange_to_coeff","mul","mul","multiopen","ne","new","next","num_coeffs","one_minus","pinned","prev","rotate","rotate_omega","sub","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","0","Accumulator","Blind","Guard","MSM","Params","add","add_assign","add_assign","add_constant_term","add_msm","add_to_g_scalars","add_to_h_scalar","add_to_u_scalar","append_term","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","challenges_packed","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","commit","commit_lagrange","compute_g","create_proof","default","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","empty_msm","eq","eval","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","g","get_g","init","init","init","init","init","into","into","into","into","into","mul","mul_assign","mul_assign","ne","new","new","read","scale","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","use_challenges","use_g","verify_proof","vzip","vzip","vzip","vzip","vzip","write","ProverQuery","VerifierQuery","blind","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","commitment","create_proof","deref","deref","deref_mut","deref_mut","drop","drop","eval","fmt","fmt","from","from","init","init","into","into","point","point","poly","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","verify_proof","vzip","vzip","Blake2bRead","Blake2bWrite","Challenge255","ChallengeScalar","EncodedChallenge","Input","Transcript","TranscriptRead","TranscriptWrite","as_challenge_scalar","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","common_point","common_point","common_point","common_scalar","common_scalar","common_scalar","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","finalize","fmt","fmt","fmt","fmt","from","from","from","from","get_scalar","get_scalar","init","init","init","init","init","init","into","into","into","into","new","new","read_point","read_point","read_scalar","read_scalar","squeeze_challenge","squeeze_challenge","squeeze_challenge","squeeze_challenge_scalar","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","write_point","write_point","write_scalar","write_scalar"],"q":["halo2","","","","","","halo2::arithmetic","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::circuit","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::circuit::floor_planner","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::circuit::layouter","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::dev","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::dev::VerifyFailure","","","","","","","","","","","halo2::dev::metadata","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::plonk","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::poly","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::poly::commitment","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::poly::multiopen","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","halo2::transcript","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["This module provides common utilities, traits and …","Traits and structs for implementing circuit components.","Tools for developing circuits.","This module provides an implementation of a variant of …","Contains utilities for performing arithmetic over …","This module contains utilities and traits for dealing …","The affine version of the curve","The base field over which this elliptic curve is …","The base field over which this elliptic curve is …","Extension trait for iterators over mutable field elements …","CURVE_ID used for hash-to-curve.","The affine coordinates of a point on an elliptic curve.","This trait is the affine counterpart to Curve and is used …","This trait is a common interface for dealing with …","The projective form of the curve","Generator of the $t-order$ multiplicative subgroup","This trait represents an element of a field.","This trait represents an element of a field.","This trait is a common interface for dealing with …","This represents an element of a group with basic …","Modulus of the field written as a string for display …","Ideally the smallest prime $\\\\alpha$ such that gcd($p - …","$RESCUE_INVALPHA \\\\cdot RESCUE_ALPHA = 1 \\\\mod p - 1$ such …","Generator of the $2^S$ multiplicative subgroup","Inverse of ROOT_OF_UNITY","The group is assumed to be of prime order $p$. Scalar is …","The scalar field of this elliptic curve.","The scalar field of this elliptic curve.","Tables used for square root computation.","Inverse of $2$ in the field.","The value $(T-1)/2$ such that $2^S \\\\cdot T = p - 1$ with …","Element of multiplicative order $3$.","Returns the curve constant a.","Returns the curve constant $a$.","Returns the curve constant b.","Returns the curve constant $b$.","Consume this iterator and invert each field element (when …","Performs a batch inversion using Montgomery’s trick, …","Performs a radix-$2$ Fast-Fourier Transformation (FFT) on …","Performs a multi-exponentiation operation.","","","","","","","This computes the inner product of two vectors a and b.","","Gets the coordinates of this point.","Returns whether or not this element is zero.","Cubes this element.","Cubes this element.","","","","","","Doubles this element.","Doubles this element.","","","Apply the curve endomorphism by multiplying the …","This evaluates a provided polynomial (in coefficient …","","","","","Attempts to obtain a field element from its normalized, …","Obtains a field element that is congruent to the provided …","Obtains a field element congruent to the integer v.","Obtains a field element congruent to the integer v.","Obtains a point given $(x, y)$, failing if it is not on …","Gets the lower 128 bits of this field element when …","Gets the lower 32 bits of this field element when …","Adds rhs to this group element.","Scales this group element by a scalar.","Subtracts rhs from this group element.","Returns the additive identity of the group.","Requests a hasher that accepts messages and returns …","","","","","Computes the multiplicative inverse of this element, …","Computes the multiplicative inverse of this element, …","Returns whether or not this element is on the curve; …","Returns whether or not this element is on the curve; …","Returns true iff this element is zero.","Returns true iff this element is zero.","Return the Jacobian coordinates of this point.","Divides polynomial a in X by X - b with no remainder.","Returns coefficients of an n - 1 degree polynomial given …","Build tables given parameters for the perfect hash.","Obtains a point given Jacobian coordinates $X : Y : Z$, …","Returns the one element of the field, the multiplicative …","Returns the one element of the field, the multiplicative …","This simple utility function will parallelize an …","Exponentiates self by by, where by is a little-endian …","Raise this field element to the power T_MINUS1_OVER2. …","Exponentiates self by exp, where exp is a little-endian …","Exponentiates self by exp, where exp is a little-endian …","This computes a random element of the field using system …","Returns an element chosen uniformly at random using a …","Returns an element chosen uniformly at random using a …","Reads a compressed element from the buffer and attempts …","Reads a normalized, little endian represented field …","Performs a small multi-exponentiation operation. Uses the …","Returns the square root of the field element, if it is …","Returns the square root of the field element, if it is …","Equivalent to sqrt_ratio(self, one()).","Same as sqrt_ratio(u, one()) but more efficient.","Computes:","Computes:","Squares this element.","Squares this element.","Converts this field element to its normalized, little …","","","","","","","","Returns the u-coordinate.","Returns the v-coordinate.","","","Writes an element in compressed form to the buffer.","Writes this element in its normalized, little endian form …","Returns the x-coordinate.","Returns the y-coordinate.","Returns the zero element of the field, the additive …","Returns the zero element of the field, the additive …","A pointer to a cell within a circuit.","A chip implements a set of instructions that can be used …","A type that holds the configuration for this chip, and …","A layout strategy within a circuit. The layouter is …","A type that holds any general chip state that needs to be …","This is a “namespaced” layouter which borrows a …","A region of the circuit in which a Chip can assign cells.","Index of a region in a layouter","Starting row of a region in a layouter","Represents the type of the “root” of this layouter, …","A simple FloorPlanner that performs minimal optimizations.","Assign an advice column value (witness).","Assign a fixed value.","Assign a region of gates to an absolute row number.","","","","","","","","","","","","","","","","","","","","The chip holds its own configuration.","Constraint two cells to have the same value.","","","","","","","","","","","","","","","","","","","","","","","Implementations of common circuit floor planners.","","","","","","","","","","","","","","","","Gets the “root” of this assignment, bypassing the …","","","","","","","","","","","","","","Implementations of common circuit layouters.","Provides access to general chip state loaded at the …","Enters into a namespace.","","Exits out of the existing namespace.","","Creates a new (sub)namespace and enters into it.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The version 1 FloorPlanner provided by halo2.","A single pass of the V1 layouter.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Helper trait for implementing a custom Layouter.","The shape of a region. For a region at a certain index, …","Assign an advice column value (witness)","","Assign a fixed value","","","","","","Get a reference to the set of columns used in a …","Constraint two cells to have the same value.","","","","","Enables a selector at the given offset.","","","","","","Create a new RegionShape for a region at region_index.","Get the region_index of a RegionShape.","Get the row_count of a RegionShape.","","","","","","A cell used in an active gate was not assigned to.","A constraint was not satisfied for a particular row.","A lookup input did not exist in its corresponding table.","A test prover for debugging circuits.","A permutation did not preserve the original value of a …","The reasons why a particular circuit is not satisfied.","","","","","","","","","","","","","","","","","","","","","","","","","","","Metadata about circuits.","","","","Runs a synthetic keygen-and-prove operation on the given …","","","","","","","","Returns Ok(()) if this MockProver is satisfied, or a list …","","","The column in which this cell should be assigned.","The column in which this permutation is not satisfied.","The polynomial constraint that is not satisfied.","The index of the active gate.","The index of the lookup that is not satisfied. These …","The offset (relative to the start of the region) at which …","The index of the permutation that is not satisfied. These …","The region in which this cell should be assigned.","The row on which this constraint is not satisfied.","The row on which this lookup is not satisfied.","The row on which this permutation is not satisfied.","Metadata about a configured constraint within a circuit.","Metadata about a configured gate within a circuit.","Metadata about an assigned region within a circuit.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","An advice column","An Advice variant","This is an advice (witness) column queried at a certain …","An enum over the Advice, Fixed, Instance structs","A value assigned to a cell within a circuit.","This trait allows a Circuit to direct some backend to …","Out of bounds index passed to a backend","This is a trait that circuits provide implementations for …","A column with an index and type","A column type","This is a configuration object that stores things like …","This is a constant polynomial","An individual polynomial constraint.","This is a description of the circuit environment, such as …","The constraint system is not satisfied.","This is an error that could occur during proving or …","Low-degree expression representing an identity that must …","A fixed column","A Fixed variant","This is a fixed column queried at a certain relative …","A floor planning strategy for a circuit.","The floor planner used for this circuit. This is an …","The structured reference string or the parameters are not …","An instance column","An Instance variant","This is an instance (external) column queried at a …","Opening error","A permutation.","Represents the minimal parameters that determine a …","Minimal representation of a verification key that can be …","This is the product of two polynomials","This is a proving key which allows for the creation of …","A value stored as a fraction to enable batch inversion.","This is a scaled polynomial","A selector, representing a fixed boolean value per row of …","This is the sum of two polynomials","This is an error that can occur during synthesis of the …","Transcript error","A value that does not require inversion to evaluate.","This is a verifying key which allows for the verification …","Exposes the “virtual cells” that can be queried while …","The field element zero.","","","","Allocate a new advice column","Assign an advice column value (witness)","Assign a fixed value","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The circuit is given an opportunity to describe the exact …","Assign two cells to have the same value","Creates a new gate.","This creates a proof for the provided circuit when given …","","Compute the degree of this polynomial","Compute the degree of the constraint system (the maximum …","Returns the denominator, if non-trivial.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enable this selector at the given offset within the given …","Enables a selector at the given row.","Creates a new region and enters into it.","","","","","","","","Evaluates this assigned value directly, performing an …","Evaluate the polynomial using the provided closures to …","Exits the current region.","Allocate a new fixed column","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get the underlying EvaluationDomain.","Get the underlying VerifyingKey.","","","","","","","Hashes a verification key into a transcript.","Returns index of permutation","","","","","","","","","","","","","","","","","","Allocate a new instance column","","","","","","","","","","","","","","","","","","Inverts this assigned value.","Generate a ProvingKey from a VerifyingKey and an instance …","Generate a VerifyingKey from an instance of Circuit.","Add a lookup argument for some input expressions and …","Returns mapping of permutation","","","","","","","","","","Configures a new permutation for the given columns.","Returns the numerator.","","Add a permutation argument for some columns","Obtain a pinned version of this constraint system; a …","Obtains a pinned representation of this verification key …","Exits out of the existing namespace.","Creates a new (sub)namespace and enters into it.","Query an advice column at a relative position","Query an Any column at a relative position","Query a fixed column at a relative position","Query an instance column at a relative position","Query a selector at the current position.","Reads a verification key from a buffer.","Allocate a new selector.","Square this expression.","","","","Given the provided cs, synthesize the given circuit.","Given the provided cs, synthesize the circuit. The …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns a boolean indicating whether or not the proof is …","","","","","","","","","","","","","","","","","","Returns a copy of this circuit with no witness values …","Writes a verifying key to a buffer.","","The basis over which a polynomial is described.","The polynomial is defined as coefficients","This is an error that could occur during proving or …","This structure contains precomputed constants and other …","The polynomial is defined as coefficients of Lagrange …","The polynomial is defined as coefficients of Lagrange …","OpeningProof is not well-formed","Represents the minimal parameters that determine an …","Represents a univariate polynomial defined over a field …","Describes the relative rotation of a vector. Negative …","Caller needs to re-sample a point","","","","","","","","","","","","","","","","","","","","","","","","","","","","Obtains a polynomial in coefficient form when given a …","This takes us from an n-length coefficient vector into a …","This module contains an implementation of the polynomial …","Returns a constant polynomial in the extended Lagrange …","Returns a constant polynomial in the Lagrange coefficient …","The current location in the evaluation domain","","","","","","","","","","","","","","","","","","","","This divides the polynomial (in the extended domain) by …","","","","","","","","","Returns an empty (zero) polynomial in the coefficient …","Returns an empty (zero) polynomial in the extended …","Returns an empty (zero) polynomial in the Lagrange …","","Get the size of the extended domain","This takes us from the extended evaluation domain and …","","","","","","","","","","","","","","","","","Gets the barycentric weight of $1$ over the $2^k$ size …","Get the generator of the extended domain’s …","Get $\\\\omega$, the generator of the $2^k$ order …","Get $\\\\omega^{-1}$, the inverse of the generator of the …","Gets the quotient polynomial’s degree (as a multiple of …","","","","","","","","","","","","","","","","","","","","","","","Iterate over the values, which are either in coefficient …","Iterate over the values mutably, which are either in …","Obtains a polynomial in Lagrange form when given a vector …","This takes us from an n-length vector into the …","","","This module contains an optimisation of the polynomial …","","This constructs a new evaluation domain object based on …","The next location in the evaluation domain","Gets the size of this polynomial in terms of the number of…","Maps every coefficient c in p to 1 - c.","Obtain a pinned version of this evaluation domain; a …","The previous location in the evaluation domain","Rotates the values in a Lagrange basis polynomial by …","Multiplies a value by some power of $\\\\omega$, essentially …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","An accumulator instance consisting of an evaluation claim …","Wrapper type around a blinding factor.","A guard returned by the verifier","A multiscalar multiplication in the polynomial commitment …","These are the public parameters for the polynomial …","","","","Add a value to the first entry of g_scalars.","Add another multiexp into this one","Add a vector of scalars to g_scalars. This function will …","Add to h_scalar","Add to u_scalar","Add arbitrary term (the scalar and the point)","","","","","","","","","","","A vector of 128-bit challenges sampled by the verifier, …","","","","","","","","","This computes a commitment to a polynomial described by …","This commits to a polynomial using its evaluations over …","Computes G + H, where G = ⟨s, params.g⟩ and H is used …","Create a polynomial commitment opening proof for the …","","","","","","","","","","","","","","","","","Generates an empty multiscalar multiplication struct …","","Perform multiexp and check that it results in zero","","","","","","","","","","","The claimed output of the linear-time polycommit opening …","Getter for g generators","","","","","","","","","","","","","","","Create a new, empty MSM using the provided parameters.","Initializes parameters for the curve, given a random …","Reads params from a buffer.","Scale all scalars in the MSM by some scaling factor","","","","","","","","","","","","","","","","","","","","Lets caller supply the challenges and obtain an MSM with …","Lets caller supply the purported G point and simply …","Checks to see if the proof represented within transcript …","","","","","","Writes params to a buffer.","A polynomial query at a point","A polynomial query at a point","blinding factor of polynomial","","","","","","","","","commitment to polynomial","Create a multi-opening proof","","","","","","","evaluation of polynomial at query point","","","","","","","","","point at which polynomial is queried","point at which polynomial is queried","coefficients of polynomial","","","","","","","","","Verify a multi-opening proof","","","We will replace BLAKE2b with an algebraic hash function …","We will replace BLAKE2b with an algebraic hash function …","A 255-bit challenge.","The scalar representation of a verifier challenge.","EncodedChallenge defines a challenge encoding with a …","The Input type used to derive the challenge encoding. For …","Generic transcript view (from either the prover or …","Transcript view from the perspective of a verifier that …","Transcript view from the perspective of a prover that has …","Cast an encoded challenge as a typed ChallengeScalar.","","","","","","","","","","","","","","","","","Writing the point to the transcript without writing it to …","","","Writing the scalar to the transcript without writing it …","","","","","","","","","","","","","","","","","Conclude the interaction and return the output buffer …","","","","","","","","","Get a scalar field element from an encoded challenge.","","","Initialize a transcript given an input buffer.","","Initialize a transcript given an output buffer.","","","","","","","Get an encoded challenge from a given input challenge.","","Read a curve point from the prover.","","Read a curve scalar from the prover.","","Squeeze an encoded verifier challenge from the transcript.","","","Squeeze a typed challenge (in the scalar field) from the …","","","","","","","","","","","","","","","","","","","","","Write a curve point to the proof and the transcript.","","Write a scalar to the proof and the transcript.",""],"i":[0,0,0,0,0,0,1,1,2,0,1,0,0,0,2,3,0,0,0,0,3,3,3,3,3,4,1,2,0,3,3,3,1,2,1,2,5,3,0,0,6,7,6,7,6,6,0,6,2,3,8,8,6,6,7,6,7,8,8,6,7,1,0,6,7,6,7,3,3,3,3,2,3,3,4,4,4,4,1,6,7,6,7,8,8,1,2,8,8,1,0,0,7,1,8,8,0,3,3,8,8,3,8,8,2,3,0,8,8,3,7,3,7,8,8,3,6,6,7,6,7,6,7,6,6,6,7,2,3,6,6,8,8,0,0,9,0,9,0,0,0,0,10,0,11,11,10,12,13,14,15,16,11,12,13,14,15,16,11,12,14,15,16,14,15,16,9,11,13,14,14,15,15,16,11,12,13,14,15,16,11,12,13,14,15,16,11,12,12,15,0,13,14,15,16,11,12,13,14,14,15,15,16,11,11,12,10,12,13,14,15,16,11,12,13,14,15,16,11,12,0,9,10,15,10,12,10,12,13,14,15,16,13,14,15,16,11,12,13,14,15,16,11,12,13,14,15,16,11,12,13,14,15,16,11,12,0,0,17,18,17,18,17,18,17,18,17,18,17,18,17,18,17,17,18,17,18,17,17,17,18,18,17,18,17,18,17,18,17,0,0,19,20,19,20,20,20,20,20,20,19,20,20,20,20,19,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,0,21,0,22,22,21,22,21,22,22,21,22,21,22,21,22,22,22,21,22,21,21,22,21,22,21,22,21,22,0,21,22,22,22,21,21,22,21,22,21,22,22,21,22,23,24,25,23,26,23,24,23,25,26,24,0,0,0,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,27,27,28,28,29,29,27,27,28,28,29,29,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,27,28,29,0,30,31,0,0,0,32,0,0,0,33,31,0,0,32,0,0,0,30,31,0,33,32,0,30,31,32,0,0,0,31,0,34,31,0,31,32,32,34,0,0,34,34,34,31,35,36,36,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,35,37,38,39,40,30,41,42,34,31,35,37,33,36,35,0,35,31,35,34,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,41,36,36,37,38,39,40,30,41,42,34,31,36,35,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,37,37,37,38,39,40,30,30,30,30,41,42,34,34,34,31,43,43,43,35,44,45,46,47,48,32,46,48,37,38,39,40,30,41,46,42,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,35,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,34,0,0,35,42,34,34,31,31,37,41,42,34,31,42,34,37,35,35,46,36,36,45,45,45,45,45,46,35,31,34,34,31,49,33,37,38,39,40,30,41,42,34,31,35,37,37,37,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,0,37,38,39,40,30,41,42,34,31,43,35,44,45,46,47,48,32,33,46,50,0,0,0,0,0,0,51,0,0,0,51,52,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,55,56,57,52,50,55,56,57,52,50,53,53,0,53,53,50,50,53,54,51,55,56,57,52,52,50,53,54,51,55,56,57,52,52,50,53,53,54,51,55,56,57,52,50,53,53,53,50,53,53,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,53,53,53,53,53,52,52,52,52,52,52,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,52,52,53,53,52,52,0,50,53,50,52,52,53,50,52,53,52,55,56,57,52,50,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,53,54,51,55,56,57,52,50,58,0,0,0,0,0,58,58,58,59,59,59,59,59,59,59,60,61,62,58,59,60,61,62,58,61,59,60,61,58,59,60,61,58,62,62,60,0,58,59,60,61,62,58,59,60,61,62,58,59,60,61,62,58,62,58,59,59,60,61,62,58,59,60,61,62,58,61,62,59,60,61,62,58,59,60,61,62,58,58,58,58,58,59,62,62,59,59,60,61,58,59,60,61,62,58,59,60,61,62,58,59,60,61,62,58,60,60,0,59,60,61,62,58,62,0,0,63,63,64,63,64,63,64,63,64,64,0,63,64,63,64,63,64,64,63,64,63,64,63,64,63,64,63,64,63,63,64,63,64,63,64,63,64,0,63,64,0,0,0,0,0,65,0,0,0,65,66,67,68,69,66,67,68,69,66,67,68,69,66,67,68,69,70,66,67,70,66,67,66,67,68,68,69,69,66,67,68,69,66,67,68,69,67,66,67,68,69,66,67,68,69,65,69,66,66,67,67,68,69,66,67,68,69,65,69,71,66,71,66,70,66,67,70,66,67,68,69,66,67,68,69,66,67,68,69,66,67,68,69,66,67,68,69,72,67,72,67],"f":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[["u32",15]]],[[]],[[]],[[]],[[]],[[]],[[],["coordinates",3]],[[]],[[],["field",8]],[[["coordinates",3],["choice",3]],["coordinates",3]],[[],[["ctoption",3,["coordinates"]],["coordinates",3]]],[[],["choice",3]],[[]],[[]],[[],["coordinates",3]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[]],[[["usize",15]]],[[["usize",15]]],[[]],[[["field",8]],["field",8]],[[["formatter",3]],[["result",4,["error"]],["error",3]]],[[["formatter",3]],[["result",4,["error"]],["error",3]]],[[]],[[]],[[],["ctoption",3]],[[]],[[["u128",15]]],[[["u64",15]]],[[],["ctoption",3]],[[],["u128",15]],[[],["u32",15]],[[]],[[]],[[]],[[]],[[["str",15]],[["box",3,["fn","global"]],["fn",8],["global",3]]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[],["ctoption",3]],[[],["ctoption",3]],[[],["choice",3]],[[],["choice",3]],[[],["bool",15]],[[],["bool",15]],[[]],[[["intoiterator",8],["field",8]],[["field",8],["vec",3]]],[[],[["vec",3],["fieldext",8]]],[[["usize",15],["u32",15]],["sqrttables",3]],[[],["ctoption",3]],[[]],[[]],[[["sync",8],["send",8],["fn",8],["clone",8]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[["error",3],["result",4,["error"]]]],[[],[["error",3],["result",4,["error"]]]],[[]],[[],["ctoption",3]],[[],["ctoption",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[],[["error",3],["result",4,["error"]]]],[[],[["error",3],["result",4,["error"]]]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,null,null,null,null,null,[[["column",3,["advice"]],["usize",15],["advice",3]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[["usize",15],["column",3,["fixed"]],["fixed",3]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[],[["error",4],["result",4,["error"]]]],[[],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["regionindex",3]],[[],["regionstart",3]],[[],["cell",3]],[[]],[[]],[[]],[[]],[[["permutation",3],["cell",3]],[["error",4],["result",4,["error"]]]],[[["usize",15]]],[[]],[[["usize",15]]],[[["usize",15]]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[["usize",15]]],[[["regionstart",3]],["bool",15]],null,[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[["usize",15]],["regionindex",3]],[[]],[[]],[[["usize",15]],["regionstart",3]],[[]],[[]],[[["regionlayouter",8]]],[[]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[]],[[]],[[]],[[]],null,[[]],[[],["namespacedlayouter",3]],[[["regionstart",3]],["bool",15]],[[["string",3],["option",4,["string"]]]],[[["string",3],["option",4,["string"]]]],[[]],[[]],[[],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],null,null,[[],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[["string",3],["option",4,["string"]]]],[[]],[[],[["error",4],["result",4,["error"]]]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],null,null,[[["usize",15],["column",3,["advice"]],["fn",8],["fnmut",8],["advice",3]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[["usize",15],["column",3,["advice"]],["fn",8],["fnmut",8],["advice",3]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[["usize",15],["column",3,["fixed"]],["fn",8],["fixed",3],["fnmut",8]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[["usize",15],["column",3,["fixed"]],["fn",8],["fixed",3],["fnmut",8]],[["result",4,["cell","error"]],["cell",3],["error",4]]],[[]],[[]],[[],["regionshape",3]],[[]],[[],["hashset",3]],[[["permutation",3],["cell",3]],[["error",4],["result",4,["error"]]]],[[["permutation",3],["cell",3]],[["error",4],["result",4,["error"]]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["selector",3],["usize",15],["fn",8]],[["error",4],["result",4,["error"]]]],[[["selector",3],["usize",15],["fn",8]],[["error",4],["result",4,["error"]]]],[[["formatter",3]],["result",6]],[[]],[[],["usize",15]],[[]],[[["regionindex",3]]],[[],["regionindex",3]],[[],["usize",15]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],null,null,null,null,null,null,[[["column",3,["advice"]],["usize",15],["advice",3]],[["error",4],["result",4,["error"]]]],[[["usize",15],["column",3,["fixed"]],["fixed",3]],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[]],[[["any",4],["column",3,["any"]],["usize",15],["permutation",3]],[["error",4],["result",4,["error"]]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["selector",3],["usize",15]],[["error",4],["result",4,["error"]]]],[[]],[[["verifyfailure",4]],["bool",15]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],null,[[["verifyfailure",4]],["bool",15]],[[["string",3],["option",4,["string"]]]],[[]],[[["vec",3],["u32",15],["vec",3,["vec"]]],[["result",4,["error"]],["error",4]]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],[["result",4,["vec"]],["vec",3,["verifyfailure"]]]],[[]],[[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["gate",3]],["bool",15]],[[["constraint",3]],["bool",15]],[[["region",3]],["bool",15]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[]],[[["gate",3]],["bool",15]],[[["constraint",3]],["bool",15]],[[["region",3]],["bool",15]],[[],["string",3]],[[],["string",3]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[["assigned",4]],["assigned",4]],[[],["assigned",4]],[[["expression",4]],["expression",4]],[[],[["advice",3],["column",3,["advice"]]]],[[["column",3,["advice"]],["usize",15],["advice",3]],[["error",4],["result",4,["error"]]]],[[["usize",15],["column",3,["fixed"]],["fixed",3]],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["column",3]],[[],["advice",3]],[[],["fixed",3]],[[],["instance",3]],[[],["any",4]],[[],["selector",3]],[[],["permutation",3]],[[],["assigned",4]],[[],["expression",4]],[[],["constraintsystem",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["ordering",4]],[[["constraintsystem",3]]],[[["any",4],["column",3,["any"]],["usize",15],["permutation",3]],[["error",4],["result",4,["error"]]]],[[["str",15]]],[[["params",3],["provingkey",3]],[["error",4],["result",4,["error"]]]],[[],["constraintsystem",3]],[[],["usize",15]],[[],["usize",15]],[[],["option",4]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15],["region",3]],[["error",4],["result",4,["error"]]]],[[["selector",3],["usize",15]],[["error",4],["result",4,["error"]]]],[[]],[[["column",3]],["bool",15]],[[["advice",3]],["bool",15]],[[["fixed",3]],["bool",15]],[[["instance",3]],["bool",15]],[[["any",4]],["bool",15]],[[["selector",3]],["bool",15]],[[["permutation",3]],["bool",15]],[[]],[[]],[[]],[[],[["column",3,["fixed"]],["fixed",3]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["instance",3],["column",3,["instance"]]],[["any",4],["column",3,["any"]]]],[[]],[[["column",3,["fixed"]],["fixed",3]],[["any",4],["column",3,["any"]]]],[[["column",3,["advice"]],["advice",3]],[["any",4],["column",3,["any"]]]],[[]],[[]],[[]],[[["instance",3]],["any",4]],[[]],[[["fixed",3]],["any",4]],[[["advice",3]],["any",4]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["expression",4]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["evaluationdomain",3]],[[],["verifyingkey",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",6]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],[["instance",3],["column",3,["instance"]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["params",3],["verifyingkey",3]],[["error",4],["result",4,["provingkey","error"]],["provingkey",3]]],[[["params",3]],[["verifyingkey",3],["result",4,["verifyingkey","error"]],["error",4]]],[[],["usize",15]],[[]],[[],["assigned",4]],[[["assigned",4]],["assigned",4]],[[["expression",4]],["expression",4]],[[],["expression",4]],[[["column",3]],["bool",15]],[[["selector",3]],["bool",15]],[[["permutation",3]],["bool",15]],[[]],[[]],[[["constraintsystem",3]]],[[]],[[],[["option",4,["ordering"]],["ordering",4]]],[[],["permutation",3]],[[],["pinnedconstraintsystem",3]],[[],["pinnedverificationkey",3]],[[["string",3],["option",4,["string"]]]],[[]],[[["column",3,["advice"]],["rotation",3],["advice",3]],["expression",4]],[[["any",4],["column",3,["any"]],["rotation",3]],["expression",4]],[[["rotation",3],["column",3,["fixed"]],["fixed",3]],["expression",4]],[[["instance",3],["column",3,["instance"]],["rotation",3]],["expression",4]],[[["selector",3]],["expression",4]],[[["params",3]],["result",6]],[[],["selector",3]],[[]],[[["assigned",4]],["assigned",4]],[[],["assigned",4]],[[["expression",4]],["expression",4]],[[],[["error",4],["result",4,["error"]]]],[[],[["error",4],["result",4,["error"]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["any",4],["column",3,["any"]]],["result",4]],[[],["result",4]],[[["any",4],["column",3,["any"]]],["result",4]],[[["any",4],["column",3,["any"]]],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[["msm",3],["verifyingkey",3],["curveaffine",8],["params",3]],[["guard",3],["result",4,["guard","error"]],["error",4]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",6]],null,null,null,null,null,null,null,null,null,null,null,null,[[["polynomial",3]],["polynomial",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["coeff",3]],[[],["lagrangecoeff",3]],[[],["extendedlagrangecoeff",3]],[[],["polynomial",3]],[[],["rotation",3]],[[]],[[]],[[]],[[]],[[]],[[["vec",3]],[["polynomial",3,["coeff"]],["coeff",3]]],[[["polynomial",3,["coeff"]],["coeff",3],["rotation",3]],[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]]],null,[[],[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]]],[[],[["polynomial",3,["lagrangecoeff"]],["lagrangecoeff",3]]],[[],["rotation",3]],[[],["rotation",3]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[["usize",15]]],[[["usize",15]]],[[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]],[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[],[["polynomial",3,["coeff"]],["coeff",3]]],[[],[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]]],[[],[["polynomial",3,["lagrangecoeff"]],["lagrangecoeff",3]]],[[["rotation",3]],["bool",15]],[[],["usize",15]],[[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]],["vec",3]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["usize",15]],[[["usize",15]]],[[["rangefull",3]]],[[["usize",15],["rangefrom",3,["usize"]]]],[[["usize",15],["rangefrom",3,["usize"]]]],[[["rangefull",3]]],[[["usize",15]]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["vec",3]],[["polynomial",3,["lagrangecoeff"]],["lagrangecoeff",3]]],[[["polynomial",3,["lagrangecoeff"]],["lagrangecoeff",3]],[["polynomial",3,["coeff"]],["coeff",3]]],[[["polynomial",3]],[["extendedlagrangecoeff",3],["polynomial",3,["extendedlagrangecoeff"]]]],[[],["polynomial",3]],null,[[["rotation",3]],["bool",15]],[[["u32",15]]],[[],["rotation",3]],[[],["usize",15]],[[]],[[],["pinnedevaluationdomain",3]],[[],["rotation",3]],[[["rotation",3]],[["polynomial",3,["lagrangecoeff"]],["lagrangecoeff",3]]],[[["rotation",3]]],[[["polynomial",3]],["polynomial",3]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,[[["blind",3]]],[[]],[[["blind",3]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,[[],["msm",3]],[[],["guard",3]],[[],["accumulator",3]],[[],["blind",3]],[[]],[[]],[[]],[[]],[[["polynomial",3],["blind",3]]],[[["polynomial",3],["blind",3]]],[[]],[[["params",3],["polynomial",3],["blind",3]],["result",6]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[],["msm",3]],[[["blind",3]],["bool",15]],[[],["bool",15]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],null,[[],["vec",3]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[]],[[]],[[]],[[["blind",3]]],[[["blind",3]]],[[]],[[["blind",3]],["bool",15]],[[["params",3]]],[[["u32",15]]],[[],["result",6]],[[]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["msm",3]],[[]],[[["msm",3],["curveaffine",8],["params",3]],[["guard",3],["error",4],["result",4,["guard","error"]]]],[[]],[[]],[[]],[[]],[[]],[[],["result",6]],null,null,null,[[]],[[]],[[]],[[]],[[],["proverquery",3]],[[],["verifierquery",3]],[[]],[[]],null,[[["params",3]],["result",6]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],null,[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],null,null,null,[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[["msm",3],["curveaffine",8],["params",3]],[["guard",3],["error",4],["result",4,["guard","error"]]]],[[]],[[]],null,null,null,null,null,null,null,null,null,[[],["challengescalar",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["blake2bread",3]],[[],["blake2bwrite",3]],[[],["challengescalar",3]],[[],["challenge255",3]],[[]],[[]],[[]],[[]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[["usize",15]]],[[]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[["usize",15]]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["usize",15]],[[]],[[],["usize",15]],[[]],[[],["usize",15]],[[],["usize",15]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[]],[[],["challenge255",3]],[[],["challenge255",3]],[[],["challengescalar",3]],[[]],[[]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[],["result",6]],[[],["result",6]],[[],["result",6]],[[],["result",6]]],"p":[[8,"CurveExt"],[8,"CurveAffine"],[8,"FieldExt"],[8,"Group"],[8,"BatchInvert"],[3,"Coordinates"],[3,"SqrtTables"],[8,"Field"],[8,"Chip"],[8,"Layouter"],[3,"Region"],[3,"NamespacedLayouter"],[3,"SimpleFloorPlanner"],[3,"RegionIndex"],[3,"RegionStart"],[3,"Cell"],[3,"V1Pass"],[3,"V1"],[8,"RegionLayouter"],[3,"RegionShape"],[4,"VerifyFailure"],[3,"MockProver"],[13,"Cell"],[13,"Permutation"],[13,"Constraint"],[13,"Lookup"],[3,"Gate"],[3,"Constraint"],[3,"Region"],[4,"Any"],[4,"Expression"],[4,"Error"],[8,"Circuit"],[4,"Assigned"],[3,"ConstraintSystem"],[8,"Assignment"],[3,"Column"],[3,"Advice"],[3,"Fixed"],[3,"Instance"],[3,"Selector"],[3,"Permutation"],[3,"Constraint"],[3,"PinnedConstraintSystem"],[3,"VirtualCells"],[3,"VerifyingKey"],[3,"PinnedVerificationKey"],[3,"ProvingKey"],[8,"FloorPlanner"],[3,"Rotation"],[4,"Error"],[3,"Polynomial"],[3,"EvaluationDomain"],[3,"PinnedEvaluationDomain"],[3,"Coeff"],[3,"LagrangeCoeff"],[3,"ExtendedLagrangeCoeff"],[3,"Blind"],[3,"MSM"],[3,"Guard"],[3,"Accumulator"],[3,"Params"],[3,"ProverQuery"],[3,"VerifierQuery"],[8,"EncodedChallenge"],[3,"Blake2bRead"],[3,"Blake2bWrite"],[3,"ChallengeScalar"],[3,"Challenge255"],[8,"Transcript"],[8,"TranscriptRead"],[8,"TranscriptWrite"]]}\ +}'); +if (window.initSearch) {window.initSearch(searchIndex)}; \ No newline at end of file diff --git a/rustdoc/latest/search.js b/rustdoc/latest/search.js new file mode 100644 index 00000000..798e252d --- /dev/null +++ b/rustdoc/latest/search.js @@ -0,0 +1 @@ +(function(){var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function printTab(nb){if(nb===0||nb===1||nb===2){searchState.currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){addClass(elem,"active")}else{removeClass(elem,"active")}nb-=1})}function removeEmptyStringsFromArray(x){for(var i=0,len=x.length;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(hasOwnPropertyRustdoc(results,entry)){ar.push(results[entry])}}results=ar;var i,len,result;for(i=0,len=results.length;ib?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});for(i=0,len=results.length;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function getObjectNameFromId(id){if(typeof id==="number"){return searchIndex[id].name}return id}function checkGenerics(obj,val){var tmp_lev,elem_name;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=Object.create(null);var elength=obj[GENERICS_DATA].length;for(var x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length>0){var elems=Object.create(null);len=obj[GENERICS_DATA].length;for(x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}}}else if(literalSearch){if((!val.generics||val.generics.length===0)&&obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){return obj[GENERICS_DATA].some(function(name){return name===val.name})}return false}lev_distance=Math.min(levenshtein(obj[NAME],val.name),lev_distance);if(lev_distance<=MAX_LEV_DISTANCE){lev_distance=Math.ceil((checkGenerics(obj,val)+lev_distance)/2)}else if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x0){var length=obj.type[INPUTS_DATA].length;for(var i=0;iOUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(var x=0,len=ret.length;xlength){return MAX_LEV_DISTANCE+1}for(var i=0;ilength){break}var lev_total=0;var aborted=false;for(var x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates){var aliases=[];var crateAliases=[];if(filterCrates!==undefined){if(ALIASES[filterCrates]&&ALIASES[filterCrates][query.search]){var query_aliases=ALIASES[filterCrates][query.search];var len=query_aliases.length;for(var i=0;iMAX_RESULTS){ret.others.pop()}};onEach(aliases,pushFunc);onEach(crateAliases,pushFunc)}var nSearchWords=searchWords.length;var i,it;var ty;var fullId;var returned;var in_args;var len;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0,len=inputs.length;i1?paths.length-1:1);var lev,j;for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=ty.id;if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||ty.normalizedName.indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=ty.normalizedName.indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)){lev+=1}else{lev=MAX_LEV_DISTANCE+1}}in_args=findArg(ty,valGenerics,false,typeFilter);returned=checkReturned(ty,valGenerics,false,typeFilter);lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(typePassesFilter(typeFilter,ty.ty)&&(index!==-1||lev<=MAX_LEV_DISTANCE)){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results,false),};handleAliases(ret,query,filterCrates);return ret}function validateResult(name,path,keys,parent){for(var i=0,len=keys.length;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function nextTab(direction){var next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){var target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=window.rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=window.rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=window.rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var enumNameIdx=item.path.lastIndexOf("::");var enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=window.rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=window.rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraClass="";if(display===true){extraClass=" active"}var output=document.createElement("div");var duplicates={};var length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(function(item){if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}var name=item.name;var type=itemTypes[item.ty];length+=1;var extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}var link=document.createElement("a");link.className="result-"+type;link.href=item.href;var wrapper=document.createElement("div");var resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){var alias=document.createElement("span");alias.className="alias";var bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);var description=document.createElement("div");description.className="desc";var spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else{output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first){var search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText))){var elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}var query=getQuery(searchState.input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
";var resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;search.appendChild(resultsElem);searchState.focusedByTab=[null,null,null];searchState.showResults(search);var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0,len=positions.length;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0,arrays_len=arrays.length;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}function tokenizeQuery(raw){var i,matched;var l=raw.length;var depth=0;var nextAngle=/(<|>)/g;var ret=[];var start=0;for(i=0;i'){depth+=1}break;case">":if(depth>0){depth-=1}break;case",":if(depth===0){ret.push(raw.substring(start,i));start=i+1}break}}if(start!==i){ret.push(raw.substring(start,i))}return ret}var queries=tokenizeQuery(query.raw);var results={"in_args":[],"returned":[],"others":[],};for(var i=0,len=queries.length;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return undefined}function search(e,forced){var params=searchState.getQueryStringParams();var query=getQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(!forced&&query.id===currentResults){if(query.query.length>0){searchState.putBackSearch(searchState.input)}return}searchState.title="Results for "+query.query+" - Rust";if(searchState.browserSupportsHistoryApi()){var newURL=getNakedUrl()+"?search="+encodeURIComponent(query.raw)+window.location.hash;if(!history.state&&!params.search){history.pushState(query,"",newURL)}else{history.replaceState(query,"",newURL)}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates),params.go_to_first)}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i,word;var currentIndex=0;var id=0;for(var crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}var crateSize=0;searchWords.push(crate);var crateRow={crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),};id+=1;searchIndex.push(crateRow);currentIndex+=1;var itemTypes=rawSearchIndex[crate].t;var itemNames=rawSearchIndex[crate].n;var itemPaths=rawSearchIndex[crate].q;var itemDescs=rawSearchIndex[crate].d;var itemParentIdxs=rawSearchIndex[crate].i;var itemFunctionSearchTypes=rawSearchIndex[crate].f;var paths=rawSearchIndex[crate].p;var aliases=rawSearchIndex[crate].a;var len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:itemFunctionSearchTypes[i],id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]={};var j,local_aliases;for(var alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}if(!hasOwnPropertyRustdoc(ALIASES[crate],alias_name)){ALIASES[crate][alias_name]=[]}local_aliases=aliases[alias_name];for(j=0,len=local_aliases.length;j0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=function(){var qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}index=buildIndex(rawSearchIndex);registerSearchEvents();if(searchState.getQueryStringParams().search){search()}};if(window.searchIndex!==undefined){initSearch(window.searchIndex)}})() \ No newline at end of file diff --git a/rustdoc/latest/settings.css b/rustdoc/latest/settings.css new file mode 100644 index 00000000..67098658 --- /dev/null +++ b/rustdoc/latest/settings.css @@ -0,0 +1 @@ +.setting-line{padding:5px;position:relative;}.setting-line>div{display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{opacity:0;position:absolute;}.select-wrapper{float:right;position:relative;height:27px;min-width:25%;}.select-wrapper select{appearance:none;-moz-appearance:none;-webkit-appearance:none;background:none;border:2px solid #ccc;padding-right:28px;width:100%;}.select-wrapper img{pointer-events:none;position:absolute;right:0;bottom:0;background:#ccc;height:100%;width:28px;padding:0px 4px;}.select-wrapper select option{color:initial;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;} \ No newline at end of file diff --git a/rustdoc/latest/settings.html b/rustdoc/latest/settings.html new file mode 100644 index 00000000..75969d2d --- /dev/null +++ b/rustdoc/latest/settings.html @@ -0,0 +1,19 @@ +Rustdoc settings + + + +

Rustdoc settings

Theme preferences
Use system theme
Preferred dark theme
Preferred light theme
+
Auto-hide item contents for large items.
Auto-hide item methods' documentation
Auto-hide trait implementation documentation
Directly go to item in search if there is only one result
Show line numbers on code examples
Disable keyboard shortcuts
+ + \ No newline at end of file diff --git a/rustdoc/latest/settings.js b/rustdoc/latest/settings.js new file mode 100644 index 00000000..b4d6fdcd --- /dev/null +++ b/rustdoc/latest/settings.js @@ -0,0 +1 @@ +(function(){function changeSetting(settingName,value){updateLocalStorage("rustdoc-"+settingName,value);switch(settingName){case"preferred-dark-theme":case"preferred-light-theme":case"use-system-theme":updateSystemTheme();break}}function handleKey(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return}switch(getVirtualKey(ev)){case"Enter":case"Return":case"Space":ev.target.checked=!ev.target.checked;ev.preventDefault();break}}function setEvents(){onEachLazy(document.getElementsByClassName("slider"),function(elem){var toggle=elem.previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)};toggle.onkeyup=handleKey;toggle.onkeyrelease=handleKey});onEachLazy(document.getElementsByClassName("select-wrapper"),function(elem){var select=elem.getElementsByTagName("select")[0];var settingId=select.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){select.value=settingValue}select.onchange=function(){changeSetting(this.id,this.value)}})}window.addEventListener("DOMContentLoaded",setEvents)})() \ No newline at end of file diff --git a/rustdoc/latest/source-files.js b/rustdoc/latest/source-files.js new file mode 100644 index 00000000..4b856096 --- /dev/null +++ b/rustdoc/latest/source-files.js @@ -0,0 +1,3 @@ +var N = null;var sourcesIndex = {}; +sourcesIndex["halo2"] = {"name":"","dirs":[{"name":"circuit","dirs":[{"name":"floor_planner","dirs":[{"name":"v1","files":["strategy.rs"]}],"files":["single_pass.rs","v1.rs"]}],"files":["floor_planner.rs","layouter.rs"]},{"name":"dev","files":["metadata.rs"]},{"name":"plonk","dirs":[{"name":"lookup","files":["prover.rs","verifier.rs"]},{"name":"permutation","files":["keygen.rs","prover.rs","verifier.rs"]},{"name":"vanishing","files":["prover.rs","verifier.rs"]}],"files":["circuit.rs","keygen.rs","lookup.rs","permutation.rs","prover.rs","vanishing.rs","verifier.rs"]},{"name":"poly","dirs":[{"name":"commitment","files":["msm.rs","prover.rs","verifier.rs"]},{"name":"multiopen","files":["prover.rs","verifier.rs"]}],"files":["commitment.rs","domain.rs","multiopen.rs"]}],"files":["arithmetic.rs","circuit.rs","dev.rs","lib.rs","multicore.rs","plonk.rs","poly.rs","transcript.rs"]}; +createSourceSidebar(); diff --git a/rustdoc/latest/source-script.js b/rustdoc/latest/source-script.js new file mode 100644 index 00000000..5dc8fee0 --- /dev/null +++ b/rustdoc/latest/source-script.js @@ -0,0 +1 @@ +(function(){function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0,len=rootPathParts.length;i"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(!window.rootPath.endsWith("/")){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild);var selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}var lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(scrollTo,match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(tocur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",function(){var match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(false,match)}});onEachLazy(document.getElementsByClassName("line-numbers"),function(el){el.addEventListener("click",handleSourceHighlight)});highlightSourceLines(true);window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/arithmetic.rs.html b/rustdoc/latest/src/halo2/arithmetic.rs.html new file mode 100644 index 00000000..e09fdb6b --- /dev/null +++ b/rustdoc/latest/src/halo2/arithmetic.rs.html @@ -0,0 +1,938 @@ +arithmetic.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+
+//! This module provides common utilities, traits and structures for group,
+//! field and polynomial arithmetic.
+
+use super::multicore;
+pub use ff::Field;
+use group::Group as _;
+
+pub use pasta_curves::arithmetic::*;
+
+/// Extension trait for iterators over mutable field elements which allows those
+/// field elements to be inverted in a batch.
+pub trait BatchInvert<F: Field> {
+    /// Consume this iterator and invert each field element (when nonzero),
+    /// returning the inverse of all nonzero field elements. Zero elements
+    /// are left as zero.
+    fn batch_invert(self) -> F;
+}
+
+impl<'a, F, I> BatchInvert<F> for I
+where
+    F: FieldExt,
+    I: IntoIterator<Item = &'a mut F>,
+{
+    fn batch_invert(self) -> F {
+        let mut acc = F::one();
+        let iter = self.into_iter();
+        let mut tmp = Vec::with_capacity(iter.size_hint().0);
+        for p in iter {
+            let q = *p;
+            tmp.push((acc, p));
+            acc = F::conditional_select(&(acc * q), &acc, q.ct_is_zero());
+        }
+        acc = acc.invert().unwrap();
+        let allinv = acc;
+
+        for (tmp, p) in tmp.into_iter().rev() {
+            let skip = p.ct_is_zero();
+
+            let tmp = tmp * acc;
+            acc = F::conditional_select(&(acc * *p), &acc, skip);
+            *p = F::conditional_select(&tmp, p, skip);
+        }
+
+        allinv
+    }
+}
+
+fn multiexp_serial<C: CurveAffine>(coeffs: &[C::Scalar], bases: &[C], acc: &mut C::Curve) {
+    let coeffs: Vec<[u8; 32]> = coeffs.iter().map(|a| a.to_bytes()).collect();
+
+    let c = if bases.len() < 4 {
+        1
+    } else if bases.len() < 32 {
+        3
+    } else {
+        (f64::from(bases.len() as u32)).ln().ceil() as usize
+    };
+
+    fn get_at(segment: usize, c: usize, bytes: &[u8; 32]) -> usize {
+        let skip_bits = segment * c;
+        let skip_bytes = skip_bits / 8;
+
+        if skip_bytes >= 32 {
+            return 0;
+        }
+
+        let mut v = [0; 8];
+        for (v, o) in v.iter_mut().zip(bytes[skip_bytes..].iter()) {
+            *v = *o;
+        }
+
+        let mut tmp = u64::from_le_bytes(v);
+        tmp >>= skip_bits - (skip_bytes * 8);
+        tmp = tmp % (1 << c);
+
+        tmp as usize
+    }
+
+    let segments = (256 / c) + 1;
+
+    for current_segment in (0..segments).rev() {
+        for _ in 0..c {
+            *acc = acc.double();
+        }
+
+        #[derive(Clone, Copy)]
+        enum Bucket<C: CurveAffine> {
+            None,
+            Affine(C),
+            Projective(C::Curve),
+        }
+
+        impl<C: CurveAffine> Bucket<C> {
+            fn add_assign(&mut self, other: &C) {
+                *self = match *self {
+                    Bucket::None => Bucket::Affine(*other),
+                    Bucket::Affine(a) => Bucket::Projective(a + *other),
+                    Bucket::Projective(mut a) => {
+                        a += *other;
+                        Bucket::Projective(a)
+                    }
+                }
+            }
+
+            fn add(self, mut other: C::Curve) -> C::Curve {
+                match self {
+                    Bucket::None => other,
+                    Bucket::Affine(a) => {
+                        other += a;
+                        other
+                    }
+                    Bucket::Projective(a) => other + &a,
+                }
+            }
+        }
+
+        let mut buckets: Vec<Bucket<C>> = vec![Bucket::None; (1 << c) - 1];
+
+        for (coeff, base) in coeffs.iter().zip(bases.iter()) {
+            let coeff = get_at(current_segment, c, coeff);
+            if coeff != 0 {
+                buckets[coeff - 1].add_assign(base);
+            }
+        }
+
+        // Summation by parts
+        // e.g. 3a + 2b + 1c = a +
+        //                    (a) + b +
+        //                    ((a) + b) + c
+        let mut running_sum = C::Curve::identity();
+        for exp in buckets.into_iter().rev() {
+            running_sum = exp.add(running_sum);
+            *acc = *acc + &running_sum;
+        }
+    }
+}
+
+/// Performs a small multi-exponentiation operation.
+/// Uses the double-and-add algorithm with doublings shared across points.
+pub fn small_multiexp<C: CurveAffine>(coeffs: &[C::Scalar], bases: &[C]) -> C::Curve {
+    let coeffs: Vec<[u8; 32]> = coeffs.iter().map(|a| a.to_bytes()).collect();
+    let mut acc = C::Curve::identity();
+
+    // for byte idx
+    for byte_idx in (0..32).rev() {
+        // for bit idx
+        for bit_idx in (0..8).rev() {
+            acc = acc.double();
+            // for each coeff
+            for coeff_idx in 0..coeffs.len() {
+                let byte = coeffs[coeff_idx][byte_idx];
+                if ((byte >> bit_idx) & 1) != 0 {
+                    acc += bases[coeff_idx];
+                }
+            }
+        }
+    }
+
+    acc
+}
+
+/// Performs a multi-exponentiation operation.
+///
+/// This function will panic if coeffs and bases have a different length.
+///
+/// This will use multithreading if beneficial.
+pub fn best_multiexp<C: CurveAffine>(coeffs: &[C::Scalar], bases: &[C]) -> C::Curve {
+    assert_eq!(coeffs.len(), bases.len());
+
+    let num_threads = multicore::current_num_threads();
+    if coeffs.len() > num_threads {
+        let chunk = coeffs.len() / num_threads;
+        let num_chunks = coeffs.chunks(chunk).len();
+        let mut results = vec![C::Curve::identity(); num_chunks];
+        multicore::scope(|scope| {
+            let chunk = coeffs.len() / num_threads;
+
+            for ((coeffs, bases), acc) in coeffs
+                .chunks(chunk)
+                .zip(bases.chunks(chunk))
+                .zip(results.iter_mut())
+            {
+                scope.spawn(move |_| {
+                    multiexp_serial(coeffs, bases, acc);
+                });
+            }
+        });
+        results.iter().fold(C::Curve::identity(), |a, b| a + b)
+    } else {
+        let mut acc = C::Curve::identity();
+        multiexp_serial(coeffs, bases, &mut acc);
+        acc
+    }
+}
+
+/// Performs a radix-$2$ Fast-Fourier Transformation (FFT) on a vector of size
+/// $n = 2^k$, when provided `log_n` = $k$ and an element of multiplicative
+/// order $n$ called `omega` ($\omega$). The result is that the vector `a`, when
+/// interpreted as the coefficients of a polynomial of degree $n - 1$, is
+/// transformed into the evaluations of this polynomial at each of the $n$
+/// distinct powers of $\omega$. This transformation is invertible by providing
+/// $\omega^{-1}$ in place of $\omega$ and dividing each resulting field element
+/// by $n$.
+///
+/// This will use multithreading if beneficial.
+pub fn best_fft<G: Group>(a: &mut [G], omega: G::Scalar, log_n: u32) {
+    let threads = multicore::current_num_threads();
+    let log_threads = log2_floor(threads);
+
+    if log_n <= log_threads {
+        serial_fft(a, omega, log_n);
+    } else {
+        parallel_fft(a, omega, log_n, log_threads);
+    }
+}
+
+fn serial_fft<G: Group>(a: &mut [G], omega: G::Scalar, log_n: u32) {
+    fn bitreverse(mut n: u32, l: u32) -> u32 {
+        let mut r = 0;
+        for _ in 0..l {
+            r = (r << 1) | (n & 1);
+            n >>= 1;
+        }
+        r
+    }
+
+    let n = a.len() as u32;
+    assert_eq!(n, 1 << log_n);
+
+    for k in 0..n {
+        let rk = bitreverse(k, log_n);
+        if k < rk {
+            a.swap(rk as usize, k as usize);
+        }
+    }
+
+    let mut m = 1;
+    for _ in 0..log_n {
+        let w_m = omega.pow(&[u64::from(n / (2 * m)), 0, 0, 0]);
+
+        let mut k = 0;
+        while k < n {
+            let mut w = G::Scalar::one();
+            for j in 0..m {
+                let mut t = a[(k + j + m) as usize];
+                t.group_scale(&w);
+                a[(k + j + m) as usize] = a[(k + j) as usize];
+                a[(k + j + m) as usize].group_sub(&t);
+                a[(k + j) as usize].group_add(&t);
+                w *= &w_m;
+            }
+
+            k += 2 * m;
+        }
+
+        m *= 2;
+    }
+}
+
+fn parallel_fft<G: Group>(a: &mut [G], omega: G::Scalar, log_n: u32, log_threads: u32) {
+    assert!(log_n >= log_threads);
+
+    let num_threads = 1 << log_threads;
+    let log_new_n = log_n - log_threads;
+    let mut tmp = vec![vec![G::group_zero(); 1 << log_new_n]; num_threads];
+    let new_omega = omega.pow(&[num_threads as u64, 0, 0, 0]);
+
+    multicore::scope(|scope| {
+        let a = &*a;
+
+        for (j, tmp) in tmp.iter_mut().enumerate() {
+            scope.spawn(move |_| {
+                // Shuffle into a sub-FFT
+                let omega_j = omega.pow(&[j as u64, 0, 0, 0]);
+                let omega_step = omega.pow(&[(j as u64) << log_new_n, 0, 0, 0]);
+
+                let mut elt = G::Scalar::one();
+
+                for (i, tmp) in tmp.iter_mut().enumerate() {
+                    for s in 0..num_threads {
+                        let idx = (i + (s << log_new_n)) % (1 << log_n);
+                        let mut t = a[idx];
+                        t.group_scale(&elt);
+                        tmp.group_add(&t);
+                        elt *= &omega_step;
+                    }
+                    elt *= &omega_j;
+                }
+
+                // Perform sub-FFT
+                serial_fft(tmp, new_omega, log_new_n);
+            });
+        }
+    });
+
+    // Unshuffle
+    let mask = (1 << log_threads) - 1;
+    for (idx, a) in a.iter_mut().enumerate() {
+        *a = tmp[idx & mask][idx >> log_threads];
+    }
+}
+
+/// This evaluates a provided polynomial (in coefficient form) at `point`.
+pub fn eval_polynomial<F: Field>(poly: &[F], point: F) -> F {
+    // TODO: parallelize?
+    poly.iter()
+        .rev()
+        .fold(F::zero(), |acc, coeff| acc * point + coeff)
+}
+
+/// This computes the inner product of two vectors `a` and `b`.
+///
+/// This function will panic if the two vectors are not the same size.
+pub fn compute_inner_product<F: Field>(a: &[F], b: &[F]) -> F {
+    // TODO: parallelize?
+    assert_eq!(a.len(), b.len());
+
+    let mut acc = F::zero();
+    for (a, b) in a.iter().zip(b.iter()) {
+        acc += (*a) * (*b);
+    }
+
+    acc
+}
+
+/// Divides polynomial `a` in `X` by `X - b` with
+/// no remainder.
+pub fn kate_division<'a, F: Field, I: IntoIterator<Item = &'a F>>(a: I, mut b: F) -> Vec<F>
+where
+    I::IntoIter: DoubleEndedIterator + ExactSizeIterator,
+{
+    b = -b;
+    let a = a.into_iter();
+
+    let mut q = vec![F::zero(); a.len() - 1];
+
+    let mut tmp = F::zero();
+    for (q, r) in q.iter_mut().rev().zip(a.rev()) {
+        let mut lead_coeff = *r;
+        lead_coeff.sub_assign(&tmp);
+        *q = lead_coeff;
+        tmp = lead_coeff;
+        tmp.mul_assign(&b);
+    }
+
+    q
+}
+
+/// This simple utility function will parallelize an operation that is to be
+/// performed over a mutable slice.
+pub fn parallelize<T: Send, F: Fn(&mut [T], usize) + Send + Sync + Clone>(v: &mut [T], f: F) {
+    let n = v.len();
+    let num_threads = multicore::current_num_threads();
+    let mut chunk = (n as usize) / num_threads;
+    if chunk < num_threads {
+        chunk = n as usize;
+    }
+
+    multicore::scope(|scope| {
+        for (chunk_num, v) in v.chunks_mut(chunk).enumerate() {
+            let f = f.clone();
+            scope.spawn(move |_| {
+                let start = chunk_num * chunk;
+                f(v, start);
+            });
+        }
+    });
+}
+
+fn log2_floor(num: usize) -> u32 {
+    assert!(num > 0);
+
+    let mut pow = 0;
+
+    while (1 << (pow + 1)) <= num {
+        pow += 1;
+    }
+
+    pow
+}
+
+/// Returns coefficients of an n - 1 degree polynomial given a set of n points
+/// and their evaluations. This function will panic if two values in `points`
+/// are the same.
+pub fn lagrange_interpolate<F: FieldExt>(points: &[F], evals: &[F]) -> Vec<F> {
+    assert_eq!(points.len(), evals.len());
+    if points.len() == 1 {
+        // Constant polynomial
+        return vec![evals[0]];
+    } else {
+        let mut denoms = Vec::with_capacity(points.len());
+        for (j, x_j) in points.iter().enumerate() {
+            let mut denom = Vec::with_capacity(points.len() - 1);
+            for x_k in points
+                .iter()
+                .enumerate()
+                .filter(|&(k, _)| k != j)
+                .map(|a| a.1)
+            {
+                denom.push(*x_j - x_k);
+            }
+            denoms.push(denom);
+        }
+        // Compute (x_j - x_k)^(-1) for each j != i
+        denoms.iter_mut().flat_map(|v| v.iter_mut()).batch_invert();
+
+        let mut final_poly = vec![F::zero(); points.len()];
+        for (j, (denoms, eval)) in denoms.into_iter().zip(evals.iter()).enumerate() {
+            let mut tmp: Vec<F> = Vec::with_capacity(points.len());
+            let mut product = Vec::with_capacity(points.len() - 1);
+            tmp.push(F::one());
+            for (x_k, denom) in points
+                .iter()
+                .enumerate()
+                .filter(|&(k, _)| k != j)
+                .map(|a| a.1)
+                .zip(denoms.into_iter())
+            {
+                product.resize(tmp.len() + 1, F::zero());
+                for ((a, b), product) in tmp
+                    .iter()
+                    .chain(std::iter::once(&F::zero()))
+                    .zip(std::iter::once(&F::zero()).chain(tmp.iter()))
+                    .zip(product.iter_mut())
+                {
+                    *product = *a * (-denom * x_k) + *b * denom;
+                }
+                std::mem::swap(&mut tmp, &mut product);
+            }
+            assert_eq!(tmp.len(), points.len());
+            assert_eq!(product.len(), points.len() - 1);
+            for (final_coeff, interpolation_coeff) in final_poly.iter_mut().zip(tmp.into_iter()) {
+                *final_coeff += interpolation_coeff * eval;
+            }
+        }
+        final_poly
+    }
+}
+
+#[cfg(test)]
+use crate::pasta::Fp;
+
+#[test]
+fn test_lagrange_interpolate() {
+    let points = (0..5).map(|_| Fp::rand()).collect::<Vec<_>>();
+    let evals = (0..5).map(|_| Fp::rand()).collect::<Vec<_>>();
+
+    for coeffs in 0..5 {
+        let points = &points[0..coeffs];
+        let evals = &evals[0..coeffs];
+
+        let poly = lagrange_interpolate(points, evals);
+        assert_eq!(poly.len(), points.len());
+
+        for (point, eval) in points.iter().zip(evals) {
+            assert_eq!(eval_polynomial(&poly, *point), *eval);
+        }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit.rs.html b/rustdoc/latest/src/halo2/circuit.rs.html new file mode 100644 index 00000000..6cf34e5f --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit.rs.html @@ -0,0 +1,646 @@ +circuit.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+
+//! Traits and structs for implementing circuit components.
+
+use std::{fmt, marker::PhantomData};
+
+use ff::Field;
+
+use crate::{
+    arithmetic::FieldExt,
+    plonk::{Advice, Any, Assigned, Column, Error, Fixed, Permutation, Selector},
+};
+
+pub mod floor_planner;
+pub use floor_planner::single_pass::SimpleFloorPlanner;
+
+pub mod layouter;
+
+/// A chip implements a set of instructions that can be used by gadgets.
+///
+/// The chip stores state that is required at circuit synthesis time in
+/// [`Chip::Config`], which can be fetched via [`Chip::config`].
+///
+/// The chip also loads any fixed configuration needed at synthesis time
+/// using its own implementation of `load`, and stores it in [`Chip::Loaded`].
+/// This can be accessed via [`Chip::loaded`].
+pub trait Chip<F: FieldExt>: Sized {
+    /// A type that holds the configuration for this chip, and any other state it may need
+    /// during circuit synthesis, that can be derived during [`Circuit::configure`].
+    ///
+    /// [`Circuit::configure`]: crate::plonk::Circuit::configure
+    type Config: fmt::Debug + Clone;
+
+    /// A type that holds any general chip state that needs to be loaded at the start of
+    /// [`Circuit::synthesize`]. This might simply be `()` for some chips.
+    ///
+    /// [`Circuit::synthesize`]: crate::plonk::Circuit::synthesize
+    type Loaded: fmt::Debug + Clone;
+
+    /// The chip holds its own configuration.
+    fn config(&self) -> &Self::Config;
+
+    /// Provides access to general chip state loaded at the beginning of circuit
+    /// synthesis.
+    ///
+    /// Panics if called before `Chip::load`.
+    fn loaded(&self) -> &Self::Loaded;
+}
+
+/// Index of a region in a layouter
+#[derive(Clone, Copy, Debug)]
+pub struct RegionIndex(usize);
+
+impl From<usize> for RegionIndex {
+    fn from(idx: usize) -> RegionIndex {
+        RegionIndex(idx)
+    }
+}
+
+impl std::ops::Deref for RegionIndex {
+    type Target = usize;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+/// Starting row of a region in a layouter
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub struct RegionStart(usize);
+
+impl From<usize> for RegionStart {
+    fn from(idx: usize) -> RegionStart {
+        RegionStart(idx)
+    }
+}
+
+impl std::ops::Deref for RegionStart {
+    type Target = usize;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+/// A pointer to a cell within a circuit.
+#[derive(Clone, Copy, Debug)]
+pub struct Cell {
+    /// Identifies the region in which this cell resides.
+    region_index: RegionIndex,
+    /// The relative offset of this cell within its region.
+    row_offset: usize,
+    /// The column of this cell.
+    column: Column<Any>,
+}
+
+/// A region of the circuit in which a [`Chip`] can assign cells.
+///
+/// Inside a region, the chip may freely use relative offsets; the [`Layouter`] will
+/// treat these assignments as a single "region" within the circuit.
+///
+/// The [`Layouter`] is allowed to optimise between regions as it sees fit. Chips must use
+/// [`Region::constrain_equal`] to copy in variables assigned in other regions.
+///
+/// TODO: It would be great if we could constrain the columns in these types to be
+/// "logical" columns that are guaranteed to correspond to the chip (and have come from
+/// `Chip::Config`).
+#[derive(Debug)]
+pub struct Region<'r, F: Field> {
+    region: &'r mut dyn layouter::RegionLayouter<F>,
+}
+
+impl<'r, F: Field> From<&'r mut dyn layouter::RegionLayouter<F>> for Region<'r, F> {
+    fn from(region: &'r mut dyn layouter::RegionLayouter<F>) -> Self {
+        Region { region }
+    }
+}
+
+impl<'r, F: Field> Region<'r, F> {
+    /// Enables a selector at the given offset.
+    pub(crate) fn enable_selector<A, AR>(
+        &mut self,
+        annotation: A,
+        selector: &Selector,
+        offset: usize,
+    ) -> Result<(), Error>
+    where
+        A: Fn() -> AR,
+        AR: Into<String>,
+    {
+        self.region
+            .enable_selector(&|| annotation().into(), selector, offset)
+    }
+
+    /// Assign an advice column value (witness).
+    ///
+    /// Even though `to` has `FnMut` bounds, it is guaranteed to be called at most once.
+    pub fn assign_advice<'v, V, VR, A, AR>(
+        &'v mut self,
+        annotation: A,
+        column: Column<Advice>,
+        offset: usize,
+        mut to: V,
+    ) -> Result<Cell, Error>
+    where
+        V: FnMut() -> Result<VR, Error> + 'v,
+        VR: Into<Assigned<F>>,
+        A: Fn() -> AR,
+        AR: Into<String>,
+    {
+        self.region
+            .assign_advice(&|| annotation().into(), column, offset, &mut || {
+                to().map(|v| v.into())
+            })
+    }
+
+    /// Assign a fixed value.
+    ///
+    /// Even though `to` has `FnMut` bounds, it is guaranteed to be called at most once.
+    pub fn assign_fixed<'v, V, VR, A, AR>(
+        &'v mut self,
+        annotation: A,
+        column: Column<Fixed>,
+        offset: usize,
+        mut to: V,
+    ) -> Result<Cell, Error>
+    where
+        V: FnMut() -> Result<VR, Error> + 'v,
+        VR: Into<Assigned<F>>,
+        A: Fn() -> AR,
+        AR: Into<String>,
+    {
+        self.region
+            .assign_fixed(&|| annotation().into(), column, offset, &mut || {
+                to().map(|v| v.into())
+            })
+    }
+
+    /// Constraint two cells to have the same value.
+    ///
+    /// Returns an error if either of the cells is not within the given permutation.
+    pub fn constrain_equal(
+        &mut self,
+        permutation: &Permutation,
+        left: Cell,
+        right: Cell,
+    ) -> Result<(), Error> {
+        self.region.constrain_equal(permutation, left, right)
+    }
+}
+
+/// A layout strategy within a circuit. The layouter is chip-agnostic and applies its
+/// strategy to the context and config it is given.
+///
+/// This abstracts over the circuit assignments, handling row indices etc.
+///
+pub trait Layouter<F: Field> {
+    /// Represents the type of the "root" of this layouter, so that nested namespaces
+    /// can minimize indirection.
+    type Root: Layouter<F>;
+
+    /// Assign a region of gates to an absolute row number.
+    ///
+    /// Inside the closure, the chip may freely use relative offsets; the `Layouter` will
+    /// treat these assignments as a single "region" within the circuit. Outside this
+    /// closure, the `Layouter` is allowed to optimise as it sees fit.
+    ///
+    /// ```ignore
+    /// fn assign_region(&mut self, || "region name", |region| {
+    ///     let config = chip.config();
+    ///     region.assign_advice(config.a, offset, || { Some(value)});
+    /// });
+    /// ```
+    fn assign_region<A, AR, N, NR>(&mut self, name: N, assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+        N: Fn() -> NR,
+        NR: Into<String>;
+
+    /// Gets the "root" of this assignment, bypassing the namespacing.
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::namespace`] instead.
+    fn get_root(&mut self) -> &mut Self::Root;
+
+    /// Creates a new (sub)namespace and enters into it.
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::namespace`] instead.
+    fn push_namespace<NR, N>(&mut self, name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR;
+
+    /// Exits out of the existing namespace.
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::namespace`] instead.
+    fn pop_namespace(&mut self, gadget_name: Option<String>);
+
+    /// Enters into a namespace.
+    fn namespace<NR, N>(&mut self, name_fn: N) -> NamespacedLayouter<'_, F, Self::Root>
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        self.get_root().push_namespace(name_fn);
+
+        NamespacedLayouter(self.get_root(), PhantomData)
+    }
+}
+
+/// This is a "namespaced" layouter which borrows a `Layouter` (pushing a namespace
+/// context) and, when dropped, pops out of the namespace context.
+#[derive(Debug)]
+pub struct NamespacedLayouter<'a, F: Field, L: Layouter<F> + 'a>(&'a mut L, PhantomData<F>);
+
+impl<'a, F: Field, L: Layouter<F> + 'a> Layouter<F> for NamespacedLayouter<'a, F, L> {
+    type Root = L::Root;
+
+    fn assign_region<A, AR, N, NR>(&mut self, name: N, assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+        N: Fn() -> NR,
+        NR: Into<String>,
+    {
+        self.0.assign_region(name, assignment)
+    }
+
+    fn get_root(&mut self) -> &mut Self::Root {
+        self.0.get_root()
+    }
+
+    fn push_namespace<NR, N>(&mut self, _name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        panic!("Only the root's push_namespace should be called");
+    }
+
+    fn pop_namespace(&mut self, _gadget_name: Option<String>) {
+        panic!("Only the root's pop_namespace should be called");
+    }
+}
+
+impl<'a, F: Field, L: Layouter<F> + 'a> Drop for NamespacedLayouter<'a, F, L> {
+    fn drop(&mut self) {
+        let gadget_name = {
+            #[cfg(feature = "gadget-traces")]
+            {
+                let mut gadget_name = None;
+                let mut is_second_frame = false;
+                backtrace::trace(|frame| {
+                    if is_second_frame {
+                        // Resolve this instruction pointer to a symbol name.
+                        backtrace::resolve_frame(frame, |symbol| {
+                            gadget_name = symbol.name().map(|name| format!("{:#}", name));
+                        });
+
+                        // We are done!
+                        false
+                    } else {
+                        // We want the next frame.
+                        is_second_frame = true;
+                        true
+                    }
+                });
+                gadget_name
+            }
+
+            #[cfg(not(feature = "gadget-traces"))]
+            None
+        };
+
+        self.get_root().pop_namespace(gadget_name);
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit/floor_planner.rs.html b/rustdoc/latest/src/halo2/circuit/floor_planner.rs.html new file mode 100644 index 00000000..7aaa339c --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit/floor_planner.rs.html @@ -0,0 +1,32 @@ +floor_planner.rs - source + + + +
1
+2
+3
+4
+5
+6
+
+//! Implementations of common circuit floor planners.
+
+pub(super) mod single_pass;
+
+mod v1;
+pub use v1::{V1Pass, V1};
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit/floor_planner/single_pass.rs.html b/rustdoc/latest/src/halo2/circuit/floor_planner/single_pass.rs.html new file mode 100644 index 00000000..a08d709a --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit/floor_planner/single_pass.rs.html @@ -0,0 +1,476 @@ +single_pass.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+
+use std::cmp;
+use std::collections::HashMap;
+use std::fmt;
+use std::marker::PhantomData;
+
+use ff::Field;
+
+use crate::{
+    circuit::{
+        layouter::{RegionLayouter, RegionShape},
+        Cell, Layouter, Region, RegionIndex, RegionStart,
+    },
+    plonk::{
+        Advice, Any, Assigned, Assignment, Circuit, Column, Error, Fixed, FloorPlanner,
+        Permutation, Selector,
+    },
+};
+
+/// A simple [`FloorPlanner`] that performs minimal optimizations.
+///
+/// This floor planner is suitable for debugging circuits. It aims to reflect the circuit
+/// "business logic" in the circuit layout as closely as possible. It uses a single-pass
+/// layouter that does not reorder regions for optimal packing.
+#[derive(Debug)]
+pub struct SimpleFloorPlanner;
+
+impl FloorPlanner for SimpleFloorPlanner {
+    fn synthesize<F: Field, CS: Assignment<F>, C: Circuit<F>>(
+        cs: &mut CS,
+        circuit: &C,
+        config: C::Config,
+    ) -> Result<(), Error> {
+        let layouter = SingleChipLayouter::new(cs)?;
+        circuit.synthesize(config, layouter)
+    }
+}
+
+/// A [`Layouter`] for a single-chip circuit.
+pub struct SingleChipLayouter<'a, F: Field, CS: Assignment<F> + 'a> {
+    cs: &'a mut CS,
+    /// Stores the starting row for each region.
+    regions: Vec<RegionStart>,
+    /// Stores the first empty row for each column.
+    columns: HashMap<Column<Any>, usize>,
+    _marker: PhantomData<F>,
+}
+
+impl<'a, F: Field, CS: Assignment<F> + 'a> fmt::Debug for SingleChipLayouter<'a, F, CS> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("SingleChipLayouter")
+            .field("regions", &self.regions)
+            .field("columns", &self.columns)
+            .finish()
+    }
+}
+
+impl<'a, F: Field, CS: Assignment<F>> SingleChipLayouter<'a, F, CS> {
+    /// Creates a new single-chip layouter.
+    pub fn new(cs: &'a mut CS) -> Result<Self, Error> {
+        let ret = SingleChipLayouter {
+            cs,
+            regions: vec![],
+            columns: HashMap::default(),
+            _marker: PhantomData,
+        };
+        Ok(ret)
+    }
+}
+
+impl<'a, F: Field, CS: Assignment<F> + 'a> Layouter<F> for SingleChipLayouter<'a, F, CS> {
+    type Root = Self;
+
+    fn assign_region<A, AR, N, NR>(&mut self, name: N, mut assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+        N: Fn() -> NR,
+        NR: Into<String>,
+    {
+        let region_index = self.regions.len();
+
+        // Get shape of the region.
+        let mut shape = RegionShape::new(region_index.into());
+        {
+            let region: &mut dyn RegionLayouter<F> = &mut shape;
+            assignment(region.into())?;
+        }
+
+        // Lay out this region. We implement the simplest approach here: position the
+        // region starting at the earliest row for which none of the columns are in use.
+        let mut region_start = 0;
+        for column in &shape.columns {
+            region_start = cmp::max(region_start, self.columns.get(column).cloned().unwrap_or(0));
+        }
+        self.regions.push(region_start.into());
+
+        // Update column usage information.
+        for column in shape.columns {
+            self.columns.insert(column, region_start + shape.row_count);
+        }
+
+        self.cs.enter_region(name);
+        let mut region = SingleChipLayouterRegion::new(self, region_index.into());
+        let result = {
+            let region: &mut dyn RegionLayouter<F> = &mut region;
+            assignment(region.into())
+        }?;
+        self.cs.exit_region();
+
+        Ok(result)
+    }
+
+    fn get_root(&mut self) -> &mut Self::Root {
+        self
+    }
+
+    fn push_namespace<NR, N>(&mut self, name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        self.cs.push_namespace(name_fn)
+    }
+
+    fn pop_namespace(&mut self, gadget_name: Option<String>) {
+        self.cs.pop_namespace(gadget_name)
+    }
+}
+
+struct SingleChipLayouterRegion<'r, 'a, F: Field, CS: Assignment<F> + 'a> {
+    layouter: &'r mut SingleChipLayouter<'a, F, CS>,
+    region_index: RegionIndex,
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> fmt::Debug
+    for SingleChipLayouterRegion<'r, 'a, F, CS>
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("SingleChipLayouterRegion")
+            .field("layouter", &self.layouter)
+            .field("region_index", &self.region_index)
+            .finish()
+    }
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> SingleChipLayouterRegion<'r, 'a, F, CS> {
+    fn new(layouter: &'r mut SingleChipLayouter<'a, F, CS>, region_index: RegionIndex) -> Self {
+        SingleChipLayouterRegion {
+            layouter,
+            region_index,
+        }
+    }
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> RegionLayouter<F>
+    for SingleChipLayouterRegion<'r, 'a, F, CS>
+{
+    fn enable_selector<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        selector: &Selector,
+        offset: usize,
+    ) -> Result<(), Error> {
+        self.layouter.cs.enable_selector(
+            annotation,
+            selector,
+            *self.layouter.regions[*self.region_index] + offset,
+        )
+    }
+
+    fn assign_advice<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Advice>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.layouter.cs.assign_advice(
+            annotation,
+            column,
+            *self.layouter.regions[*self.region_index] + offset,
+            to,
+        )?;
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn assign_fixed<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Fixed>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.layouter.cs.assign_fixed(
+            annotation,
+            column,
+            *self.layouter.regions[*self.region_index] + offset,
+            to,
+        )?;
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn constrain_equal(
+        &mut self,
+        permutation: &Permutation,
+        left: Cell,
+        right: Cell,
+    ) -> Result<(), Error> {
+        self.layouter.cs.copy(
+            permutation,
+            left.column,
+            *self.layouter.regions[*left.region_index] + left.row_offset,
+            right.column,
+            *self.layouter.regions[*right.region_index] + right.row_offset,
+        )?;
+
+        Ok(())
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit/floor_planner/v1.rs.html b/rustdoc/latest/src/halo2/circuit/floor_planner/v1.rs.html new file mode 100644 index 00000000..4066d8e4 --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit/floor_planner/v1.rs.html @@ -0,0 +1,620 @@ +v1.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+
+use std::fmt;
+use std::marker::PhantomData;
+
+use ff::Field;
+
+use crate::{
+    circuit::{
+        layouter::{RegionLayouter, RegionShape},
+        Cell, Layouter, Region, RegionIndex, RegionStart,
+    },
+    plonk::{
+        Advice, Assigned, Assignment, Circuit, Column, Error, Fixed, FloorPlanner, Permutation,
+        Selector,
+    },
+};
+
+mod strategy;
+
+/// The version 1 [`FloorPlanner`] provided by `halo2`.
+///
+/// - No column optimizations are performed. Circuit configuration is left entirely to the
+///   circuit designer.
+/// - A dual-pass layouter is used to measures regions prior to assignment.
+/// - Regions are measured as rectangles, bounded on the cells they assign.
+/// - Regions are layed out using a greedy first-fit strategy, after sorting regions by
+///   their "advice area" (number of advice columns * rows).
+#[derive(Debug)]
+pub struct V1;
+
+struct V1Plan<'a, F: Field, CS: Assignment<F> + 'a> {
+    cs: &'a mut CS,
+    /// Stores the starting row for each region.
+    regions: Vec<RegionStart>,
+    _marker: PhantomData<F>,
+}
+
+impl<'a, F: Field, CS: Assignment<F> + 'a> fmt::Debug for V1Plan<'a, F, CS> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("floor_planner::V1Plan").finish()
+    }
+}
+
+impl<'a, F: Field, CS: Assignment<F>> V1Plan<'a, F, CS> {
+    /// Creates a new v1 layouter.
+    pub fn new(cs: &'a mut CS) -> Result<Self, Error> {
+        let ret = V1Plan {
+            cs,
+            regions: vec![],
+            _marker: PhantomData,
+        };
+        Ok(ret)
+    }
+}
+
+impl FloorPlanner for V1 {
+    fn synthesize<F: Field, CS: Assignment<F>, C: Circuit<F>>(
+        cs: &mut CS,
+        circuit: &C,
+        config: C::Config,
+    ) -> Result<(), Error> {
+        let mut plan = V1Plan::new(cs)?;
+
+        // First pass: measure the regions within the circuit.
+        let mut measure = MeasurementPass::new();
+        {
+            let pass = &mut measure;
+            circuit
+                .without_witnesses()
+                .synthesize(config.clone(), V1Pass::<_, CS>::measure(pass))?;
+        }
+
+        plan.regions = strategy::slot_in_biggest_advice_first(measure.regions);
+
+        // Second pass: assign the regions.
+        let mut assign = AssignmentPass::new(&mut plan);
+        {
+            let pass = &mut assign;
+            circuit.synthesize(config, V1Pass::assign(pass))?;
+        }
+
+        Ok(())
+    }
+}
+
+#[derive(Debug)]
+enum Pass<'p, 'a, F: Field, CS: Assignment<F> + 'a> {
+    Measurement(&'p mut MeasurementPass),
+    Assignment(&'p mut AssignmentPass<'p, 'a, F, CS>),
+}
+
+/// A single pass of the [`V1`] layouter.
+#[derive(Debug)]
+pub struct V1Pass<'p, 'a, F: Field, CS: Assignment<F> + 'a>(Pass<'p, 'a, F, CS>);
+
+impl<'p, 'a, F: Field, CS: Assignment<F> + 'a> V1Pass<'p, 'a, F, CS> {
+    fn measure(pass: &'p mut MeasurementPass) -> Self {
+        V1Pass(Pass::Measurement(pass))
+    }
+
+    fn assign(pass: &'p mut AssignmentPass<'p, 'a, F, CS>) -> Self {
+        V1Pass(Pass::Assignment(pass))
+    }
+}
+
+impl<'p, 'a, F: Field, CS: Assignment<F> + 'a> Layouter<F> for V1Pass<'p, 'a, F, CS> {
+    type Root = Self;
+
+    fn assign_region<A, AR, N, NR>(&mut self, name: N, assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+        N: Fn() -> NR,
+        NR: Into<String>,
+    {
+        match &mut self.0 {
+            Pass::Measurement(pass) => pass.assign_region(assignment),
+            Pass::Assignment(pass) => pass.assign_region(name, assignment),
+        }
+    }
+
+    fn get_root(&mut self) -> &mut Self::Root {
+        self
+    }
+
+    fn push_namespace<NR, N>(&mut self, name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        if let Pass::Assignment(pass) = &mut self.0 {
+            pass.plan.cs.push_namespace(name_fn);
+        }
+    }
+
+    fn pop_namespace(&mut self, gadget_name: Option<String>) {
+        if let Pass::Assignment(pass) = &mut self.0 {
+            pass.plan.cs.pop_namespace(gadget_name);
+        }
+    }
+}
+
+/// Measures the circuit.
+#[derive(Debug)]
+pub struct MeasurementPass {
+    regions: Vec<RegionShape>,
+}
+
+impl MeasurementPass {
+    fn new() -> Self {
+        MeasurementPass { regions: vec![] }
+    }
+
+    fn assign_region<F: Field, A, AR>(&mut self, mut assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+    {
+        let region_index = self.regions.len();
+
+        // Get shape of the region.
+        let mut shape = RegionShape::new(region_index.into());
+        let result = {
+            let region: &mut dyn RegionLayouter<F> = &mut shape;
+            assignment(region.into())
+        }?;
+        self.regions.push(shape);
+
+        Ok(result)
+    }
+}
+
+/// Assigns the circuit.
+#[derive(Debug)]
+pub struct AssignmentPass<'p, 'a, F: Field, CS: Assignment<F> + 'a> {
+    plan: &'p mut V1Plan<'a, F, CS>,
+    /// Counter tracking which region we need to assign next.
+    region_index: usize,
+}
+
+impl<'p, 'a, F: Field, CS: Assignment<F> + 'a> AssignmentPass<'p, 'a, F, CS> {
+    fn new(plan: &'p mut V1Plan<'a, F, CS>) -> Self {
+        AssignmentPass {
+            plan,
+            region_index: 0,
+        }
+    }
+
+    fn assign_region<A, AR, N, NR>(&mut self, name: N, mut assignment: A) -> Result<AR, Error>
+    where
+        A: FnMut(Region<'_, F>) -> Result<AR, Error>,
+        N: Fn() -> NR,
+        NR: Into<String>,
+    {
+        // Get the next region we are assigning.
+        let region_index = self.region_index;
+        self.region_index += 1;
+
+        self.plan.cs.enter_region(name);
+        let mut region = V1Region::new(self.plan, region_index.into());
+        let result = {
+            let region: &mut dyn RegionLayouter<F> = &mut region;
+            assignment(region.into())
+        }?;
+        self.plan.cs.exit_region();
+
+        Ok(result)
+    }
+}
+
+struct V1Region<'r, 'a, F: Field, CS: Assignment<F> + 'a> {
+    plan: &'r mut V1Plan<'a, F, CS>,
+    region_index: RegionIndex,
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> fmt::Debug for V1Region<'r, 'a, F, CS> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("V1Region")
+            .field("plan", &self.plan)
+            .field("region_index", &self.region_index)
+            .finish()
+    }
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> V1Region<'r, 'a, F, CS> {
+    fn new(plan: &'r mut V1Plan<'a, F, CS>, region_index: RegionIndex) -> Self {
+        V1Region { plan, region_index }
+    }
+}
+
+impl<'r, 'a, F: Field, CS: Assignment<F> + 'a> RegionLayouter<F> for V1Region<'r, 'a, F, CS> {
+    fn enable_selector<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        selector: &Selector,
+        offset: usize,
+    ) -> Result<(), Error> {
+        self.plan.cs.enable_selector(
+            annotation,
+            selector,
+            *self.plan.regions[*self.region_index] + offset,
+        )
+    }
+
+    fn assign_advice<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Advice>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.plan.cs.assign_advice(
+            annotation,
+            column,
+            *self.plan.regions[*self.region_index] + offset,
+            to,
+        )?;
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn assign_fixed<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Fixed>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.plan.cs.assign_fixed(
+            annotation,
+            column,
+            *self.plan.regions[*self.region_index] + offset,
+            to,
+        )?;
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn constrain_equal(
+        &mut self,
+        permutation: &Permutation,
+        left: Cell,
+        right: Cell,
+    ) -> Result<(), Error> {
+        self.plan.cs.copy(
+            permutation,
+            left.column,
+            *self.plan.regions[*left.region_index] + left.row_offset,
+            right.column,
+            *self.plan.regions[*right.region_index] + right.row_offset,
+        )?;
+
+        Ok(())
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit/floor_planner/v1/strategy.rs.html b/rustdoc/latest/src/halo2/circuit/floor_planner/v1/strategy.rs.html new file mode 100644 index 00000000..1056ef07 --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit/floor_planner/v1/strategy.rs.html @@ -0,0 +1,478 @@ +strategy.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+use std::{
+    cmp,
+    collections::{BTreeSet, HashMap},
+};
+
+use super::RegionShape;
+use crate::{
+    circuit::RegionStart,
+    plonk::{Any, Column},
+};
+
+/// A region allocated within a column.
+#[derive(Clone, Default, Debug, PartialEq, Eq)]
+struct AllocatedRegion {
+    // The starting position of the region.
+    start: usize,
+    // The length of the region.
+    length: usize,
+}
+
+impl Ord for AllocatedRegion {
+    fn cmp(&self, other: &Self) -> cmp::Ordering {
+        self.start.cmp(&other.start)
+    }
+}
+
+impl PartialOrd for AllocatedRegion {
+    fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+/// An area of empty space within a column.
+struct EmptySpace {
+    // The starting position of the empty space.
+    start: usize,
+    // The number of rows of empty space, or `None` if unbounded.
+    end: Option<usize>,
+}
+
+/// Allocated rows within a column.
+///
+/// This is a set of [a_start, a_end) pairs representing disjoint allocated intervals.
+#[derive(Clone, Default, Debug)]
+struct Allocations(BTreeSet<AllocatedRegion>);
+
+impl Allocations {
+    /// Return all the *unallocated* nonempty intervals intersecting [start, end).
+    ///
+    /// `end = None` represents an unbounded end.
+    fn free_intervals(
+        &self,
+        start: usize,
+        end: Option<usize>,
+    ) -> impl Iterator<Item = EmptySpace> + '_ {
+        self.0
+            .iter()
+            .map(Some)
+            .chain(Some(None))
+            .scan(start, move |row, region| {
+                Some(if let Some(region) = region {
+                    if end.map(|end| region.start >= end).unwrap_or(false) {
+                        None
+                    } else {
+                        let ret = if *row < region.start {
+                            Some(EmptySpace {
+                                start: *row,
+                                end: Some(region.start),
+                            })
+                        } else {
+                            None
+                        };
+
+                        *row = cmp::max(*row, region.start + region.length);
+
+                        ret
+                    }
+                } else if end.map(|end| *row < end).unwrap_or(true) {
+                    Some(EmptySpace { start: *row, end })
+                } else {
+                    None
+                })
+            })
+            .flatten()
+    }
+}
+
+/// - `start` is the current start row of the region (not of this column).
+/// - `slack` is the maximum number of rows the start could be moved down, taking into
+///   account prior columns.
+fn first_fit_region(
+    column_allocations: &mut HashMap<Column<Any>, Allocations>,
+    region_columns: &[Column<Any>],
+    region_length: usize,
+    start: usize,
+    slack: Option<usize>,
+) -> Option<usize> {
+    let (c, remaining_columns) = match region_columns.split_first() {
+        Some(cols) => cols,
+        None => return Some(start),
+    };
+    let end = slack.map(|slack| start + region_length + slack);
+
+    // Iterate over the unallocated non-empty intervals in c that intersect [start, end).
+    for space in column_allocations
+        .entry(*c)
+        .or_default()
+        .clone()
+        .free_intervals(start, end)
+    {
+        // Do we have enough room for this column of the region in this interval?
+        let s_slack = space
+            .end
+            .map(|end| (end as isize - space.start as isize) - region_length as isize);
+        if let Some((slack, s_slack)) = slack.zip(s_slack) {
+            assert!(s_slack <= slack as isize);
+        }
+        if s_slack.unwrap_or(0) >= 0 {
+            let row = first_fit_region(
+                column_allocations,
+                remaining_columns,
+                region_length,
+                space.start,
+                s_slack.map(|s| s as usize),
+            );
+            if let Some(row) = row {
+                if let Some(end) = end {
+                    assert!(row + region_length <= end);
+                }
+                column_allocations
+                    .get_mut(c)
+                    .unwrap()
+                    .0
+                    .insert(AllocatedRegion {
+                        start: row,
+                        length: region_length,
+                    });
+                return Some(row);
+            }
+        }
+    }
+
+    // No placement worked; the caller will need to try other possibilities.
+    None
+}
+
+/// Positions the regions starting at the earliest row for which none of the columns are
+/// in use, taking into account gaps between earlier regions.
+fn slot_in(region_shapes: Vec<RegionShape>) -> Vec<(RegionStart, RegionShape)> {
+    // Tracks the empty regions for each column.
+    let mut column_allocations: HashMap<Column<Any>, Allocations> = Default::default();
+
+    region_shapes
+        .into_iter()
+        .map(|region| {
+            // Sort the region's columns to ensure determinism.
+            // - An unstable sort is fine, because region.columns() returns a set.
+            // - The sort order relies on Column's Ord implementation!
+            let mut region_columns: Vec<_> = region.columns().iter().cloned().collect();
+            region_columns.sort_unstable();
+
+            let region_start = first_fit_region(
+                &mut column_allocations,
+                &region_columns,
+                region.row_count(),
+                0,
+                None,
+            )
+            .expect("We can always fit a region somewhere");
+
+            (region_start.into(), region)
+        })
+        .collect()
+}
+
+/// Sorts the regions by advice area and then lays them out with the [`slot_in`] strategy.
+pub fn slot_in_biggest_advice_first(region_shapes: Vec<RegionShape>) -> Vec<RegionStart> {
+    let mut sorted_regions: Vec<_> = region_shapes.into_iter().collect();
+    sorted_regions.sort_unstable_by_key(|shape| {
+        // Count the number of advice columns
+        let advice_cols = shape
+            .columns()
+            .iter()
+            .filter(|c| matches!(c.column_type(), Any::Advice))
+            .count();
+        // Sort by advice area (since this has the most contention).
+        advice_cols * shape.row_count()
+    });
+    sorted_regions.reverse();
+
+    // Lay out the sorted regions.
+    let mut regions = slot_in(sorted_regions);
+
+    // Un-sort the regions so they match the original indexing.
+    regions.sort_unstable_by_key(|(_, region)| region.region_index().0);
+    regions.into_iter().map(|(start, _)| start).collect()
+}
+
+#[test]
+fn test_slot_in() {
+    let regions = vec![
+        RegionShape {
+            region_index: 0.into(),
+            columns: vec![Column::new(0, Any::Advice), Column::new(1, Any::Advice)]
+                .into_iter()
+                .collect(),
+            row_count: 15,
+        },
+        RegionShape {
+            region_index: 1.into(),
+            columns: vec![Column::new(2, Any::Advice)].into_iter().collect(),
+            row_count: 10,
+        },
+        RegionShape {
+            region_index: 2.into(),
+            columns: vec![Column::new(2, Any::Advice), Column::new(0, Any::Advice)]
+                .into_iter()
+                .collect(),
+            row_count: 10,
+        },
+    ];
+    assert_eq!(
+        slot_in(regions)
+            .into_iter()
+            .map(|(i, _)| i)
+            .collect::<Vec<_>>(),
+        vec![0.into(), 0.into(), 15.into()]
+    );
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/circuit/layouter.rs.html b/rustdoc/latest/src/halo2/circuit/layouter.rs.html new file mode 100644 index 00000000..01f7a3a3 --- /dev/null +++ b/rustdoc/latest/src/halo2/circuit/layouter.rs.html @@ -0,0 +1,366 @@ +layouter.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+//! Implementations of common circuit layouters.
+
+use std::cmp;
+use std::collections::HashSet;
+use std::fmt;
+
+use ff::Field;
+
+use super::{Cell, RegionIndex};
+use crate::plonk::Assigned;
+use crate::plonk::{Advice, Any, Column, Error, Fixed, Permutation, Selector};
+
+/// Helper trait for implementing a custom [`Layouter`].
+///
+/// This trait is used for implementing region assignments:
+///
+/// ```ignore
+/// impl<'a, F: FieldExt, C: Chip<F>, CS: Assignment<F> + 'a> Layouter<C> for MyLayouter<'a, C, CS> {
+///     fn assign_region(
+///         &mut self,
+///         assignment: impl FnOnce(Region<'_, F, C>) -> Result<(), Error>,
+///     ) -> Result<(), Error> {
+///         let region_index = self.regions.len();
+///         self.regions.push(self.current_gate);
+///
+///         let mut region = MyRegion::new(self, region_index);
+///         {
+///             let region: &mut dyn RegionLayouter<F> = &mut region;
+///             assignment(region.into())?;
+///         }
+///         self.current_gate += region.row_count;
+///
+///         Ok(())
+///     }
+/// }
+/// ```
+///
+/// TODO: It would be great if we could constrain the columns in these types to be
+/// "logical" columns that are guaranteed to correspond to the chip (and have come from
+/// `Chip::Config`).
+///
+/// [`Layouter`]: super::Layouter
+pub trait RegionLayouter<F: Field>: fmt::Debug {
+    /// Enables a selector at the given offset.
+    fn enable_selector<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        selector: &Selector,
+        offset: usize,
+    ) -> Result<(), Error>;
+
+    /// Assign an advice column value (witness)
+    fn assign_advice<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Advice>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error>;
+
+    /// Assign a fixed value
+    fn assign_fixed<'v>(
+        &'v mut self,
+        annotation: &'v (dyn Fn() -> String + 'v),
+        column: Column<Fixed>,
+        offset: usize,
+        to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error>;
+
+    /// Constraint two cells to have the same value.
+    ///
+    /// Returns an error if either of the cells is not within the given permutation.
+    fn constrain_equal(
+        &mut self,
+        permutation: &Permutation,
+        left: Cell,
+        right: Cell,
+    ) -> Result<(), Error>;
+}
+
+/// The shape of a region. For a region at a certain index, we track
+/// the set of columns it uses as well as the number of rows it uses.
+#[derive(Clone, Debug)]
+pub struct RegionShape {
+    pub(super) region_index: RegionIndex,
+    pub(super) columns: HashSet<Column<Any>>,
+    pub(super) row_count: usize,
+}
+
+impl RegionShape {
+    /// Create a new `RegionShape` for a region at `region_index`.
+    pub fn new(region_index: RegionIndex) -> Self {
+        RegionShape {
+            region_index,
+            columns: HashSet::default(),
+            row_count: 0,
+        }
+    }
+
+    /// Get the `region_index` of a `RegionShape`.
+    pub fn region_index(&self) -> RegionIndex {
+        self.region_index
+    }
+
+    /// Get a reference to the set of `columns` used in a `RegionShape`.
+    pub fn columns(&self) -> &HashSet<Column<Any>> {
+        &self.columns
+    }
+
+    /// Get the `row_count` of a `RegionShape`.
+    pub fn row_count(&self) -> usize {
+        self.row_count
+    }
+}
+
+impl<F: Field> RegionLayouter<F> for RegionShape {
+    fn enable_selector<'v>(
+        &'v mut self,
+        _: &'v (dyn Fn() -> String + 'v),
+        selector: &Selector,
+        offset: usize,
+    ) -> Result<(), Error> {
+        // Track the selector's fixed column as part of the region's shape.
+        // TODO: Avoid exposing selector internals?
+        self.columns.insert(selector.0.into());
+        self.row_count = cmp::max(self.row_count, offset + 1);
+        Ok(())
+    }
+
+    fn assign_advice<'v>(
+        &'v mut self,
+        _: &'v (dyn Fn() -> String + 'v),
+        column: Column<Advice>,
+        offset: usize,
+        _to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.columns.insert(column.into());
+        self.row_count = cmp::max(self.row_count, offset + 1);
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn assign_fixed<'v>(
+        &'v mut self,
+        _: &'v (dyn Fn() -> String + 'v),
+        column: Column<Fixed>,
+        offset: usize,
+        _to: &'v mut (dyn FnMut() -> Result<Assigned<F>, Error> + 'v),
+    ) -> Result<Cell, Error> {
+        self.columns.insert(column.into());
+        self.row_count = cmp::max(self.row_count, offset + 1);
+
+        Ok(Cell {
+            region_index: self.region_index,
+            row_offset: offset,
+            column: column.into(),
+        })
+    }
+
+    fn constrain_equal(
+        &mut self,
+        _permutation: &Permutation,
+        _left: Cell,
+        _right: Cell,
+    ) -> Result<(), Error> {
+        // Equality constraints don't affect the region shape.
+        Ok(())
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/dev.rs.html b/rustdoc/latest/src/halo2/dev.rs.html new file mode 100644 index 00000000..a03da83a --- /dev/null +++ b/rustdoc/latest/src/halo2/dev.rs.html @@ -0,0 +1,1524 @@ +dev.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+
+//! Tools for developing circuits.
+
+use std::collections::HashMap;
+use std::fmt;
+use std::iter;
+
+use ff::Field;
+
+use crate::plonk::Assigned;
+use crate::{
+    arithmetic::{FieldExt, Group},
+    plonk::{
+        permutation, Advice, Any, Assignment, Circuit, Column, ColumnType, ConstraintSystem, Error,
+        Expression, Fixed, FloorPlanner, Permutation, Selector,
+    },
+    poly::Rotation,
+};
+
+pub mod metadata;
+
+#[cfg(feature = "dev-graph")]
+mod graph;
+
+#[cfg(feature = "dev-graph")]
+#[cfg_attr(docsrs, doc(cfg(feature = "dev-graph")))]
+pub use graph::{circuit_dot_graph, layout::CircuitLayout};
+
+/// Cells that haven't been explicitly assigned to, default to zero.
+fn cell_value<F: Field>(cell: Option<F>) -> F {
+    cell.unwrap_or_else(F::zero)
+}
+
+/// The reasons why a particular circuit is not satisfied.
+#[derive(Debug, PartialEq)]
+pub enum VerifyFailure {
+    /// A cell used in an active gate was not assigned to.
+    Cell {
+        /// The index of the active gate.
+        gate: metadata::Gate,
+        /// The region in which this cell should be assigned.
+        region: metadata::Region,
+        /// The column in which this cell should be assigned.
+        column: Column<Any>,
+        /// The offset (relative to the start of the region) at which this cell should be
+        /// assigned. This may be negative (for example, if a selector enables a gate at
+        /// offset 0, but the gate uses `Rotation::prev()`).
+        offset: isize,
+    },
+    /// A constraint was not satisfied for a particular row.
+    Constraint {
+        /// The polynomial constraint that is not satisfied.
+        constraint: metadata::Constraint,
+        /// The row on which this constraint is not satisfied.
+        row: usize,
+    },
+    /// A lookup input did not exist in its corresponding table.
+    Lookup {
+        /// The index of the lookup that is not satisfied. These indices are assigned in
+        /// the order in which `ConstraintSystem::lookup` is called during
+        /// `Circuit::configure`.
+        lookup_index: usize,
+        /// The row on which this lookup is not satisfied.
+        row: usize,
+    },
+    /// A permutation did not preserve the original value of a cell.
+    Permutation {
+        /// The index of the permutation that is not satisfied. These indices are assigned
+        /// in the order in which `ConstraintSystem::lookup` is called during
+        /// `Circuit::configure`.
+        perm_index: usize,
+        /// The column in which this permutation is not satisfied.
+        column: usize,
+        /// The row on which this permutation is not satisfied.
+        row: usize,
+    },
+}
+
+impl fmt::Display for VerifyFailure {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            Self::Cell {
+                gate,
+                region,
+                column,
+                offset,
+            } => {
+                write!(
+                    f,
+                    "{} uses {}, which requires cell in column {:?} at offset {} to be assigned.",
+                    region, gate, column, offset
+                )
+            }
+            Self::Constraint { constraint, row } => {
+                write!(f, "{} is not satisfied on row {}", constraint, row)
+            }
+            Self::Lookup { lookup_index, row } => {
+                write!(f, "Lookup {} is not satisfied on row {}", lookup_index, row)
+            }
+            Self::Permutation {
+                perm_index,
+                column,
+                row,
+            } => {
+                write!(
+                    f,
+                    "Permutation {} is not satisfied by cell ({:?}, {})",
+                    perm_index, column, row
+                )
+            }
+        }
+    }
+}
+
+#[derive(Debug)]
+struct Region {
+    /// The name of the region. Not required to be unique.
+    name: String,
+    /// The row that this region starts on, if known.
+    start: Option<usize>,
+    /// The selectors that have been enabled in this region. All other selectors are by
+    /// construction not enabled.
+    enabled_selectors: HashMap<Selector, Vec<usize>>,
+    /// The cells assigned in this region. We store this as a `Vec` so that if any cells
+    /// are double-assigned, they will be visibly darker.
+    cells: Vec<(Column<Any>, usize)>,
+}
+
+impl Region {
+    fn update_start(&mut self, row: usize) {
+        // The region start is the earliest row assigned to.
+        let mut start = self.start.unwrap_or(row);
+        if row < start {
+            // The first row assigned was not at start 0 within the region.
+            start = row;
+        }
+        self.start = Some(start);
+    }
+}
+
+/// A test prover for debugging circuits.
+///
+/// The normal proving process, when applied to a buggy circuit implementation, might
+/// return proofs that do not validate when they should, but it can't indicate anything
+/// other than "something is invalid". `MockProver` can be used to figure out _why_ these
+/// are invalid: it stores all the private inputs along with the circuit internals, and
+/// then checks every constraint manually.
+///
+/// # Examples
+///
+/// ```
+/// use halo2::{
+///     arithmetic::FieldExt,
+///     circuit::{Layouter, SimpleFloorPlanner},
+///     dev::{MockProver, VerifyFailure},
+///     pasta::Fp,
+///     plonk::{Advice, Circuit, Column, ConstraintSystem, Error},
+///     poly::Rotation,
+/// };
+/// const K: u32 = 5;
+///
+/// #[derive(Copy, Clone)]
+/// struct MyConfig {
+///     a: Column<Advice>,
+///     b: Column<Advice>,
+///     c: Column<Advice>,
+/// }
+///
+/// #[derive(Clone, Default)]
+/// struct MyCircuit {
+///     a: Option<u64>,
+///     b: Option<u64>,
+/// }
+///
+/// impl<F: FieldExt> Circuit<F> for MyCircuit {
+///     type Config = MyConfig;
+///     type FloorPlanner = SimpleFloorPlanner;
+///
+///     fn without_witnesses(&self) -> Self {
+///         Self::default()
+///     }
+///
+///     fn configure(meta: &mut ConstraintSystem<F>) -> MyConfig {
+///         let a = meta.advice_column();
+///         let b = meta.advice_column();
+///         let c = meta.advice_column();
+///
+///         meta.create_gate("R1CS constraint", |meta| {
+///             let a = meta.query_advice(a, Rotation::cur());
+///             let b = meta.query_advice(b, Rotation::cur());
+///             let c = meta.query_advice(c, Rotation::cur());
+///
+///             // BUG: Should be a * b - c
+///             Some(("buggy R1CS", a * b + c))
+///         });
+///
+///         MyConfig { a, b, c }
+///     }
+///
+///     fn synthesize(&self, config: MyConfig, mut layouter: impl Layouter<F>) -> Result<(), Error> {
+///         layouter.assign_region(|| "Example region", |mut region| {
+///             region.assign_advice(|| "a", config.a, 0, || {
+///                 self.a.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
+///             })?;
+///             region.assign_advice(|| "b", config.b, 0, || {
+///                 self.b.map(|v| F::from_u64(v)).ok_or(Error::SynthesisError)
+///             })?;
+///             region.assign_advice(|| "c", config.c, 0, || {
+///                 self.a
+///                     .and_then(|a| self.b.map(|b| F::from_u64(a * b)))
+///                     .ok_or(Error::SynthesisError)
+///             })?;
+///             Ok(())
+///         })
+///     }
+/// }
+///
+/// // Assemble the private inputs to the circuit.
+/// let circuit = MyCircuit {
+///     a: Some(2),
+///     b: Some(4),
+/// };
+///
+/// // This circuit has no public inputs.
+/// let instance = vec![];
+///
+/// let prover = MockProver::<Fp>::run(K, &circuit, instance).unwrap();
+/// assert_eq!(
+///     prover.verify(),
+///     Err(vec![VerifyFailure::Constraint {
+///         constraint: ((0, "R1CS constraint").into(), 0, "buggy R1CS").into(),
+///         row: 0
+///     }])
+/// );
+/// ```
+#[derive(Debug)]
+pub struct MockProver<F: Group + Field> {
+    n: u32,
+    cs: ConstraintSystem<F>,
+
+    /// The regions in the circuit.
+    regions: Vec<Region>,
+    /// The current region being assigned to. Will be `None` after the circuit has been
+    /// synthesized.
+    current_region: Option<Region>,
+
+    // The fixed cells in the circuit, arranged as [column][row].
+    fixed: Vec<Vec<Option<F>>>,
+    // The advice cells in the circuit, arranged as [column][row].
+    advice: Vec<Vec<Option<F>>>,
+    // The instance cells in the circuit, arranged as [column][row].
+    instance: Vec<Vec<F>>,
+
+    permutations: Vec<permutation::keygen::Assembly>,
+}
+
+impl<F: Field + Group> Assignment<F> for MockProver<F> {
+    fn enter_region<NR, N>(&mut self, name: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        assert!(self.current_region.is_none());
+        self.current_region = Some(Region {
+            name: name().into(),
+            start: None,
+            enabled_selectors: HashMap::default(),
+            cells: vec![],
+        });
+    }
+
+    fn exit_region(&mut self) {
+        self.regions.push(self.current_region.take().unwrap());
+    }
+
+    fn enable_selector<A, AR>(
+        &mut self,
+        annotation: A,
+        selector: &Selector,
+        row: usize,
+    ) -> Result<(), Error>
+    where
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        // Track that this selector was enabled. We require that all selectors are enabled
+        // inside some region (i.e. no floating selectors).
+        self.current_region
+            .as_mut()
+            .unwrap()
+            .enabled_selectors
+            .entry(*selector)
+            .or_default()
+            .push(row);
+
+        // Selectors are just fixed columns.
+        self.assign_fixed(annotation, selector.0, row, || Ok(F::one()))
+    }
+
+    fn assign_advice<V, VR, A, AR>(
+        &mut self,
+        _: A,
+        column: Column<Advice>,
+        row: usize,
+        to: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        if let Some(region) = self.current_region.as_mut() {
+            region.update_start(row);
+            region.cells.push((column.into(), row));
+        }
+
+        *self
+            .advice
+            .get_mut(column.index())
+            .and_then(|v| v.get_mut(row))
+            .ok_or(Error::BoundsFailure)? = Some(to()?.into().evaluate());
+
+        Ok(())
+    }
+
+    fn assign_fixed<V, VR, A, AR>(
+        &mut self,
+        _: A,
+        column: Column<Fixed>,
+        row: usize,
+        to: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        if let Some(region) = self.current_region.as_mut() {
+            region.update_start(row);
+            region.cells.push((column.into(), row));
+        }
+
+        *self
+            .fixed
+            .get_mut(column.index())
+            .and_then(|v| v.get_mut(row))
+            .ok_or(Error::BoundsFailure)? = Some(to()?.into().evaluate());
+
+        Ok(())
+    }
+
+    fn copy(
+        &mut self,
+        permutation: &Permutation,
+        left_column: Column<Any>,
+        left_row: usize,
+        right_column: Column<Any>,
+        right_row: usize,
+    ) -> Result<(), crate::plonk::Error> {
+        // Check bounds first
+        if permutation.index() >= self.permutations.len() {
+            return Err(Error::BoundsFailure);
+        }
+
+        let left_column_index = permutation
+            .mapping()
+            .iter()
+            .position(|c| c == &left_column)
+            .ok_or(Error::SynthesisError)?;
+        let right_column_index = permutation
+            .mapping()
+            .iter()
+            .position(|c| c == &right_column)
+            .ok_or(Error::SynthesisError)?;
+
+        self.permutations[permutation.index()].copy(
+            left_column_index,
+            left_row,
+            right_column_index,
+            right_row,
+        )
+    }
+
+    fn push_namespace<NR, N>(&mut self, _: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        // TODO: Do something with namespaces :)
+    }
+
+    fn pop_namespace(&mut self, _: Option<String>) {
+        // TODO: Do something with namespaces :)
+    }
+}
+
+impl<F: FieldExt> MockProver<F> {
+    /// Runs a synthetic keygen-and-prove operation on the given circuit, collecting data
+    /// about the constraints and their assignments.
+    pub fn run<ConcreteCircuit: Circuit<F>>(
+        k: u32,
+        circuit: &ConcreteCircuit,
+        instance: Vec<Vec<F>>,
+    ) -> Result<Self, Error> {
+        let n = 1 << k;
+
+        let mut cs = ConstraintSystem::default();
+        let config = ConcreteCircuit::configure(&mut cs);
+
+        let fixed = vec![vec![None; n as usize]; cs.num_fixed_columns];
+        let advice = vec![vec![None; n as usize]; cs.num_advice_columns];
+        let permutations = cs
+            .permutations
+            .iter()
+            .map(|p| permutation::keygen::Assembly::new(n as usize, p))
+            .collect();
+
+        let mut prover = MockProver {
+            n,
+            cs,
+            regions: vec![],
+            current_region: None,
+            fixed,
+            advice,
+            instance,
+            permutations,
+        };
+
+        ConcreteCircuit::FloorPlanner::synthesize(&mut prover, circuit, config)?;
+
+        Ok(prover)
+    }
+
+    /// Returns `Ok(())` if this `MockProver` is satisfied, or a list of errors indicating
+    /// the reasons that the circuit is not satisfied.
+    pub fn verify(&self) -> Result<(), Vec<VerifyFailure>> {
+        let n = self.n as i32;
+
+        // Check that within each region, all cells used in instantiated gates have been
+        // assigned to.
+        let selector_errors = self.regions.iter().enumerate().flat_map(|(r_i, r)| {
+            r.enabled_selectors.iter().flat_map(move |(selector, at)| {
+                // Find the gates enabled by this selector
+                self.cs
+                    .gates
+                    .iter()
+                    // Assume that if a queried selector is enabled, the user wants to use the
+                    // corresponding gate in some way.
+                    //
+                    // TODO: This will trip up on the reverse case, where leaving a selector
+                    // un-enabled keeps a gate enabled. We could alternatively require that
+                    // every selector is explicitly enabled or disabled on every row? But that
+                    // seems messy and confusing.
+                    .enumerate()
+                    .filter(move |(_, g)| g.queried_selectors().contains(selector))
+                    .flat_map(move |(gate_index, gate)| {
+                        at.iter().flat_map(move |selector_row| {
+                            // Selectors are queried with no rotation.
+                            let gate_row = *selector_row as i32;
+
+                            gate.queried_cells().iter().filter_map(move |cell| {
+                                // Determine where this cell should have been assigned.
+                                let cell_row = ((gate_row + n + cell.rotation.0) % n) as usize;
+
+                                // Check that it was assigned!
+                                if r.cells.contains(&(cell.column, cell_row)) {
+                                    None
+                                } else {
+                                    Some(VerifyFailure::Cell {
+                                        gate: (gate_index, gate.name()).into(),
+                                        region: (r_i, r.name.clone()).into(),
+                                        column: cell.column,
+                                        offset: cell_row as isize - r.start.unwrap() as isize,
+                                    })
+                                }
+                            })
+                        })
+                    })
+            })
+        });
+
+        // Check that all gates are satisfied for all rows.
+        let gate_errors =
+            self.cs
+                .gates
+                .iter()
+                .enumerate()
+                .flat_map(|(gate_index, gate)| {
+                    // We iterate from n..2n so we can just reduce to handle wrapping.
+                    (n..(2 * n)).flat_map(move |row| {
+                        fn load_opt<'a, F: FieldExt, T: ColumnType>(
+                            n: i32,
+                            row: i32,
+                            queries: &'a [(Column<T>, Rotation)],
+                            cells: &'a [Vec<Option<F>>],
+                        ) -> impl Fn(usize) -> F + 'a {
+                            move |index| {
+                                let (column, at) = &queries[index];
+                                let resolved_row = (row + at.0) % n;
+                                cell_value(cells[column.index()][resolved_row as usize])
+                            }
+                        }
+
+                        fn load<'a, F: FieldExt, T: ColumnType>(
+                            n: i32,
+                            row: i32,
+                            queries: &'a [(Column<T>, Rotation)],
+                            cells: &'a [Vec<F>],
+                        ) -> impl Fn(usize) -> F + 'a {
+                            move |index| {
+                                let (column, at) = &queries[index];
+                                let resolved_row = (row + at.0) % n;
+                                cells[column.index()][resolved_row as usize]
+                            }
+                        }
+
+                        gate.polynomials().iter().enumerate().filter_map(
+                            move |(poly_index, poly)| {
+                                if poly.evaluate(
+                                    &|scalar| scalar,
+                                    &load_opt(n, row, &self.cs.fixed_queries, &self.fixed),
+                                    &load_opt(n, row, &self.cs.advice_queries, &self.advice),
+                                    &load(n, row, &self.cs.instance_queries, &self.instance),
+                                    &|a, b| a + &b,
+                                    &|a, b| a * &b,
+                                    &|a, scalar| a * scalar,
+                                ) == F::zero()
+                                {
+                                    None
+                                } else {
+                                    Some(VerifyFailure::Constraint {
+                                        constraint: (
+                                            (gate_index, gate.name()).into(),
+                                            poly_index,
+                                            gate.constraint_name(poly_index),
+                                        )
+                                            .into(),
+                                        row: (row - n) as usize,
+                                    })
+                                }
+                            },
+                        )
+                    })
+                });
+
+        // Check that all lookups exist in their respective tables.
+        let lookup_errors =
+            self.cs
+                .lookups
+                .iter()
+                .enumerate()
+                .flat_map(|(lookup_index, lookup)| {
+                    (0..n).filter_map(move |input_row| {
+                        let load = |expression: &Expression<F>, row| {
+                            expression.evaluate(
+                                &|scalar| scalar,
+                                &|index| {
+                                    let query = self.cs.fixed_queries[index];
+                                    let column_index = query.0.index();
+                                    let rotation = query.1 .0;
+                                    cell_value(
+                                        self.fixed[column_index]
+                                            [(row as i32 + n + rotation) as usize % n as usize],
+                                    )
+                                },
+                                &|index| {
+                                    let query = self.cs.advice_queries[index];
+                                    let column_index = query.0.index();
+                                    let rotation = query.1 .0;
+                                    cell_value(
+                                        self.advice[column_index]
+                                            [(row as i32 + n + rotation) as usize % n as usize],
+                                    )
+                                },
+                                &|index| {
+                                    let query = self.cs.instance_queries[index];
+                                    let column_index = query.0.index();
+                                    let rotation = query.1 .0;
+                                    self.instance[column_index]
+                                        [(row as i32 + n + rotation) as usize % n as usize]
+                                },
+                                &|a, b| a + b,
+                                &|a, b| a * b,
+                                &|a, scalar| a * scalar,
+                            )
+                        };
+
+                        let inputs: Vec<_> = lookup
+                            .input_expressions
+                            .iter()
+                            .map(|c| load(c, input_row))
+                            .collect();
+                        let lookup_passes = (0..n)
+                            .map(|table_row| {
+                                lookup
+                                    .table_expressions
+                                    .iter()
+                                    .map(move |c| load(c, table_row))
+                            })
+                            .any(|table_row| table_row.eq(inputs.iter().cloned()));
+                        if lookup_passes {
+                            None
+                        } else {
+                            Some(VerifyFailure::Lookup {
+                                lookup_index,
+                                row: input_row as usize,
+                            })
+                        }
+                    })
+                });
+
+        // Check that permutations preserve the original values of the cells.
+        let perm_errors =
+            self.permutations
+                .iter()
+                .enumerate()
+                .flat_map(|(perm_index, assembly)| {
+                    // Original values of columns involved in the permutation
+                    let original = |perm_index: usize, column, row| {
+                        self.cs.permutations[perm_index]
+                            .get_columns()
+                            .get(column)
+                            .map(|c: &Column<Any>| match c.column_type() {
+                                Any::Advice => cell_value(self.advice[c.index()][row]),
+                                Any::Fixed => cell_value(self.fixed[c.index()][row]),
+                                Any::Instance => self.instance[c.index()][row],
+                            })
+                            .unwrap()
+                    };
+
+                    // Iterate over each column of the permutation
+                    assembly
+                        .mapping
+                        .iter()
+                        .enumerate()
+                        .flat_map(move |(column, values)| {
+                            // Iterate over each row of the column to check that the cell's
+                            // value is preserved by the mapping.
+                            values.iter().enumerate().filter_map(move |(row, cell)| {
+                                let original_cell = original(perm_index, column, row);
+                                let permuted_cell = original(perm_index, cell.0, cell.1);
+                                if original_cell == permuted_cell {
+                                    None
+                                } else {
+                                    Some(VerifyFailure::Permutation {
+                                        perm_index,
+                                        column,
+                                        row,
+                                    })
+                                }
+                            })
+                        })
+                });
+
+        let errors: Vec<_> = iter::empty()
+            .chain(selector_errors)
+            .chain(gate_errors)
+            .chain(lookup_errors)
+            .chain(perm_errors)
+            .collect();
+        if errors.is_empty() {
+            Ok(())
+        } else {
+            Err(errors)
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use pasta_curves::Fp;
+
+    use super::{MockProver, VerifyFailure};
+    use crate::{
+        circuit::{Layouter, SimpleFloorPlanner},
+        plonk::{Advice, Any, Circuit, Column, ConstraintSystem, Error, Selector},
+        poly::Rotation,
+    };
+
+    #[test]
+    fn unassigned_cell() {
+        const K: u32 = 4;
+
+        #[derive(Clone)]
+        struct FaultyCircuitConfig {
+            a: Column<Advice>,
+            q: Selector,
+        }
+
+        struct FaultyCircuit {}
+
+        impl Circuit<Fp> for FaultyCircuit {
+            type Config = FaultyCircuitConfig;
+            type FloorPlanner = SimpleFloorPlanner;
+
+            fn configure(meta: &mut ConstraintSystem<Fp>) -> Self::Config {
+                let a = meta.advice_column();
+                let b = meta.advice_column();
+                let q = meta.selector();
+
+                meta.create_gate("Equality check", |cells| {
+                    let a = cells.query_advice(a, Rotation::prev());
+                    let b = cells.query_advice(b, Rotation::cur());
+                    let q = cells.query_selector(q);
+
+                    // If q is enabled, a and b must be assigned to.
+                    vec![q * (a - b)]
+                });
+
+                FaultyCircuitConfig { a, q }
+            }
+
+            fn without_witnesses(&self) -> Self {
+                Self {}
+            }
+
+            fn synthesize(
+                &self,
+                config: Self::Config,
+                mut layouter: impl Layouter<Fp>,
+            ) -> Result<(), Error> {
+                layouter.assign_region(
+                    || "Faulty synthesis",
+                    |mut region| {
+                        // Enable the equality gate.
+                        config.q.enable(&mut region, 1)?;
+
+                        // Assign a = 0.
+                        region.assign_advice(|| "a", config.a, 0, || Ok(Fp::zero()))?;
+
+                        // BUG: Forget to assign b = 0! This could go unnoticed during
+                        // development, because cell values default to zero, which in this
+                        // case is fine, but for other assignments would be broken.
+                        Ok(())
+                    },
+                )
+            }
+        }
+
+        let prover = MockProver::run(K, &FaultyCircuit {}, vec![]).unwrap();
+        assert_eq!(
+            prover.verify(),
+            Err(vec![VerifyFailure::Cell {
+                gate: (0, "Equality check").into(),
+                region: (0, "Faulty synthesis".to_owned()).into(),
+                column: Column::new(1, Any::Advice),
+                offset: 1,
+            }])
+        );
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/dev/metadata.rs.html b/rustdoc/latest/src/halo2/dev/metadata.rs.html new file mode 100644 index 00000000..9e1c4280 --- /dev/null +++ b/rustdoc/latest/src/halo2/dev/metadata.rs.html @@ -0,0 +1,192 @@ +metadata.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+
+//! Metadata about circuits.
+
+use std::fmt;
+
+/// Metadata about a configured gate within a circuit.
+#[derive(Debug, PartialEq)]
+pub struct Gate {
+    /// The index of the active gate. These indices are assigned in the order in which
+    /// `ConstraintSystem::create_gate` is called during `Circuit::configure`.
+    index: usize,
+    /// The name of the active gate. These are specified by the gate creator (such as
+    /// a chip implementation), and is not enforced to be unique.
+    name: &'static str,
+}
+
+impl fmt::Display for Gate {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "Gate {} ('{}')", self.index, self.name)
+    }
+}
+
+impl From<(usize, &'static str)> for Gate {
+    fn from((index, name): (usize, &'static str)) -> Self {
+        Gate { index, name }
+    }
+}
+
+/// Metadata about a configured constraint within a circuit.
+#[derive(Debug, PartialEq)]
+pub struct Constraint {
+    /// The gate containing the constraint.
+    gate: Gate,
+    /// The index of the polynomial constraint within the gate. These indices correspond
+    /// to the order in which the constraints are returned from the closure passed to
+    /// `ConstraintSystem::create_gate` during `Circuit::configure`.
+    index: usize,
+    /// The name of the constraint. This is specified by the gate creator (such as a chip
+    /// implementation), and is not enforced to be unique.
+    name: &'static str,
+}
+
+impl fmt::Display for Constraint {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(
+            f,
+            "Constraint {}{} in gate {} ('{}')",
+            self.index,
+            if self.name.is_empty() {
+                String::new()
+            } else {
+                format!(" ('{}')", self.name)
+            },
+            self.gate.index,
+            self.gate.name,
+        )
+    }
+}
+
+impl From<(Gate, usize, &'static str)> for Constraint {
+    fn from((gate, index, name): (Gate, usize, &'static str)) -> Self {
+        Constraint { gate, index, name }
+    }
+}
+
+/// Metadata about an assigned region within a circuit.
+#[derive(Debug, PartialEq)]
+pub struct Region {
+    /// The index of the region. These indices are assigned in the order in which
+    /// `Layouter::assign_region` is called during `Circuit::synthesize`.
+    index: usize,
+    /// The name of the region. This is specified by the region creator (such as a chip
+    /// implementation), and is not enforced to be unique.
+    name: String,
+}
+
+impl fmt::Display for Region {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "Region {} ('{}')", self.index, self.name)
+    }
+}
+
+impl From<(usize, String)> for Region {
+    fn from((index, name): (usize, String)) -> Self {
+        Region { index, name }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/lib.rs.html b/rustdoc/latest/src/halo2/lib.rs.html new file mode 100644 index 00000000..895949af --- /dev/null +++ b/rustdoc/latest/src/halo2/lib.rs.html @@ -0,0 +1,86 @@ +lib.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+//! # halo2
+
+#![cfg_attr(docsrs, feature(doc_cfg))]
+// Build without warnings on stable 1.51 and later.
+#![allow(unknown_lints)]
+// Disable old lint warnings until our MSRV is at least 1.51.
+#![allow(renamed_and_removed_lints)]
+// Use the old lint name to build without warnings until our MSRV is at least 1.51.
+#![allow(clippy::unknown_clippy_lints)]
+// The actual lints we want to disable.
+#![allow(
+    clippy::op_ref,
+    clippy::assign_op_pattern,
+    clippy::too_many_arguments,
+    clippy::suspicious_arithmetic_impl,
+    clippy::many_single_char_names,
+    clippy::same_item_push,
+    clippy::upper_case_acronyms
+)]
+#![deny(broken_intra_doc_links)]
+#![deny(missing_debug_implementations)]
+#![deny(missing_docs)]
+#![deny(unsafe_code)]
+
+pub mod arithmetic;
+pub mod circuit;
+pub use pasta_curves as pasta;
+mod multicore;
+pub mod plonk;
+pub mod poly;
+pub mod transcript;
+
+pub mod dev;
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/multicore.rs.html b/rustdoc/latest/src/halo2/multicore.rs.html new file mode 100644 index 00000000..4f1d0242 --- /dev/null +++ b/rustdoc/latest/src/halo2/multicore.rs.html @@ -0,0 +1,30 @@ +multicore.rs - source + + + +
1
+2
+3
+4
+5
+
+//! An interface for dealing with the kinds of parallel computations involved in
+//! `halo2`. It's currently just a (very!) thin wrapper around [`rayon`] but may
+//! be extended in the future to allow for various parallelism strategies.
+
+pub use rayon::{current_num_threads, scope, Scope};
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk.rs.html b/rustdoc/latest/src/halo2/plonk.rs.html new file mode 100644 index 00000000..c34a257c --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk.rs.html @@ -0,0 +1,404 @@ +plonk.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
+//! This module provides an implementation of a variant of (Turbo)[PLONK][plonk]
+//! that is designed specifically for the polynomial commitment scheme described
+//! in the [Halo][halo] paper.
+//!
+//! [halo]: https://eprint.iacr.org/2019/1021
+//! [plonk]: https://eprint.iacr.org/2019/953
+
+use blake2b_simd::Params as Blake2bParams;
+
+use crate::arithmetic::{CurveAffine, FieldExt};
+use crate::poly::{
+    commitment::Params, Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff,
+    PinnedEvaluationDomain, Polynomial,
+};
+use crate::transcript::{ChallengeScalar, EncodedChallenge, Transcript};
+
+mod circuit;
+mod keygen;
+mod lookup;
+pub(crate) mod permutation;
+mod vanishing;
+
+mod prover;
+mod verifier;
+
+pub use circuit::*;
+pub use keygen::*;
+pub use prover::*;
+pub use verifier::*;
+
+use std::io;
+
+/// This is a verifying key which allows for the verification of proofs for a
+/// particular circuit.
+#[derive(Debug)]
+pub struct VerifyingKey<C: CurveAffine> {
+    domain: EvaluationDomain<C::Scalar>,
+    fixed_commitments: Vec<C>,
+    permutations: Vec<permutation::VerifyingKey<C>>,
+    cs: ConstraintSystem<C::Scalar>,
+}
+
+impl<C: CurveAffine> VerifyingKey<C> {
+    /// Writes a verifying key to a buffer.
+    pub fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
+        for commitment in &self.fixed_commitments {
+            writer.write_all(commitment.to_bytes().as_ref())?;
+        }
+        for permutation in &self.permutations {
+            permutation.write(writer)?;
+        }
+
+        Ok(())
+    }
+
+    /// Reads a verification key from a buffer.
+    pub fn read<R: io::Read, ConcreteCircuit: Circuit<C::Scalar>>(
+        reader: &mut R,
+        params: &Params<C>,
+    ) -> io::Result<Self> {
+        let (domain, cs, _) = keygen::create_domain::<C, ConcreteCircuit>(params);
+
+        let fixed_commitments: Vec<_> = (0..cs.num_fixed_columns)
+            .map(|_| C::read(reader))
+            .collect::<Result<_, _>>()?;
+
+        let permutations: Vec<_> = cs
+            .permutations
+            .iter()
+            .map(|argument| permutation::VerifyingKey::read(reader, argument))
+            .collect::<Result<_, _>>()?;
+
+        Ok(VerifyingKey {
+            domain,
+            fixed_commitments,
+            permutations,
+            cs,
+        })
+    }
+
+    /// Hashes a verification key into a transcript.
+    pub fn hash_into<E: EncodedChallenge<C>, T: Transcript<C, E>>(
+        &self,
+        transcript: &mut T,
+    ) -> io::Result<()> {
+        let mut hasher = Blake2bParams::new()
+            .hash_length(64)
+            .personal(b"Halo2-Verify-Key")
+            .to_state();
+
+        let s = format!("{:?}", self.pinned());
+
+        hasher.update(&(s.len() as u64).to_le_bytes());
+        hasher.update(s.as_bytes());
+
+        // Hash in final Blake2bState
+        transcript.common_scalar(C::Scalar::from_bytes_wide(hasher.finalize().as_array()))?;
+
+        Ok(())
+    }
+
+    /// Obtains a pinned representation of this verification key that contains
+    /// the minimal information necessary to reconstruct the verification key.
+    pub fn pinned(&self) -> PinnedVerificationKey<'_, C> {
+        PinnedVerificationKey {
+            base_modulus: C::Base::MODULUS,
+            scalar_modulus: C::Scalar::MODULUS,
+            domain: self.domain.pinned(),
+            fixed_commitments: &self.fixed_commitments,
+            permutations: &self.permutations,
+            cs: self.cs.pinned(),
+        }
+    }
+}
+
+/// Minimal representation of a verification key that can be used to identify
+/// its active contents.
+#[derive(Debug)]
+pub struct PinnedVerificationKey<'a, C: CurveAffine> {
+    base_modulus: &'static str,
+    scalar_modulus: &'static str,
+    domain: PinnedEvaluationDomain<'a, C::Scalar>,
+    cs: PinnedConstraintSystem<'a, C::Scalar>,
+    fixed_commitments: &'a Vec<C>,
+    permutations: &'a Vec<permutation::VerifyingKey<C>>,
+}
+/// This is a proving key which allows for the creation of proofs for a
+/// particular circuit.
+#[derive(Debug)]
+pub struct ProvingKey<C: CurveAffine> {
+    vk: VerifyingKey<C>,
+    // TODO: get rid of this?
+    l0: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    fixed_values: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
+    fixed_polys: Vec<Polynomial<C::Scalar, Coeff>>,
+    fixed_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+    permutations: Vec<permutation::ProvingKey<C>>,
+}
+
+/// This is an error that could occur during proving or circuit synthesis.
+// TODO: these errors need to be cleaned up
+#[derive(Debug)]
+pub enum Error {
+    /// This is an error that can occur during synthesis of the circuit, for
+    /// example, when the witness is not present.
+    SynthesisError,
+    /// The structured reference string or the parameters are not compatible
+    /// with the circuit being synthesized.
+    IncompatibleParams,
+    /// The constraint system is not satisfied.
+    ConstraintSystemFailure,
+    /// Out of bounds index passed to a backend
+    BoundsFailure,
+    /// Opening error
+    OpeningError,
+    /// Transcript error
+    TranscriptError,
+}
+
+impl<C: CurveAffine> ProvingKey<C> {
+    /// Get the underlying [`VerifyingKey`].
+    pub fn get_vk(&self) -> &VerifyingKey<C> {
+        &self.vk
+    }
+}
+
+impl<C: CurveAffine> VerifyingKey<C> {
+    /// Get the underlying [`EvaluationDomain`].
+    pub fn get_domain(&self) -> &EvaluationDomain<C::Scalar> {
+        &self.domain
+    }
+}
+
+#[derive(Clone, Copy, Debug)]
+struct Theta;
+type ChallengeTheta<F> = ChallengeScalar<F, Theta>;
+
+#[derive(Clone, Copy, Debug)]
+struct Beta;
+type ChallengeBeta<F> = ChallengeScalar<F, Beta>;
+
+#[derive(Clone, Copy, Debug)]
+struct Gamma;
+type ChallengeGamma<F> = ChallengeScalar<F, Gamma>;
+
+#[derive(Clone, Copy, Debug)]
+struct Y;
+type ChallengeY<F> = ChallengeScalar<F, Y>;
+
+#[derive(Clone, Copy, Debug)]
+struct X;
+type ChallengeX<F> = ChallengeScalar<F, X>;
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/circuit.rs.html b/rustdoc/latest/src/halo2/plonk/circuit.rs.html new file mode 100644 index 00000000..6b628343 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/circuit.rs.html @@ -0,0 +1,2360 @@ +circuit.rs - source + + + +
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+
+use core::cmp::max;
+use core::ops::{Add, Mul};
+use ff::Field;
+use std::{
+    convert::TryFrom,
+    ops::{Neg, Sub},
+};
+
+use super::{lookup, permutation, Error};
+use crate::circuit::Layouter;
+use crate::{arithmetic::FieldExt, circuit::Region, poly::Rotation};
+
+/// A column type
+pub trait ColumnType:
+    'static + Sized + Copy + std::fmt::Debug + PartialEq + Eq + Into<Any>
+{
+}
+
+/// A column with an index and type
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
+pub struct Column<C: ColumnType> {
+    index: usize,
+    column_type: C,
+}
+
+impl<C: ColumnType> Column<C> {
+    #[cfg(test)]
+    pub(crate) fn new(index: usize, column_type: C) -> Self {
+        Column { index, column_type }
+    }
+
+    pub(crate) fn index(&self) -> usize {
+        self.index
+    }
+
+    pub(crate) fn column_type(&self) -> &C {
+        &self.column_type
+    }
+}
+
+impl<C: ColumnType> Ord for Column<C> {
+    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
+        // This ordering is consensus-critical! The layouters rely on deterministic column
+        // orderings.
+        match (self.column_type.into(), other.column_type.into()) {
+            // Indices are assigned within column types.
+            (Any::Advice, Any::Advice)
+            | (Any::Instance, Any::Instance)
+            | (Any::Fixed, Any::Fixed) => self.index.cmp(&other.index),
+            // Across column types, sort Advice < Instance < Fixed.
+            (Any::Advice, Any::Instance)
+            | (Any::Advice, Any::Fixed)
+            | (Any::Instance, Any::Fixed) => std::cmp::Ordering::Less,
+            (Any::Fixed, Any::Instance)
+            | (Any::Fixed, Any::Advice)
+            | (Any::Instance, Any::Advice) => std::cmp::Ordering::Greater,
+        }
+    }
+}
+
+impl<C: ColumnType> PartialOrd for Column<C> {
+    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+/// An advice column
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
+pub struct Advice;
+
+/// A fixed column
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
+pub struct Fixed;
+
+/// An instance column
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
+pub struct Instance;
+
+/// An enum over the Advice, Fixed, Instance structs
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
+pub enum Any {
+    /// An Advice variant
+    Advice,
+    /// A Fixed variant
+    Fixed,
+    /// An Instance variant
+    Instance,
+}
+
+impl ColumnType for Advice {}
+impl ColumnType for Fixed {}
+impl ColumnType for Instance {}
+impl ColumnType for Any {}
+
+impl From<Advice> for Any {
+    fn from(_: Advice) -> Any {
+        Any::Advice
+    }
+}
+
+impl From<Fixed> for Any {
+    fn from(_: Fixed) -> Any {
+        Any::Fixed
+    }
+}
+
+impl From<Instance> for Any {
+    fn from(_: Instance) -> Any {
+        Any::Instance
+    }
+}
+
+impl From<Column<Advice>> for Column<Any> {
+    fn from(advice: Column<Advice>) -> Column<Any> {
+        Column {
+            index: advice.index(),
+            column_type: Any::Advice,
+        }
+    }
+}
+
+impl From<Column<Fixed>> for Column<Any> {
+    fn from(advice: Column<Fixed>) -> Column<Any> {
+        Column {
+            index: advice.index(),
+            column_type: Any::Fixed,
+        }
+    }
+}
+
+impl From<Column<Instance>> for Column<Any> {
+    fn from(advice: Column<Instance>) -> Column<Any> {
+        Column {
+            index: advice.index(),
+            column_type: Any::Instance,
+        }
+    }
+}
+
+impl TryFrom<Column<Any>> for Column<Advice> {
+    type Error = &'static str;
+
+    fn try_from(any: Column<Any>) -> Result<Self, Self::Error> {
+        match any.column_type() {
+            Any::Advice => Ok(Column {
+                index: any.index(),
+                column_type: Advice,
+            }),
+            _ => Err("Cannot convert into Column<Advice>"),
+        }
+    }
+}
+
+impl TryFrom<Column<Any>> for Column<Fixed> {
+    type Error = &'static str;
+
+    fn try_from(any: Column<Any>) -> Result<Self, Self::Error> {
+        match any.column_type() {
+            Any::Fixed => Ok(Column {
+                index: any.index(),
+                column_type: Fixed,
+            }),
+            _ => Err("Cannot convert into Column<Fixed>"),
+        }
+    }
+}
+
+impl TryFrom<Column<Any>> for Column<Instance> {
+    type Error = &'static str;
+
+    fn try_from(any: Column<Any>) -> Result<Self, Self::Error> {
+        match any.column_type() {
+            Any::Instance => Ok(Column {
+                index: any.index(),
+                column_type: Instance,
+            }),
+            _ => Err("Cannot convert into Column<Instance>"),
+        }
+    }
+}
+
+/// A selector, representing a fixed boolean value per row of the circuit.
+///
+/// Selectors can be used to conditionally enable (portions of) gates:
+/// ```
+/// use halo2::poly::Rotation;
+/// # use halo2::pasta::Fp;
+/// # use halo2::plonk::ConstraintSystem;
+///
+/// # let mut meta = ConstraintSystem::<Fp>::default();
+/// let a = meta.advice_column();
+/// let b = meta.advice_column();
+/// let s = meta.selector();
+///
+/// meta.create_gate("foo", |meta| {
+///     let a = meta.query_advice(a, Rotation::prev());
+///     let b = meta.query_advice(b, Rotation::cur());
+///     let s = meta.query_selector(s);
+///
+///     // On rows where the selector is enabled, a is constrained to equal b.
+///     // On rows where the selector is disabled, a and b can take any value.
+///     vec![s * (a - b)]
+/// });
+/// ```
+///
+/// Selectors are disabled on all rows by default, and must be explicitly enabled on each
+/// row when required:
+/// ```
+/// use halo2::{arithmetic::FieldExt, circuit::{Chip, Layouter}, plonk::{Advice, Column, Error, Selector}};
+/// # use ff::Field;
+/// # use halo2::plonk::Fixed;
+///
+/// struct Config {
+///     a: Column<Advice>,
+///     b: Column<Advice>,
+///     s: Selector,
+/// }
+///
+/// fn circuit_logic<F: FieldExt, C: Chip<F>>(chip: C, mut layouter: impl Layouter<F>) -> Result<(), Error> {
+///     let config = chip.config();
+///     # let config: Config = todo!();
+///     layouter.assign_region(|| "bar", |mut region| {
+///         region.assign_advice(|| "a", config.a, 0, || Ok(F::one()))?;
+///         region.assign_advice(|| "a", config.b, 1, || Ok(F::one()))?;
+///         config.s.enable(&mut region, 1)
+///     })?;
+///     Ok(())
+/// }
+/// ```
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+pub struct Selector(pub(crate) Column<Fixed>);
+
+impl Selector {
+    /// Enable this selector at the given offset within the given region.
+    pub fn enable<F: FieldExt>(&self, region: &mut Region<F>, offset: usize) -> Result<(), Error> {
+        region.enable_selector(|| "", self, offset)
+    }
+}
+
+/// A permutation.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct Permutation {
+    /// The index of this permutation.
+    index: usize,
+    /// The mapping between columns involved in this permutation.
+    mapping: Vec<Column<Any>>,
+}
+
+impl Permutation {
+    /// Configures a new permutation for the given columns.
+    pub fn new<F: FieldExt>(meta: &mut ConstraintSystem<F>, columns: &[Column<Any>]) -> Self {
+        meta.permutation(columns)
+    }
+
+    /// Returns index of permutation
+    pub fn index(&self) -> usize {
+        self.index
+    }
+
+    /// Returns mapping of permutation
+    pub fn mapping(&self) -> &[Column<Any>] {
+        &self.mapping
+    }
+}
+
+/// A value assigned to a cell within a circuit.
+///
+/// Stored as a fraction, so the backend can use batch inversion.
+///
+/// A denominator of zero maps to an assigned value of zero.
+#[derive(Clone, Copy, Debug)]
+pub enum Assigned<F> {
+    /// The field element zero.
+    Zero,
+    /// A value that does not require inversion to evaluate.
+    Trivial(F),
+    /// A value stored as a fraction to enable batch inversion.
+    Rational(F, F),
+}
+
+impl<F: Field> From<F> for Assigned<F> {
+    fn from(numerator: F) -> Self {
+        Assigned::Trivial(numerator)
+    }
+}
+
+impl<F: Field> From<(F, F)> for Assigned<F> {
+    fn from((numerator, denominator): (F, F)) -> Self {
+        Assigned::Rational(numerator, denominator)
+    }
+}
+
+impl<F: Field> Neg for Assigned<F> {
+    type Output = Assigned<F>;
+    fn neg(self) -> Self::Output {
+        match self {
+            Self::Zero => Self::Zero,
+            Self::Trivial(numerator) => Self::Trivial(-numerator),
+            Self::Rational(numerator, denominator) => Self::Rational(-numerator, denominator),
+        }
+    }
+}
+
+impl<F: Field> Add for Assigned<F> {
+    type Output = Assigned<F>;
+    fn add(self, rhs: Assigned<F>) -> Assigned<F> {
+        match (self, rhs) {
+            (Self::Zero, _) => rhs,
+            (_, Self::Zero) => self,
+            (Self::Trivial(lhs), Self::Trivial(rhs)) => Self::Trivial(lhs + rhs),
+            (Self::Rational(numerator, denominator), Self::Trivial(other))
+            | (Self::Trivial(other), Self::Rational(numerator, denominator)) => {
+                Self::Rational(numerator + denominator * other, denominator)
+            }
+            (
+                Self::Rational(lhs_numerator, lhs_denominator),
+                Self::Rational(rhs_numerator, rhs_denominator),
+            ) => Self::Rational(
+                lhs_numerator * rhs_denominator + lhs_denominator * rhs_numerator,
+                lhs_denominator * rhs_denominator,
+            ),
+        }
+    }
+}
+
+impl<F: Field> Add<F> for Assigned<F> {
+    type Output = Assigned<F>;
+    fn add(self, rhs: F) -> Assigned<F> {
+        self + Self::Trivial(rhs)
+    }
+}
+
+impl<F: Field> Sub for Assigned<F> {
+    type Output = Assigned<F>;
+    fn sub(self, rhs: Assigned<F>) -> Assigned<F> {
+        self + (-rhs)
+    }
+}
+
+impl<F: Field> Sub<F> for Assigned<F> {
+    type Output = Assigned<F>;
+    fn sub(self, rhs: F) -> Assigned<F> {
+        self + (-rhs)
+    }
+}
+
+impl<F: Field> Mul for Assigned<F> {
+    type Output = Assigned<F>;
+    fn mul(self, rhs: Assigned<F>) -> Assigned<F> {
+        match (self, rhs) {
+            (Self::Zero, _) | (_, Self::Zero) => Self::Zero,
+            (Self::Trivial(lhs), Self::Trivial(rhs)) => Self::Trivial(lhs * rhs),
+            (Self::Rational(numerator, denominator), Self::Trivial(other))
+            | (Self::Trivial(other), Self::Rational(numerator, denominator)) => {
+                Self::Rational(numerator * other, denominator)
+            }
+            (
+                Self::Rational(lhs_numerator, lhs_denominator),
+                Self::Rational(rhs_numerator, rhs_denominator),
+            ) => Self::Rational(
+                lhs_numerator * rhs_numerator,
+                lhs_denominator * rhs_denominator,
+            ),
+        }
+    }
+}
+
+impl<F: Field> Mul<F> for Assigned<F> {
+    type Output = Assigned<F>;
+    fn mul(self, rhs: F) -> Assigned<F> {
+        self * Self::Trivial(rhs)
+    }
+}
+
+impl<F: Field> Assigned<F> {
+    /// Returns the numerator.
+    pub fn numerator(&self) -> F {
+        match self {
+            Self::Zero => F::zero(),
+            Self::Trivial(x) => *x,
+            Self::Rational(numerator, _) => *numerator,
+        }
+    }
+
+    /// Returns the denominator, if non-trivial.
+    pub fn denominator(&self) -> Option<F> {
+        match self {
+            Self::Zero => None,
+            Self::Trivial(_) => None,
+            Self::Rational(_, denominator) => Some(*denominator),
+        }
+    }
+
+    /// Inverts this assigned value.
+    pub fn invert(&self) -> Self {
+        match self {
+            Self::Zero => Self::Zero,
+            Self::Trivial(x) => Self::Rational(F::one(), *x),
+            Self::Rational(numerator, denominator) => Self::Rational(*denominator, *numerator),
+        }
+    }
+
+    /// Evaluates this assigned value directly, performing an unbatched inversion if
+    /// necessary.
+    ///
+    /// If the denominator is zero, this returns zero.
+    pub fn evaluate(self) -> F {
+        match self {
+            Self::Zero => F::zero(),
+            Self::Trivial(x) => x,
+            Self::Rational(numerator, denominator) => {
+                if denominator == F::one() {
+                    numerator
+                } else {
+                    numerator * denominator.invert().unwrap_or(F::zero())
+                }
+            }
+        }
+    }
+}
+
+/// This trait allows a [`Circuit`] to direct some backend to assign a witness
+/// for a constraint system.
+pub trait Assignment<F: Field> {
+    /// Creates a new region and enters into it.
+    ///
+    /// Panics if we are currently in a region (if `exit_region` was not called).
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::assign_region`] instead.
+    ///
+    /// [`Layouter::assign_region`]: crate::circuit::Layouter#method.assign_region
+    fn enter_region<NR, N>(&mut self, name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR;
+
+    /// Exits the current region.
+    ///
+    /// Panics if we are not currently in a region (if `enter_region` was not called).
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::assign_region`] instead.
+    ///
+    /// [`Layouter::assign_region`]: crate::circuit::Layouter#method.assign_region
+    fn exit_region(&mut self);
+
+    /// Enables a selector at the given row.
+    fn enable_selector<A, AR>(
+        &mut self,
+        annotation: A,
+        selector: &Selector,
+        row: usize,
+    ) -> Result<(), Error>
+    where
+        A: FnOnce() -> AR,
+        AR: Into<String>;
+
+    /// Assign an advice column value (witness)
+    fn assign_advice<V, VR, A, AR>(
+        &mut self,
+        annotation: A,
+        column: Column<Advice>,
+        row: usize,
+        to: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>;
+
+    /// Assign a fixed value
+    fn assign_fixed<V, VR, A, AR>(
+        &mut self,
+        annotation: A,
+        column: Column<Fixed>,
+        row: usize,
+        to: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>;
+
+    /// Assign two cells to have the same value
+    fn copy(
+        &mut self,
+        permutation: &Permutation,
+        left_column: Column<Any>,
+        left_row: usize,
+        right_column: Column<Any>,
+        right_row: usize,
+    ) -> Result<(), Error>;
+
+    /// Creates a new (sub)namespace and enters into it.
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::namespace`] instead.
+    ///
+    /// [`Layouter::namespace`]: crate::circuit::Layouter#method.namespace
+    fn push_namespace<NR, N>(&mut self, name_fn: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR;
+
+    /// Exits out of the existing namespace.
+    ///
+    /// Not intended for downstream consumption; use [`Layouter::namespace`] instead.
+    ///
+    /// [`Layouter::namespace`]: crate::circuit::Layouter#method.namespace
+    fn pop_namespace(&mut self, gadget_name: Option<String>);
+}
+
+/// A floor planning strategy for a circuit.
+///
+/// The floor planner is chip-agnostic and applies its strategy to the circuit it is used
+/// within.
+pub trait FloorPlanner {
+    /// Given the provided `cs`, synthesize the given circuit.
+    ///
+    /// Internally, a floor planner will perform the following operations:
+    /// - Instantiate a [`Layouter`] for this floor planner.
+    /// - Perform any necessary setup or measurement tasks, which may involve one or more
+    ///   calls to `Circuit::default().synthesize(config, &mut layouter)`.
+    /// - Call `circuit.synthesize(config, &mut layouter)` exactly once.
+    fn synthesize<F: Field, CS: Assignment<F>, C: Circuit<F>>(
+        cs: &mut CS,
+        circuit: &C,
+        config: C::Config,
+    ) -> Result<(), Error>;
+}
+
+/// This is a trait that circuits provide implementations for so that the
+/// backend prover can ask the circuit to synthesize using some given
+/// [`ConstraintSystem`] implementation.
+pub trait Circuit<F: Field> {
+    /// This is a configuration object that stores things like columns.
+    type Config: Clone;
+    /// The floor planner used for this circuit. This is an associated type of the
+    /// `Circuit` trait because its behaviour is circuit-critical.
+    type FloorPlanner: FloorPlanner;
+
+    /// Returns a copy of this circuit with no witness values (i.e. all witnesses set to
+    /// `None`). For most circuits, this will be equal to `Self::default()`.
+    fn without_witnesses(&self) -> Self;
+
+    /// The circuit is given an opportunity to describe the exact gate
+    /// arrangement, column arrangement, etc.
+    fn configure(meta: &mut ConstraintSystem<F>) -> Self::Config;
+
+    /// Given the provided `cs`, synthesize the circuit. The concrete type of
+    /// the caller will be different depending on the context, and they may or
+    /// may not expect to have a witness present.
+    fn synthesize(&self, config: Self::Config, layouter: impl Layouter<F>) -> Result<(), Error>;
+}
+
+/// Low-degree expression representing an identity that must hold over the committed columns.
+#[derive(Clone, Debug)]
+pub enum Expression<F> {
+    /// This is a constant polynomial
+    Constant(F),
+    /// This is a fixed column queried at a certain relative location
+    Fixed(usize),
+    /// This is an advice (witness) column queried at a certain relative location
+    Advice(usize),
+    /// This is an instance (external) column queried at a certain relative location
+    Instance(usize),
+    /// This is the sum of two polynomials
+    Sum(Box<Expression<F>>, Box<Expression<F>>),
+    /// This is the product of two polynomials
+    Product(Box<Expression<F>>, Box<Expression<F>>),
+    /// This is a scaled polynomial
+    Scaled(Box<Expression<F>>, F),
+}
+
+impl<F: Field> Expression<F> {
+    /// Evaluate the polynomial using the provided closures to perform the
+    /// operations.
+    pub fn evaluate<T>(
+        &self,
+        constant: &impl Fn(F) -> T,
+        fixed_column: &impl Fn(usize) -> T,
+        advice_column: &impl Fn(usize) -> T,
+        instance_column: &impl Fn(usize) -> T,
+        sum: &impl Fn(T, T) -> T,
+        product: &impl Fn(T, T) -> T,
+        scaled: &impl Fn(T, F) -> T,
+    ) -> T {
+        match self {
+            Expression::Constant(scalar) => constant(*scalar),
+            Expression::Fixed(index) => fixed_column(*index),
+            Expression::Advice(index) => advice_column(*index),
+            Expression::Instance(index) => instance_column(*index),
+            Expression::Sum(a, b) => {
+                let a = a.evaluate(
+                    constant,
+                    fixed_column,
+                    advice_column,
+                    instance_column,
+                    sum,
+                    product,
+                    scaled,
+                );
+                let b = b.evaluate(
+                    constant,
+                    fixed_column,
+                    advice_column,
+                    instance_column,
+                    sum,
+                    product,
+                    scaled,
+                );
+                sum(a, b)
+            }
+            Expression::Product(a, b) => {
+                let a = a.evaluate(
+                    constant,
+                    fixed_column,
+                    advice_column,
+                    instance_column,
+                    sum,
+                    product,
+                    scaled,
+                );
+                let b = b.evaluate(
+                    constant,
+                    fixed_column,
+                    advice_column,
+                    instance_column,
+                    sum,
+                    product,
+                    scaled,
+                );
+                product(a, b)
+            }
+            Expression::Scaled(a, f) => {
+                let a = a.evaluate(
+                    constant,
+                    fixed_column,
+                    advice_column,
+                    instance_column,
+                    sum,
+                    product,
+                    scaled,
+                );
+                scaled(a, *f)
+            }
+        }
+    }
+
+    /// Compute the degree of this polynomial
+    pub fn degree(&self) -> usize {
+        match self {
+            Expression::Constant(_) => 0,
+            Expression::Fixed(_) => 1,
+            Expression::Advice(_) => 1,
+            Expression::Instance(_) => 1,
+            Expression::Sum(a, b) => max(a.degree(), b.degree()),
+            Expression::Product(a, b) => a.degree() + b.degree(),
+            Expression::Scaled(poly, _) => poly.degree(),
+        }
+    }
+
+    /// Square this expression.
+    pub fn square(self) -> Self {
+        self.clone() * self
+    }
+}
+
+impl<F: Field> Neg for Expression<F> {
+    type Output = Expression<F>;
+    fn neg(self) -> Self::Output {
+        Expression::Scaled(Box::new(self), -F::one())
+    }
+}
+
+impl<F> Add for Expression<F> {
+    type Output = Expression<F>;
+    fn add(self, rhs: Expression<F>) -> Expression<F> {
+        Expression::Sum(Box::new(self), Box::new(rhs))
+    }
+}
+
+impl<F: Field> Sub for Expression<F> {
+    type Output = Expression<F>;
+    fn sub(self, rhs: Expression<F>) -> Expression<F> {
+        Expression::Sum(Box::new(self), Box::new(-rhs))
+    }
+}
+
+impl<F> Mul for Expression<F> {
+    type Output = Expression<F>;
+    fn mul(self, rhs: Expression<F>) -> Expression<F> {
+        Expression::Product(Box::new(self), Box::new(rhs))
+    }
+}
+
+impl<F> Mul<F> for Expression<F> {
+    type Output = Expression<F>;
+    fn mul(self, rhs: F) -> Expression<F> {
+        Expression::Scaled(Box::new(self), rhs)
+    }
+}
+
+/// Represents an index into a vector where each entry corresponds to a distinct
+/// point that polynomials are queried at.
+#[derive(Copy, Clone, Debug)]
+pub(crate) struct PointIndex(pub usize);
+
+/// A "virtual cell" is a PLONK cell that has been queried at a particular relative offset
+/// within a custom gate.
+#[derive(Clone, Debug)]
+pub(crate) struct VirtualCell {
+    pub(crate) column: Column<Any>,
+    pub(crate) rotation: Rotation,
+}
+
+impl<Col: Into<Column<Any>>> From<(Col, Rotation)> for VirtualCell {
+    fn from((column, rotation): (Col, Rotation)) -> Self {
+        VirtualCell {
+            column: column.into(),
+            rotation,
+        }
+    }
+}
+
+/// An individual polynomial constraint.
+///
+/// These are returned by the closures passed to `ConstraintSystem::create_gate`.
+#[derive(Debug)]
+pub struct Constraint<F: Field> {
+    name: &'static str,
+    poly: Expression<F>,
+}
+
+impl<F: Field> From<Expression<F>> for Constraint<F> {
+    fn from(poly: Expression<F>) -> Self {
+        Constraint { name: "", poly }
+    }
+}
+
+impl<F: Field> From<(&'static str, Expression<F>)> for Constraint<F> {
+    fn from((name, poly): (&'static str, Expression<F>)) -> Self {
+        Constraint { name, poly }
+    }
+}
+
+impl<F: Field> From<Expression<F>> for Vec<Constraint<F>> {
+    fn from(poly: Expression<F>) -> Self {
+        vec![Constraint { name: "", poly }]
+    }
+}
+
+#[derive(Clone, Debug)]
+pub(crate) struct Gate<F: Field> {
+    name: &'static str,
+    constraint_names: Vec<&'static str>,
+    polys: Vec<Expression<F>>,
+    /// We track queried selectors separately from other cells, so that we can use them to
+    /// trigger debug checks on gates.
+    queried_selectors: Vec<Selector>,
+    queried_cells: Vec<VirtualCell>,
+}
+
+impl<F: Field> Gate<F> {
+    pub(crate) fn name(&self) -> &'static str {
+        self.name
+    }
+
+    pub(crate) fn constraint_name(&self, constraint_index: usize) -> &'static str {
+        self.constraint_names[constraint_index]
+    }
+
+    pub(crate) fn polynomials(&self) -> &[Expression<F>] {
+        &self.polys
+    }
+
+    pub(crate) fn queried_selectors(&self) -> &[Selector] {
+        &self.queried_selectors
+    }
+
+    pub(crate) fn queried_cells(&self) -> &[VirtualCell] {
+        &self.queried_cells
+    }
+}
+
+/// This is a description of the circuit environment, such as the gate, column and
+/// permutation arrangements.
+#[derive(Debug, Clone)]
+pub struct ConstraintSystem<F: Field> {
+    pub(crate) num_fixed_columns: usize,
+    pub(crate) num_advice_columns: usize,
+    pub(crate) num_instance_columns: usize,
+    pub(crate) gates: Vec<Gate<F>>,
+    pub(crate) advice_queries: Vec<(Column<Advice>, Rotation)>,
+    pub(crate) instance_queries: Vec<(Column<Instance>, Rotation)>,
+    pub(crate) fixed_queries: Vec<(Column<Fixed>, Rotation)>,
+
+    // Vector of permutation arguments, where each corresponds to a sequence of columns
+    // that are involved in a permutation argument.
+    pub(crate) permutations: Vec<permutation::Argument>,
+
+    // Vector of lookup arguments, where each corresponds to a sequence of
+    // input expressions and a sequence of table expressions involved in the lookup.
+    pub(crate) lookups: Vec<lookup::Argument<F>>,
+}
+
+/// Represents the minimal parameters that determine a `ConstraintSystem`.
+#[derive(Debug)]
+pub struct PinnedConstraintSystem<'a, F: Field> {
+    num_fixed_columns: &'a usize,
+    num_advice_columns: &'a usize,
+    num_instance_columns: &'a usize,
+    gates: PinnedGates<'a, F>,
+    advice_queries: &'a Vec<(Column<Advice>, Rotation)>,
+    instance_queries: &'a Vec<(Column<Instance>, Rotation)>,
+    fixed_queries: &'a Vec<(Column<Fixed>, Rotation)>,
+    permutations: &'a Vec<permutation::Argument>,
+    lookups: &'a Vec<lookup::Argument<F>>,
+}
+
+struct PinnedGates<'a, F: Field>(&'a Vec<Gate<F>>);
+
+impl<'a, F: Field> std::fmt::Debug for PinnedGates<'a, F> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        f.debug_list()
+            .entries(self.0.iter().flat_map(|gate| gate.polynomials().iter()))
+            .finish()
+    }
+}
+
+impl<F: Field> Default for ConstraintSystem<F> {
+    fn default() -> ConstraintSystem<F> {
+        ConstraintSystem {
+            num_fixed_columns: 0,
+            num_advice_columns: 0,
+            num_instance_columns: 0,
+            gates: vec![],
+            fixed_queries: Vec::new(),
+            advice_queries: Vec::new(),
+            instance_queries: Vec::new(),
+            permutations: Vec::new(),
+            lookups: Vec::new(),
+        }
+    }
+}
+
+impl<F: Field> ConstraintSystem<F> {
+    /// Obtain a pinned version of this constraint system; a structure with the
+    /// minimal parameters needed to determine the rest of the constraint
+    /// system.
+    pub fn pinned(&self) -> PinnedConstraintSystem<'_, F> {
+        PinnedConstraintSystem {
+            num_fixed_columns: &self.num_fixed_columns,
+            num_advice_columns: &self.num_advice_columns,
+            num_instance_columns: &self.num_instance_columns,
+            gates: PinnedGates(&self.gates),
+            fixed_queries: &self.fixed_queries,
+            advice_queries: &self.advice_queries,
+            instance_queries: &self.instance_queries,
+            permutations: &self.permutations,
+            lookups: &self.lookups,
+        }
+    }
+
+    /// Add a permutation argument for some columns
+    pub fn permutation(&mut self, columns: &[Column<Any>]) -> Permutation {
+        let index = self.permutations.len();
+
+        for column in columns {
+            self.query_any_index(*column, Rotation::cur());
+        }
+        self.permutations
+            .push(permutation::Argument::new(columns.to_vec()));
+
+        Permutation {
+            index,
+            mapping: columns.to_vec(),
+        }
+    }
+
+    /// Add a lookup argument for some input expressions and table expressions.
+    ///
+    /// `table_map` returns a map between input expressions and the table expressions
+    /// they need to match.
+    pub fn lookup(
+        &mut self,
+        table_map: impl FnOnce(&mut VirtualCells<'_, F>) -> Vec<(Expression<F>, Expression<F>)>,
+    ) -> usize {
+        let mut cells = VirtualCells::new(self);
+        let table_map = table_map(&mut cells);
+
+        let index = self.lookups.len();
+
+        self.lookups.push(lookup::Argument::new(table_map));
+
+        index
+    }
+
+    fn query_fixed_index(&mut self, column: Column<Fixed>, at: Rotation) -> usize {
+        // Return existing query, if it exists
+        for (index, fixed_query) in self.fixed_queries.iter().enumerate() {
+            if fixed_query == &(column, at) {
+                return index;
+            }
+        }
+
+        // Make a new query
+        let index = self.fixed_queries.len();
+        self.fixed_queries.push((column, at));
+
+        index
+    }
+
+    pub(crate) fn query_advice_index(&mut self, column: Column<Advice>, at: Rotation) -> usize {
+        // Return existing query, if it exists
+        for (index, advice_query) in self.advice_queries.iter().enumerate() {
+            if advice_query == &(column, at) {
+                return index;
+            }
+        }
+
+        // Make a new query
+        let index = self.advice_queries.len();
+        self.advice_queries.push((column, at));
+
+        index
+    }
+
+    fn query_instance_index(&mut self, column: Column<Instance>, at: Rotation) -> usize {
+        // Return existing query, if it exists
+        for (index, instance_query) in self.instance_queries.iter().enumerate() {
+            if instance_query == &(column, at) {
+                return index;
+            }
+        }
+
+        // Make a new query
+        let index = self.instance_queries.len();
+        self.instance_queries.push((column, at));
+
+        index
+    }
+
+    fn query_any_index(&mut self, column: Column<Any>, at: Rotation) -> usize {
+        match column.column_type() {
+            Any::Advice => self.query_advice_index(Column::<Advice>::try_from(column).unwrap(), at),
+            Any::Fixed => self.query_fixed_index(Column::<Fixed>::try_from(column).unwrap(), at),
+            Any::Instance => {
+                self.query_instance_index(Column::<Instance>::try_from(column).unwrap(), at)
+            }
+        }
+    }
+
+    pub(crate) fn get_advice_query_index(&self, column: Column<Advice>, at: Rotation) -> usize {
+        for (index, advice_query) in self.advice_queries.iter().enumerate() {
+            if advice_query == &(column, at) {
+                return index;
+            }
+        }
+
+        panic!("get_advice_query_index called for non-existent query");
+    }
+
+    pub(crate) fn get_fixed_query_index(&self, column: Column<Fixed>, at: Rotation) -> usize {
+        for (index, fixed_query) in self.fixed_queries.iter().enumerate() {
+            if fixed_query == &(column, at) {
+                return index;
+            }
+        }
+
+        panic!("get_fixed_query_index called for non-existent query");
+    }
+
+    pub(crate) fn get_instance_query_index(&self, column: Column<Instance>, at: Rotation) -> usize {
+        for (index, instance_query) in self.instance_queries.iter().enumerate() {
+            if instance_query == &(column, at) {
+                return index;
+            }
+        }
+
+        panic!("get_instance_query_index called for non-existent query");
+    }
+
+    pub(crate) fn get_any_query_index(&self, column: Column<Any>, at: Rotation) -> usize {
+        match column.column_type() {
+            Any::Advice => {
+                self.get_advice_query_index(Column::<Advice>::try_from(column).unwrap(), at)
+            }
+            Any::Fixed => {
+                self.get_fixed_query_index(Column::<Fixed>::try_from(column).unwrap(), at)
+            }
+            Any::Instance => {
+                self.get_instance_query_index(Column::<Instance>::try_from(column).unwrap(), at)
+            }
+        }
+    }
+
+    /// Creates a new gate.
+    ///
+    /// # Panics
+    ///
+    /// A gate is required to contain polynomial constraints. This method will panic if
+    /// `constraints` returns an empty iterator.
+    pub fn create_gate<C: Into<Constraint<F>>, Iter: IntoIterator<Item = C>>(
+        &mut self,
+        name: &'static str,
+        constraints: impl FnOnce(&mut VirtualCells<'_, F>) -> Iter,
+    ) {
+        let mut cells = VirtualCells::new(self);
+        let constraints = constraints(&mut cells);
+        let queried_selectors = cells.queried_selectors;
+        let queried_cells = cells.queried_cells;
+
+        let (constraint_names, polys): (_, Vec<_>) = constraints
+            .into_iter()
+            .map(|c| c.into())
+            .map(|c| (c.name, c.poly))
+            .unzip();
+
+        assert!(
+            !polys.is_empty(),
+            "Gates must contain at least one constraint."
+        );
+
+        self.gates.push(Gate {
+            name,
+            constraint_names,
+            polys,
+            queried_selectors,
+            queried_cells,
+        });
+    }
+
+    /// Allocate a new selector.
+    pub fn selector(&mut self) -> Selector {
+        // TODO: Track selectors separately, and combine selectors where possible.
+        // https://github.com/zcash/halo2/issues/116
+        Selector(self.fixed_column())
+    }
+
+    /// Allocate a new fixed column
+    pub fn fixed_column(&mut self) -> Column<Fixed> {
+        let tmp = Column {
+            index: self.num_fixed_columns,
+            column_type: Fixed,
+        };
+        self.num_fixed_columns += 1;
+        tmp
+    }
+
+    /// Allocate a new advice column
+    pub fn advice_column(&mut self) -> Column<Advice> {
+        let tmp = Column {
+            index: self.num_advice_columns,
+            column_type: Advice,
+        };
+        self.num_advice_columns += 1;
+        tmp
+    }
+
+    /// Allocate a new instance column
+    pub fn instance_column(&mut self) -> Column<Instance> {
+        let tmp = Column {
+            index: self.num_instance_columns,
+            column_type: Instance,
+        };
+        self.num_instance_columns += 1;
+        tmp
+    }
+
+    /// Compute the degree of the constraint system (the maximum degree of all
+    /// constraints).
+    pub fn degree(&self) -> usize {
+        // The permutation argument will serve alongside the gates, so must be
+        // accounted for.
+        let mut degree = self
+            .permutations
+            .iter()
+            .map(|p| p.required_degree())
+            .max()
+            .unwrap_or(1);
+
+        // The lookup argument also serves alongside the gates and must be accounted
+        // for.
+        degree = std::cmp::max(
+            degree,
+            self.lookups
+                .iter()
+                .map(|l| l.required_degree())
+                .max()
+                .unwrap_or(1),
+        );
+
+        // Account for each gate to ensure our quotient polynomial is the
+        // correct degree and that our extended domain is the right size.
+        degree = std::cmp::max(
+            degree,
+            self.gates
+                .iter()
+                .flat_map(|gate| gate.polynomials().iter().map(|poly| poly.degree()))
+                .max()
+                .unwrap_or(0),
+        );
+
+        degree
+    }
+}
+
+/// Exposes the "virtual cells" that can be queried while creating a custom gate or lookup
+/// table.
+#[derive(Debug)]
+pub struct VirtualCells<'a, F: Field> {
+    meta: &'a mut ConstraintSystem<F>,
+    queried_selectors: Vec<Selector>,
+    queried_cells: Vec<VirtualCell>,
+}
+
+impl<'a, F: Field> VirtualCells<'a, F> {
+    fn new(meta: &'a mut ConstraintSystem<F>) -> Self {
+        VirtualCells {
+            meta,
+            queried_selectors: vec![],
+            queried_cells: vec![],
+        }
+    }
+
+    /// Query a selector at the current position.
+    pub fn query_selector(&mut self, selector: Selector) -> Expression<F> {
+        // Selectors are always queried at the current row.
+        self.queried_selectors.push(selector);
+        Expression::Fixed(self.meta.query_fixed_index(selector.0, Rotation::cur()))
+    }
+
+    /// Query a fixed column at a relative position
+    pub fn query_fixed(&mut self, column: Column<Fixed>, at: Rotation) -> Expression<F> {
+        self.queried_cells.push((column, at).into());
+        Expression::Fixed(self.meta.query_fixed_index(column, at))
+    }
+
+    /// Query an advice column at a relative position
+    pub fn query_advice(&mut self, column: Column<Advice>, at: Rotation) -> Expression<F> {
+        self.queried_cells.push((column, at).into());
+        Expression::Advice(self.meta.query_advice_index(column, at))
+    }
+
+    /// Query an instance column at a relative position
+    pub fn query_instance(&mut self, column: Column<Instance>, at: Rotation) -> Expression<F> {
+        self.queried_cells.push((column, at).into());
+        Expression::Instance(self.meta.query_instance_index(column, at))
+    }
+
+    /// Query an Any column at a relative position
+    pub fn query_any(&mut self, column: Column<Any>, at: Rotation) -> Expression<F> {
+        self.queried_cells.push((column, at).into());
+        match column.column_type() {
+            Any::Advice => Expression::Advice(
+                self.meta
+                    .query_advice_index(Column::<Advice>::try_from(column).unwrap(), at),
+            ),
+            Any::Fixed => Expression::Fixed(
+                self.meta
+                    .query_fixed_index(Column::<Fixed>::try_from(column).unwrap(), at),
+            ),
+            Any::Instance => Expression::Instance(
+                self.meta
+                    .query_instance_index(Column::<Instance>::try_from(column).unwrap(), at),
+            ),
+        }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/keygen.rs.html b/rustdoc/latest/src/halo2/plonk/keygen.rs.html new file mode 100644 index 00000000..f88aa90c --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/keygen.rs.html @@ -0,0 +1,576 @@ +keygen.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+
+use ff::Field;
+use group::Curve;
+
+use super::{
+    circuit::{
+        Advice, Any, Assignment, Circuit, Column, ConstraintSystem, Fixed, FloorPlanner, Selector,
+    },
+    permutation, Assigned, Error, LagrangeCoeff, Permutation, Polynomial, ProvingKey, VerifyingKey,
+};
+use crate::poly::{
+    commitment::{Blind, Params},
+    EvaluationDomain, Rotation,
+};
+use crate::{arithmetic::CurveAffine, poly::batch_invert_assigned};
+
+pub(crate) fn create_domain<C, ConcreteCircuit>(
+    params: &Params<C>,
+) -> (
+    EvaluationDomain<C::Scalar>,
+    ConstraintSystem<C::Scalar>,
+    ConcreteCircuit::Config,
+)
+where
+    C: CurveAffine,
+    ConcreteCircuit: Circuit<C::Scalar>,
+{
+    let mut cs = ConstraintSystem::default();
+    let config = ConcreteCircuit::configure(&mut cs);
+
+    let degree = cs.degree();
+
+    let domain = EvaluationDomain::new(degree as u32, params.k);
+
+    (domain, cs, config)
+}
+
+/// Assembly to be used in circuit synthesis.
+#[derive(Debug)]
+struct Assembly<F: Field> {
+    fixed: Vec<Polynomial<Assigned<F>, LagrangeCoeff>>,
+    permutations: Vec<permutation::keygen::Assembly>,
+    _marker: std::marker::PhantomData<F>,
+}
+
+impl<F: Field> Assignment<F> for Assembly<F> {
+    fn enter_region<NR, N>(&mut self, _: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        // Do nothing; we don't care about regions in this context.
+    }
+
+    fn exit_region(&mut self) {
+        // Do nothing; we don't care about regions in this context.
+    }
+
+    fn enable_selector<A, AR>(
+        &mut self,
+        annotation: A,
+        selector: &Selector,
+        row: usize,
+    ) -> Result<(), Error>
+    where
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        // Selectors are just fixed columns.
+        // TODO: Ensure that the default for a selector's cells is always zero, if we
+        // alter the proving system to change the global default.
+        // TODO: Implement selector combining optimization
+        // https://github.com/zcash/halo2/issues/116
+        self.assign_fixed(annotation, selector.0, row, || Ok(F::one()))
+    }
+
+    fn assign_advice<V, VR, A, AR>(
+        &mut self,
+        _: A,
+        _: Column<Advice>,
+        _: usize,
+        _: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        // We only care about fixed columns here
+        Ok(())
+    }
+
+    fn assign_fixed<V, VR, A, AR>(
+        &mut self,
+        _: A,
+        column: Column<Fixed>,
+        row: usize,
+        to: V,
+    ) -> Result<(), Error>
+    where
+        V: FnOnce() -> Result<VR, Error>,
+        VR: Into<Assigned<F>>,
+        A: FnOnce() -> AR,
+        AR: Into<String>,
+    {
+        *self
+            .fixed
+            .get_mut(column.index())
+            .and_then(|v| v.get_mut(row))
+            .ok_or(Error::BoundsFailure)? = to()?.into();
+
+        Ok(())
+    }
+
+    fn copy(
+        &mut self,
+        permutation: &Permutation,
+        left_column: Column<Any>,
+        left_row: usize,
+        right_column: Column<Any>,
+        right_row: usize,
+    ) -> Result<(), Error> {
+        // Check bounds first
+        if permutation.index() >= self.permutations.len() {
+            return Err(Error::BoundsFailure);
+        }
+
+        let left_column_index = permutation
+            .mapping()
+            .iter()
+            .position(|c| c == &left_column)
+            .ok_or(Error::SynthesisError)?;
+        let right_column_index = permutation
+            .mapping()
+            .iter()
+            .position(|c| c == &right_column)
+            .ok_or(Error::SynthesisError)?;
+
+        self.permutations[permutation.index()].copy(
+            left_column_index,
+            left_row,
+            right_column_index,
+            right_row,
+        )
+    }
+
+    fn push_namespace<NR, N>(&mut self, _: N)
+    where
+        NR: Into<String>,
+        N: FnOnce() -> NR,
+    {
+        // Do nothing; we don't care about namespaces in this context.
+    }
+
+    fn pop_namespace(&mut self, _: Option<String>) {
+        // Do nothing; we don't care about namespaces in this context.
+    }
+}
+
+/// Generate a `VerifyingKey` from an instance of `Circuit`.
+pub fn keygen_vk<C, ConcreteCircuit>(
+    params: &Params<C>,
+    circuit: &ConcreteCircuit,
+) -> Result<VerifyingKey<C>, Error>
+where
+    C: CurveAffine,
+    ConcreteCircuit: Circuit<C::Scalar>,
+{
+    let (domain, cs, config) = create_domain::<C, ConcreteCircuit>(params);
+
+    let mut assembly: Assembly<C::Scalar> = Assembly {
+        fixed: vec![domain.empty_lagrange_assigned(); cs.num_fixed_columns],
+        permutations: cs
+            .permutations
+            .iter()
+            .map(|p| permutation::keygen::Assembly::new(params.n as usize, p))
+            .collect(),
+        _marker: std::marker::PhantomData,
+    };
+
+    // Synthesize the circuit to obtain URS
+    ConcreteCircuit::FloorPlanner::synthesize(&mut assembly, circuit, config)?;
+
+    let fixed = batch_invert_assigned(&assembly.fixed);
+
+    let permutation_helper = permutation::keygen::Assembly::build_helper(params, &cs, &domain);
+
+    let permutation_vks = cs
+        .permutations
+        .iter()
+        .zip(assembly.permutations.into_iter())
+        .map(|(p, assembly)| assembly.build_vk(params, &domain, &permutation_helper, p))
+        .collect();
+
+    let fixed_commitments = fixed
+        .iter()
+        .map(|poly| params.commit_lagrange(poly, Blind::default()).to_affine())
+        .collect();
+
+    Ok(VerifyingKey {
+        domain,
+        fixed_commitments,
+        permutations: permutation_vks,
+        cs,
+    })
+}
+
+/// Generate a `ProvingKey` from a `VerifyingKey` and an instance of `Circuit`.
+pub fn keygen_pk<C, ConcreteCircuit>(
+    params: &Params<C>,
+    vk: VerifyingKey<C>,
+    circuit: &ConcreteCircuit,
+) -> Result<ProvingKey<C>, Error>
+where
+    C: CurveAffine,
+    ConcreteCircuit: Circuit<C::Scalar>,
+{
+    let mut cs = ConstraintSystem::default();
+    let config = ConcreteCircuit::configure(&mut cs);
+
+    let mut assembly: Assembly<C::Scalar> = Assembly {
+        fixed: vec![vk.domain.empty_lagrange_assigned(); vk.cs.num_fixed_columns],
+        permutations: vk
+            .cs
+            .permutations
+            .iter()
+            .map(|p| permutation::keygen::Assembly::new(params.n as usize, p))
+            .collect(),
+        _marker: std::marker::PhantomData,
+    };
+
+    // Synthesize the circuit to obtain URS
+    ConcreteCircuit::FloorPlanner::synthesize(&mut assembly, circuit, config)?;
+
+    let fixed = batch_invert_assigned(&assembly.fixed);
+
+    let fixed_polys: Vec<_> = fixed
+        .iter()
+        .map(|poly| vk.domain.lagrange_to_coeff(poly.clone()))
+        .collect();
+
+    let fixed_cosets = vk
+        .cs
+        .fixed_queries
+        .iter()
+        .map(|&(column, at)| {
+            let poly = fixed_polys[column.index()].clone();
+            vk.domain.coeff_to_extended(poly, at)
+        })
+        .collect();
+
+    let permutation_helper =
+        permutation::keygen::Assembly::build_helper(params, &vk.cs, &vk.domain);
+
+    let permutation_pks = vk
+        .cs
+        .permutations
+        .iter()
+        .zip(assembly.permutations.into_iter())
+        .map(|(p, assembly)| assembly.build_pk(&vk.domain, &permutation_helper, p))
+        .collect();
+
+    // Compute l_0(X)
+    // TODO: this can be done more efficiently
+    let mut l0 = vk.domain.empty_lagrange();
+    l0[0] = C::Scalar::one();
+    let l0 = vk.domain.lagrange_to_coeff(l0);
+    let l0 = vk.domain.coeff_to_extended(l0, Rotation::cur());
+
+    Ok(ProvingKey {
+        vk,
+        l0,
+        fixed_values: fixed,
+        fixed_polys,
+        fixed_cosets,
+        permutations: permutation_pks,
+    })
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/lookup.rs.html b/rustdoc/latest/src/halo2/plonk/lookup.rs.html new file mode 100644 index 00000000..f14958a4 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/lookup.rs.html @@ -0,0 +1,122 @@ +lookup.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+use super::circuit::Expression;
+use ff::Field;
+
+pub(crate) mod prover;
+pub(crate) mod verifier;
+
+#[derive(Clone, Debug)]
+pub(crate) struct Argument<F: Field> {
+    pub input_expressions: Vec<Expression<F>>,
+    pub table_expressions: Vec<Expression<F>>,
+}
+
+impl<F: Field> Argument<F> {
+    /// Constructs a new lookup argument.
+    ///
+    /// `table_map` is a sequence of `(input, table)` tuples.
+    pub fn new(table_map: Vec<(Expression<F>, Expression<F>)>) -> Self {
+        let (input_expressions, table_expressions) = table_map.into_iter().unzip();
+        Argument {
+            input_expressions,
+            table_expressions,
+        }
+    }
+
+    pub(crate) fn required_degree(&self) -> usize {
+        assert_eq!(self.input_expressions.len(), self.table_expressions.len());
+
+        // degree 2:
+        // l_0(X) * (1 - z'(X)) = 0
+        //
+        // degree (1 + input_degree + table_degree):
+        // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+        // - z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+        //
+        // degree 2:
+        // l_0(X) * (a'(X) - s'(X)) = 0
+        //
+        // degree 2:
+        // (a′(X)−s′(X))⋅(a′(X)−a′(\omega{-1} X)) = 0
+        let mut input_degree = 1;
+        for expr in self.input_expressions.iter() {
+            input_degree = std::cmp::max(input_degree, expr.degree());
+        }
+        let mut table_degree = 1;
+        for expr in self.table_expressions.iter() {
+            table_degree = std::cmp::max(table_degree, expr.degree());
+        }
+
+        1 + input_degree + table_degree
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/lookup/prover.rs.html b/rustdoc/latest/src/halo2/plonk/lookup/prover.rs.html new file mode 100644 index 00000000..722334a4 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/lookup/prover.rs.html @@ -0,0 +1,1308 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+
+use super::super::{
+    circuit::Expression, ChallengeBeta, ChallengeGamma, ChallengeTheta, ChallengeX, Error,
+    ProvingKey,
+};
+use super::Argument;
+use crate::{
+    arithmetic::{eval_polynomial, parallelize, BatchInvert, CurveAffine, FieldExt},
+    poly::{
+        commitment::{Blind, Params},
+        multiopen::ProverQuery,
+        Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial, Rotation,
+    },
+    transcript::{EncodedChallenge, TranscriptWrite},
+};
+use ff::Field;
+use group::Curve;
+use std::{
+    collections::BTreeMap,
+    iter,
+    ops::{Mul, MulAssign},
+};
+
+#[derive(Debug)]
+pub(in crate::plonk) struct Permuted<C: CurveAffine> {
+    unpermuted_input_expressions: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
+    unpermuted_input_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+    permuted_input_expression: Polynomial<C::Scalar, LagrangeCoeff>,
+    permuted_input_poly: Polynomial<C::Scalar, Coeff>,
+    permuted_input_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    permuted_input_inv_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    permuted_input_blind: Blind<C::Scalar>,
+    permuted_input_commitment: C,
+    unpermuted_table_expressions: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
+    unpermuted_table_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+    permuted_table_expression: Polynomial<C::Scalar, LagrangeCoeff>,
+    permuted_table_poly: Polynomial<C::Scalar, Coeff>,
+    permuted_table_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    permuted_table_blind: Blind<C::Scalar>,
+    permuted_table_commitment: C,
+}
+
+#[derive(Debug)]
+pub(in crate::plonk) struct Committed<C: CurveAffine> {
+    permuted: Permuted<C>,
+    product_poly: Polynomial<C::Scalar, Coeff>,
+    product_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    product_inv_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    product_blind: Blind<C::Scalar>,
+    product_commitment: C,
+}
+
+pub(in crate::plonk) struct Constructed<C: CurveAffine> {
+    permuted_input_poly: Polynomial<C::Scalar, Coeff>,
+    permuted_input_blind: Blind<C::Scalar>,
+    permuted_table_poly: Polynomial<C::Scalar, Coeff>,
+    permuted_table_blind: Blind<C::Scalar>,
+    product_poly: Polynomial<C::Scalar, Coeff>,
+    product_blind: Blind<C::Scalar>,
+}
+
+pub(in crate::plonk) struct Evaluated<C: CurveAffine> {
+    constructed: Constructed<C>,
+}
+
+impl<F: FieldExt> Argument<F> {
+    /// Given a Lookup with input expressions [A_0, A_1, ..., A_{m-1}] and table expressions
+    /// [S_0, S_1, ..., S_{m-1}], this method
+    /// - constructs A_compressed = \theta^{m-1} A_0 + theta^{m-2} A_1 + ... + \theta A_{m-2} + A_{m-1}
+    ///   and S_compressed = \theta^{m-1} S_0 + theta^{m-2} S_1 + ... + \theta S_{m-2} + S_{m-1},
+    /// - permutes A_compressed and S_compressed using permute_expression_pair() helper,
+    ///   obtaining A' and S', and
+    /// - constructs Permuted<C> struct using permuted_input_value = A', and
+    ///   permuted_table_expression = S'.
+    /// The Permuted<C> struct is used to update the Lookup, and is then returned.
+    pub(in crate::plonk) fn commit_permuted<
+        'a,
+        C,
+        E: EncodedChallenge<C>,
+        T: TranscriptWrite<C, E>,
+    >(
+        &self,
+        pk: &ProvingKey<C>,
+        params: &Params<C>,
+        domain: &EvaluationDomain<C::Scalar>,
+        theta: ChallengeTheta<C>,
+        advice_values: &'a [Polynomial<C::Scalar, LagrangeCoeff>],
+        fixed_values: &'a [Polynomial<C::Scalar, LagrangeCoeff>],
+        instance_values: &'a [Polynomial<C::Scalar, LagrangeCoeff>],
+        advice_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        fixed_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        instance_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        transcript: &mut T,
+    ) -> Result<Permuted<C>, Error>
+    where
+        C: CurveAffine<ScalarExt = F>,
+        C::Curve: Mul<F, Output = C::Curve> + MulAssign<F>,
+    {
+        // Closure to get values of expressions and compress them
+        let compress_expressions = |expressions: &[Expression<C::Scalar>]| {
+            // Values of input expressions involved in the lookup
+            let unpermuted_expressions: Vec<_> = expressions
+                .iter()
+                .map(|expression| {
+                    expression.evaluate(
+                        &|scalar| pk.vk.domain.constant_lagrange(scalar),
+                        &|index| {
+                            let query = pk.vk.cs.fixed_queries[index];
+                            let column_index = query.0.index();
+                            let rotation = query.1;
+                            fixed_values[column_index].clone().rotate(rotation)
+                        },
+                        &|index| {
+                            let query = pk.vk.cs.advice_queries[index];
+                            let column_index = query.0.index();
+                            let rotation = query.1;
+                            advice_values[column_index].clone().rotate(rotation)
+                        },
+                        &|index| {
+                            let query = pk.vk.cs.instance_queries[index];
+                            let column_index = query.0.index();
+                            let rotation = query.1;
+                            instance_values[column_index].clone().rotate(rotation)
+                        },
+                        &|a, b| a + &b,
+                        &|a, b| {
+                            let mut modified_a = vec![C::Scalar::one(); params.n as usize];
+                            parallelize(&mut modified_a, |modified_a, start| {
+                                for ((modified_a, a), b) in modified_a
+                                    .iter_mut()
+                                    .zip(a[start..].iter())
+                                    .zip(b[start..].iter())
+                                {
+                                    *modified_a *= *a * b;
+                                }
+                            });
+                            pk.vk.domain.lagrange_from_vec(modified_a)
+                        },
+                        &|a, scalar| a * scalar,
+                    )
+                })
+                .collect();
+
+            let unpermuted_cosets: Vec<_> = expressions
+                .iter()
+                .map(|expression| {
+                    expression.evaluate(
+                        &|scalar| pk.vk.domain.constant_extended(scalar),
+                        &|index| fixed_cosets[index].clone(),
+                        &|index| advice_cosets[index].clone(),
+                        &|index| instance_cosets[index].clone(),
+                        &|a, b| a + &b,
+                        &|a, b| a * &b,
+                        &|a, scalar| a * scalar,
+                    )
+                })
+                .collect();
+
+            // Compressed version of expressions
+            let compressed_expression = unpermuted_expressions
+                .iter()
+                .fold(domain.empty_lagrange(), |acc, expression| {
+                    acc * *theta + expression
+                });
+
+            (
+                unpermuted_expressions,
+                unpermuted_cosets,
+                compressed_expression,
+            )
+        };
+
+        // Closure to construct commitment to vector of values
+        let commit_values = |values: &Polynomial<C::Scalar, LagrangeCoeff>| {
+            let poly = pk.vk.domain.lagrange_to_coeff(values.clone());
+            let blind = Blind(C::Scalar::rand());
+            let commitment = params.commit_lagrange(values, blind).to_affine();
+            (poly, blind, commitment)
+        };
+
+        // Get values of input expressions involved in the lookup and compress them
+        let (unpermuted_input_expressions, unpermuted_input_cosets, compressed_input_expression) =
+            compress_expressions(&self.input_expressions);
+
+        // Get values of table expressions involved in the lookup and compress them
+        let (unpermuted_table_expressions, unpermuted_table_cosets, compressed_table_expression) =
+            compress_expressions(&self.table_expressions);
+
+        // Permute compressed (InputExpression, TableExpression) pair
+        let (permuted_input_expression, permuted_table_expression) = permute_expression_pair::<C>(
+            domain,
+            &compressed_input_expression,
+            &compressed_table_expression,
+        )?;
+
+        // Commit to permuted input expression
+        let (permuted_input_poly, permuted_input_blind, permuted_input_commitment) =
+            commit_values(&permuted_input_expression);
+
+        // Commit to permuted table expression
+        let (permuted_table_poly, permuted_table_blind, permuted_table_commitment) =
+            commit_values(&permuted_table_expression);
+
+        // Hash permuted input commitment
+        transcript
+            .write_point(permuted_input_commitment)
+            .map_err(|_| Error::TranscriptError)?;
+
+        // Hash permuted table commitment
+        transcript
+            .write_point(permuted_table_commitment)
+            .map_err(|_| Error::TranscriptError)?;
+
+        let permuted_input_coset = pk
+            .vk
+            .domain
+            .coeff_to_extended(permuted_input_poly.clone(), Rotation::cur());
+        let permuted_input_inv_coset = pk
+            .vk
+            .domain
+            .coeff_to_extended(permuted_input_poly.clone(), Rotation(-1));
+        let permuted_table_coset = pk
+            .vk
+            .domain
+            .coeff_to_extended(permuted_table_poly.clone(), Rotation::cur());
+
+        Ok(Permuted {
+            unpermuted_input_expressions,
+            unpermuted_input_cosets,
+            permuted_input_expression,
+            permuted_input_poly,
+            permuted_input_coset,
+            permuted_input_inv_coset,
+            permuted_input_blind,
+            permuted_input_commitment,
+            unpermuted_table_expressions,
+            unpermuted_table_cosets,
+            permuted_table_expression,
+            permuted_table_poly,
+            permuted_table_coset,
+            permuted_table_blind,
+            permuted_table_commitment,
+        })
+    }
+}
+
+impl<C: CurveAffine> Permuted<C> {
+    /// Given a Lookup with input expressions, table expressions, and the permuted
+    /// input expression and permuted table expression, this method constructs the
+    /// grand product polynomial over the lookup. The grand product polynomial
+    /// is used to populate the Product<C> struct. The Product<C> struct is
+    /// added to the Lookup and finally returned by the method.
+    pub(in crate::plonk) fn commit_product<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+        self,
+        pk: &ProvingKey<C>,
+        params: &Params<C>,
+        theta: ChallengeTheta<C>,
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+        transcript: &mut T,
+    ) -> Result<Committed<C>, Error> {
+        // Goal is to compute the products of fractions
+        //
+        // Numerator: (\theta^{m-1} a_0(\omega^i) + \theta^{m-2} a_1(\omega^i) + ... + \theta a_{m-2}(\omega^i) + a_{m-1}(\omega^i) + \beta)
+        //            * (\theta^{m-1} s_0(\omega^i) + \theta^{m-2} s_1(\omega^i) + ... + \theta s_{m-2}(\omega^i) + s_{m-1}(\omega^i) + \gamma)
+        // Denominator: (a'(\omega^i) + \beta) (s'(\omega^i) + \gamma)
+        //
+        // where a_j(X) is the jth input expression in this lookup,
+        // where a'(X) is the compression of the permuted input expressions,
+        // s_j(X) is the jth table expression in this lookup,
+        // s'(X) is the compression of the permuted table expressions,
+        // and i is the ith row of the expression.
+        let mut lookup_product = vec![C::Scalar::zero(); params.n as usize];
+        // Denominator uses the permuted input expression and permuted table expression
+        parallelize(&mut lookup_product, |lookup_product, start| {
+            for ((lookup_product, permuted_input_value), permuted_table_value) in lookup_product
+                .iter_mut()
+                .zip(self.permuted_input_expression[start..].iter())
+                .zip(self.permuted_table_expression[start..].iter())
+            {
+                *lookup_product = (*beta + permuted_input_value) * &(*gamma + permuted_table_value);
+            }
+        });
+
+        // Batch invert to obtain the denominators for the lookup product
+        // polynomials
+        lookup_product.iter_mut().batch_invert();
+
+        // Finish the computation of the entire fraction by computing the numerators
+        // (\theta^{m-1} a_0(\omega^i) + \theta^{m-2} a_1(\omega^i) + ... + \theta a_{m-2}(\omega^i) + a_{m-1}(\omega^i) + \beta)
+        // * (\theta^{m-1} s_0(\omega^i) + \theta^{m-2} s_1(\omega^i) + ... + \theta s_{m-2}(\omega^i) + s_{m-1}(\omega^i) + \gamma)
+        parallelize(&mut lookup_product, |product, start| {
+            for (i, product) in product.iter_mut().enumerate() {
+                let i = i + start;
+
+                // Compress unpermuted input expressions
+                let mut input_term = C::Scalar::zero();
+                for unpermuted_input_expression in self.unpermuted_input_expressions.iter() {
+                    input_term *= &*theta;
+                    input_term += &unpermuted_input_expression[i];
+                }
+
+                // Compress unpermuted table expressions
+                let mut table_term = C::Scalar::zero();
+                for unpermuted_table_expression in self.unpermuted_table_expressions.iter() {
+                    table_term *= &*theta;
+                    table_term += &unpermuted_table_expression[i];
+                }
+
+                *product *= &(input_term + &*beta);
+                *product *= &(table_term + &*gamma);
+            }
+        });
+
+        // The product vector is a vector of products of fractions of the form
+        //
+        // Numerator: (\theta^{m-1} a_0(\omega^i) + \theta^{m-2} a_1(\omega^i) + ... + \theta a_{m-2}(\omega^i) + a_{m-1}(\omega^i) + \beta)
+        //            * (\theta^{m-1} s_0(\omega^i) + \theta^{m-2} s_1(\omega^i) + ... + \theta s_{m-2}(\omega^i) + s_{m-1}(\omega^i) + \gamma)
+        // Denominator: (a'(\omega^i) + \beta) (s'(\omega^i) + \gamma)
+        //
+        // where there are m input expressions and m table expressions,
+        // a_j(\omega^i) is the jth input expression in this lookup,
+        // a'j(\omega^i) is the permuted input expression,
+        // s_j(\omega^i) is the jth table expression in this lookup,
+        // s'(\omega^i) is the permuted table expression,
+        // and i is the ith row of the expression.
+
+        // Compute the evaluations of the lookup product polynomial
+        // over our domain, starting with z[0] = 1
+        let z = iter::once(C::Scalar::one())
+            .chain(lookup_product.into_iter().skip(1))
+            .scan(C::Scalar::one(), |state, cur| {
+                *state *= &cur;
+                Some(*state)
+            })
+            .collect::<Vec<_>>();
+        let z = pk.vk.domain.lagrange_from_vec(z);
+
+        #[cfg(feature = "sanity-checks")]
+        // This test works only with intermediate representations in this method.
+        // It can be used for debugging purposes.
+        {
+            // While in Lagrange basis, check that product is correctly constructed
+            let n = params.n as usize;
+
+            // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+            // - z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+            for i in 0..n {
+                let prev_idx = (n + i - 1) % n;
+
+                let mut left = z[i];
+                let permuted_input_value = &self.permuted_input_expression[i];
+
+                let permuted_table_value = &self.permuted_table_expression[i];
+
+                left *= &(*beta + permuted_input_value);
+                left *= &(*gamma + permuted_table_value);
+
+                let mut right = z[prev_idx];
+                let mut input_term = self
+                    .unpermuted_input_expressions
+                    .iter()
+                    .fold(C::Scalar::zero(), |acc, input| acc * &*theta + &input[i]);
+
+                let mut table_term = self
+                    .unpermuted_table_expressions
+                    .iter()
+                    .fold(C::Scalar::zero(), |acc, table| acc * &*theta + &table[i]);
+
+                input_term += &(*beta);
+                table_term += &(*gamma);
+                right *= &(input_term * &table_term);
+
+                assert_eq!(left, right);
+            }
+        }
+
+        let product_blind = Blind(C::Scalar::rand());
+        let product_commitment = params.commit_lagrange(&z, product_blind).to_affine();
+        let z = pk.vk.domain.lagrange_to_coeff(z);
+        let product_coset = pk.vk.domain.coeff_to_extended(z.clone(), Rotation::cur());
+        let product_inv_coset = pk.vk.domain.coeff_to_extended(z.clone(), Rotation::prev());
+
+        // Hash product commitment
+        transcript
+            .write_point(product_commitment)
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Committed::<C> {
+            permuted: self,
+            product_poly: z,
+            product_coset,
+            product_inv_coset,
+            product_commitment,
+            product_blind,
+        })
+    }
+}
+
+impl<'a, C: CurveAffine> Committed<C> {
+    /// Given a Lookup with input expressions, table expressions, permuted input
+    /// expression, permuted table expression, and grand product polynomial, this
+    /// method constructs constraints that must hold between these values.
+    /// This method returns the constraints as a vector of polynomials in
+    /// the extended evaluation domain.
+    pub(in crate::plonk) fn construct(
+        self,
+        pk: &'a ProvingKey<C>,
+        theta: ChallengeTheta<C>,
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+    ) -> (
+        Constructed<C>,
+        impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a,
+    ) {
+        let permuted = self.permuted;
+
+        let expressions = iter::empty()
+            // l_0(X) * (1 - z'(X)) = 0
+            .chain(Some(
+                Polynomial::one_minus(self.product_coset.clone()) * &pk.l0,
+            ))
+            // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+            // - z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+            .chain({
+                // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+                let mut left = self.product_coset.clone();
+                parallelize(&mut left, |left, start| {
+                    for ((left, permuted_input), permuted_table) in left
+                        .iter_mut()
+                        .zip(permuted.permuted_input_coset[start..].iter())
+                        .zip(permuted.permuted_table_coset[start..].iter())
+                    {
+                        *left *= &(*permuted_input + &(*beta));
+                        *left *= &(*permuted_table + &(*gamma));
+                    }
+                });
+
+                //  z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+                let mut right = self.product_inv_coset;
+                parallelize(&mut right, |right, start| {
+                    for (i, right) in right.iter_mut().enumerate() {
+                        let i = i + start;
+
+                        // Compress the unpermuted input expressions
+                        let mut input_term = C::Scalar::zero();
+                        for input in permuted.unpermuted_input_cosets.iter() {
+                            input_term *= &*theta;
+                            input_term += &input[i];
+                        }
+
+                        // Compress the unpermuted table expressions
+                        let mut table_term = C::Scalar::zero();
+                        for table in permuted.unpermuted_table_cosets.iter() {
+                            table_term *= &*theta;
+                            table_term += &table[i];
+                        }
+
+                        // Add \beta and \gamma offsets
+                        *right *= &(input_term + &*beta);
+                        *right *= &(table_term + &*gamma);
+                    }
+                });
+
+                Some(left - &right)
+            })
+            // Check that the first values in the permuted input expression and permuted
+            // fixed expression are the same.
+            // l_0(X) * (a'(X) - s'(X)) = 0
+            .chain(Some(
+                (permuted.permuted_input_coset.clone() - &permuted.permuted_table_coset) * &pk.l0,
+            ))
+            // Check that each value in the permuted lookup input expression is either
+            // equal to the value above it, or the value at the same index in the
+            // permuted table expression.
+            // (a′(X)−s′(X))⋅(a′(X)−a′(\omega{-1} X)) = 0
+            .chain(Some(
+                (permuted.permuted_input_coset.clone() - &permuted.permuted_table_coset)
+                    * &(permuted.permuted_input_coset.clone() - &permuted.permuted_input_inv_coset),
+            ));
+
+        (
+            Constructed {
+                permuted_input_poly: permuted.permuted_input_poly,
+                permuted_input_blind: permuted.permuted_input_blind,
+                permuted_table_poly: permuted.permuted_table_poly,
+                permuted_table_blind: permuted.permuted_table_blind,
+                product_poly: self.product_poly,
+                product_blind: self.product_blind,
+            },
+            expressions,
+        )
+    }
+}
+
+impl<C: CurveAffine> Constructed<C> {
+    pub(in crate::plonk) fn evaluate<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+        self,
+        pk: &ProvingKey<C>,
+        x: ChallengeX<C>,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let domain = &pk.vk.domain;
+        let x_inv = domain.rotate_omega(*x, Rotation(-1));
+
+        let product_eval = eval_polynomial(&self.product_poly, *x);
+        let product_inv_eval = eval_polynomial(&self.product_poly, x_inv);
+        let permuted_input_eval = eval_polynomial(&self.permuted_input_poly, *x);
+        let permuted_input_inv_eval = eval_polynomial(&self.permuted_input_poly, x_inv);
+        let permuted_table_eval = eval_polynomial(&self.permuted_table_poly, *x);
+
+        // Hash each advice evaluation
+        for eval in iter::empty()
+            .chain(Some(product_eval))
+            .chain(Some(product_inv_eval))
+            .chain(Some(permuted_input_eval))
+            .chain(Some(permuted_input_inv_eval))
+            .chain(Some(permuted_table_eval))
+        {
+            transcript
+                .write_scalar(eval)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+
+        Ok(Evaluated { constructed: self })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn open<'a>(
+        &'a self,
+        pk: &'a ProvingKey<C>,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = ProverQuery<'a, C>> + Clone {
+        let x_inv = pk.vk.domain.rotate_omega(*x, Rotation(-1));
+
+        iter::empty()
+            // Open lookup product commitments at x
+            .chain(Some(ProverQuery {
+                point: *x,
+                poly: &self.constructed.product_poly,
+                blind: self.constructed.product_blind,
+            }))
+            // Open lookup input commitments at x
+            .chain(Some(ProverQuery {
+                point: *x,
+                poly: &self.constructed.permuted_input_poly,
+                blind: self.constructed.permuted_input_blind,
+            }))
+            // Open lookup table commitments at x
+            .chain(Some(ProverQuery {
+                point: *x,
+                poly: &self.constructed.permuted_table_poly,
+                blind: self.constructed.permuted_table_blind,
+            }))
+            // Open lookup input commitments at x_inv
+            .chain(Some(ProverQuery {
+                point: x_inv,
+                poly: &self.constructed.permuted_input_poly,
+                blind: self.constructed.permuted_input_blind,
+            }))
+            // Open lookup product commitments at x_inv
+            .chain(Some(ProverQuery {
+                point: x_inv,
+                poly: &self.constructed.product_poly,
+                blind: self.constructed.product_blind,
+            }))
+    }
+}
+
+type ExpressionPair<F> = (Polynomial<F, LagrangeCoeff>, Polynomial<F, LagrangeCoeff>);
+
+/// Given a vector of input values A and a vector of table values S,
+/// this method permutes A and S to produce A' and S', such that:
+/// - like values in A' are vertically adjacent to each other; and
+/// - the first row in a sequence of like values in A' is the row
+///   that has the corresponding value in S'.
+/// This method returns (A', S') if no errors are encountered.
+fn permute_expression_pair<C: CurveAffine>(
+    domain: &EvaluationDomain<C::Scalar>,
+    input_expression: &Polynomial<C::Scalar, LagrangeCoeff>,
+    table_expression: &Polynomial<C::Scalar, LagrangeCoeff>,
+) -> Result<ExpressionPair<C::Scalar>, Error> {
+    let mut permuted_input_expression = input_expression.clone();
+
+    // Sort input lookup expression values
+    permuted_input_expression.sort();
+
+    // A BTreeMap of each unique element in the table expression and its count
+    let mut leftover_table_map: BTreeMap<C::Scalar, u32> =
+        table_expression
+            .iter()
+            .fold(BTreeMap::new(), |mut acc, coeff| {
+                *acc.entry(*coeff).or_insert(0) += 1;
+                acc
+            });
+    let mut permuted_table_coeffs = vec![C::Scalar::zero(); table_expression.len()];
+
+    let mut repeated_input_rows = permuted_input_expression
+        .iter()
+        .zip(permuted_table_coeffs.iter_mut())
+        .enumerate()
+        .filter_map(|(row, (input_value, table_value))| {
+            // If this is the first occurence of `input_value` in the input expression
+            if row == 0 || *input_value != permuted_input_expression[row - 1] {
+                *table_value = *input_value;
+                // Remove one instance of input_value from leftover_table_map
+                if let Some(count) = leftover_table_map.get_mut(input_value) {
+                    assert!(*count > 0);
+                    *count -= 1;
+                    None
+                } else {
+                    // Return error if input_value not found
+                    Some(Err(Error::ConstraintSystemFailure))
+                }
+            // If input value is repeated
+            } else {
+                Some(Ok(row))
+            }
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Populate permuted table at unfilled rows with leftover table elements
+    for (coeff, count) in leftover_table_map.iter() {
+        for _ in 0..*count {
+            permuted_table_coeffs[repeated_input_rows.pop().unwrap() as usize] = *coeff;
+        }
+    }
+    assert!(repeated_input_rows.is_empty());
+
+    let mut permuted_table_expression = domain.empty_lagrange();
+    parallelize(
+        &mut permuted_table_expression,
+        |permuted_table_expression, start| {
+            for (permuted_table_value, permuted_table_coeff) in permuted_table_expression
+                .iter_mut()
+                .zip(permuted_table_coeffs[start..].iter())
+            {
+                *permuted_table_value += permuted_table_coeff;
+            }
+        },
+    );
+
+    Ok((permuted_input_expression, permuted_table_expression))
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/lookup/verifier.rs.html b/rustdoc/latest/src/halo2/plonk/lookup/verifier.rs.html new file mode 100644 index 00000000..e900cc7c --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/lookup/verifier.rs.html @@ -0,0 +1,440 @@ +verifier.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+
+use std::iter;
+
+use super::super::{
+    circuit::Expression, ChallengeBeta, ChallengeGamma, ChallengeTheta, ChallengeX,
+};
+use super::Argument;
+use crate::{
+    arithmetic::{CurveAffine, FieldExt},
+    plonk::{Error, VerifyingKey},
+    poly::{multiopen::VerifierQuery, Rotation},
+    transcript::{EncodedChallenge, TranscriptRead},
+};
+use ff::Field;
+
+pub struct PermutationCommitments<C: CurveAffine> {
+    permuted_input_commitment: C,
+    permuted_table_commitment: C,
+}
+
+pub struct Committed<C: CurveAffine> {
+    permuted: PermutationCommitments<C>,
+    product_commitment: C,
+}
+
+pub struct Evaluated<C: CurveAffine> {
+    committed: Committed<C>,
+    product_eval: C::Scalar,
+    product_inv_eval: C::Scalar,
+    permuted_input_eval: C::Scalar,
+    permuted_input_inv_eval: C::Scalar,
+    permuted_table_eval: C::Scalar,
+}
+
+impl<F: FieldExt> Argument<F> {
+    pub(in crate::plonk) fn read_permuted_commitments<
+        C: CurveAffine,
+        E: EncodedChallenge<C>,
+        T: TranscriptRead<C, E>,
+    >(
+        &self,
+        transcript: &mut T,
+    ) -> Result<PermutationCommitments<C>, Error> {
+        let permuted_input_commitment = transcript
+            .read_point()
+            .map_err(|_| Error::TranscriptError)?;
+        let permuted_table_commitment = transcript
+            .read_point()
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(PermutationCommitments {
+            permuted_input_commitment,
+            permuted_table_commitment,
+        })
+    }
+}
+
+impl<C: CurveAffine> PermutationCommitments<C> {
+    pub(in crate::plonk) fn read_product_commitment<
+        E: EncodedChallenge<C>,
+        T: TranscriptRead<C, E>,
+    >(
+        self,
+        transcript: &mut T,
+    ) -> Result<Committed<C>, Error> {
+        let product_commitment = transcript
+            .read_point()
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Committed {
+            permuted: self,
+            product_commitment,
+        })
+    }
+}
+
+impl<C: CurveAffine> Committed<C> {
+    pub(crate) fn evaluate<E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+        self,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let product_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let product_inv_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let permuted_input_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let permuted_input_inv_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let permuted_table_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Evaluated {
+            committed: self,
+            product_eval,
+            product_inv_eval,
+            permuted_input_eval,
+            permuted_input_inv_eval,
+            permuted_table_eval,
+        })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn expressions<'a>(
+        &'a self,
+        l_0: C::Scalar,
+        argument: &'a Argument<C::Scalar>,
+        theta: ChallengeTheta<C>,
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+        advice_evals: &[C::Scalar],
+        fixed_evals: &[C::Scalar],
+        instance_evals: &[C::Scalar],
+    ) -> impl Iterator<Item = C::Scalar> + 'a {
+        let product_expression = || {
+            // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+            // - z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+            let left = self.product_eval
+                * &(self.permuted_input_eval + &*beta)
+                * &(self.permuted_table_eval + &*gamma);
+
+            let compress_expressions = |expressions: &[Expression<C::Scalar>]| {
+                expressions
+                    .iter()
+                    .map(|expression| {
+                        expression.evaluate(
+                            &|scalar| scalar,
+                            &|index| fixed_evals[index],
+                            &|index| advice_evals[index],
+                            &|index| instance_evals[index],
+                            &|a, b| a + &b,
+                            &|a, b| a * &b,
+                            &|a, scalar| a * &scalar,
+                        )
+                    })
+                    .fold(C::Scalar::zero(), |acc, eval| acc * &*theta + &eval)
+            };
+            let right = self.product_inv_eval
+                * &(compress_expressions(&argument.input_expressions) + &*beta)
+                * &(compress_expressions(&argument.table_expressions) + &*gamma);
+
+            left - &right
+        };
+
+        std::iter::empty()
+            .chain(
+                // l_0(X) * (1 - z'(X)) = 0
+                Some(l_0 * &(C::Scalar::one() - &self.product_eval)),
+            )
+            .chain(
+                // z'(X) (a'(X) + \beta) (s'(X) + \gamma)
+                // - z'(\omega^{-1} X) (\theta^{m-1} a_0(X) + ... + a_{m-1}(X) + \beta) (\theta^{m-1} s_0(X) + ... + s_{m-1}(X) + \gamma)
+                Some(product_expression()),
+            )
+            .chain(Some(
+                // l_0(X) * (a'(X) - s'(X)) = 0
+                l_0 * &(self.permuted_input_eval - &self.permuted_table_eval),
+            ))
+            .chain(Some(
+                // (a′(X)−s′(X))⋅(a′(X)−a′(\omega{-1} X)) = 0
+                (self.permuted_input_eval - &self.permuted_table_eval)
+                    * &(self.permuted_input_eval - &self.permuted_input_inv_eval),
+            ))
+    }
+
+    pub(in crate::plonk) fn queries<'a>(
+        &'a self,
+        vk: &'a VerifyingKey<C>,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = VerifierQuery<'a, C>> + Clone {
+        let x_inv = vk.domain.rotate_omega(*x, Rotation(-1));
+
+        iter::empty()
+            // Open lookup product commitments at x
+            .chain(Some(VerifierQuery {
+                point: *x,
+                commitment: &self.committed.product_commitment,
+                eval: self.product_eval,
+            }))
+            // Open lookup input commitments at x
+            .chain(Some(VerifierQuery {
+                point: *x,
+                commitment: &self.committed.permuted.permuted_input_commitment,
+                eval: self.permuted_input_eval,
+            }))
+            // Open lookup table commitments at x
+            .chain(Some(VerifierQuery {
+                point: *x,
+                commitment: &self.committed.permuted.permuted_table_commitment,
+                eval: self.permuted_table_eval,
+            }))
+            // Open lookup input commitments at \omega^{-1} x
+            .chain(Some(VerifierQuery {
+                point: x_inv,
+                commitment: &self.committed.permuted.permuted_input_commitment,
+                eval: self.permuted_input_inv_eval,
+            }))
+            // Open lookup product commitments at \omega^{-1} x
+            .chain(Some(VerifierQuery {
+                point: x_inv,
+                commitment: &self.committed.product_commitment,
+                eval: self.product_inv_eval,
+            }))
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/permutation.rs.html b/rustdoc/latest/src/halo2/plonk/permutation.rs.html new file mode 100644 index 00000000..c150c2a2 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/permutation.rs.html @@ -0,0 +1,174 @@ +permutation.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+//! Implementation of a PLONK permutation argument.
+
+use super::circuit::{Any, Column};
+use crate::{
+    arithmetic::CurveAffine,
+    poly::{Coeff, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial},
+};
+
+pub(crate) mod keygen;
+pub(crate) mod prover;
+pub(crate) mod verifier;
+
+use std::io;
+
+/// A permutation argument.
+#[derive(Debug, Clone)]
+pub(crate) struct Argument {
+    /// A sequence of columns involved in the argument.
+    columns: Vec<Column<Any>>,
+}
+
+impl Argument {
+    pub(crate) fn new(columns: Vec<Column<Any>>) -> Self {
+        Argument { columns }
+    }
+
+    pub(crate) fn required_degree(&self) -> usize {
+        // The permutation argument will serve alongside the gates, so must be
+        // accounted for. There are constraints of degree 2 regardless of the
+        // number of columns involved. (It doesn't make sense to make a
+        // permutation argument with zero columns but to be rigorous we account
+        // for it here.)
+
+        // degree 2:
+        // l_0(X) * (1 - z(X)) = 0
+        //
+        // degree columns + 1
+        // z(X) \prod (p(X) + \beta s_i(X) + \gamma)
+        // - z(omega^{-1} X) \prod (p(X) + \delta^i \beta X + \gamma)
+        std::cmp::max(self.columns.len() + 1, 2)
+    }
+
+    pub(crate) fn get_columns(&self) -> Vec<Column<Any>> {
+        self.columns.clone()
+    }
+}
+
+/// The verifying key for a single permutation argument.
+#[derive(Debug)]
+pub(crate) struct VerifyingKey<C: CurveAffine> {
+    commitments: Vec<C>,
+}
+
+impl<C: CurveAffine> VerifyingKey<C> {
+    pub(crate) fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
+        for commitment in &self.commitments {
+            commitment.write(writer)?;
+        }
+
+        Ok(())
+    }
+
+    pub(crate) fn read<R: io::Read>(reader: &mut R, argument: &Argument) -> io::Result<Self> {
+        let commitments = (0..argument.columns.len())
+            .map(|_| C::read(reader))
+            .collect::<Result<Vec<_>, _>>()?;
+        Ok(VerifyingKey { commitments })
+    }
+}
+
+/// The proving key for a single permutation argument.
+#[derive(Debug)]
+pub(crate) struct ProvingKey<C: CurveAffine> {
+    permutations: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
+    polys: Vec<Polynomial<C::Scalar, Coeff>>,
+    cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/permutation/keygen.rs.html b/rustdoc/latest/src/halo2/plonk/permutation/keygen.rs.html new file mode 100644 index 00000000..dd2653b6 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/permutation/keygen.rs.html @@ -0,0 +1,410 @@ +keygen.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
+use ff::Field;
+use group::Curve;
+
+use super::{Argument, ProvingKey, VerifyingKey};
+use crate::{
+    arithmetic::{CurveAffine, FieldExt},
+    plonk::{circuit::ConstraintSystem, Error},
+    poly::{
+        commitment::{Blind, Params},
+        EvaluationDomain, Rotation,
+    },
+};
+
+pub(crate) struct AssemblyHelper<C: CurveAffine> {
+    deltaomega: Vec<Vec<C::Scalar>>,
+}
+
+#[derive(Debug)]
+pub(crate) struct Assembly {
+    pub(crate) mapping: Vec<Vec<(usize, usize)>>,
+    aux: Vec<Vec<(usize, usize)>>,
+    sizes: Vec<Vec<usize>>,
+}
+
+impl Assembly {
+    pub(crate) fn new(n: usize, p: &Argument) -> Self {
+        // Initialize the copy vector to keep track of copy constraints in all
+        // the permutation arguments.
+        let mut columns = vec![];
+        for i in 0..p.columns.len() {
+            // Computes [(i, 0), (i, 1), ..., (i, n - 1)]
+            columns.push((0..n).map(|j| (i, j)).collect());
+        }
+
+        // Before any equality constraints are applied, every cell in the permutation is
+        // in a 1-cycle; therefore mapping and aux are identical, because every cell is
+        // its own distinguished element.
+        Assembly {
+            mapping: columns.clone(),
+            aux: columns,
+            sizes: vec![vec![1usize; n]; p.columns.len()],
+        }
+    }
+
+    pub(crate) fn copy(
+        &mut self,
+        left_column: usize,
+        left_row: usize,
+        right_column: usize,
+        right_row: usize,
+    ) -> Result<(), Error> {
+        // Check bounds first
+        if left_column >= self.mapping.len()
+            || left_row >= self.mapping[left_column].len()
+            || right_column >= self.mapping.len()
+            || right_row >= self.mapping[right_column].len()
+        {
+            return Err(Error::BoundsFailure);
+        }
+
+        // See book/src/design/permutation.md for a description of this algorithm.
+
+        let mut left_cycle = self.aux[left_column][left_row];
+        let mut right_cycle = self.aux[right_column][right_row];
+
+        // If left and right are in the same cycle, do nothing.
+        if left_cycle == right_cycle {
+            return Ok(());
+        }
+
+        if self.sizes[left_cycle.0][left_cycle.1] < self.sizes[right_cycle.0][right_cycle.1] {
+            std::mem::swap(&mut left_cycle, &mut right_cycle);
+        }
+
+        // Merge the right cycle into the left one.
+        self.sizes[left_cycle.0][left_cycle.1] += self.sizes[right_cycle.0][right_cycle.1];
+        let mut i = right_cycle;
+        loop {
+            self.aux[i.0][i.1] = left_cycle;
+            i = self.mapping[i.0][i.1];
+            if i == right_cycle {
+                break;
+            }
+        }
+
+        let tmp = self.mapping[left_column][left_row];
+        self.mapping[left_column][left_row] = self.mapping[right_column][right_row];
+        self.mapping[right_column][right_row] = tmp;
+
+        Ok(())
+    }
+
+    pub(crate) fn build_helper<C: CurveAffine>(
+        params: &Params<C>,
+        cs: &ConstraintSystem<C::Scalar>,
+        domain: &EvaluationDomain<C::Scalar>,
+    ) -> AssemblyHelper<C> {
+        // Get the largest permutation argument length in terms of the number of
+        // advice columns involved.
+        let largest_permutation_length = cs
+            .permutations
+            .iter()
+            .map(|p| p.columns.len())
+            .max()
+            .unwrap_or_default();
+
+        // Compute [omega^0, omega^1, ..., omega^{params.n - 1}]
+        let mut omega_powers = Vec::with_capacity(params.n as usize);
+        {
+            let mut cur = C::Scalar::one();
+            for _ in 0..params.n {
+                omega_powers.push(cur);
+                cur *= &domain.get_omega();
+            }
+        }
+
+        // Compute [omega_powers * \delta^0, omega_powers * \delta^1, ..., omega_powers * \delta^m]
+        let mut deltaomega = Vec::with_capacity(largest_permutation_length);
+        {
+            let mut cur = C::Scalar::one();
+            for _ in 0..largest_permutation_length {
+                let mut omega_powers = omega_powers.clone();
+                for o in &mut omega_powers {
+                    *o *= &cur;
+                }
+
+                deltaomega.push(omega_powers);
+
+                cur *= &C::Scalar::DELTA;
+            }
+        }
+
+        AssemblyHelper { deltaomega }
+    }
+
+    pub(crate) fn build_vk<C: CurveAffine>(
+        self,
+        params: &Params<C>,
+        domain: &EvaluationDomain<C::Scalar>,
+        helper: &AssemblyHelper<C>,
+        p: &Argument,
+    ) -> VerifyingKey<C> {
+        // Pre-compute commitments for the URS.
+        let mut commitments = vec![];
+        for i in 0..p.columns.len() {
+            // Computes the permutation polynomial based on the permutation
+            // description in the assembly.
+            let mut permutation_poly = domain.empty_lagrange();
+            for (j, p) in permutation_poly.iter_mut().enumerate() {
+                let (permuted_i, permuted_j) = self.mapping[i][j];
+                *p = helper.deltaomega[permuted_i][permuted_j];
+            }
+
+            // Compute commitment to permutation polynomial
+            commitments.push(
+                params
+                    .commit_lagrange(&permutation_poly, Blind::default())
+                    .to_affine(),
+            );
+        }
+        VerifyingKey { commitments }
+    }
+
+    pub(crate) fn build_pk<C: CurveAffine>(
+        self,
+        domain: &EvaluationDomain<C::Scalar>,
+        helper: &AssemblyHelper<C>,
+        p: &Argument,
+    ) -> ProvingKey<C> {
+        // Compute permutation polynomials, convert to coset form.
+        let mut permutations = vec![];
+        let mut polys = vec![];
+        let mut cosets = vec![];
+        for i in 0..p.columns.len() {
+            // Computes the permutation polynomial based on the permutation
+            // description in the assembly.
+            let mut permutation_poly = domain.empty_lagrange();
+            for (j, p) in permutation_poly.iter_mut().enumerate() {
+                let (permuted_i, permuted_j) = self.mapping[i][j];
+                *p = helper.deltaomega[permuted_i][permuted_j];
+            }
+
+            // Store permutation polynomial and precompute its coset evaluation
+            permutations.push(permutation_poly.clone());
+            let poly = domain.lagrange_to_coeff(permutation_poly);
+            polys.push(poly.clone());
+            cosets.push(domain.coeff_to_extended(poly, Rotation::cur()));
+        }
+        ProvingKey {
+            permutations,
+            polys,
+            cosets,
+        }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/permutation/prover.rs.html b/rustdoc/latest/src/halo2/plonk/permutation/prover.rs.html new file mode 100644 index 00000000..3423ff67 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/permutation/prover.rs.html @@ -0,0 +1,654 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+
+use ff::Field;
+use group::Curve;
+use std::iter;
+
+use super::super::{circuit::Any, ChallengeBeta, ChallengeGamma, ChallengeX};
+use super::{Argument, ProvingKey};
+use crate::{
+    arithmetic::{eval_polynomial, parallelize, BatchInvert, CurveAffine, FieldExt},
+    plonk::{self, Error},
+    poly::{
+        commitment::{Blind, Params},
+        multiopen::ProverQuery,
+        Coeff, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial, Rotation,
+    },
+    transcript::{EncodedChallenge, TranscriptWrite},
+};
+
+pub(crate) struct Committed<C: CurveAffine> {
+    permutation_product_poly: Polynomial<C::Scalar, Coeff>,
+    permutation_product_coset: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    permutation_product_coset_inv: Polynomial<C::Scalar, ExtendedLagrangeCoeff>,
+    permutation_product_blind: Blind<C::Scalar>,
+}
+
+pub(crate) struct Constructed<C: CurveAffine> {
+    permutation_product_poly: Polynomial<C::Scalar, Coeff>,
+    permutation_product_blind: Blind<C::Scalar>,
+}
+
+pub(crate) struct Evaluated<C: CurveAffine> {
+    constructed: Constructed<C>,
+}
+
+impl Argument {
+    pub(in crate::plonk) fn commit<
+        C: CurveAffine,
+        E: EncodedChallenge<C>,
+        T: TranscriptWrite<C, E>,
+    >(
+        &self,
+        params: &Params<C>,
+        pk: &plonk::ProvingKey<C>,
+        pkey: &ProvingKey<C>,
+        advice: &[Polynomial<C::Scalar, LagrangeCoeff>],
+        fixed: &[Polynomial<C::Scalar, LagrangeCoeff>],
+        instance: &[Polynomial<C::Scalar, LagrangeCoeff>],
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+        transcript: &mut T,
+    ) -> Result<Committed<C>, Error> {
+        let domain = &pk.vk.domain;
+
+        // Goal is to compute the products of fractions
+        //
+        // (p_j(\omega^i) + \delta^j \omega^i \beta + \gamma) /
+        // (p_j(\omega^i) + \beta s_j(\omega^i) + \gamma)
+        //
+        // where p_j(X) is the jth column in this permutation,
+        // and i is the ith row of the column.
+
+        let mut modified_values = vec![C::Scalar::one(); params.n as usize];
+
+        // Iterate over each column of the permutation
+        for (&column, permuted_column_values) in self.columns.iter().zip(pkey.permutations.iter()) {
+            let values = match column.column_type() {
+                Any::Advice => advice,
+                Any::Fixed => fixed,
+                Any::Instance => instance,
+            };
+            parallelize(&mut modified_values, |modified_values, start| {
+                for ((modified_values, value), permuted_value) in modified_values
+                    .iter_mut()
+                    .zip(values[column.index()][start..].iter())
+                    .zip(permuted_column_values[start..].iter())
+                {
+                    *modified_values *= &(*beta * permuted_value + &*gamma + value);
+                }
+            });
+        }
+
+        // Invert to obtain the denominator for the permutation product polynomial
+        modified_values.batch_invert();
+
+        // Iterate over each column again, this time finishing the computation
+        // of the entire fraction by computing the numerators
+        let mut deltaomega = C::Scalar::one();
+        for &column in self.columns.iter() {
+            let omega = domain.get_omega();
+            let values = match column.column_type() {
+                Any::Advice => advice,
+                Any::Fixed => fixed,
+                Any::Instance => instance,
+            };
+            parallelize(&mut modified_values, |modified_values, start| {
+                let mut deltaomega = deltaomega * &omega.pow_vartime(&[start as u64, 0, 0, 0]);
+                for (modified_values, value) in modified_values
+                    .iter_mut()
+                    .zip(values[column.index()][start..].iter())
+                {
+                    // Multiply by p_j(\omega^i) + \delta^j \omega^i \beta
+                    *modified_values *= &(deltaomega * &*beta + &*gamma + value);
+                    deltaomega *= &omega;
+                }
+            });
+            deltaomega *= &C::Scalar::DELTA;
+        }
+
+        // The modified_values vector is a vector of products of fractions
+        // of the form
+        //
+        // (p_j(\omega^i) + \delta^j \omega^i \beta + \gamma) /
+        // (p_j(\omega^i) + \beta s_j(\omega^i) + \gamma)
+        //
+        // where i is the index into modified_values, for the jth column in
+        // the permutation
+
+        // Compute the evaluations of the permutation product polynomial
+        // over our domain, starting with z[0] = 1
+        let mut z = vec![C::Scalar::one()];
+        for row in 1..(params.n as usize) {
+            let mut tmp = z[row - 1];
+
+            tmp *= &modified_values[row];
+            z.push(tmp);
+        }
+        let z = domain.lagrange_from_vec(z);
+
+        let blind = Blind(C::Scalar::rand());
+
+        let permutation_product_commitment_projective = params.commit_lagrange(&z, blind);
+        let permutation_product_blind = blind;
+        let z = domain.lagrange_to_coeff(z);
+        let permutation_product_poly = z.clone();
+        let permutation_product_coset = domain.coeff_to_extended(z.clone(), Rotation::cur());
+        let permutation_product_coset_inv = domain.coeff_to_extended(z, Rotation::prev());
+
+        let permutation_product_commitment = permutation_product_commitment_projective.to_affine();
+
+        // Hash the permutation product commitment
+        transcript
+            .write_point(permutation_product_commitment)
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Committed {
+            permutation_product_poly,
+            permutation_product_coset,
+            permutation_product_coset_inv,
+            permutation_product_blind,
+        })
+    }
+}
+
+impl<C: CurveAffine> Committed<C> {
+    pub(in crate::plonk) fn construct<'a>(
+        self,
+        pk: &'a plonk::ProvingKey<C>,
+        p: &'a Argument,
+        pkey: &'a ProvingKey<C>,
+        advice_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        fixed_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        instance_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+    ) -> (
+        Constructed<C>,
+        impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a,
+    ) {
+        let domain = &pk.vk.domain;
+        let expressions = iter::empty()
+            // l_0(X) * (1 - z(X)) = 0
+            .chain(Some(
+                Polynomial::one_minus(self.permutation_product_coset.clone()) * &pk.l0,
+            ))
+            // z(X) \prod (p(X) + \beta s_i(X) + \gamma) - z(omega^{-1} X) \prod (p(X) + \delta^i \beta X + \gamma)
+            .chain(Some({
+                let mut left = self.permutation_product_coset.clone();
+                for (values, permutation) in p
+                    .columns
+                    .iter()
+                    .map(|&column| match column.column_type() {
+                        Any::Advice => {
+                            &advice_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                        Any::Fixed => {
+                            &fixed_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                        Any::Instance => {
+                            &instance_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                    })
+                    .zip(pkey.cosets.iter())
+                {
+                    parallelize(&mut left, |left, start| {
+                        for ((left, value), permutation) in left
+                            .iter_mut()
+                            .zip(values[start..].iter())
+                            .zip(permutation[start..].iter())
+                        {
+                            *left *= &(*value + &(*beta * permutation) + &*gamma);
+                        }
+                    });
+                }
+
+                let mut right = self.permutation_product_coset_inv.clone();
+                let mut current_delta = *beta * &C::Scalar::ZETA;
+                let step = domain.get_extended_omega();
+                for values in p.columns.iter().map(|&column| match column.column_type() {
+                    Any::Advice => {
+                        &advice_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                    }
+                    Any::Fixed => {
+                        &fixed_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                    }
+                    Any::Instance => {
+                        &instance_cosets[pk.vk.cs.get_any_query_index(column, Rotation::cur())]
+                    }
+                }) {
+                    parallelize(&mut right, move |right, start| {
+                        let mut beta_term =
+                            current_delta * &step.pow_vartime(&[start as u64, 0, 0, 0]);
+                        for (right, value) in right.iter_mut().zip(values[start..].iter()) {
+                            *right *= &(*value + &beta_term + &*gamma);
+                            beta_term *= &step;
+                        }
+                    });
+                    current_delta *= &C::Scalar::DELTA;
+                }
+
+                left - &right
+            }));
+
+        (
+            Constructed {
+                permutation_product_poly: self.permutation_product_poly,
+                permutation_product_blind: self.permutation_product_blind,
+            },
+            expressions,
+        )
+    }
+}
+
+impl<C: CurveAffine> super::ProvingKey<C> {
+    fn evaluate(&self, x: ChallengeX<C>) -> Vec<C::Scalar> {
+        self.polys
+            .iter()
+            .map(|poly| eval_polynomial(poly, *x))
+            .collect()
+    }
+
+    fn open(&self, x: ChallengeX<C>) -> impl Iterator<Item = ProverQuery<'_, C>> + Clone {
+        self.polys.iter().map(move |poly| ProverQuery {
+            point: *x,
+            poly,
+            blind: Blind::default(),
+        })
+    }
+}
+
+impl<C: CurveAffine> Constructed<C> {
+    pub(in crate::plonk) fn evaluate<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+        self,
+        pk: &plonk::ProvingKey<C>,
+        pkey: &ProvingKey<C>,
+        x: ChallengeX<C>,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let domain = &pk.vk.domain;
+
+        let permutation_product_eval = eval_polynomial(&self.permutation_product_poly, *x);
+
+        let permutation_product_inv_eval = eval_polynomial(
+            &self.permutation_product_poly,
+            domain.rotate_omega(*x, Rotation(-1)),
+        );
+
+        let permutation_evals = pkey.evaluate(x);
+
+        // Hash permutation product evals
+        for eval in iter::empty()
+            .chain(Some(&permutation_product_eval))
+            .chain(Some(&permutation_product_inv_eval))
+            .chain(permutation_evals.iter())
+        {
+            transcript
+                .write_scalar(*eval)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+
+        Ok(Evaluated { constructed: self })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn open<'a>(
+        &'a self,
+        pk: &'a plonk::ProvingKey<C>,
+        pkey: &'a ProvingKey<C>,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = ProverQuery<'a, C>> + Clone {
+        let x_inv = pk.vk.domain.rotate_omega(*x, Rotation(-1));
+
+        iter::empty()
+            // Open permutation product commitments at x and \omega^{-1} x
+            .chain(Some(ProverQuery {
+                point: *x,
+                poly: &self.constructed.permutation_product_poly,
+                blind: self.constructed.permutation_product_blind,
+            }))
+            .chain(Some(ProverQuery {
+                point: x_inv,
+                poly: &self.constructed.permutation_product_poly,
+                blind: self.constructed.permutation_product_blind,
+            }))
+            // Open permutation polynomial commitments at x
+            .chain(pkey.open(x))
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/permutation/verifier.rs.html b/rustdoc/latest/src/halo2/plonk/permutation/verifier.rs.html new file mode 100644 index 00000000..3f7a9e67 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/permutation/verifier.rs.html @@ -0,0 +1,346 @@ +verifier.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+use ff::Field;
+use std::iter;
+
+use super::super::{circuit::Any, ChallengeBeta, ChallengeGamma, ChallengeX};
+use super::{Argument, VerifyingKey};
+use crate::{
+    arithmetic::{CurveAffine, FieldExt},
+    plonk::{self, Error},
+    poly::{multiopen::VerifierQuery, Rotation},
+    transcript::{EncodedChallenge, TranscriptRead},
+};
+
+pub struct Committed<C: CurveAffine> {
+    permutation_product_commitment: C,
+}
+
+pub struct Evaluated<C: CurveAffine> {
+    permutation_product_commitment: C,
+    permutation_product_eval: C::Scalar,
+    permutation_product_inv_eval: C::Scalar,
+    permutation_evals: Vec<C::Scalar>,
+}
+
+impl Argument {
+    pub(crate) fn read_product_commitment<
+        C: CurveAffine,
+        E: EncodedChallenge<C>,
+        T: TranscriptRead<C, E>,
+    >(
+        &self,
+        transcript: &mut T,
+    ) -> Result<Committed<C>, Error> {
+        let permutation_product_commitment = transcript
+            .read_point()
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Committed {
+            permutation_product_commitment,
+        })
+    }
+}
+
+impl<C: CurveAffine> Committed<C> {
+    pub(crate) fn evaluate<E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+        self,
+        vkey: &VerifyingKey<C>,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let permutation_product_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let permutation_product_inv_eval = transcript
+            .read_scalar()
+            .map_err(|_| Error::TranscriptError)?;
+        let mut permutation_evals = Vec::with_capacity(vkey.commitments.len());
+        for _ in 0..vkey.commitments.len() {
+            permutation_evals.push(
+                transcript
+                    .read_scalar()
+                    .map_err(|_| Error::TranscriptError)?,
+            );
+        }
+
+        Ok(Evaluated {
+            permutation_product_commitment: self.permutation_product_commitment,
+            permutation_product_eval,
+            permutation_product_inv_eval,
+            permutation_evals,
+        })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn expressions<'a>(
+        &'a self,
+        vk: &'a plonk::VerifyingKey<C>,
+        p: &'a Argument,
+        advice_evals: &'a [C::Scalar],
+        fixed_evals: &[C::Scalar],
+        instance_evals: &'a [C::Scalar],
+        l_0: C::Scalar,
+        beta: ChallengeBeta<C>,
+        gamma: ChallengeGamma<C>,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = C::Scalar> + 'a {
+        iter::empty()
+            // l_0(X) * (1 - z(X)) = 0
+            .chain(Some(
+                l_0 * &(C::Scalar::one() - &self.permutation_product_eval),
+            ))
+            // z(X) \prod (p(X) + \beta s_i(X) + \gamma)
+            // - z(omega^{-1} X) \prod (p(X) + \delta^i \beta X + \gamma)
+            .chain(Some({
+                let mut left = self.permutation_product_eval;
+                for (eval, permutation_eval) in p
+                    .columns
+                    .iter()
+                    .map(|&column| match column.column_type() {
+                        Any::Advice => {
+                            advice_evals[vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                        Any::Fixed => {
+                            fixed_evals[vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                        Any::Instance => {
+                            instance_evals[vk.cs.get_any_query_index(column, Rotation::cur())]
+                        }
+                    })
+                    .zip(self.permutation_evals.iter())
+                {
+                    left *= &(eval + &(*beta * permutation_eval) + &*gamma);
+                }
+
+                let mut right = self.permutation_product_inv_eval;
+                let mut current_delta = *beta * &*x;
+                for eval in p.columns.iter().map(|&column| match column.column_type() {
+                    Any::Advice => advice_evals[vk.cs.get_any_query_index(column, Rotation::cur())],
+                    Any::Fixed => fixed_evals[vk.cs.get_any_query_index(column, Rotation::cur())],
+                    Any::Instance => {
+                        instance_evals[vk.cs.get_any_query_index(column, Rotation::cur())]
+                    }
+                }) {
+                    right *= &(eval + &current_delta + &*gamma);
+                    current_delta *= &C::Scalar::DELTA;
+                }
+
+                left - &right
+            }))
+    }
+
+    pub(in crate::plonk) fn queries<'a>(
+        &'a self,
+        vk: &'a plonk::VerifyingKey<C>,
+        vkey: &'a VerifyingKey<C>,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = VerifierQuery<'a, C>> + Clone {
+        let x_inv = vk.domain.rotate_omega(*x, Rotation(-1));
+
+        iter::empty()
+            // Open permutation product commitments at x and \omega^{-1} x
+            .chain(Some(VerifierQuery {
+                point: *x,
+                commitment: &self.permutation_product_commitment,
+                eval: self.permutation_product_eval,
+            }))
+            .chain(Some(VerifierQuery {
+                point: x_inv,
+                commitment: &self.permutation_product_commitment,
+                eval: self.permutation_product_inv_eval,
+            }))
+            // Open permutation commitments for each permutation argument at x
+            .chain(
+                vkey.commitments
+                    .iter()
+                    .zip(self.permutation_evals.iter())
+                    .map(move |(commitment, &eval)| VerifierQuery {
+                        point: *x,
+                        commitment,
+                        eval,
+                    }),
+            )
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/prover.rs.html b/rustdoc/latest/src/halo2/plonk/prover.rs.html new file mode 100644 index 00000000..5427d64f --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/prover.rs.html @@ -0,0 +1,1128 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+
+use ff::Field;
+use group::Curve;
+use std::iter;
+
+use super::{
+    circuit::{
+        Advice, Any, Assignment, Circuit, Column, ConstraintSystem, Fixed, FloorPlanner, Selector,
+    },
+    lookup, permutation, vanishing, ChallengeBeta, ChallengeGamma, ChallengeTheta, ChallengeX,
+    ChallengeY, Error, Permutation, ProvingKey,
+};
+use crate::poly::{
+    commitment::{Blind, Params},
+    multiopen::{self, ProverQuery},
+    Coeff, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial,
+};
+use crate::{
+    arithmetic::{eval_polynomial, CurveAffine, FieldExt},
+    plonk::Assigned,
+};
+use crate::{
+    poly::batch_invert_assigned,
+    transcript::{EncodedChallenge, TranscriptWrite},
+};
+
+/// This creates a proof for the provided `circuit` when given the public
+/// parameters `params` and the proving key [`ProvingKey`] that was
+/// generated previously for the same circuit.
+pub fn create_proof<
+    C: CurveAffine,
+    E: EncodedChallenge<C>,
+    T: TranscriptWrite<C, E>,
+    ConcreteCircuit: Circuit<C::Scalar>,
+>(
+    params: &Params<C>,
+    pk: &ProvingKey<C>,
+    circuits: &[ConcreteCircuit],
+    instances: &[&[Polynomial<C::Scalar, LagrangeCoeff>]],
+    transcript: &mut T,
+) -> Result<(), Error> {
+    for instance in instances.iter() {
+        if instance.len() != pk.vk.cs.num_instance_columns {
+            return Err(Error::IncompatibleParams);
+        }
+    }
+
+    // Hash verification key into transcript
+    pk.vk
+        .hash_into(transcript)
+        .map_err(|_| Error::TranscriptError)?;
+
+    let domain = &pk.vk.domain;
+    let mut meta = ConstraintSystem::default();
+    let config = ConcreteCircuit::configure(&mut meta);
+
+    struct InstanceSingle<'a, C: CurveAffine> {
+        pub instance_values: &'a [Polynomial<C::Scalar, LagrangeCoeff>],
+        pub instance_polys: Vec<Polynomial<C::Scalar, Coeff>>,
+        pub instance_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+    }
+
+    let instance: Vec<InstanceSingle<C>> = instances
+        .iter()
+        .map(|instance| -> Result<InstanceSingle<C>, Error> {
+            let instance_commitments_projective: Vec<_> = instance
+                .iter()
+                .map(|poly| params.commit_lagrange(poly, Blind::default()))
+                .collect();
+            let mut instance_commitments =
+                vec![C::identity(); instance_commitments_projective.len()];
+            C::Curve::batch_normalize(&instance_commitments_projective, &mut instance_commitments);
+            let instance_commitments = instance_commitments;
+            drop(instance_commitments_projective);
+
+            for commitment in &instance_commitments {
+                transcript
+                    .common_point(*commitment)
+                    .map_err(|_| Error::TranscriptError)?;
+            }
+
+            let instance_polys: Vec<_> = instance
+                .iter()
+                .map(|poly| {
+                    let lagrange_vec = domain.lagrange_from_vec(poly.to_vec());
+                    domain.lagrange_to_coeff(lagrange_vec)
+                })
+                .collect();
+
+            let instance_cosets: Vec<_> = meta
+                .instance_queries
+                .iter()
+                .map(|&(column, at)| {
+                    let poly = instance_polys[column.index()].clone();
+                    domain.coeff_to_extended(poly, at)
+                })
+                .collect();
+
+            Ok(InstanceSingle {
+                instance_values: *instance,
+                instance_polys,
+                instance_cosets,
+            })
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    struct AdviceSingle<C: CurveAffine> {
+        pub advice_values: Vec<Polynomial<C::Scalar, LagrangeCoeff>>,
+        pub advice_polys: Vec<Polynomial<C::Scalar, Coeff>>,
+        pub advice_cosets: Vec<Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+        pub advice_blinds: Vec<Blind<C::Scalar>>,
+    }
+
+    let advice: Vec<AdviceSingle<C>> = circuits
+        .iter()
+        .map(|circuit| -> Result<AdviceSingle<C>, Error> {
+            struct WitnessCollection<F: Field> {
+                pub advice: Vec<Polynomial<Assigned<F>, LagrangeCoeff>>,
+                _marker: std::marker::PhantomData<F>,
+            }
+
+            impl<F: Field> Assignment<F> for WitnessCollection<F> {
+                fn enter_region<NR, N>(&mut self, _: N)
+                where
+                    NR: Into<String>,
+                    N: FnOnce() -> NR,
+                {
+                    // Do nothing; we don't care about regions in this context.
+                }
+
+                fn exit_region(&mut self) {
+                    // Do nothing; we don't care about regions in this context.
+                }
+
+                fn enable_selector<A, AR>(
+                    &mut self,
+                    _: A,
+                    _: &Selector,
+                    _: usize,
+                ) -> Result<(), Error>
+                where
+                    A: FnOnce() -> AR,
+                    AR: Into<String>,
+                {
+                    // We only care about advice columns here
+
+                    Ok(())
+                }
+
+                fn assign_advice<V, VR, A, AR>(
+                    &mut self,
+                    _: A,
+                    column: Column<Advice>,
+                    row: usize,
+                    to: V,
+                ) -> Result<(), Error>
+                where
+                    V: FnOnce() -> Result<VR, Error>,
+                    VR: Into<Assigned<F>>,
+                    A: FnOnce() -> AR,
+                    AR: Into<String>,
+                {
+                    *self
+                        .advice
+                        .get_mut(column.index())
+                        .and_then(|v| v.get_mut(row))
+                        .ok_or(Error::BoundsFailure)? = to()?.into();
+
+                    Ok(())
+                }
+
+                fn assign_fixed<V, VR, A, AR>(
+                    &mut self,
+                    _: A,
+                    _: Column<Fixed>,
+                    _: usize,
+                    _: V,
+                ) -> Result<(), Error>
+                where
+                    V: FnOnce() -> Result<VR, Error>,
+                    VR: Into<Assigned<F>>,
+                    A: FnOnce() -> AR,
+                    AR: Into<String>,
+                {
+                    // We only care about advice columns here
+
+                    Ok(())
+                }
+
+                fn copy(
+                    &mut self,
+                    _: &Permutation,
+                    _: Column<Any>,
+                    _: usize,
+                    _: Column<Any>,
+                    _: usize,
+                ) -> Result<(), Error> {
+                    // We only care about advice columns here
+
+                    Ok(())
+                }
+
+                fn push_namespace<NR, N>(&mut self, _: N)
+                where
+                    NR: Into<String>,
+                    N: FnOnce() -> NR,
+                {
+                    // Do nothing; we don't care about namespaces in this context.
+                }
+
+                fn pop_namespace(&mut self, _: Option<String>) {
+                    // Do nothing; we don't care about namespaces in this context.
+                }
+            }
+
+            let mut witness = WitnessCollection {
+                advice: vec![domain.empty_lagrange_assigned(); meta.num_advice_columns],
+                _marker: std::marker::PhantomData,
+            };
+
+            // Synthesize the circuit to obtain the witness and other information.
+            ConcreteCircuit::FloorPlanner::synthesize(&mut witness, circuit, config.clone())?;
+
+            let advice = batch_invert_assigned(&witness.advice);
+
+            // Compute commitments to advice column polynomials
+            let advice_blinds: Vec<_> = advice.iter().map(|_| Blind(C::Scalar::rand())).collect();
+            let advice_commitments_projective: Vec<_> = advice
+                .iter()
+                .zip(advice_blinds.iter())
+                .map(|(poly, blind)| params.commit_lagrange(poly, *blind))
+                .collect();
+            let mut advice_commitments = vec![C::identity(); advice_commitments_projective.len()];
+            C::Curve::batch_normalize(&advice_commitments_projective, &mut advice_commitments);
+            let advice_commitments = advice_commitments;
+            drop(advice_commitments_projective);
+
+            for commitment in &advice_commitments {
+                transcript
+                    .write_point(*commitment)
+                    .map_err(|_| Error::TranscriptError)?;
+            }
+
+            let advice_polys: Vec<_> = advice
+                .clone()
+                .into_iter()
+                .map(|poly| domain.lagrange_to_coeff(poly))
+                .collect();
+
+            let advice_cosets: Vec<_> = meta
+                .advice_queries
+                .iter()
+                .map(|&(column, at)| {
+                    let poly = advice_polys[column.index()].clone();
+                    domain.coeff_to_extended(poly, at)
+                })
+                .collect();
+
+            Ok(AdviceSingle {
+                advice_values: advice,
+                advice_polys,
+                advice_cosets,
+                advice_blinds,
+            })
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Sample theta challenge for keeping lookup columns linearly independent
+    let theta: ChallengeTheta<_> = transcript.squeeze_challenge_scalar();
+
+    let lookups: Vec<Vec<lookup::prover::Permuted<C>>> = instance
+        .iter()
+        .zip(advice.iter())
+        .map(|(instance, advice)| -> Result<Vec<_>, Error> {
+            // Construct and commit to permuted values for each lookup
+            pk.vk
+                .cs
+                .lookups
+                .iter()
+                .map(|lookup| {
+                    lookup.commit_permuted(
+                        pk,
+                        params,
+                        domain,
+                        theta,
+                        &advice.advice_values,
+                        &pk.fixed_values,
+                        instance.instance_values,
+                        &advice.advice_cosets,
+                        &pk.fixed_cosets,
+                        &instance.instance_cosets,
+                        transcript,
+                    )
+                })
+                .collect()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Sample beta challenge
+    let beta: ChallengeBeta<_> = transcript.squeeze_challenge_scalar();
+
+    // Sample gamma challenge
+    let gamma: ChallengeGamma<_> = transcript.squeeze_challenge_scalar();
+
+    let permutations: Vec<Vec<permutation::prover::Committed<C>>> = instance
+        .iter()
+        .zip(advice.iter())
+        .map(|(instance, advice)| -> Result<Vec<_>, Error> {
+            // Commit to permutations, if any.
+            pk.vk
+                .cs
+                .permutations
+                .iter()
+                .zip(pk.permutations.iter())
+                .map(|(p, pkey)| {
+                    p.commit(
+                        params,
+                        pk,
+                        pkey,
+                        &advice.advice_values,
+                        &pk.fixed_values,
+                        instance.instance_values,
+                        beta,
+                        gamma,
+                        transcript,
+                    )
+                })
+                .collect()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let lookups: Vec<Vec<lookup::prover::Committed<C>>> = lookups
+        .into_iter()
+        .map(|lookups| -> Result<Vec<_>, _> {
+            // Construct and commit to products for each lookup
+            lookups
+                .into_iter()
+                .map(|lookup| lookup.commit_product(pk, params, theta, beta, gamma, transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Obtain challenge for keeping all separate gates linearly independent
+    let y: ChallengeY<_> = transcript.squeeze_challenge_scalar();
+
+    let (permutations, permutation_expressions): (Vec<Vec<_>>, Vec<Vec<_>>) = permutations
+        .into_iter()
+        .zip(advice.iter())
+        .zip(instance.iter())
+        .map(|((permutations, advice), instance)| {
+            // Evaluate the h(X) polynomial's constraint system expressions for the permutation constraints, if any.
+            permutations
+                .into_iter()
+                .zip(pk.vk.cs.permutations.iter())
+                .zip(pk.permutations.iter())
+                .map(|((p, argument), pkey)| {
+                    p.construct(
+                        pk,
+                        argument,
+                        pkey,
+                        &advice.advice_cosets,
+                        &pk.fixed_cosets,
+                        &instance.instance_cosets,
+                        beta,
+                        gamma,
+                    )
+                })
+                .unzip()
+        })
+        .unzip();
+
+    let (lookups, lookup_expressions): (Vec<Vec<_>>, Vec<Vec<_>>) = lookups
+        .into_iter()
+        .map(|lookups| {
+            // Evaluate the h(X) polynomial's constraint system expressions for the lookup constraints, if any.
+            lookups
+                .into_iter()
+                .map(|p| p.construct(pk, theta, beta, gamma))
+                .unzip()
+        })
+        .unzip();
+
+    let expressions = advice
+        .iter()
+        .zip(instance.iter())
+        .zip(permutation_expressions.into_iter())
+        .zip(lookup_expressions.into_iter())
+        .flat_map(
+            |(((advice, instance), permutation_expressions), lookup_expressions)| {
+                iter::empty()
+                    // Custom constraints
+                    .chain(meta.gates.iter().flat_map(move |gate| {
+                        gate.polynomials().iter().map(move |poly| {
+                            poly.evaluate(
+                                &|scalar| pk.vk.domain.constant_extended(scalar),
+                                &|index| pk.fixed_cosets[index].clone(),
+                                &|index| advice.advice_cosets[index].clone(),
+                                &|index| instance.instance_cosets[index].clone(),
+                                &|a, b| a + &b,
+                                &|a, b| a * &b,
+                                &|a, scalar| a * scalar,
+                            )
+                        })
+                    }))
+                    // Permutation constraints, if any.
+                    .chain(permutation_expressions.into_iter().flatten())
+                    // Lookup constraints, if any.
+                    .chain(lookup_expressions.into_iter().flatten())
+            },
+        );
+
+    // Construct the vanishing argument
+    let vanishing = vanishing::Argument::construct(params, domain, expressions, y, transcript)?;
+
+    let x: ChallengeX<_> = transcript.squeeze_challenge_scalar();
+
+    // Compute and hash instance evals for each circuit instance
+    for instance in instance.iter() {
+        // Evaluate polynomials at omega^i x
+        let instance_evals: Vec<_> = meta
+            .instance_queries
+            .iter()
+            .map(|&(column, at)| {
+                eval_polynomial(
+                    &instance.instance_polys[column.index()],
+                    domain.rotate_omega(*x, at),
+                )
+            })
+            .collect();
+
+        // Hash each instance column evaluation
+        for eval in instance_evals.iter() {
+            transcript
+                .write_scalar(*eval)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+    }
+
+    // Compute and hash advice evals for each circuit instance
+    for advice in advice.iter() {
+        // Evaluate polynomials at omega^i x
+        let advice_evals: Vec<_> = meta
+            .advice_queries
+            .iter()
+            .map(|&(column, at)| {
+                eval_polynomial(
+                    &advice.advice_polys[column.index()],
+                    domain.rotate_omega(*x, at),
+                )
+            })
+            .collect();
+
+        // Hash each advice column evaluation
+        for eval in advice_evals.iter() {
+            transcript
+                .write_scalar(*eval)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+    }
+
+    // Compute and hash fixed evals (shared across all circuit instances)
+    let fixed_evals: Vec<_> = meta
+        .fixed_queries
+        .iter()
+        .map(|&(column, at)| {
+            eval_polynomial(&pk.fixed_polys[column.index()], domain.rotate_omega(*x, at))
+        })
+        .collect();
+
+    // Hash each fixed column evaluation
+    for eval in fixed_evals.iter() {
+        transcript
+            .write_scalar(*eval)
+            .map_err(|_| Error::TranscriptError)?;
+    }
+
+    let vanishing = vanishing.evaluate(x, transcript)?;
+
+    // Evaluate the permutations, if any, at omega^i x.
+    let permutations: Vec<Vec<permutation::prover::Evaluated<C>>> = permutations
+        .into_iter()
+        .map(|permutations| -> Result<Vec<_>, _> {
+            permutations
+                .into_iter()
+                .zip(pk.permutations.iter())
+                .map(|(p, pkey)| p.evaluate(pk, pkey, x, transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Evaluate the lookups, if any, at omega^i x.
+    let lookups: Vec<Vec<lookup::prover::Evaluated<C>>> = lookups
+        .into_iter()
+        .map(|lookups| -> Result<Vec<_>, _> {
+            lookups
+                .into_iter()
+                .map(|p| p.evaluate(pk, x, transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let instances = instance
+        .iter()
+        .zip(advice.iter())
+        .zip(permutations.iter())
+        .zip(lookups.iter())
+        .flat_map(|(((instance, advice), permutations), lookups)| {
+            iter::empty()
+                .chain(
+                    pk.vk
+                        .cs
+                        .instance_queries
+                        .iter()
+                        .map(move |&(column, at)| ProverQuery {
+                            point: domain.rotate_omega(*x, at),
+                            poly: &instance.instance_polys[column.index()],
+                            blind: Blind::default(),
+                        }),
+                )
+                .chain(
+                    pk.vk
+                        .cs
+                        .advice_queries
+                        .iter()
+                        .map(move |&(column, at)| ProverQuery {
+                            point: domain.rotate_omega(*x, at),
+                            poly: &advice.advice_polys[column.index()],
+                            blind: advice.advice_blinds[column.index()],
+                        }),
+                )
+                .chain(
+                    permutations
+                        .iter()
+                        .zip(pk.permutations.iter())
+                        .flat_map(move |(p, pkey)| p.open(pk, pkey, x))
+                        .into_iter(),
+                )
+                .chain(lookups.iter().flat_map(move |p| p.open(pk, x)).into_iter())
+        })
+        .chain(
+            pk.vk
+                .cs
+                .fixed_queries
+                .iter()
+                .map(|&(column, at)| ProverQuery {
+                    point: domain.rotate_omega(*x, at),
+                    poly: &pk.fixed_polys[column.index()],
+                    blind: Blind::default(),
+                }),
+        )
+        // We query the h(X) polynomial at x
+        .chain(vanishing.open(x));
+
+    multiopen::create_proof(params, transcript, instances).map_err(|_| Error::OpeningError)
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/vanishing.rs.html b/rustdoc/latest/src/halo2/plonk/vanishing.rs.html new file mode 100644 index 00000000..97751288 --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/vanishing.rs.html @@ -0,0 +1,42 @@ +vanishing.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+
+use std::marker::PhantomData;
+
+use crate::arithmetic::CurveAffine;
+
+mod prover;
+mod verifier;
+
+/// A vanishing argument.
+pub(crate) struct Argument<C: CurveAffine> {
+    _marker: PhantomData<C>,
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/vanishing/prover.rs.html b/rustdoc/latest/src/halo2/plonk/vanishing/prover.rs.html new file mode 100644 index 00000000..a589a1fc --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/vanishing/prover.rs.html @@ -0,0 +1,238 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+
+use group::Curve;
+
+use super::super::{ChallengeX, ChallengeY};
+use super::Argument;
+use crate::{
+    arithmetic::{eval_polynomial, CurveAffine, FieldExt},
+    plonk::Error,
+    poly::{
+        commitment::{Blind, Params},
+        multiopen::ProverQuery,
+        Coeff, EvaluationDomain, ExtendedLagrangeCoeff, Polynomial,
+    },
+    transcript::{EncodedChallenge, TranscriptWrite},
+};
+
+pub(in crate::plonk) struct Constructed<C: CurveAffine> {
+    h_pieces: Vec<Polynomial<C::Scalar, Coeff>>,
+    h_blinds: Vec<Blind<C::Scalar>>,
+}
+
+pub(in crate::plonk) struct Evaluated<C: CurveAffine> {
+    constructed: Constructed<C>,
+}
+
+impl<C: CurveAffine> Argument<C> {
+    pub(in crate::plonk) fn construct<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+        params: &Params<C>,
+        domain: &EvaluationDomain<C::Scalar>,
+        expressions: impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>>,
+        y: ChallengeY<C>,
+        transcript: &mut T,
+    ) -> Result<Constructed<C>, Error> {
+        // Evaluate the h(X) polynomial's constraint system expressions for the constraints provided
+        let h_poly = expressions.fold(domain.empty_extended(), |h_poly, v| h_poly * *y + &v);
+
+        // Divide by t(X) = X^{params.n} - 1.
+        let h_poly = domain.divide_by_vanishing_poly(h_poly);
+
+        // Obtain final h(X) polynomial
+        let h_poly = domain.extended_to_coeff(h_poly);
+
+        // Split h(X) up into pieces
+        let h_pieces = h_poly
+            .chunks_exact(params.n as usize)
+            .map(|v| domain.coeff_from_vec(v.to_vec()))
+            .collect::<Vec<_>>();
+        drop(h_poly);
+        let h_blinds: Vec<_> = h_pieces.iter().map(|_| Blind(C::Scalar::rand())).collect();
+
+        // Compute commitments to each h(X) piece
+        let h_commitments_projective: Vec<_> = h_pieces
+            .iter()
+            .zip(h_blinds.iter())
+            .map(|(h_piece, blind)| params.commit(h_piece, *blind))
+            .collect();
+        let mut h_commitments = vec![C::identity(); h_commitments_projective.len()];
+        C::Curve::batch_normalize(&h_commitments_projective, &mut h_commitments);
+        let h_commitments = h_commitments;
+
+        // Hash each h(X) piece
+        for c in h_commitments.iter() {
+            transcript
+                .write_point(*c)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+
+        Ok(Constructed { h_pieces, h_blinds })
+    }
+}
+
+impl<C: CurveAffine> Constructed<C> {
+    pub(in crate::plonk) fn evaluate<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+        self,
+        x: ChallengeX<C>,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let h_evals: Vec<_> = self
+            .h_pieces
+            .iter()
+            .map(|poly| eval_polynomial(poly, *x))
+            .collect();
+
+        // Hash each advice evaluation
+        for eval in &h_evals {
+            transcript
+                .write_scalar(*eval)
+                .map_err(|_| Error::TranscriptError)?;
+        }
+
+        Ok(Evaluated { constructed: self })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn open(
+        &self,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = ProverQuery<'_, C>> + Clone {
+        self.constructed
+            .h_pieces
+            .iter()
+            .zip(self.constructed.h_blinds.iter())
+            .map(move |(h_poly, h_blind)| ProverQuery {
+                point: *x,
+                poly: h_poly,
+                blind: *h_blind,
+            })
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/vanishing/verifier.rs.html b/rustdoc/latest/src/halo2/plonk/vanishing/verifier.rs.html new file mode 100644 index 00000000..2786bf5f --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/vanishing/verifier.rs.html @@ -0,0 +1,194 @@ +verifier.rs - source + + + +
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
+use ff::Field;
+
+use crate::{
+    arithmetic::CurveAffine,
+    plonk::{Error, VerifyingKey},
+    poly::multiopen::VerifierQuery,
+    transcript::{read_n_points, read_n_scalars, EncodedChallenge, TranscriptRead},
+};
+
+use super::super::{ChallengeX, ChallengeY};
+use super::Argument;
+
+pub struct Committed<C: CurveAffine> {
+    h_commitments: Vec<C>,
+}
+
+pub struct Evaluated<C: CurveAffine> {
+    h_commitments: Vec<C>,
+    h_evals: Vec<C::Scalar>,
+}
+
+impl<C: CurveAffine> Argument<C> {
+    pub(in crate::plonk) fn read_commitments<E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+        vk: &VerifyingKey<C>,
+        transcript: &mut T,
+    ) -> Result<Committed<C>, Error> {
+        // Obtain a commitment to h(X) in the form of multiple pieces of degree n - 1
+        let h_commitments = read_n_points(transcript, vk.domain.get_quotient_poly_degree())
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Committed { h_commitments })
+    }
+}
+
+impl<C: CurveAffine> Committed<C> {
+    pub(in crate::plonk) fn evaluate<E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+        self,
+        transcript: &mut T,
+    ) -> Result<Evaluated<C>, Error> {
+        let h_evals = read_n_scalars(transcript, self.h_commitments.len())
+            .map_err(|_| Error::TranscriptError)?;
+
+        Ok(Evaluated {
+            h_commitments: self.h_commitments,
+            h_evals,
+        })
+    }
+}
+
+impl<C: CurveAffine> Evaluated<C> {
+    pub(in crate::plonk) fn verify(
+        &self,
+        expressions: impl Iterator<Item = C::Scalar>,
+        y: ChallengeY<C>,
+        xn: C::Scalar,
+    ) -> Result<(), Error> {
+        let expected_h_eval = expressions.fold(C::Scalar::zero(), |h_eval, v| h_eval * &*y + &v);
+
+        // Compute h(x) from the prover
+        let h_eval = self
+            .h_evals
+            .iter()
+            .rev()
+            .fold(C::Scalar::zero(), |acc, eval| acc * &xn + eval);
+
+        // Did the prover commit to the correct polynomial?
+        if expected_h_eval != (h_eval * &(xn - &C::Scalar::one())) {
+            return Err(Error::ConstraintSystemFailure);
+        }
+
+        Ok(())
+    }
+
+    pub(in crate::plonk) fn queries(
+        &self,
+        x: ChallengeX<C>,
+    ) -> impl Iterator<Item = VerifierQuery<'_, C>> + Clone {
+        self.h_commitments
+            .iter()
+            .zip(self.h_evals.iter())
+            .map(move |(commitment, &eval)| VerifierQuery {
+                point: *x,
+                commitment,
+                eval,
+            })
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/plonk/verifier.rs.html b/rustdoc/latest/src/halo2/plonk/verifier.rs.html new file mode 100644 index 00000000..bab924ea --- /dev/null +++ b/rustdoc/latest/src/halo2/plonk/verifier.rs.html @@ -0,0 +1,592 @@ +verifier.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+
+use ff::Field;
+use std::iter;
+
+use super::{
+    vanishing, ChallengeBeta, ChallengeGamma, ChallengeTheta, ChallengeX, ChallengeY, Error,
+    VerifyingKey,
+};
+use crate::arithmetic::{CurveAffine, FieldExt};
+use crate::poly::{
+    commitment::{Guard, Params, MSM},
+    multiopen::{self, VerifierQuery},
+};
+use crate::transcript::{read_n_points, read_n_scalars, EncodedChallenge, TranscriptRead};
+
+/// Returns a boolean indicating whether or not the proof is valid
+pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+    params: &'a Params<C>,
+    vk: &VerifyingKey<C>,
+    msm: MSM<'a, C>,
+    instance_commitments: &[&[C]],
+    transcript: &mut T,
+) -> Result<Guard<'a, C, E>, Error> {
+    // Check that instance_commitments matches the expected number of instance columns
+    for instance_commitments in instance_commitments.iter() {
+        if instance_commitments.len() != vk.cs.num_instance_columns {
+            return Err(Error::IncompatibleParams);
+        }
+    }
+
+    let num_proofs = instance_commitments.len();
+
+    // Hash verification key into transcript
+    vk.hash_into(transcript)
+        .map_err(|_| Error::TranscriptError)?;
+
+    for instance_commitments in instance_commitments.iter() {
+        // Hash the instance (external) commitments into the transcript
+        for commitment in *instance_commitments {
+            transcript
+                .common_point(*commitment)
+                .map_err(|_| Error::TranscriptError)?
+        }
+    }
+
+    let advice_commitments = (0..num_proofs)
+        .map(|_| -> Result<Vec<_>, _> {
+            // Hash the prover's advice commitments into the transcript
+            read_n_points(transcript, vk.cs.num_advice_columns).map_err(|_| Error::TranscriptError)
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Sample theta challenge for keeping lookup columns linearly independent
+    let theta: ChallengeTheta<_> = transcript.squeeze_challenge_scalar();
+
+    let lookups_permuted = (0..num_proofs)
+        .map(|_| -> Result<Vec<_>, _> {
+            // Hash each lookup permuted commitment
+            vk.cs
+                .lookups
+                .iter()
+                .map(|argument| argument.read_permuted_commitments(transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Sample beta challenge
+    let beta: ChallengeBeta<_> = transcript.squeeze_challenge_scalar();
+
+    // Sample gamma challenge
+    let gamma: ChallengeGamma<_> = transcript.squeeze_challenge_scalar();
+
+    let permutations_committed = (0..num_proofs)
+        .map(|_| -> Result<Vec<_>, _> {
+            // Hash each permutation product commitment
+            vk.cs
+                .permutations
+                .iter()
+                .map(|argument| argument.read_product_commitment(transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let lookups_committed = lookups_permuted
+        .into_iter()
+        .map(|lookups| {
+            // Hash each lookup product commitment
+            lookups
+                .into_iter()
+                .map(|lookup| lookup.read_product_commitment(transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // Sample y challenge, which keeps the gates linearly independent.
+    let y: ChallengeY<_> = transcript.squeeze_challenge_scalar();
+    let vanishing = vanishing::Argument::read_commitments(vk, transcript)?;
+
+    // Sample x challenge, which is used to ensure the circuit is
+    // satisfied with high probability.
+    let x: ChallengeX<_> = transcript.squeeze_challenge_scalar();
+    let instance_evals = (0..num_proofs)
+        .map(|_| -> Result<Vec<_>, _> {
+            read_n_scalars(transcript, vk.cs.instance_queries.len())
+                .map_err(|_| Error::TranscriptError)
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let advice_evals = (0..num_proofs)
+        .map(|_| -> Result<Vec<_>, _> {
+            read_n_scalars(transcript, vk.cs.advice_queries.len())
+                .map_err(|_| Error::TranscriptError)
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let fixed_evals = read_n_scalars(transcript, vk.cs.fixed_queries.len())
+        .map_err(|_| Error::TranscriptError)?;
+
+    let vanishing = vanishing.evaluate(transcript)?;
+
+    let permutations_evaluated = permutations_committed
+        .into_iter()
+        .map(|permutations| -> Result<Vec<_>, _> {
+            permutations
+                .into_iter()
+                .zip(vk.permutations.iter())
+                .map(|(permutation, vkey)| permutation.evaluate(vkey, transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    let lookups_evaluated = lookups_committed
+        .into_iter()
+        .map(|lookups| -> Result<Vec<_>, _> {
+            lookups
+                .into_iter()
+                .map(|lookup| lookup.evaluate(transcript))
+                .collect::<Result<Vec<_>, _>>()
+        })
+        .collect::<Result<Vec<_>, _>>()?;
+
+    // This check ensures the circuit is satisfied so long as the polynomial
+    // commitments open to the correct values.
+    {
+        // x^n
+        let xn = x.pow(&[params.n as u64, 0, 0, 0]);
+
+        // TODO: bubble this error up
+        // l_0(x)
+        let l_0 = (*x - &C::Scalar::one()).invert().unwrap() // 1 / (x - 1)
+            * &(xn - &C::Scalar::one()) // (x^n - 1) / (x - 1)
+            * &vk.domain.get_barycentric_weight(); // l_0(x)
+
+        // Compute the expected value of h(x)
+        let expressions = advice_evals
+            .iter()
+            .zip(instance_evals.iter())
+            .zip(permutations_evaluated.iter())
+            .zip(lookups_evaluated.iter())
+            .flat_map(
+                |(((advice_evals, instance_evals), permutations), lookups)| {
+                    let fixed_evals = fixed_evals.clone();
+                    let fixed_evals_copy = fixed_evals.clone();
+                    let fixed_evals_copy_copy = fixed_evals.clone();
+
+                    std::iter::empty()
+                        // Evaluate the circuit using the custom gates provided
+                        .chain(vk.cs.gates.iter().flat_map(move |gate| {
+                            let fixed_evals = fixed_evals.clone();
+
+                            gate.polynomials().iter().map(move |poly| {
+                                poly.evaluate(
+                                    &|scalar| scalar,
+                                    &|index| fixed_evals[index],
+                                    &|index| advice_evals[index],
+                                    &|index| instance_evals[index],
+                                    &|a, b| a + &b,
+                                    &|a, b| a * &b,
+                                    &|a, scalar| a * &scalar,
+                                )
+                            })
+                        }))
+                        .chain(
+                            permutations
+                                .iter()
+                                .zip(vk.cs.permutations.iter())
+                                .flat_map(move |(p, argument)| {
+                                    p.expressions(
+                                        vk,
+                                        argument,
+                                        advice_evals,
+                                        &fixed_evals_copy,
+                                        instance_evals,
+                                        l_0,
+                                        beta,
+                                        gamma,
+                                        x,
+                                    )
+                                })
+                                .into_iter(),
+                        )
+                        .chain(
+                            lookups
+                                .iter()
+                                .zip(vk.cs.lookups.iter())
+                                .flat_map(move |(p, argument)| {
+                                    p.expressions(
+                                        l_0,
+                                        argument,
+                                        theta,
+                                        beta,
+                                        gamma,
+                                        advice_evals,
+                                        &fixed_evals_copy_copy,
+                                        instance_evals,
+                                    )
+                                })
+                                .into_iter(),
+                        )
+                },
+            );
+
+        vanishing.verify(expressions, y, xn)?;
+    }
+
+    let queries = instance_commitments
+        .iter()
+        .zip(instance_evals.iter())
+        .zip(advice_commitments.iter())
+        .zip(advice_evals.iter())
+        .zip(permutations_evaluated.iter())
+        .zip(lookups_evaluated.iter())
+        .flat_map(
+            |(
+                (
+                    (((instance_commitments, instance_evals), advice_commitments), advice_evals),
+                    permutations,
+                ),
+                lookups,
+            )| {
+                iter::empty()
+                    .chain(vk.cs.instance_queries.iter().enumerate().map(
+                        move |(query_index, &(column, at))| VerifierQuery {
+                            point: vk.domain.rotate_omega(*x, at),
+                            commitment: &instance_commitments[column.index()],
+                            eval: instance_evals[query_index],
+                        },
+                    ))
+                    .chain(vk.cs.advice_queries.iter().enumerate().map(
+                        move |(query_index, &(column, at))| VerifierQuery {
+                            point: vk.domain.rotate_omega(*x, at),
+                            commitment: &advice_commitments[column.index()],
+                            eval: advice_evals[query_index],
+                        },
+                    ))
+                    .chain(
+                        permutations
+                            .iter()
+                            .zip(vk.permutations.iter())
+                            .flat_map(move |(p, vkey)| p.queries(vk, vkey, x))
+                            .into_iter(),
+                    )
+                    .chain(
+                        lookups
+                            .iter()
+                            .flat_map(move |p| p.queries(vk, x))
+                            .into_iter(),
+                    )
+            },
+        )
+        .chain(
+            vk.cs
+                .fixed_queries
+                .iter()
+                .enumerate()
+                .map(|(query_index, &(column, at))| VerifierQuery {
+                    point: vk.domain.rotate_omega(*x, at),
+                    commitment: &vk.fixed_commitments[column.index()],
+                    eval: fixed_evals[query_index],
+                }),
+        )
+        .chain(vanishing.queries(x));
+
+    // We are now convinced the circuit is satisfied so long as the
+    // polynomial commitments open to the correct values.
+    multiopen::verify_proof(params, transcript, queries, msm).map_err(|_| Error::OpeningError)
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly.rs.html b/rustdoc/latest/src/halo2/poly.rs.html new file mode 100644 index 00000000..0e7d2e81 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly.rs.html @@ -0,0 +1,618 @@ +poly.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+
+//! Contains utilities for performing arithmetic over univariate polynomials in
+//! various forms, including computing commitments to them and provably opening
+//! the committed polynomials at arbitrary points.
+
+use crate::arithmetic::parallelize;
+use crate::arithmetic::BatchInvert;
+use crate::plonk::Assigned;
+
+use ff::Field;
+use pasta_curves::arithmetic::FieldExt;
+use std::fmt::Debug;
+use std::marker::PhantomData;
+use std::ops::{Add, Deref, DerefMut, Index, IndexMut, Mul, RangeFrom, RangeFull, Sub};
+
+pub mod commitment;
+mod domain;
+pub mod multiopen;
+
+pub use domain::*;
+
+/// This is an error that could occur during proving or circuit synthesis.
+// TODO: these errors need to be cleaned up
+#[derive(Debug)]
+pub enum Error {
+    /// OpeningProof is not well-formed
+    OpeningError,
+    /// Caller needs to re-sample a point
+    SamplingError,
+}
+
+/// The basis over which a polynomial is described.
+pub trait Basis: Clone + Debug + Send + Sync {}
+
+/// The polynomial is defined as coefficients
+#[derive(Clone, Debug)]
+pub struct Coeff;
+impl Basis for Coeff {}
+
+/// The polynomial is defined as coefficients of Lagrange basis polynomials
+#[derive(Clone, Debug)]
+pub struct LagrangeCoeff;
+impl Basis for LagrangeCoeff {}
+
+/// The polynomial is defined as coefficients of Lagrange basis polynomials in
+/// an extended size domain which supports multiplication
+#[derive(Clone, Debug)]
+pub struct ExtendedLagrangeCoeff;
+impl Basis for ExtendedLagrangeCoeff {}
+
+/// Represents a univariate polynomial defined over a field and a particular
+/// basis.
+#[derive(Clone, Debug)]
+pub struct Polynomial<F, B> {
+    values: Vec<F>,
+    _marker: PhantomData<B>,
+}
+
+impl<F, B> Index<usize> for Polynomial<F, B> {
+    type Output = F;
+
+    fn index(&self, index: usize) -> &F {
+        self.values.index(index)
+    }
+}
+
+impl<F, B> IndexMut<usize> for Polynomial<F, B> {
+    fn index_mut(&mut self, index: usize) -> &mut F {
+        self.values.index_mut(index)
+    }
+}
+
+impl<F, B> Index<RangeFrom<usize>> for Polynomial<F, B> {
+    type Output = [F];
+
+    fn index(&self, index: RangeFrom<usize>) -> &[F] {
+        self.values.index(index)
+    }
+}
+
+impl<F, B> IndexMut<RangeFrom<usize>> for Polynomial<F, B> {
+    fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut [F] {
+        self.values.index_mut(index)
+    }
+}
+
+impl<F, B> Index<RangeFull> for Polynomial<F, B> {
+    type Output = [F];
+
+    fn index(&self, index: RangeFull) -> &[F] {
+        self.values.index(index)
+    }
+}
+
+impl<F, B> IndexMut<RangeFull> for Polynomial<F, B> {
+    fn index_mut(&mut self, index: RangeFull) -> &mut [F] {
+        self.values.index_mut(index)
+    }
+}
+
+impl<F, B> Deref for Polynomial<F, B> {
+    type Target = [F];
+
+    fn deref(&self) -> &[F] {
+        &self.values[..]
+    }
+}
+
+impl<F, B> DerefMut for Polynomial<F, B> {
+    fn deref_mut(&mut self) -> &mut [F] {
+        &mut self.values[..]
+    }
+}
+
+impl<F, B> Polynomial<F, B> {
+    /// Iterate over the values, which are either in coefficient or evaluation
+    /// form depending on the basis `B`.
+    pub fn iter(&self) -> impl Iterator<Item = &F> {
+        self.values.iter()
+    }
+
+    /// Iterate over the values mutably, which are either in coefficient or
+    /// evaluation form depending on the basis `B`.
+    pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut F> {
+        self.values.iter_mut()
+    }
+
+    /// Gets the size of this polynomial in terms of the number of
+    /// coefficients used to describe it.
+    pub fn num_coeffs(&self) -> usize {
+        self.values.len()
+    }
+}
+
+pub(crate) fn batch_invert_assigned<F: FieldExt>(
+    assigned: &[Polynomial<Assigned<F>, LagrangeCoeff>],
+) -> Vec<Polynomial<F, LagrangeCoeff>> {
+    let mut assigned_denominators: Vec<_> = assigned
+        .iter()
+        .map(|f| {
+            f.iter()
+                .map(|value| value.denominator())
+                .collect::<Vec<_>>()
+        })
+        .collect();
+
+    assigned_denominators
+        .iter_mut()
+        .flat_map(|f| {
+            f.iter_mut()
+                // If the denominator is trivial, we can skip it, reducing the
+                // size of the batch inversion.
+                .filter_map(|d| d.as_mut())
+        })
+        .batch_invert();
+
+    assigned
+        .iter()
+        .zip(assigned_denominators.into_iter())
+        .map(|(poly, inv_denoms)| {
+            poly.invert(inv_denoms.into_iter().map(|d| d.unwrap_or_else(F::one)))
+        })
+        .collect()
+}
+
+impl<F: Field> Polynomial<Assigned<F>, LagrangeCoeff> {
+    pub(crate) fn invert(
+        &self,
+        inv_denoms: impl Iterator<Item = F> + ExactSizeIterator,
+    ) -> Polynomial<F, LagrangeCoeff> {
+        assert_eq!(inv_denoms.len(), self.values.len());
+        Polynomial {
+            values: self
+                .values
+                .iter()
+                .zip(inv_denoms.into_iter())
+                .map(|(a, inv_den)| a.numerator() * inv_den)
+                .collect(),
+            _marker: self._marker,
+        }
+    }
+}
+
+impl<F: Field> Polynomial<F, ExtendedLagrangeCoeff> {
+    /// Maps every coefficient `c` in `p` to `1 - c`.
+    pub fn one_minus(mut p: Self) -> Self {
+        parallelize(&mut p.values, |p, _start| {
+            for term in p {
+                *term = F::one() - *term;
+            }
+        });
+        p
+    }
+}
+
+impl<'a, F: Field, B: Basis> Add<&'a Polynomial<F, B>> for Polynomial<F, B> {
+    type Output = Polynomial<F, B>;
+
+    fn add(mut self, rhs: &'a Polynomial<F, B>) -> Polynomial<F, B> {
+        parallelize(&mut self.values, |lhs, start| {
+            for (lhs, rhs) in lhs.iter_mut().zip(rhs.values[start..].iter()) {
+                *lhs += *rhs;
+            }
+        });
+
+        self
+    }
+}
+
+impl<'a, F: Field, B: Basis> Sub<&'a Polynomial<F, B>> for Polynomial<F, B> {
+    type Output = Polynomial<F, B>;
+
+    fn sub(mut self, rhs: &'a Polynomial<F, B>) -> Polynomial<F, B> {
+        parallelize(&mut self.values, |lhs, start| {
+            for (lhs, rhs) in lhs.iter_mut().zip(rhs.values[start..].iter()) {
+                *lhs -= *rhs;
+            }
+        });
+
+        self
+    }
+}
+
+impl<'a, F: Field> Mul<&'a Polynomial<F, ExtendedLagrangeCoeff>>
+    for Polynomial<F, ExtendedLagrangeCoeff>
+{
+    type Output = Polynomial<F, ExtendedLagrangeCoeff>;
+
+    fn mul(
+        mut self,
+        rhs: &'a Polynomial<F, ExtendedLagrangeCoeff>,
+    ) -> Polynomial<F, ExtendedLagrangeCoeff> {
+        parallelize(&mut self.values, |lhs, start| {
+            for (lhs, rhs) in lhs.iter_mut().zip(rhs.values[start..].iter()) {
+                *lhs *= *rhs;
+            }
+        });
+
+        self
+    }
+}
+
+impl<'a, F: Field> Polynomial<F, LagrangeCoeff> {
+    /// Rotates the values in a Lagrange basis polynomial by `Rotation`
+    pub fn rotate(&self, rotation: Rotation) -> Polynomial<F, LagrangeCoeff> {
+        let mut values = self.values.clone();
+        if rotation.0 < 0 {
+            values.rotate_right((-rotation.0) as usize);
+        } else {
+            values.rotate_left(rotation.0 as usize);
+        }
+        Polynomial {
+            values,
+            _marker: PhantomData,
+        }
+    }
+}
+
+impl<'a, F: Field, B: Basis> Mul<F> for Polynomial<F, B> {
+    type Output = Polynomial<F, B>;
+
+    fn mul(mut self, rhs: F) -> Polynomial<F, B> {
+        parallelize(&mut self.values, |lhs, _| {
+            for lhs in lhs.iter_mut() {
+                *lhs *= rhs;
+            }
+        });
+
+        self
+    }
+}
+
+/// Describes the relative rotation of a vector. Negative numbers represent
+/// reverse (leftmost) rotations and positive numbers represent forward (rightmost)
+/// rotations. Zero represents no rotation.
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub struct Rotation(pub i32);
+
+impl Default for Rotation {
+    fn default() -> Rotation {
+        Rotation(0)
+    }
+}
+
+impl Rotation {
+    /// The current location in the evaluation domain
+    pub fn cur() -> Rotation {
+        Rotation(0)
+    }
+
+    /// The previous location in the evaluation domain
+    pub fn prev() -> Rotation {
+        Rotation(-1)
+    }
+
+    /// The next location in the evaluation domain
+    pub fn next() -> Rotation {
+        Rotation(1)
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/commitment.rs.html b/rustdoc/latest/src/halo2/poly/commitment.rs.html new file mode 100644 index 00000000..c8f5734e --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/commitment.rs.html @@ -0,0 +1,756 @@ +commitment.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+
+//! This module contains an implementation of the polynomial commitment scheme
+//! described in the [Halo][halo] paper.
+//!
+//! [halo]: https://eprint.iacr.org/2019/1021
+
+use super::{Coeff, LagrangeCoeff, Polynomial};
+use crate::arithmetic::{
+    best_fft, best_multiexp, parallelize, CurveAffine, CurveExt, FieldExt, Group,
+};
+
+use ff::{Field, PrimeField};
+use group::{prime::PrimeCurveAffine, Curve, Group as _};
+use std::ops::{Add, AddAssign, Mul, MulAssign};
+
+mod msm;
+mod prover;
+mod verifier;
+
+pub use msm::MSM;
+pub use prover::create_proof;
+pub use verifier::{verify_proof, Accumulator, Guard};
+
+use std::io;
+
+/// These are the public parameters for the polynomial commitment scheme.
+#[derive(Debug)]
+pub struct Params<C: CurveAffine> {
+    pub(crate) k: u32,
+    pub(crate) n: u64,
+    pub(crate) g: Vec<C>,
+    pub(crate) g_lagrange: Vec<C>,
+    pub(crate) h: C,
+    pub(crate) u: C,
+}
+
+impl<C: CurveAffine> Params<C> {
+    /// Initializes parameters for the curve, given a random oracle to draw
+    /// points from.
+    pub fn new(k: u32) -> Self {
+        // This is usually a limitation on the curve, but we also want 32-bit
+        // architectures to be supported.
+        assert!(k < 32);
+
+        // In src/arithmetic/fields.rs we ensure that usize is at least 32 bits.
+
+        let n: u64 = 1 << k;
+
+        let g_projective = {
+            let mut g = Vec::with_capacity(n as usize);
+            g.resize(n as usize, C::Curve::identity());
+
+            parallelize(&mut g, move |g, start| {
+                let hasher = C::CurveExt::hash_to_curve("Halo2-Parameters");
+
+                for (i, g) in g.iter_mut().enumerate() {
+                    let i = (i + start) as u32;
+
+                    let mut message = [0u8; 5];
+                    message[1..5].copy_from_slice(&i.to_le_bytes());
+
+                    *g = hasher(&message);
+                }
+            });
+
+            g
+        };
+
+        let g = {
+            let mut g = vec![C::identity(); n as usize];
+            parallelize(&mut g, |g, starts| {
+                C::Curve::batch_normalize(&g_projective[starts..(starts + g.len())], g);
+            });
+            g
+        };
+
+        // Let's evaluate all of the Lagrange basis polynomials
+        // using an inverse FFT.
+        let mut alpha_inv = <<C as PrimeCurveAffine>::Curve as Group>::Scalar::ROOT_OF_UNITY_INV;
+        for _ in k..C::Scalar::S {
+            alpha_inv = alpha_inv.square();
+        }
+        let mut g_lagrange_projective = g_projective;
+        best_fft(&mut g_lagrange_projective, alpha_inv, k);
+        let minv = C::Scalar::TWO_INV.pow_vartime(&[k as u64, 0, 0, 0]);
+        parallelize(&mut g_lagrange_projective, |g, _| {
+            for g in g.iter_mut() {
+                *g *= minv;
+            }
+        });
+
+        let g_lagrange = {
+            let mut g_lagrange = vec![C::identity(); n as usize];
+            parallelize(&mut g_lagrange, |g_lagrange, starts| {
+                C::Curve::batch_normalize(
+                    &g_lagrange_projective[starts..(starts + g_lagrange.len())],
+                    g_lagrange,
+                );
+            });
+            drop(g_lagrange_projective);
+            g_lagrange
+        };
+
+        let hasher = C::CurveExt::hash_to_curve("Halo2-Parameters");
+        let h = hasher(&[1]).to_affine();
+        let u = hasher(&[2]).to_affine();
+
+        Params {
+            k,
+            n,
+            g,
+            g_lagrange,
+            h,
+            u,
+        }
+    }
+
+    /// This computes a commitment to a polynomial described by the provided
+    /// slice of coefficients. The commitment will be blinded by the blinding
+    /// factor `r`.
+    pub fn commit(&self, poly: &Polynomial<C::Scalar, Coeff>, r: Blind<C::Scalar>) -> C::Curve {
+        let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
+        let mut tmp_bases = Vec::with_capacity(poly.len() + 1);
+
+        tmp_scalars.extend(poly.iter());
+        tmp_scalars.push(r.0);
+
+        tmp_bases.extend(self.g.iter());
+        tmp_bases.push(self.h);
+
+        best_multiexp::<C>(&tmp_scalars, &tmp_bases)
+    }
+
+    /// This commits to a polynomial using its evaluations over the $2^k$ size
+    /// evaluation domain. The commitment will be blinded by the blinding factor
+    /// `r`.
+    pub fn commit_lagrange(
+        &self,
+        poly: &Polynomial<C::Scalar, LagrangeCoeff>,
+        r: Blind<C::Scalar>,
+    ) -> C::Curve {
+        let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
+        let mut tmp_bases = Vec::with_capacity(poly.len() + 1);
+
+        tmp_scalars.extend(poly.iter());
+        tmp_scalars.push(r.0);
+
+        tmp_bases.extend(self.g_lagrange.iter());
+        tmp_bases.push(self.h);
+
+        best_multiexp::<C>(&tmp_scalars, &tmp_bases)
+    }
+
+    /// Generates an empty multiscalar multiplication struct using the
+    /// appropriate params.
+    pub fn empty_msm(&self) -> MSM<C> {
+        MSM::new(self)
+    }
+
+    /// Getter for g generators
+    pub fn get_g(&self) -> Vec<C> {
+        self.g.clone()
+    }
+
+    /// Writes params to a buffer.
+    pub fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
+        writer.write_all(&self.k.to_le_bytes())?;
+        for g_element in &self.g {
+            writer.write_all(g_element.to_bytes().as_ref())?;
+        }
+        for g_lagrange_element in &self.g_lagrange {
+            writer.write_all(g_lagrange_element.to_bytes().as_ref())?;
+        }
+        writer.write_all(self.h.to_bytes().as_ref())?;
+        writer.write_all(self.u.to_bytes().as_ref())?;
+
+        Ok(())
+    }
+
+    /// Reads params from a buffer.
+    pub fn read<R: io::Read>(reader: &mut R) -> io::Result<Self> {
+        let mut k = [0u8; 4];
+        reader.read_exact(&mut k[..])?;
+        let k = u32::from_le_bytes(k);
+
+        let n: u64 = 1 << k;
+
+        let g: Vec<_> = (0..n).map(|_| C::read(reader)).collect::<Result<_, _>>()?;
+        let g_lagrange: Vec<_> = (0..n).map(|_| C::read(reader)).collect::<Result<_, _>>()?;
+
+        let h = C::read(reader)?;
+        let u = C::read(reader)?;
+
+        Ok(Params {
+            k,
+            n,
+            g,
+            g_lagrange,
+            h,
+            u,
+        })
+    }
+}
+
+/// Wrapper type around a blinding factor.
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
+pub struct Blind<F>(pub F);
+
+impl<F: FieldExt> Default for Blind<F> {
+    fn default() -> Self {
+        Blind(F::one())
+    }
+}
+
+impl<F: FieldExt> Add for Blind<F> {
+    type Output = Self;
+
+    fn add(self, rhs: Blind<F>) -> Self {
+        Blind(self.0 + rhs.0)
+    }
+}
+
+impl<F: FieldExt> Mul for Blind<F> {
+    type Output = Self;
+
+    fn mul(self, rhs: Blind<F>) -> Self {
+        Blind(self.0 * rhs.0)
+    }
+}
+
+impl<F: FieldExt> AddAssign for Blind<F> {
+    fn add_assign(&mut self, rhs: Blind<F>) {
+        self.0 += rhs.0;
+    }
+}
+
+impl<F: FieldExt> MulAssign for Blind<F> {
+    fn mul_assign(&mut self, rhs: Blind<F>) {
+        self.0 *= rhs.0;
+    }
+}
+
+impl<F: FieldExt> AddAssign<F> for Blind<F> {
+    fn add_assign(&mut self, rhs: F) {
+        self.0 += rhs;
+    }
+}
+
+impl<F: FieldExt> MulAssign<F> for Blind<F> {
+    fn mul_assign(&mut self, rhs: F) {
+        self.0 *= rhs;
+    }
+}
+
+#[test]
+fn test_commit_lagrange_epaffine() {
+    const K: u32 = 6;
+
+    use crate::pasta::{EpAffine, Fq};
+    let params = Params::<EpAffine>::new(K);
+    let domain = super::EvaluationDomain::new(1, K);
+
+    let mut a = domain.empty_lagrange();
+
+    for (i, a) in a.iter_mut().enumerate() {
+        *a = Fq::from(i as u64);
+    }
+
+    let b = domain.lagrange_to_coeff(a.clone());
+
+    let alpha = Blind(Fq::rand());
+
+    assert_eq!(params.commit(&b, alpha), params.commit_lagrange(&a, alpha));
+}
+
+#[test]
+fn test_commit_lagrange_eqaffine() {
+    const K: u32 = 6;
+
+    use crate::pasta::{EqAffine, Fp};
+    let params = Params::<EqAffine>::new(K);
+    let domain = super::EvaluationDomain::new(1, K);
+
+    let mut a = domain.empty_lagrange();
+
+    for (i, a) in a.iter_mut().enumerate() {
+        *a = Fp::from(i as u64);
+    }
+
+    let b = domain.lagrange_to_coeff(a.clone());
+
+    let alpha = Blind(Fp::rand());
+
+    assert_eq!(params.commit(&b, alpha), params.commit_lagrange(&a, alpha));
+}
+
+#[test]
+fn test_opening_proof() {
+    const K: u32 = 6;
+
+    use ff::Field;
+
+    use super::{
+        commitment::{Blind, Params},
+        EvaluationDomain,
+    };
+    use crate::arithmetic::{eval_polynomial, FieldExt};
+    use crate::pasta::{EpAffine, Fq};
+    use crate::transcript::{
+        Blake2bRead, Blake2bWrite, Challenge255, Transcript, TranscriptRead, TranscriptWrite,
+    };
+
+    let params = Params::<EpAffine>::new(K);
+    let mut params_buffer = vec![];
+    params.write(&mut params_buffer).unwrap();
+    let params: Params<EpAffine> = Params::read::<_>(&mut &params_buffer[..]).unwrap();
+
+    let domain = EvaluationDomain::new(1, K);
+
+    let mut px = domain.empty_coeff();
+
+    for (i, a) in px.iter_mut().enumerate() {
+        *a = Fq::from(i as u64);
+    }
+
+    let blind = Blind(Fq::rand());
+
+    let p = params.commit(&px, blind).to_affine();
+
+    let mut transcript = Blake2bWrite::<Vec<u8>, EpAffine, Challenge255<EpAffine>>::init(vec![]);
+    transcript.write_point(p).unwrap();
+    let x = transcript.squeeze_challenge_scalar::<()>();
+    // Evaluate the polynomial
+    let v = eval_polynomial(&px, *x);
+    transcript.write_scalar(v).unwrap();
+
+    let (proof, ch_prover) = {
+        create_proof(&params, &mut transcript, &px, blind, *x).unwrap();
+        let ch_prover = transcript.squeeze_challenge();
+        (transcript.finalize(), ch_prover)
+    };
+
+    // Verify the opening proof
+    let mut transcript = Blake2bRead::<&[u8], EpAffine, Challenge255<EpAffine>>::init(&proof[..]);
+    let p_prime = transcript.read_point().unwrap();
+    assert_eq!(p, p_prime);
+    let x_prime = transcript.squeeze_challenge_scalar::<()>();
+    assert_eq!(*x, *x_prime);
+    let v_prime = transcript.read_scalar().unwrap();
+    assert_eq!(v, v_prime);
+
+    let mut commitment_msm = params.empty_msm();
+    commitment_msm.append_term(Field::one(), p);
+    let guard = verify_proof(&params, commitment_msm, &mut transcript, *x, v).unwrap();
+    let ch_verifier = transcript.squeeze_challenge();
+    assert_eq!(*ch_prover, *ch_verifier);
+
+    // Test guard behavior prior to checking another proof
+    {
+        // Test use_challenges()
+        let msm_challenges = guard.clone().use_challenges();
+        assert!(msm_challenges.eval());
+
+        // Test use_g()
+        let g = guard.compute_g();
+        let (msm_g, _accumulator) = guard.clone().use_g(g);
+        assert!(msm_g.eval());
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/commitment/msm.rs.html b/rustdoc/latest/src/halo2/poly/commitment/msm.rs.html new file mode 100644 index 00000000..b0bdc0c2 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/commitment/msm.rs.html @@ -0,0 +1,318 @@ +msm.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+
+use super::Params;
+use crate::arithmetic::{best_multiexp, parallelize, CurveAffine};
+use ff::Field;
+use group::Group;
+
+/// A multiscalar multiplication in the polynomial commitment scheme
+#[derive(Debug, Clone)]
+pub struct MSM<'a, C: CurveAffine> {
+    pub(crate) params: &'a Params<C>,
+    g_scalars: Option<Vec<C::Scalar>>,
+    h_scalar: Option<C::Scalar>,
+    u_scalar: Option<C::Scalar>,
+    other_scalars: Vec<C::Scalar>,
+    other_bases: Vec<C>,
+}
+
+impl<'a, C: CurveAffine> MSM<'a, C> {
+    /// Create a new, empty MSM using the provided parameters.
+    pub fn new(params: &'a Params<C>) -> Self {
+        let g_scalars = None;
+        let h_scalar = None;
+        let u_scalar = None;
+        let other_scalars = vec![];
+        let other_bases = vec![];
+
+        MSM {
+            params,
+            g_scalars,
+            h_scalar,
+            u_scalar,
+            other_scalars,
+            other_bases,
+        }
+    }
+
+    /// Add another multiexp into this one
+    pub fn add_msm(&mut self, other: &Self) {
+        self.other_scalars.extend(other.other_scalars.iter());
+        self.other_bases.extend(other.other_bases.iter());
+
+        if let Some(g_scalars) = &other.g_scalars {
+            self.add_to_g_scalars(g_scalars);
+        }
+
+        if let Some(h_scalar) = &other.h_scalar {
+            self.add_to_h_scalar(*h_scalar);
+        }
+
+        if let Some(u_scalar) = &other.u_scalar {
+            self.add_to_u_scalar(*u_scalar);
+        }
+    }
+
+    /// Add arbitrary term (the scalar and the point)
+    pub fn append_term(&mut self, scalar: C::Scalar, point: C) {
+        self.other_scalars.push(scalar);
+        self.other_bases.push(point);
+    }
+
+    /// Add a value to the first entry of `g_scalars`.
+    pub fn add_constant_term(&mut self, constant: C::Scalar) {
+        if let Some(g_scalars) = self.g_scalars.as_mut() {
+            g_scalars[0] += &constant;
+        } else {
+            let mut g_scalars = vec![C::Scalar::zero(); self.params.n as usize];
+            g_scalars[0] += &constant;
+            self.g_scalars = Some(g_scalars);
+        }
+    }
+
+    /// Add a vector of scalars to `g_scalars`. This function will panic if the
+    /// caller provides a slice of scalars that is not of length `params.n`.
+    pub fn add_to_g_scalars(&mut self, scalars: &[C::Scalar]) {
+        assert_eq!(scalars.len(), self.params.n as usize);
+        if let Some(g_scalars) = &mut self.g_scalars {
+            parallelize(g_scalars, |g_scalars, start| {
+                for (g_scalar, scalar) in g_scalars.iter_mut().zip(scalars[start..].iter()) {
+                    *g_scalar += scalar;
+                }
+            })
+        } else {
+            self.g_scalars = Some(scalars.to_vec());
+        }
+    }
+
+    /// Add to `h_scalar`
+    pub fn add_to_h_scalar(&mut self, scalar: C::Scalar) {
+        self.h_scalar = self.h_scalar.map_or(Some(scalar), |a| Some(a + &scalar));
+    }
+
+    /// Add to `u_scalar`
+    pub fn add_to_u_scalar(&mut self, scalar: C::Scalar) {
+        self.u_scalar = self.u_scalar.map_or(Some(scalar), |a| Some(a + &scalar));
+    }
+
+    /// Scale all scalars in the MSM by some scaling factor
+    pub fn scale(&mut self, factor: C::Scalar) {
+        if let Some(g_scalars) = &mut self.g_scalars {
+            parallelize(g_scalars, |g_scalars, _| {
+                for g_scalar in g_scalars {
+                    *g_scalar *= &factor;
+                }
+            })
+        }
+
+        if !self.other_scalars.is_empty() {
+            parallelize(&mut self.other_scalars, |other_scalars, _| {
+                for other_scalar in other_scalars {
+                    *other_scalar *= &factor;
+                }
+            })
+        }
+
+        self.h_scalar = self.h_scalar.map(|a| a * &factor);
+        self.u_scalar = self.u_scalar.map(|a| a * &factor);
+    }
+
+    /// Perform multiexp and check that it results in zero
+    pub fn eval(self) -> bool {
+        let len = self.g_scalars.as_ref().map(|v| v.len()).unwrap_or(0)
+            + self.h_scalar.map(|_| 1).unwrap_or(0)
+            + self.u_scalar.map(|_| 1).unwrap_or(0)
+            + self.other_scalars.len();
+        let mut scalars: Vec<C::Scalar> = Vec::with_capacity(len);
+        let mut bases: Vec<C> = Vec::with_capacity(len);
+
+        scalars.extend(&self.other_scalars);
+        bases.extend(&self.other_bases);
+
+        if let Some(h_scalar) = self.h_scalar {
+            scalars.push(h_scalar);
+            bases.push(self.params.h);
+        }
+
+        if let Some(u_scalar) = self.u_scalar {
+            scalars.push(u_scalar);
+            bases.push(self.params.u);
+        }
+
+        if let Some(g_scalars) = &self.g_scalars {
+            scalars.extend(g_scalars);
+            bases.extend(self.params.g.iter());
+        }
+
+        assert_eq!(scalars.len(), len);
+
+        bool::from(best_multiexp(&scalars, &bases).is_identity())
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/commitment/prover.rs.html b/rustdoc/latest/src/halo2/poly/commitment/prover.rs.html new file mode 100644 index 00000000..1b594e44 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/commitment/prover.rs.html @@ -0,0 +1,332 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+
+use ff::Field;
+
+use super::super::{Coeff, Polynomial};
+use super::{Blind, Params};
+use crate::arithmetic::{
+    best_multiexp, compute_inner_product, eval_polynomial, parallelize, CurveAffine, FieldExt,
+};
+use crate::transcript::{EncodedChallenge, TranscriptWrite};
+
+use group::Curve;
+use std::io;
+
+/// Create a polynomial commitment opening proof for the polynomial defined
+/// by the coefficients `px`, the blinding factor `blind` used for the
+/// polynomial commitment, and the point `x` that the polynomial is
+/// evaluated at.
+///
+/// This function will panic if the provided polynomial is too large with
+/// respect to the polynomial commitment parameters.
+///
+/// **Important:** This function assumes that the provided `transcript` has
+/// already seen the common inputs: the polynomial commitment P, the claimed
+/// opening v, and the point x. It's probably also nice for the transcript
+/// to have seen the elliptic curve description and the URS, if you want to
+/// be rigorous.
+pub fn create_proof<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+    params: &Params<C>,
+    transcript: &mut T,
+    px: &Polynomial<C::Scalar, Coeff>,
+    blind: Blind<C::Scalar>,
+    x: C::Scalar,
+) -> io::Result<()> {
+    // We're limited to polynomials of degree n - 1.
+    assert!(px.len() <= params.n as usize);
+
+    // Sample a random polynomial (of same degree) that has a root at x, first
+    // by setting all coefficients to random values.
+    let mut s_poly = (*px).clone();
+    for coeff in s_poly.iter_mut() {
+        *coeff = C::Scalar::rand();
+    }
+    // Evaluate the random polynomial at x
+    let v_prime = eval_polynomial(&s_poly[..], x);
+    // Subtract constant coefficient to get a random polynomial with a root at x
+    s_poly[0] = s_poly[0] - &v_prime;
+    // And sample a random blind
+    let s_poly_blind = Blind(C::Scalar::rand());
+
+    // Write a commitment to the random polynomial to the transcript
+    let s_poly_commitment = params.commit(&s_poly, s_poly_blind).to_affine();
+    transcript.write_point(s_poly_commitment)?;
+
+    // Challenge that will ensure that the prover cannot change P but can only
+    // witness a random polynomial commitment that agrees with P at x, with high
+    // probability.
+    let iota = *transcript.squeeze_challenge_scalar::<()>();
+
+    // Challenge that ensures that the prover did not interfere with the U term
+    // in their commitments.
+    let z = *transcript.squeeze_challenge_scalar::<()>();
+
+    // We'll be opening `s_poly_commitment * iota + P - [v] G_0` to ensure it
+    // has a root at zero.
+    let mut final_poly = s_poly * iota + px;
+    let v = eval_polynomial(&final_poly, x);
+    final_poly[0] = final_poly[0] - &v;
+    let blind = s_poly_blind * Blind(iota) + blind;
+    let mut blind = blind.0;
+
+    // Initialize the vector `a` as the coefficients of the polynomial,
+    // rounding up to the parameters.
+    let mut a = final_poly.values;
+    a.resize(params.n as usize, C::Scalar::zero());
+
+    // Initialize the vector `b` as the powers of `x`. The inner product of
+    // `a` and `b` is the evaluation of the polynomial at `x`.
+    let mut b = Vec::with_capacity(1 << params.k);
+    {
+        let mut cur = C::Scalar::one();
+        for _ in 0..(1 << params.k) {
+            b.push(cur);
+            cur *= &x;
+        }
+    }
+
+    // Initialize the vector `G` from the URS. We'll be progressively collapsing
+    // this vector into smaller and smaller vectors until it is of length 1.
+    let mut g = params.g.clone();
+
+    // Perform the inner product argument, round by round.
+    for k in (1..=params.k).rev() {
+        let half = 1 << (k - 1); // half the length of `a`, `b`, `G`
+
+        // Compute L, R
+        //
+        // TODO: If we modify multiexp to take "extra" bases, we could speed
+        // this piece up a bit by combining the multiexps.
+        let l = best_multiexp(&a[half..], &g[0..half]);
+        let r = best_multiexp(&a[0..half], &g[half..]);
+        let value_l = compute_inner_product(&a[half..], &b[0..half]);
+        let value_r = compute_inner_product(&a[0..half], &b[half..]);
+        let l_randomness = C::Scalar::rand();
+        let r_randomness = C::Scalar::rand();
+        let l = l + &best_multiexp(&[value_l * &z, l_randomness], &[params.u, params.h]);
+        let r = r + &best_multiexp(&[value_r * &z, r_randomness], &[params.u, params.h]);
+        let l = l.to_affine();
+        let r = r.to_affine();
+
+        // Feed L and R into the real transcript
+        transcript.write_point(l)?;
+        transcript.write_point(r)?;
+
+        let challenge = *transcript.squeeze_challenge_scalar::<()>();
+        let challenge_inv = challenge.invert().unwrap(); // TODO, bubble this up
+
+        // Collapse `a` and `b`.
+        // TODO: parallelize
+        for i in 0..half {
+            a[i] = a[i] + &(a[i + half] * &challenge_inv);
+            b[i] = b[i] + &(b[i + half] * &challenge);
+        }
+        a.truncate(half);
+        b.truncate(half);
+
+        // Collapse `G`
+        parallel_generator_collapse(&mut g, challenge);
+        g.truncate(half);
+
+        // Update randomness (the synthetic blinding factor at the end)
+        blind += &(l_randomness * &challenge_inv);
+        blind += &(r_randomness * &challenge);
+    }
+
+    // We have fully collapsed `a`, `b`, `G`
+    assert_eq!(a.len(), 1);
+    let a = a[0];
+
+    transcript.write_scalar(a)?;
+    transcript.write_scalar(blind)?; // \xi
+
+    Ok(())
+}
+
+fn parallel_generator_collapse<C: CurveAffine>(g: &mut [C], challenge: C::Scalar) {
+    let len = g.len() / 2;
+    let (mut g_lo, g_hi) = g.split_at_mut(len);
+
+    parallelize(&mut g_lo, |g_lo, start| {
+        let g_hi = &g_hi[start..];
+        let mut tmp = Vec::with_capacity(g_lo.len());
+        for (g_lo, g_hi) in g_lo.iter().zip(g_hi.iter()) {
+            tmp.push(g_lo.to_curve() + &(*g_hi * challenge));
+        }
+        C::Curve::batch_normalize(&tmp, g_lo);
+    });
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/commitment/verifier.rs.html b/rustdoc/latest/src/halo2/poly/commitment/verifier.rs.html new file mode 100644 index 00000000..f7b2550e --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/commitment/verifier.rs.html @@ -0,0 +1,386 @@ +verifier.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+use ff::Field;
+use group::Curve;
+
+use super::super::Error;
+use super::{Params, MSM};
+use crate::transcript::{EncodedChallenge, TranscriptRead};
+
+use crate::arithmetic::{best_multiexp, BatchInvert, CurveAffine};
+
+/// A guard returned by the verifier
+#[derive(Debug, Clone)]
+pub struct Guard<'a, C: CurveAffine, E: EncodedChallenge<C>> {
+    msm: MSM<'a, C>,
+    neg_a: C::Scalar,
+    challenges: Vec<C::Scalar>,
+    challenges_packed: Vec<E>,
+}
+
+/// An accumulator instance consisting of an evaluation claim and a proof.
+#[derive(Debug, Clone)]
+pub struct Accumulator<C: CurveAffine, E: EncodedChallenge<C>> {
+    /// The claimed output of the linear-time polycommit opening protocol
+    pub g: C,
+
+    /// A vector of 128-bit challenges sampled by the verifier, to be used in
+    /// computing g.
+    pub challenges_packed: Vec<E>,
+}
+
+impl<'a, C: CurveAffine, E: EncodedChallenge<C>> Guard<'a, C, E> {
+    /// Lets caller supply the challenges and obtain an MSM with updated
+    /// scalars and points.
+    pub fn use_challenges(mut self) -> MSM<'a, C> {
+        let s = compute_s(&self.challenges, self.neg_a);
+        self.msm.add_to_g_scalars(&s);
+        self.msm.add_to_h_scalar(self.neg_a);
+
+        self.msm
+    }
+
+    /// Lets caller supply the purported G point and simply appends
+    /// [-a] G to return an updated MSM.
+    pub fn use_g(mut self, g: C) -> (MSM<'a, C>, Accumulator<C, E>) {
+        self.msm.append_term(self.neg_a, g);
+
+        let accumulator = Accumulator {
+            g,
+            challenges_packed: self.challenges_packed,
+        };
+
+        (self.msm, accumulator)
+    }
+
+    /// Computes G + H, where G = ⟨s, params.g⟩ and H is used for blinding
+    pub fn compute_g(&self) -> C {
+        let s = compute_s(&self.challenges, C::Scalar::one());
+
+        let mut tmp = best_multiexp(&s, &self.msm.params.g);
+        tmp += self.msm.params.h;
+        tmp.to_affine()
+    }
+}
+
+/// Checks to see if the proof represented within `transcript` is valid, and a
+/// point `x` that the polynomial commitment `P` opens purportedly to the value
+/// `v`. The provided `msm` should evaluate to the commitment `P` being opened.
+pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+    params: &'a Params<C>,
+    mut msm: MSM<'a, C>,
+    transcript: &mut T,
+    x: C::Scalar,
+    v: C::Scalar,
+) -> Result<Guard<'a, C, E>, Error> {
+    let k = params.k as usize;
+
+    //     P - [v] G_0 + S * iota
+    //   + \sum(L_i * u_i^2) + \sum(R_i * u_i^-2)
+    msm.add_constant_term(-v);
+    let s_poly_commitment = transcript.read_point().map_err(|_| Error::OpeningError)?;
+
+    let iota = *transcript.squeeze_challenge_scalar::<()>();
+
+    msm.append_term(iota, s_poly_commitment);
+
+    let z = *transcript.squeeze_challenge_scalar::<()>();
+
+    let mut rounds = vec![];
+    for _ in 0..k {
+        // Read L and R from the proof and write them to the transcript
+        let l = transcript.read_point().map_err(|_| Error::OpeningError)?;
+        let r = transcript.read_point().map_err(|_| Error::OpeningError)?;
+
+        let challenge_packed = transcript.squeeze_challenge();
+        let challenge = *challenge_packed.as_challenge_scalar::<()>();
+
+        rounds.push((
+            l,
+            r,
+            challenge,
+            /* to be inverted */ challenge,
+            challenge_packed,
+        ));
+    }
+
+    rounds
+        .iter_mut()
+        .map(|&mut (_, _, _, ref mut challenge, _)| challenge)
+        .batch_invert();
+
+    let mut challenges = Vec::with_capacity(k);
+    let mut challenges_packed: Vec<E> = Vec::with_capacity(k);
+    for (l, r, challenge, challenge_inv, challenge_packed) in rounds {
+        msm.append_term(challenge_inv, l);
+        msm.append_term(challenge, r);
+
+        challenges.push(challenge);
+        challenges_packed.push(challenge_packed);
+    }
+
+    // Our goal is to open
+    //     msm - [v] G_0 + random_poly_commitment * iota
+    //   + \sum(L_i * u_i^2) + \sum(R_i * u_i^-2)
+    // at x to 0, by asking the prover to supply (a, \xi) such that it equals
+    //   = [a] (G + [b * z] U) + [\xi] H
+    // except that we wish for the prover to supply G as Commit(g(X); 1) so
+    // we must substitute to get
+    //   = [a] ((G - H) + [b * z] U) + [\xi] H
+    //   = [a] G + [-a] H + [abz] U + [\xi] H
+    //   = [a] G + [abz] U + [\xi - a] H
+    // but subtracting to get the desired equality
+    //   ... + [-a] G + [-abz] U + [a - \xi] H = 0
+
+    let a = transcript.read_scalar().map_err(|_| Error::SamplingError)?;
+    let neg_a = -a;
+    let xi = transcript.read_scalar().map_err(|_| Error::SamplingError)?;
+    let b = compute_b(x, &challenges);
+
+    msm.add_to_u_scalar(neg_a * &b * &z);
+    msm.add_to_h_scalar(a - &xi);
+
+    let guard = Guard {
+        msm,
+        neg_a,
+        challenges,
+        challenges_packed,
+    };
+
+    Ok(guard)
+}
+
+/// Computes $\prod\limits_{i=0}^{k-1} (1 + u_i x^{2^i})$.
+fn compute_b<F: Field>(x: F, challenges: &[F]) -> F {
+    let mut tmp = F::one();
+    let mut cur = x;
+    for challenge in challenges.iter().rev() {
+        tmp *= F::one() + &(*challenge * &cur);
+        cur *= cur;
+    }
+    tmp
+}
+
+/// Computes the coefficients of $g(X) = \prod\limits_{i=0}^{k-1} (1 + u_i X^{2^i})$.
+fn compute_s<F: Field>(challenges: &[F], init: F) -> Vec<F> {
+    assert!(!challenges.is_empty());
+    let mut v = vec![F::zero(); 1 << challenges.len()];
+    v[0] = init;
+
+    for (len, challenge) in challenges
+        .iter()
+        .rev()
+        .enumerate()
+        .map(|(i, challenge)| (1 << i, challenge))
+    {
+        let (left, right) = v.split_at_mut(len);
+        let right = &mut right[0..len];
+        right.copy_from_slice(left);
+        for v in right {
+            *v *= challenge;
+        }
+    }
+
+    v
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/domain.rs.html b/rustdoc/latest/src/halo2/poly/domain.rs.html new file mode 100644 index 00000000..ece68c19 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/domain.rs.html @@ -0,0 +1,948 @@ +domain.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+
+//! Contains utilities for performing polynomial arithmetic over an evaluation
+//! domain that is of a suitable size for the application.
+
+use crate::{
+    arithmetic::{best_fft, parallelize, BatchInvert, FieldExt, Group},
+    plonk::Assigned,
+};
+
+use super::{Coeff, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial, Rotation};
+
+use ff::{Field, PrimeField};
+use std::marker::PhantomData;
+
+/// This structure contains precomputed constants and other details needed for
+/// performing operations on an evaluation domain of size $2^k$ and an extended
+/// domain of size $2^{k} * j$ with $j \neq 0$.
+#[derive(Debug)]
+pub struct EvaluationDomain<G: Group> {
+    n: u64,
+    k: u32,
+    extended_k: u32,
+    omega: G::Scalar,
+    omega_inv: G::Scalar,
+    extended_omega: G::Scalar,
+    extended_omega_inv: G::Scalar,
+    g_coset: G::Scalar,
+    g_coset_inv: G::Scalar,
+    quotient_poly_degree: u64,
+    ifft_divisor: G::Scalar,
+    extended_ifft_divisor: G::Scalar,
+    t_evaluations: Vec<G::Scalar>,
+    barycentric_weight: G::Scalar,
+}
+
+impl<G: Group> EvaluationDomain<G> {
+    /// This constructs a new evaluation domain object based on the provided
+    /// values $j, k$.
+    pub fn new(j: u32, k: u32) -> Self {
+        // quotient_poly_degree * params.n - 1 is the degree of the quotient polynomial
+        let quotient_poly_degree = (j - 1) as u64;
+
+        // n = 2^k
+        let n = 1u64 << k;
+
+        // We need to work within an extended domain, not params.k but params.k + i
+        // for some integer i such that 2^(params.k + i) is sufficiently large to
+        // describe the quotient polynomial.
+        let mut extended_k = k;
+        while (1 << extended_k) < (n * quotient_poly_degree) {
+            extended_k += 1;
+        }
+
+        let mut extended_omega = G::Scalar::ROOT_OF_UNITY;
+
+        // Get extended_omega, the 2^{extended_k}'th root of unity
+        // The loop computes extended_omega = omega^{2 ^ (S - extended_k)}
+        // Notice that extended_omega ^ {2 ^ extended_k} = omega ^ {2^S} = 1.
+        for _ in extended_k..G::Scalar::S {
+            extended_omega = extended_omega.square();
+        }
+        let extended_omega = extended_omega;
+        let mut extended_omega_inv = extended_omega; // Inversion computed later
+
+        // Get omega, the 2^{k}'th root of unity (i.e. n'th root of unity)
+        // The loop computes omega = extended_omega ^ {2 ^ (extended_k - k)}
+        //           = (omega^{2 ^ (S - extended_k)})  ^ {2 ^ (extended_k - k)}
+        //           = omega ^ {2 ^ (S - k)}.
+        // Notice that omega ^ {2^k} = omega ^ {2^S} = 1.
+        let mut omega = extended_omega;
+        for _ in k..extended_k {
+            omega = omega.square();
+        }
+        let omega = omega;
+        let mut omega_inv = omega; // Inversion computed later
+
+        // We use zeta here because we know it generates a coset, and it's available
+        // already.
+        // The coset evaluation domain is:
+        // zeta {1, extended_omega, extended_omega^2, ..., extended_omega^{(2^extended_k) - 1}}
+        let g_coset = G::Scalar::ZETA;
+        let g_coset_inv = g_coset.square();
+
+        let mut t_evaluations = Vec::with_capacity(1 << (extended_k - k));
+        {
+            // Compute the evaluations of t(X) = X^n - 1 in the coset evaluation domain.
+            // We don't have to compute all of them, because it will repeat.
+            let orig = G::Scalar::ZETA.pow_vartime(&[n as u64, 0, 0, 0]);
+            let step = extended_omega.pow_vartime(&[n as u64, 0, 0, 0]);
+            let mut cur = orig;
+            loop {
+                t_evaluations.push(cur);
+                cur *= &step;
+                if cur == orig {
+                    break;
+                }
+            }
+            assert_eq!(t_evaluations.len(), 1 << (extended_k - k));
+
+            // Subtract 1 from each to give us t_evaluations[i] = t(zeta * extended_omega^i)
+            for coeff in &mut t_evaluations {
+                *coeff -= &G::Scalar::one();
+            }
+
+            // Invert, because we're dividing by this polynomial.
+            // We invert in a batch, below.
+        }
+
+        let mut ifft_divisor = G::Scalar::from_u64(1 << k); // Inversion computed later
+        let mut extended_ifft_divisor = G::Scalar::from_u64(1 << extended_k); // Inversion computed later
+
+        // The barycentric weight of 1 over the evaluation domain
+        // 1 / \prod_{i != 0} (1 - omega^i)
+        let mut barycentric_weight = G::Scalar::from(n); // Inversion computed later
+
+        // Compute batch inversion
+        t_evaluations
+            .iter_mut()
+            .chain(Some(&mut ifft_divisor))
+            .chain(Some(&mut extended_ifft_divisor))
+            .chain(Some(&mut barycentric_weight))
+            .chain(Some(&mut extended_omega_inv))
+            .chain(Some(&mut omega_inv))
+            .batch_invert();
+
+        EvaluationDomain {
+            n,
+            k,
+            extended_k,
+            omega,
+            omega_inv,
+            extended_omega,
+            extended_omega_inv,
+            g_coset,
+            g_coset_inv,
+            quotient_poly_degree,
+            ifft_divisor,
+            extended_ifft_divisor,
+            t_evaluations,
+            barycentric_weight,
+        }
+    }
+
+    /// Obtains a polynomial in Lagrange form when given a vector of Lagrange
+    /// coefficients of size `n`; panics if the provided vector is the wrong
+    /// length.
+    pub fn lagrange_from_vec(&self, values: Vec<G>) -> Polynomial<G, LagrangeCoeff> {
+        assert_eq!(values.len(), self.n as usize);
+
+        Polynomial {
+            values,
+            _marker: PhantomData,
+        }
+    }
+
+    /// Obtains a polynomial in coefficient form when given a vector of
+    /// coefficients of size `n`; panics if the provided vector is the wrong
+    /// length.
+    pub fn coeff_from_vec(&self, values: Vec<G>) -> Polynomial<G, Coeff> {
+        assert_eq!(values.len(), self.n as usize);
+
+        Polynomial {
+            values,
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns an empty (zero) polynomial in the coefficient basis
+    pub fn empty_coeff(&self) -> Polynomial<G, Coeff> {
+        Polynomial {
+            values: vec![G::group_zero(); self.n as usize],
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns an empty (zero) polynomial in the Lagrange coefficient basis
+    pub fn empty_lagrange(&self) -> Polynomial<G, LagrangeCoeff> {
+        Polynomial {
+            values: vec![G::group_zero(); self.n as usize],
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns an empty (zero) polynomial in the Lagrange coefficient basis, with
+    /// deferred inversions.
+    pub(crate) fn empty_lagrange_assigned(&self) -> Polynomial<Assigned<G>, LagrangeCoeff>
+    where
+        G: Field,
+    {
+        Polynomial {
+            values: vec![G::group_zero().into(); self.n as usize],
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns a constant polynomial in the Lagrange coefficient basis
+    pub fn constant_lagrange(&self, scalar: G) -> Polynomial<G, LagrangeCoeff> {
+        Polynomial {
+            values: vec![scalar; self.n as usize],
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns an empty (zero) polynomial in the extended Lagrange coefficient
+    /// basis
+    pub fn empty_extended(&self) -> Polynomial<G, ExtendedLagrangeCoeff> {
+        Polynomial {
+            values: vec![G::group_zero(); self.extended_len()],
+            _marker: PhantomData,
+        }
+    }
+
+    /// Returns a constant polynomial in the extended Lagrange coefficient
+    /// basis
+    pub fn constant_extended(&self, scalar: G) -> Polynomial<G, ExtendedLagrangeCoeff> {
+        Polynomial {
+            values: vec![scalar; self.extended_len()],
+            _marker: PhantomData,
+        }
+    }
+
+    /// This takes us from an n-length vector into the coefficient form.
+    ///
+    /// This function will panic if the provided vector is not the correct
+    /// length.
+    pub fn lagrange_to_coeff(&self, mut a: Polynomial<G, LagrangeCoeff>) -> Polynomial<G, Coeff> {
+        assert_eq!(a.values.len(), 1 << self.k);
+
+        // Perform inverse FFT to obtain the polynomial in coefficient form
+        Self::ifft(&mut a.values, self.omega_inv, self.k, self.ifft_divisor);
+
+        Polynomial {
+            values: a.values,
+            _marker: PhantomData,
+        }
+    }
+
+    /// This takes us from an n-length coefficient vector into a coset of the extended
+    /// evaluation domain, rotating by `rotation` if desired.
+    pub fn coeff_to_extended(
+        &self,
+        mut a: Polynomial<G, Coeff>,
+        rotation: Rotation,
+    ) -> Polynomial<G, ExtendedLagrangeCoeff> {
+        assert_eq!(a.values.len(), 1 << self.k);
+
+        assert!(rotation.0 != i32::MIN);
+        if rotation.0 == 0 {
+            // In this special case, the powers of zeta repeat so we do not need
+            // to compute them.
+            Self::distribute_powers_zeta(&mut a.values);
+        } else {
+            let mut g = self.g_coset;
+            if rotation.0 > 0 {
+                g *= &self.omega.pow_vartime(&[rotation.0 as u64, 0, 0, 0]);
+            } else {
+                g *= &self
+                    .omega_inv
+                    .pow_vartime(&[rotation.0.abs() as u64, 0, 0, 0]);
+            }
+            Self::distribute_powers(&mut a.values, g);
+        }
+        a.values.resize(self.extended_len(), G::group_zero());
+        best_fft(&mut a.values, self.extended_omega, self.extended_k);
+
+        Polynomial {
+            values: a.values,
+            _marker: PhantomData,
+        }
+    }
+
+    /// This takes us from the extended evaluation domain and gets us the
+    /// quotient polynomial coefficients.
+    ///
+    /// This function will panic if the provided vector is not the correct
+    /// length.
+    // TODO/FIXME: caller should be responsible for truncating
+    pub fn extended_to_coeff(&self, mut a: Polynomial<G, ExtendedLagrangeCoeff>) -> Vec<G> {
+        assert_eq!(a.values.len(), self.extended_len());
+
+        // Inverse FFT
+        Self::ifft(
+            &mut a.values,
+            self.extended_omega_inv,
+            self.extended_k,
+            self.extended_ifft_divisor,
+        );
+
+        // Distribute powers to move from coset; opposite from the
+        // transformation we performed earlier.
+        Self::distribute_powers(&mut a.values, self.g_coset_inv);
+
+        // Truncate it to match the size of the quotient polynomial; the
+        // evaluation domain might be slightly larger than necessary because
+        // it always lies on a power-of-two boundary.
+        a.values
+            .truncate((&self.n * self.quotient_poly_degree) as usize);
+
+        a.values
+    }
+
+    /// This divides the polynomial (in the extended domain) by the vanishing
+    /// polynomial of the $2^k$ size domain.
+    pub fn divide_by_vanishing_poly(
+        &self,
+        mut a: Polynomial<G, ExtendedLagrangeCoeff>,
+    ) -> Polynomial<G, ExtendedLagrangeCoeff> {
+        assert_eq!(a.values.len(), self.extended_len());
+
+        // Divide to obtain the quotient polynomial in the coset evaluation
+        // domain.
+        parallelize(&mut a.values, |h, mut index| {
+            for h in h {
+                h.group_scale(&self.t_evaluations[index % self.t_evaluations.len()]);
+                index += 1;
+            }
+        });
+
+        Polynomial {
+            values: a.values,
+            _marker: PhantomData,
+        }
+    }
+
+    // Given a slice of group elements `[a_0, a_1, a_2, ...]`, this returns
+    // `[a_0, [zeta]a_1, [zeta^2]a_2, a_3, [zeta]a_4, [zeta^2]a_5, a_6, ...]`,
+    // where zeta is a cube root of unity in the multiplicative subgroup with
+    // order (p - 1), i.e. zeta^3 = 1.
+    fn distribute_powers_zeta(mut a: &mut [G]) {
+        let coset_powers = [G::Scalar::ZETA, G::Scalar::ZETA.square()];
+        parallelize(&mut a, |a, mut index| {
+            for a in a {
+                // Distribute powers to move into coset
+                let i = index % (coset_powers.len() + 1);
+                if i != 0 {
+                    a.group_scale(&coset_powers[i - 1]);
+                }
+                index += 1;
+            }
+        });
+    }
+
+    // Given a length-`n` slice of group elements `a` and a scalar `g`, this
+    // returns `[a_0, [g]a_1, [g^2]a_2, [g^3]a_3, ..., [g^n-1] a_{n-1}]`.
+    fn distribute_powers(mut a: &mut [G], g: G::Scalar) {
+        parallelize(&mut a, |a, index| {
+            let mut cur = g.pow_vartime(&[index as u64, 0, 0, 0]);
+            for a in a {
+                a.group_scale(&cur);
+                cur *= &g;
+            }
+        });
+    }
+
+    fn ifft(a: &mut [G], omega_inv: G::Scalar, log_n: u32, divisor: G::Scalar) {
+        best_fft(a, omega_inv, log_n);
+        parallelize(a, |a, _| {
+            for a in a {
+                // Finish iFFT
+                a.group_scale(&divisor);
+            }
+        });
+    }
+
+    /// Get the size of the extended domain
+    pub fn extended_len(&self) -> usize {
+        1 << self.extended_k
+    }
+
+    /// Get $\omega$, the generator of the $2^k$ order multiplicative subgroup.
+    pub fn get_omega(&self) -> G::Scalar {
+        self.omega
+    }
+
+    /// Get $\omega^{-1}$, the inverse of the generator of the $2^k$ order
+    /// multiplicative subgroup.
+    pub fn get_omega_inv(&self) -> G::Scalar {
+        self.omega_inv
+    }
+
+    /// Get the generator of the extended domain's multiplicative subgroup.
+    pub fn get_extended_omega(&self) -> G::Scalar {
+        self.extended_omega
+    }
+
+    /// Multiplies a value by some power of $\omega$, essentially rotating over
+    /// the domain.
+    pub fn rotate_omega(&self, value: G::Scalar, rotation: Rotation) -> G::Scalar {
+        let mut point = value;
+        if rotation.0 >= 0 {
+            point *= &self.get_omega().pow(&[rotation.0 as u64, 0, 0, 0]);
+        } else {
+            point *= &self
+                .get_omega_inv()
+                .pow(&[rotation.0.abs() as u64, 0, 0, 0]);
+        }
+        point
+    }
+
+    /// Gets the barycentric weight of $1$ over the $2^k$ size domain.
+    pub fn get_barycentric_weight(&self) -> G::Scalar {
+        self.barycentric_weight
+    }
+
+    /// Gets the quotient polynomial's degree (as a multiple of n)
+    pub fn get_quotient_poly_degree(&self) -> usize {
+        self.quotient_poly_degree as usize
+    }
+
+    /// Obtain a pinned version of this evaluation domain; a structure with the
+    /// minimal parameters needed to determine the rest of the evaluation
+    /// domain.
+    pub fn pinned(&self) -> PinnedEvaluationDomain<'_, G> {
+        PinnedEvaluationDomain {
+            k: &self.k,
+            extended_k: &self.extended_k,
+            omega: &self.omega,
+        }
+    }
+}
+
+/// Represents the minimal parameters that determine an `EvaluationDomain`.
+#[derive(Debug)]
+pub struct PinnedEvaluationDomain<'a, G: Group> {
+    k: &'a u32,
+    extended_k: &'a u32,
+    omega: &'a G::Scalar,
+}
+
+#[test]
+fn test_rotate() {
+    use crate::arithmetic::eval_polynomial;
+    use crate::pasta::pallas::Scalar;
+    let domain = EvaluationDomain::<Scalar>::new(1, 3);
+
+    let mut poly = domain.empty_lagrange();
+    assert_eq!(poly.len(), 8);
+    for value in poly.iter_mut() {
+        *value = Scalar::rand();
+    }
+
+    let poly_rotated_cur = poly.rotate(Rotation::cur());
+    let poly_rotated_next = poly.rotate(Rotation::next());
+    let poly_rotated_prev = poly.rotate(Rotation::prev());
+
+    let poly = domain.lagrange_to_coeff(poly);
+    let poly_rotated_cur = domain.lagrange_to_coeff(poly_rotated_cur);
+    let poly_rotated_next = domain.lagrange_to_coeff(poly_rotated_next);
+    let poly_rotated_prev = domain.lagrange_to_coeff(poly_rotated_prev);
+
+    let x = Scalar::rand();
+
+    assert_eq!(
+        eval_polynomial(&poly[..], x),
+        eval_polynomial(&poly_rotated_cur[..], x)
+    );
+    assert_eq!(
+        eval_polynomial(&poly[..], x * domain.omega),
+        eval_polynomial(&poly_rotated_next[..], x)
+    );
+    assert_eq!(
+        eval_polynomial(&poly[..], x * domain.omega_inv),
+        eval_polynomial(&poly_rotated_prev[..], x)
+    );
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/multiopen.rs.html b/rustdoc/latest/src/halo2/poly/multiopen.rs.html new file mode 100644 index 00000000..938b6098 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/multiopen.rs.html @@ -0,0 +1,1022 @@ +multiopen.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+
+//! This module contains an optimisation of the polynomial commitment opening
+//! scheme described in the [Halo][halo] paper.
+//!
+//! [halo]: https://eprint.iacr.org/2019/1021
+
+use std::collections::{BTreeMap, BTreeSet};
+
+use super::*;
+use crate::{
+    arithmetic::{CurveAffine, FieldExt},
+    transcript::ChallengeScalar,
+};
+
+mod prover;
+mod verifier;
+
+pub use prover::create_proof;
+pub use verifier::verify_proof;
+
+#[derive(Clone, Copy, Debug)]
+struct X1 {}
+/// Challenge for compressing openings at the same point sets together.
+type ChallengeX1<F> = ChallengeScalar<F, X1>;
+
+#[derive(Clone, Copy, Debug)]
+struct X2 {}
+/// Challenge for keeping the multi-point quotient polynomial terms linearly independent.
+type ChallengeX2<F> = ChallengeScalar<F, X2>;
+
+#[derive(Clone, Copy, Debug)]
+struct X3 {}
+/// Challenge point at which the commitments are opened.
+type ChallengeX3<F> = ChallengeScalar<F, X3>;
+
+#[derive(Clone, Copy, Debug)]
+struct X4 {}
+/// Challenge for collapsing the openings of the various remaining polynomials at x_3
+/// together.
+type ChallengeX4<F> = ChallengeScalar<F, X4>;
+
+/// A polynomial query at a point
+#[derive(Debug, Clone)]
+pub struct ProverQuery<'a, C: CurveAffine> {
+    /// point at which polynomial is queried
+    pub point: C::Scalar,
+    /// coefficients of polynomial
+    pub poly: &'a Polynomial<C::Scalar, Coeff>,
+    /// blinding factor of polynomial
+    pub blind: commitment::Blind<C::Scalar>,
+}
+
+/// A polynomial query at a point
+#[derive(Debug, Clone)]
+pub struct VerifierQuery<'a, C: CurveAffine> {
+    /// point at which polynomial is queried
+    pub point: C::Scalar,
+    /// commitment to polynomial
+    pub commitment: &'a C,
+    /// evaluation of polynomial at query point
+    pub eval: C::Scalar,
+}
+
+struct CommitmentData<F, T: PartialEq> {
+    commitment: T,
+    set_index: usize,
+    point_indices: Vec<usize>,
+    evals: Vec<F>,
+}
+
+impl<F, T: PartialEq> CommitmentData<F, T> {
+    fn new(commitment: T) -> Self {
+        CommitmentData {
+            commitment,
+            set_index: 0,
+            point_indices: vec![],
+            evals: vec![],
+        }
+    }
+}
+
+trait Query<F>: Sized {
+    type Commitment: PartialEq + Copy;
+    type Eval: Clone + Default;
+
+    fn get_point(&self) -> F;
+    fn get_eval(&self) -> Self::Eval;
+    fn get_commitment(&self) -> Self::Commitment;
+}
+
+type IntermediateSets<F, Q> = (
+    Vec<CommitmentData<<Q as Query<F>>::Eval, <Q as Query<F>>::Commitment>>,
+    Vec<Vec<F>>,
+);
+
+fn construct_intermediate_sets<F: FieldExt, I, Q: Query<F>>(queries: I) -> IntermediateSets<F, Q>
+where
+    I: IntoIterator<Item = Q> + Clone,
+{
+    // Construct sets of unique commitments and corresponding information about
+    // their queries.
+    let mut commitment_map: Vec<CommitmentData<Q::Eval, Q::Commitment>> = vec![];
+
+    // Also construct mapping from a unique point to a point_index. This defines
+    // an ordering on the points.
+    let mut point_index_map = BTreeMap::new();
+
+    // Iterate over all of the queries, computing the ordering of the points
+    // while also creating new commitment data.
+    for query in queries.clone() {
+        let num_points = point_index_map.len();
+        let point_idx = point_index_map
+            .entry(query.get_point())
+            .or_insert(num_points);
+
+        if let Some(pos) = commitment_map
+            .iter()
+            .position(|comm| comm.commitment == query.get_commitment())
+        {
+            commitment_map[pos].point_indices.push(*point_idx);
+        } else {
+            let mut tmp = CommitmentData::new(query.get_commitment());
+            tmp.point_indices.push(*point_idx);
+            commitment_map.push(tmp);
+        }
+    }
+
+    // Also construct inverse mapping from point_index to the point
+    let mut inverse_point_index_map = BTreeMap::new();
+    for (&point, &point_index) in point_index_map.iter() {
+        inverse_point_index_map.insert(point_index, point);
+    }
+
+    // Construct map of unique ordered point_idx_sets to their set_idx
+    let mut point_idx_sets = BTreeMap::new();
+    // Also construct mapping from commitment to point_idx_set
+    let mut commitment_set_map = Vec::new();
+
+    for commitment_data in commitment_map.iter() {
+        let mut point_index_set = BTreeSet::new();
+        // Note that point_index_set is ordered, unlike point_indices
+        for &point_index in commitment_data.point_indices.iter() {
+            point_index_set.insert(point_index);
+        }
+
+        // Push point_index_set to CommitmentData for the relevant commitment
+        commitment_set_map.push((commitment_data.commitment, point_index_set.clone()));
+
+        let num_sets = point_idx_sets.len();
+        point_idx_sets.entry(point_index_set).or_insert(num_sets);
+    }
+
+    // Initialise empty evals vec for each unique commitment
+    for commitment_data in commitment_map.iter_mut() {
+        let len = commitment_data.point_indices.len();
+        commitment_data.evals = vec![Q::Eval::default(); len];
+    }
+
+    // Populate set_index, evals and points for each commitment using point_idx_sets
+    for query in queries {
+        // The index of the point at which the commitment is queried
+        let point_index = point_index_map.get(&query.get_point()).unwrap();
+
+        // The point_index_set at which the commitment was queried
+        let mut point_index_set = BTreeSet::new();
+        for (commitment, point_idx_set) in commitment_set_map.iter() {
+            if query.get_commitment() == *commitment {
+                point_index_set = point_idx_set.clone();
+            }
+        }
+        assert!(!point_index_set.is_empty());
+
+        // The set_index of the point_index_set
+        let set_index = point_idx_sets.get(&point_index_set).unwrap();
+        for commitment_data in commitment_map.iter_mut() {
+            if query.get_commitment() == commitment_data.commitment {
+                commitment_data.set_index = *set_index;
+            }
+        }
+        let point_index_set: Vec<usize> = point_index_set.iter().cloned().collect();
+
+        // The offset of the point_index in the point_index_set
+        let point_index_in_set = point_index_set
+            .iter()
+            .position(|i| i == point_index)
+            .unwrap();
+
+        for commitment_data in commitment_map.iter_mut() {
+            if query.get_commitment() == commitment_data.commitment {
+                // Insert the eval using the ordering of the point_index_set
+                commitment_data.evals[point_index_in_set] = query.get_eval();
+            }
+        }
+    }
+
+    // Get actual points in each point set
+    let mut point_sets: Vec<Vec<F>> = vec![Vec::new(); point_idx_sets.len()];
+    for (point_idx_set, &set_idx) in point_idx_sets.iter() {
+        for &point_idx in point_idx_set.iter() {
+            let point = inverse_point_index_map.get(&point_idx).unwrap();
+            point_sets[set_idx].push(*point);
+        }
+    }
+
+    (commitment_map, point_sets)
+}
+
+#[test]
+fn test_roundtrip() {
+    use group::Curve;
+
+    use super::commitment::{Blind, Params};
+    use crate::arithmetic::{eval_polynomial, FieldExt};
+    use crate::pasta::{EqAffine, Fp};
+    use crate::transcript::Challenge255;
+
+    const K: u32 = 4;
+
+    let params: Params<EqAffine> = Params::new(K);
+    let domain = EvaluationDomain::new(1, K);
+
+    let mut ax = domain.empty_coeff();
+    for (i, a) in ax.iter_mut().enumerate() {
+        *a = Fp::from(10 + i as u64);
+    }
+
+    let mut bx = domain.empty_coeff();
+    for (i, a) in bx.iter_mut().enumerate() {
+        *a = Fp::from(100 + i as u64);
+    }
+
+    let mut cx = domain.empty_coeff();
+    for (i, a) in cx.iter_mut().enumerate() {
+        *a = Fp::from(100 + i as u64);
+    }
+
+    let blind = Blind(Fp::rand());
+
+    let a = params.commit(&ax, blind).to_affine();
+    let b = params.commit(&bx, blind).to_affine();
+    let c = params.commit(&cx, blind).to_affine();
+
+    let x = Fp::rand();
+    let y = Fp::rand();
+    let avx = eval_polynomial(&ax, x);
+    let bvx = eval_polynomial(&bx, x);
+    let cvy = eval_polynomial(&cx, y);
+
+    let mut transcript = crate::transcript::Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
+    create_proof(
+        &params,
+        &mut transcript,
+        std::iter::empty()
+            .chain(Some(ProverQuery {
+                point: x,
+                poly: &ax,
+                blind,
+            }))
+            .chain(Some(ProverQuery {
+                point: x,
+                poly: &bx,
+                blind,
+            }))
+            .chain(Some(ProverQuery {
+                point: y,
+                poly: &cx,
+                blind,
+            })),
+    )
+    .unwrap();
+    let proof = transcript.finalize();
+
+    {
+        let mut proof = &proof[..];
+        let mut transcript =
+            crate::transcript::Blake2bRead::<_, _, Challenge255<_>>::init(&mut proof);
+        let msm = params.empty_msm();
+
+        let guard = verify_proof(
+            &params,
+            &mut transcript,
+            std::iter::empty()
+                .chain(Some(VerifierQuery {
+                    point: x,
+                    commitment: &a,
+                    eval: avx,
+                }))
+                .chain(Some(VerifierQuery {
+                    point: x,
+                    commitment: &b,
+                    eval: avx, // NB: wrong!
+                }))
+                .chain(Some(VerifierQuery {
+                    point: y,
+                    commitment: &c,
+                    eval: cvy,
+                })),
+            msm,
+        )
+        .unwrap();
+
+        // Should fail.
+        assert!(!guard.use_challenges().eval());
+    }
+
+    {
+        let mut proof = &proof[..];
+
+        let mut transcript =
+            crate::transcript::Blake2bRead::<_, _, Challenge255<_>>::init(&mut proof);
+        let msm = params.empty_msm();
+
+        let guard = verify_proof(
+            &params,
+            &mut transcript,
+            std::iter::empty()
+                .chain(Some(VerifierQuery {
+                    point: x,
+                    commitment: &a,
+                    eval: avx,
+                }))
+                .chain(Some(VerifierQuery {
+                    point: x,
+                    commitment: &b,
+                    eval: bvx,
+                }))
+                .chain(Some(VerifierQuery {
+                    point: y,
+                    commitment: &c,
+                    eval: cvy,
+                })),
+            msm,
+        )
+        .unwrap();
+
+        // Should succeed.
+        assert!(guard.use_challenges().eval());
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::{construct_intermediate_sets, Query};
+    use crate::arithmetic::FieldExt;
+    use crate::pasta::Fp;
+
+    #[derive(Clone)]
+    struct MyQuery<F> {
+        commitment: usize,
+        point: F,
+        eval: F,
+    }
+
+    impl<F: Clone + Default> Query<F> for MyQuery<F> {
+        type Commitment = usize;
+        type Eval = F;
+
+        fn get_point(&self) -> F {
+            self.point.clone()
+        }
+        fn get_eval(&self) -> Self::Eval {
+            self.eval.clone()
+        }
+        fn get_commitment(&self) -> Self::Commitment {
+            self.commitment
+        }
+    }
+
+    #[test]
+    fn test_coherence() {
+        let points = &[Fp::rand(), Fp::rand(), Fp::rand(), Fp::rand(), Fp::rand()];
+
+        let build_queries = || {
+            vec![
+                MyQuery {
+                    commitment: 0,
+                    point: points[0],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 0,
+                    point: points[1],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 1,
+                    point: points[0],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 1,
+                    point: points[1],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 2,
+                    point: points[0],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 2,
+                    point: points[1],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 2,
+                    point: points[2],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 3,
+                    point: points[0],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 3,
+                    point: points[3],
+                    eval: Fp::rand(),
+                },
+                MyQuery {
+                    commitment: 4,
+                    point: points[4],
+                    eval: Fp::rand(),
+                },
+            ]
+        };
+
+        let queries = build_queries();
+
+        let (commitment_data, point_sets) = construct_intermediate_sets(queries);
+
+        // It shouldn't matter what the point or eval values are; we should get
+        // the same exact point sets again.
+        {
+            let new_queries = build_queries();
+            let (_, new_point_sets) = construct_intermediate_sets(new_queries);
+
+            assert_eq!(point_sets, new_point_sets);
+        }
+
+        let mut a = false;
+        let mut a_set = 0;
+        let mut b = false;
+        let mut b_set = 0;
+        let mut c = false;
+        let mut c_set = 0;
+        let mut d = false;
+        let mut d_set = 0;
+
+        for (i, mut point_set) in point_sets.into_iter().enumerate() {
+            point_set.sort();
+            if point_set.len() == 1 {
+                assert_eq!(point_set[0], points[4]);
+                assert!(!a);
+                a = true;
+                a_set = i;
+            } else if point_set.len() == 2 {
+                let mut v0 = [points[0], points[1]];
+                let mut v1 = [points[0], points[3]];
+                v0.sort();
+                v1.sort();
+
+                if &point_set[..] == &v0[..] {
+                    assert!(!b);
+                    b = true;
+                    b_set = i;
+                } else if &point_set[..] == &v1[..] {
+                    assert!(!c);
+                    c = true;
+                    c_set = i;
+                } else {
+                    panic!("unexpected");
+                }
+            } else if point_set.len() == 3 {
+                let mut v = [points[0], points[1], points[2]];
+                v.sort();
+                assert_eq!(&point_set[..], &v[..]);
+                assert!(!d);
+                d = true;
+                d_set = i;
+            } else {
+                panic!("unexpected");
+            }
+        }
+
+        assert!(a & b & c & d);
+
+        for commitment_data in commitment_data {
+            assert_eq!(
+                commitment_data.set_index,
+                match commitment_data.commitment {
+                    0 => b_set,
+                    1 => b_set,
+                    2 => d_set,
+                    3 => c_set,
+                    4 => a_set,
+                    _ => unreachable!(),
+                }
+            );
+        }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/multiopen/prover.rs.html b/rustdoc/latest/src/halo2/poly/multiopen/prover.rs.html new file mode 100644 index 00000000..74a0d740 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/multiopen/prover.rs.html @@ -0,0 +1,314 @@ +prover.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
+use super::super::{
+    commitment::{self, Blind, Params},
+    Coeff, Polynomial,
+};
+use super::{
+    construct_intermediate_sets, ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4, ProverQuery,
+    Query,
+};
+
+use crate::arithmetic::{eval_polynomial, kate_division, CurveAffine, FieldExt};
+use crate::transcript::{EncodedChallenge, TranscriptWrite};
+
+use ff::Field;
+use group::Curve;
+use std::io;
+use std::marker::PhantomData;
+
+#[derive(Debug, Clone)]
+struct CommitmentData<C: CurveAffine> {
+    set_index: usize,
+    blind: Blind<C::Scalar>,
+    point_indices: Vec<usize>,
+    evals: Vec<C::Scalar>,
+}
+
+/// Create a multi-opening proof
+pub fn create_proof<'a, I, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
+    params: &Params<C>,
+    transcript: &mut T,
+    queries: I,
+) -> io::Result<()>
+where
+    I: IntoIterator<Item = ProverQuery<'a, C>> + Clone,
+{
+    let x_1: ChallengeX1<_> = transcript.squeeze_challenge_scalar();
+    let x_2: ChallengeX2<_> = transcript.squeeze_challenge_scalar();
+
+    let (poly_map, point_sets) = construct_intermediate_sets(queries);
+
+    // Collapse openings at same point sets together into single openings using
+    // x_1 challenge.
+    let mut q_polys: Vec<Option<Polynomial<C::Scalar, Coeff>>> = vec![None; point_sets.len()];
+    let mut q_blinds = vec![Blind(C::Scalar::zero()); point_sets.len()];
+
+    {
+        let mut accumulate =
+            |set_idx: usize, new_poly: &Polynomial<C::Scalar, Coeff>, blind: Blind<C::Scalar>| {
+                if let Some(poly) = &q_polys[set_idx] {
+                    q_polys[set_idx] = Some(poly.clone() * *x_1 + new_poly);
+                } else {
+                    q_polys[set_idx] = Some(new_poly.clone());
+                }
+                q_blinds[set_idx] *= *x_1;
+                q_blinds[set_idx] += blind;
+            };
+
+        for commitment_data in poly_map.into_iter() {
+            accumulate(
+                commitment_data.set_index,        // set_idx,
+                commitment_data.commitment.poly,  // poly,
+                commitment_data.commitment.blind, // blind,
+            );
+        }
+    }
+
+    let f_poly = point_sets
+        .iter()
+        .zip(q_polys.iter())
+        .fold(None, |f_poly, (points, poly)| {
+            let mut poly = points
+                .iter()
+                .fold(poly.clone().unwrap().values, |poly, point| {
+                    kate_division(&poly, *point)
+                });
+            poly.resize(params.n as usize, C::Scalar::zero());
+            let poly = Polynomial {
+                values: poly,
+                _marker: PhantomData,
+            };
+
+            if f_poly.is_none() {
+                Some(poly)
+            } else {
+                f_poly.map(|f_poly| f_poly * *x_2 + &poly)
+            }
+        })
+        .unwrap();
+
+    let f_blind = Blind(C::Scalar::rand());
+    let f_commitment = params.commit(&f_poly, f_blind).to_affine();
+
+    transcript.write_point(f_commitment)?;
+
+    let x_3: ChallengeX3<_> = transcript.squeeze_challenge_scalar();
+
+    let q_evals: Vec<C::Scalar> = q_polys
+        .iter()
+        .map(|poly| eval_polynomial(poly.as_ref().unwrap(), *x_3))
+        .collect();
+
+    for eval in q_evals.iter() {
+        transcript.write_scalar(*eval)?;
+    }
+
+    let x_4: ChallengeX4<_> = transcript.squeeze_challenge_scalar();
+
+    let (f_poly, f_blind_try) = q_polys.iter().zip(q_blinds.iter()).fold(
+        (f_poly, f_blind),
+        |(f_poly, f_blind), (poly, blind)| {
+            (
+                f_poly * *x_4 + poly.as_ref().unwrap(),
+                Blind((f_blind.0 * &(*x_4)) + &blind.0),
+            )
+        },
+    );
+
+    commitment::create_proof(params, transcript, &f_poly, f_blind_try, *x_3)
+}
+
+#[doc(hidden)]
+#[derive(Copy, Clone)]
+pub struct PolynomialPointer<'a, C: CurveAffine> {
+    poly: &'a Polynomial<C::Scalar, Coeff>,
+    blind: commitment::Blind<C::Scalar>,
+}
+
+impl<'a, C: CurveAffine> PartialEq for PolynomialPointer<'a, C> {
+    fn eq(&self, other: &Self) -> bool {
+        std::ptr::eq(self.poly, other.poly)
+    }
+}
+
+impl<'a, C: CurveAffine> Query<C::Scalar> for ProverQuery<'a, C> {
+    type Commitment = PolynomialPointer<'a, C>;
+    type Eval = ();
+
+    fn get_point(&self) -> C::Scalar {
+        self.point
+    }
+    fn get_eval(&self) {}
+    fn get_commitment(&self) -> Self::Commitment {
+        PolynomialPointer {
+            poly: self.poly,
+            blind: self.blind,
+        }
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/poly/multiopen/verifier.rs.html b/rustdoc/latest/src/halo2/poly/multiopen/verifier.rs.html new file mode 100644 index 00000000..06e679e0 --- /dev/null +++ b/rustdoc/latest/src/halo2/poly/multiopen/verifier.rs.html @@ -0,0 +1,328 @@ +verifier.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+
+use ff::Field;
+
+use super::super::{
+    commitment::{Guard, Params, MSM},
+    Error,
+};
+use super::{
+    construct_intermediate_sets, ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4, Query,
+    VerifierQuery,
+};
+use crate::arithmetic::{eval_polynomial, lagrange_interpolate, CurveAffine, FieldExt};
+use crate::transcript::{EncodedChallenge, TranscriptRead};
+#[derive(Debug, Clone)]
+struct CommitmentData<C: CurveAffine> {
+    set_index: usize,
+    point_indices: Vec<usize>,
+    evals: Vec<C::Scalar>,
+}
+
+/// Verify a multi-opening proof
+pub fn verify_proof<
+    'b,
+    'a: 'b,
+    I,
+    C: CurveAffine,
+    E: EncodedChallenge<C>,
+    T: TranscriptRead<C, E>,
+>(
+    params: &'a Params<C>,
+    transcript: &mut T,
+    queries: I,
+    mut msm: MSM<'a, C>,
+) -> Result<Guard<'a, C, E>, Error>
+where
+    I: IntoIterator<Item = VerifierQuery<'b, C>> + Clone,
+{
+    // Scale the MSM by a random factor to ensure that if the existing MSM
+    // has is_zero() == false then this argument won't be able to interfere
+    // with it to make it true, with high probability.
+    msm.scale(C::Scalar::rand());
+
+    // Sample x_1 for compressing openings at the same point sets together
+    let x_1: ChallengeX1<_> = transcript.squeeze_challenge_scalar();
+
+    // Sample a challenge x_2 for keeping the multi-point quotient
+    // polynomial terms linearly independent.
+    let x_2: ChallengeX2<_> = transcript.squeeze_challenge_scalar();
+
+    let (commitment_map, point_sets) = construct_intermediate_sets(queries);
+
+    // Compress the commitments and expected evaluations at x together.
+    // using the challenge x_1
+    let mut q_commitments: Vec<_> = vec![params.empty_msm(); point_sets.len()];
+
+    // A vec of vecs of evals. The outer vec corresponds to the point set,
+    // while the inner vec corresponds to the points in a particular set.
+    let mut q_eval_sets = Vec::with_capacity(point_sets.len());
+    for point_set in point_sets.iter() {
+        q_eval_sets.push(vec![C::Scalar::zero(); point_set.len()]);
+    }
+    {
+        let mut accumulate = |set_idx: usize, new_commitment, evals: Vec<C::Scalar>| {
+            q_commitments[set_idx].scale(*x_1);
+            q_commitments[set_idx].append_term(C::Scalar::one(), new_commitment);
+            for (eval, set_eval) in evals.iter().zip(q_eval_sets[set_idx].iter_mut()) {
+                *set_eval *= &(*x_1);
+                *set_eval += eval;
+            }
+        };
+
+        // Each commitment corresponds to evaluations at a set of points.
+        // For each set, we collapse each commitment's evals pointwise.
+        for commitment_data in commitment_map.into_iter() {
+            accumulate(
+                commitment_data.set_index,     // set_idx,
+                *commitment_data.commitment.0, // commitment,
+                commitment_data.evals,         // evals
+            );
+        }
+    }
+
+    // Obtain the commitment to the multi-point quotient polynomial f(X).
+    let f_commitment = transcript.read_point().map_err(|_| Error::SamplingError)?;
+
+    // Sample a challenge x_3 for checking that f(X) was committed to
+    // correctly.
+    let x_3: ChallengeX3<_> = transcript.squeeze_challenge_scalar();
+
+    let mut q_evals = Vec::with_capacity(q_eval_sets.len());
+    for _ in 0..q_eval_sets.len() {
+        q_evals.push(transcript.read_scalar().map_err(|_| Error::SamplingError)?);
+    }
+
+    // We can compute the expected msm_eval at x_3 using the q_evals provided
+    // by the prover and from x_2
+    let msm_eval = point_sets
+        .iter()
+        .zip(q_eval_sets.iter())
+        .zip(q_evals.iter())
+        .fold(
+            C::Scalar::zero(),
+            |msm_eval, ((points, evals), proof_eval)| {
+                let r_poly = lagrange_interpolate(points, evals);
+                let r_eval = eval_polynomial(&r_poly, *x_3);
+                let eval = points.iter().fold(*proof_eval - &r_eval, |eval, point| {
+                    eval * &(*x_3 - point).invert().unwrap()
+                });
+                msm_eval * &(*x_2) + &eval
+            },
+        );
+
+    // Sample a challenge x_4 that we will use to collapse the openings of
+    // the various remaining polynomials at x_3 together.
+    let x_4: ChallengeX4<_> = transcript.squeeze_challenge_scalar();
+
+    // Compute the final commitment that has to be opened
+    msm.append_term(C::Scalar::one(), f_commitment);
+    let (msm, msm_eval) = q_commitments.into_iter().zip(q_evals.iter()).fold(
+        (msm, msm_eval),
+        |(mut msm, msm_eval), (q_commitment, q_eval)| {
+            msm.scale(*x_4);
+            msm.add_msm(&q_commitment);
+            (msm, msm_eval * &(*x_4) + q_eval)
+        },
+    );
+
+    // Verify the opening proof
+    super::commitment::verify_proof(params, msm, transcript, *x_3, msm_eval)
+}
+
+#[doc(hidden)]
+#[derive(Copy, Clone)]
+pub struct CommitmentPointer<'a, C>(&'a C);
+
+impl<'a, C> PartialEq for CommitmentPointer<'a, C> {
+    fn eq(&self, other: &Self) -> bool {
+        std::ptr::eq(self.0, other.0)
+    }
+}
+
+impl<'a, C: CurveAffine> Query<C::Scalar> for VerifierQuery<'a, C> {
+    type Commitment = CommitmentPointer<'a, C>;
+    type Eval = C::Scalar;
+
+    fn get_point(&self) -> C::Scalar {
+        self.point
+    }
+    fn get_eval(&self) -> C::Scalar {
+        self.eval
+    }
+    fn get_commitment(&self) -> Self::Commitment {
+        CommitmentPointer(self.commitment)
+    }
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/src/halo2/transcript.rs.html b/rustdoc/latest/src/halo2/transcript.rs.html new file mode 100644 index 00000000..7f03919c --- /dev/null +++ b/rustdoc/latest/src/halo2/transcript.rs.html @@ -0,0 +1,622 @@ +transcript.rs - source + + + +
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+
+//! This module contains utilities and traits for dealing with Fiat-Shamir
+//! transcripts.
+
+use blake2b_simd::{Params as Blake2bParams, State as Blake2bState};
+use std::convert::TryInto;
+
+use crate::arithmetic::{Coordinates, CurveAffine, FieldExt};
+
+use std::io::{self, Read, Write};
+use std::marker::PhantomData;
+
+/// Prefix to a prover's message soliciting a challenge
+const BLAKE2B_PREFIX_CHALLENGE: u8 = 0;
+
+/// Prefix to a prover's message containing a curve point
+const BLAKE2B_PREFIX_POINT: u8 = 1;
+
+/// Prefix to a prover's message containing a scalar
+const BLAKE2B_PREFIX_SCALAR: u8 = 2;
+
+/// Generic transcript view (from either the prover or verifier's perspective)
+pub trait Transcript<C: CurveAffine, E: EncodedChallenge<C>> {
+    /// Squeeze an encoded verifier challenge from the transcript.
+    fn squeeze_challenge(&mut self) -> E;
+
+    /// Squeeze a typed challenge (in the scalar field) from the transcript.
+    fn squeeze_challenge_scalar<T>(&mut self) -> ChallengeScalar<C, T> {
+        ChallengeScalar {
+            inner: self.squeeze_challenge().get_scalar(),
+            _marker: PhantomData,
+        }
+    }
+
+    /// Writing the point to the transcript without writing it to the proof,
+    /// treating it as a common input.
+    fn common_point(&mut self, point: C) -> io::Result<()>;
+
+    /// Writing the scalar to the transcript without writing it to the proof,
+    /// treating it as a common input.
+    fn common_scalar(&mut self, scalar: C::Scalar) -> io::Result<()>;
+}
+
+/// Transcript view from the perspective of a verifier that has access to an
+/// input stream of data from the prover to the verifier.
+pub trait TranscriptRead<C: CurveAffine, E: EncodedChallenge<C>>: Transcript<C, E> {
+    /// Read a curve point from the prover.
+    fn read_point(&mut self) -> io::Result<C>;
+
+    /// Read a curve scalar from the prover.
+    fn read_scalar(&mut self) -> io::Result<C::Scalar>;
+}
+
+/// Transcript view from the perspective of a prover that has access to an
+/// output stream of messages from the prover to the verifier.
+pub trait TranscriptWrite<C: CurveAffine, E: EncodedChallenge<C>>: Transcript<C, E> {
+    /// Write a curve point to the proof and the transcript.
+    fn write_point(&mut self, point: C) -> io::Result<()>;
+
+    /// Write a scalar to the proof and the transcript.
+    fn write_scalar(&mut self, scalar: C::Scalar) -> io::Result<()>;
+}
+
+/// We will replace BLAKE2b with an algebraic hash function in a later version.
+#[derive(Debug, Clone)]
+pub struct Blake2bRead<R: Read, C: CurveAffine, E: EncodedChallenge<C>> {
+    state: Blake2bState,
+    reader: R,
+    _marker: PhantomData<(C, E)>,
+}
+
+impl<R: Read, C: CurveAffine, E: EncodedChallenge<C>> Blake2bRead<R, C, E> {
+    /// Initialize a transcript given an input buffer.
+    pub fn init(reader: R) -> Self {
+        Blake2bRead {
+            state: Blake2bParams::new()
+                .hash_length(64)
+                .personal(b"Halo2-Transcript")
+                .to_state(),
+            reader,
+            _marker: PhantomData,
+        }
+    }
+}
+
+impl<R: Read, C: CurveAffine> TranscriptRead<C, Challenge255<C>>
+    for Blake2bRead<R, C, Challenge255<C>>
+{
+    fn read_point(&mut self) -> io::Result<C> {
+        let mut compressed = C::Repr::default();
+        self.reader.read_exact(compressed.as_mut())?;
+        let point: C = Option::from(C::from_bytes(&compressed)).ok_or_else(|| {
+            io::Error::new(io::ErrorKind::Other, "invalid point encoding in proof")
+        })?;
+        self.common_point(point)?;
+
+        Ok(point)
+    }
+
+    fn read_scalar(&mut self) -> io::Result<C::Scalar> {
+        let mut data = [0u8; 32];
+        self.reader.read_exact(&mut data)?;
+        let scalar: C::Scalar = Option::from(C::Scalar::from_bytes(&data)).ok_or_else(|| {
+            io::Error::new(
+                io::ErrorKind::Other,
+                "invalid field element encoding in proof",
+            )
+        })?;
+        self.common_scalar(scalar)?;
+
+        Ok(scalar)
+    }
+}
+
+impl<R: Read, C: CurveAffine> Transcript<C, Challenge255<C>>
+    for Blake2bRead<R, C, Challenge255<C>>
+{
+    fn squeeze_challenge(&mut self) -> Challenge255<C> {
+        self.state.update(&[BLAKE2B_PREFIX_CHALLENGE]);
+        let hasher = self.state.clone();
+        let result: [u8; 64] = hasher.finalize().as_bytes().try_into().unwrap();
+        Challenge255::<C>::new(&result)
+    }
+
+    fn common_point(&mut self, point: C) -> io::Result<()> {
+        self.state.update(&[BLAKE2B_PREFIX_POINT]);
+        let coords: Coordinates<C> = Option::from(point.coordinates()).ok_or_else(|| {
+            io::Error::new(
+                io::ErrorKind::Other,
+                "cannot write points at infinity to the transcript",
+            )
+        })?;
+        self.state.update(&coords.x().to_bytes());
+        self.state.update(&coords.y().to_bytes());
+
+        Ok(())
+    }
+
+    fn common_scalar(&mut self, scalar: C::Scalar) -> io::Result<()> {
+        self.state.update(&[BLAKE2B_PREFIX_SCALAR]);
+        self.state.update(&scalar.to_bytes());
+
+        Ok(())
+    }
+}
+
+/// We will replace BLAKE2b with an algebraic hash function in a later version.
+#[derive(Debug, Clone)]
+pub struct Blake2bWrite<W: Write, C: CurveAffine, E: EncodedChallenge<C>> {
+    state: Blake2bState,
+    writer: W,
+    _marker: PhantomData<(C, E)>,
+}
+
+impl<W: Write, C: CurveAffine, E: EncodedChallenge<C>> Blake2bWrite<W, C, E> {
+    /// Initialize a transcript given an output buffer.
+    pub fn init(writer: W) -> Self {
+        Blake2bWrite {
+            state: Blake2bParams::new()
+                .hash_length(64)
+                .personal(b"Halo2-Transcript")
+                .to_state(),
+            writer,
+            _marker: PhantomData,
+        }
+    }
+
+    /// Conclude the interaction and return the output buffer (writer).
+    pub fn finalize(self) -> W {
+        // TODO: handle outstanding scalars? see issue #138
+        self.writer
+    }
+}
+
+impl<W: Write, C: CurveAffine> TranscriptWrite<C, Challenge255<C>>
+    for Blake2bWrite<W, C, Challenge255<C>>
+{
+    fn write_point(&mut self, point: C) -> io::Result<()> {
+        self.common_point(point)?;
+        let compressed = point.to_bytes();
+        self.writer.write_all(compressed.as_ref())
+    }
+    fn write_scalar(&mut self, scalar: C::Scalar) -> io::Result<()> {
+        self.common_scalar(scalar)?;
+        let data = scalar.to_bytes();
+        self.writer.write_all(&data[..])
+    }
+}
+
+impl<W: Write, C: CurveAffine> Transcript<C, Challenge255<C>>
+    for Blake2bWrite<W, C, Challenge255<C>>
+{
+    fn squeeze_challenge(&mut self) -> Challenge255<C> {
+        self.state.update(&[BLAKE2B_PREFIX_CHALLENGE]);
+        let hasher = self.state.clone();
+        let result: [u8; 64] = hasher.finalize().as_bytes().try_into().unwrap();
+        Challenge255::<C>::new(&result)
+    }
+
+    fn common_point(&mut self, point: C) -> io::Result<()> {
+        self.state.update(&[BLAKE2B_PREFIX_POINT]);
+        let coords: Coordinates<C> = Option::from(point.coordinates()).ok_or_else(|| {
+            io::Error::new(
+                io::ErrorKind::Other,
+                "cannot write points at infinity to the transcript",
+            )
+        })?;
+        self.state.update(&coords.x().to_bytes());
+        self.state.update(&coords.y().to_bytes());
+
+        Ok(())
+    }
+
+    fn common_scalar(&mut self, scalar: C::Scalar) -> io::Result<()> {
+        self.state.update(&[BLAKE2B_PREFIX_SCALAR]);
+        self.state.update(&scalar.to_bytes());
+
+        Ok(())
+    }
+}
+
+/// The scalar representation of a verifier challenge.
+///
+/// The `Type` type can be used to scope the challenge to a specific context, or
+/// set to `()` if no context is required.
+#[derive(Copy, Clone, Debug)]
+pub struct ChallengeScalar<C: CurveAffine, T> {
+    inner: C::Scalar,
+    _marker: PhantomData<T>,
+}
+
+impl<C: CurveAffine, T> std::ops::Deref for ChallengeScalar<C, T> {
+    type Target = C::Scalar;
+
+    fn deref(&self) -> &Self::Target {
+        &self.inner
+    }
+}
+
+/// `EncodedChallenge<C>` defines a challenge encoding with a [`Self::Input`]
+/// that is used to derive the challenge encoding and `get_challenge` obtains
+/// the _real_ `C::Scalar` that the challenge encoding represents.
+pub trait EncodedChallenge<C: CurveAffine> {
+    /// The Input type used to derive the challenge encoding. For example,
+    /// an input from the Poseidon hash would be a base field element;
+    /// an input from the Blake2b hash would be a [u8; 64].
+    type Input;
+
+    /// Get an encoded challenge from a given input challenge.
+    fn new(challenge_input: &Self::Input) -> Self;
+
+    /// Get a scalar field element from an encoded challenge.
+    fn get_scalar(&self) -> C::Scalar;
+
+    /// Cast an encoded challenge as a typed `ChallengeScalar`.
+    fn as_challenge_scalar<T>(&self) -> ChallengeScalar<C, T> {
+        ChallengeScalar {
+            inner: self.get_scalar(),
+            _marker: PhantomData,
+        }
+    }
+}
+
+/// A 255-bit challenge.
+#[derive(Copy, Clone, Debug)]
+pub struct Challenge255<C: CurveAffine>([u8; 32], PhantomData<C>);
+
+impl<C: CurveAffine> std::ops::Deref for Challenge255<C> {
+    type Target = [u8; 32];
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl<C: CurveAffine> EncodedChallenge<C> for Challenge255<C> {
+    type Input = [u8; 64];
+
+    fn new(challenge_input: &[u8; 64]) -> Self {
+        Challenge255(
+            C::Scalar::from_bytes_wide(challenge_input).to_bytes(),
+            PhantomData,
+        )
+    }
+    fn get_scalar(&self) -> C::Scalar {
+        C::Scalar::from_bytes(&self.0).unwrap()
+    }
+}
+
+pub(crate) fn read_n_points<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+    transcript: &mut T,
+    n: usize,
+) -> io::Result<Vec<C>> {
+    (0..n).map(|_| transcript.read_point()).collect()
+}
+
+pub(crate) fn read_n_scalars<C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRead<C, E>>(
+    transcript: &mut T,
+    n: usize,
+) -> io::Result<Vec<C::Scalar>> {
+    (0..n).map(|_| transcript.read_scalar()).collect()
+}
+
+
+ + \ No newline at end of file diff --git a/rustdoc/latest/storage.js b/rustdoc/latest/storage.js new file mode 100644 index 00000000..6b16cbd8 --- /dev/null +++ b/rustdoc/latest/storage.js @@ -0,0 +1 @@ +var resourcesSuffix="";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} \ No newline at end of file diff --git a/rustdoc/latest/wheel.svg b/rustdoc/latest/wheel.svg new file mode 100644 index 00000000..01da3b24 --- /dev/null +++ b/rustdoc/latest/wheel.svg @@ -0,0 +1 @@ + \ No newline at end of file