@maci-protocol/website 0.0.0-ci.185b643
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +157 -0
- package/CHANGELOG.md +566 -0
- package/LICENSE +22 -0
- package/README.md +58 -0
- package/babel.config.js +3 -0
- package/blog/2021-10-12-maci-v1.md +100 -0
- package/blog/2022-09-22-maci-v1-technical-introduction.md +180 -0
- package/blog/2023-01-18-maci-v1.1.1.md +121 -0
- package/blog/2024-01-18-roadmap.md +106 -0
- package/blog/2024-02-28-maci-v1.2.0.md +121 -0
- package/blog/2024-04-10-roadmap-q2.md +96 -0
- package/blog/2024-05-08-ethdam.md +169 -0
- package/blog/2024-05-22-the-origins-of-maci.md +38 -0
- package/blog/2024-05-28-upcoming-grants.md +85 -0
- package/blog/2024-06-17-understanding-maci.md +63 -0
- package/blog/2024-06-21-deciphering-maci.md +48 -0
- package/blog/2024-06-28-revolusioning-public-goods-funding.md +32 -0
- package/blog/2024-07-23-q2-review.md +72 -0
- package/blog/2024-07-30-roadmap-q3.md +61 -0
- package/blog/2024-08-10-maci-v2.md +102 -0
- package/blog/2024-08-29-anonymous-poll-joining.md +47 -0
- package/blog/2024-10-29-q3-review.md +63 -0
- package/blog/2024-11-20-maci-platform.md +93 -0
- package/blog/2024-12-01-maci-getting-started.md +294 -0
- package/blog/2025-03-21-roadmap-2025.md +112 -0
- package/blog/assets/MACI_Bob_SignUp_1.png +0 -0
- package/blog/assets/MACI_Bob_SignUp_2.png +0 -0
- package/blog/assets/MACI_Complex_Message.png +0 -0
- package/blog/assets/MACI_Contracts.png +0 -0
- package/blog/assets/MACI_Sign_Up.png +0 -0
- package/blog/assets/MACI_Simple_Message.png +0 -0
- package/blog/assets/MACI_Verifier_1.png +0 -0
- package/blog/authors.yml +5 -0
- package/docusaurus.config.ts +213 -0
- package/package.json +65 -0
- package/src/components/ActionCard/index.tsx +30 -0
- package/src/components/ActionCard/styles.module.css +96 -0
- package/src/components/HomepageFeatures/index.tsx +91 -0
- package/src/components/HomepageFeatures/styles.module.css +17 -0
- package/src/components/ProjectCard/index.tsx +74 -0
- package/src/components/ProjectCard/styles.module.css +77 -0
- package/src/components/ProjectList/index.tsx +218 -0
- package/src/components/ProjectList/styles.module.css +180 -0
- package/src/content/projects.json +294 -0
- package/src/css/card.module.css +130 -0
- package/src/css/custom.css +91 -0
- package/src/icons/IconDiscord.tsx +16 -0
- package/src/icons/IconGithub.tsx +16 -0
- package/src/icons/IconWebsite.tsx +16 -0
- package/src/pages/blogs.tsx +58 -0
- package/src/pages/index.module.css +152 -0
- package/src/pages/index.tsx +66 -0
- package/src/pages/projects.tsx +44 -0
- package/src/pages/roadmap.md +150 -0
- package/src/pages/typedoc.tsx +11 -0
- package/src/plugins/blog-plugin/index.ts +86 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/scripts/setupSolidityDocs.ts +67 -0
- package/src/scripts/setupTypedoc.ts +112 -0
- package/src/scripts/utils.ts +115 -0
- package/src/utils/getProjectsByFilter.ts +40 -0
- package/static/.nojekyll +0 -0
- package/static/audit_reports/20210922_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/202220930_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/20240223_PSE_Audit_audit_report.pdf +0 -0
- package/static/audit_reports/20240731_PSE_Audit_audit_report.pdf +0 -0
- package/static/fonts/DM_Sans.woff2 +0 -0
- package/static/fonts/Share_Tech_Mono.woff2 +0 -0
- package/static/img/box.png +0 -0
- package/static/img/box_dark.png +0 -0
- package/static/img/chain.png +0 -0
- package/static/img/chain_dark.png +0 -0
- package/static/img/chart.png +0 -0
- package/static/img/chart_dark.png +0 -0
- package/static/img/circuits/MACI-Circuits.excalidraw +39652 -0
- package/static/img/circuits/calculateTotal.svg +21 -0
- package/static/img/circuits/ecdh.svg +21 -0
- package/static/img/circuits/messageToCommand.svg +21 -0
- package/static/img/circuits/messageValidator.svg +21 -0
- package/static/img/circuits/poseidonHasher13.svg +21 -0
- package/static/img/circuits/privToPubkey.svg +21 -0
- package/static/img/circuits/processMessages.svg +21 -0
- package/static/img/circuits/processMessagesInputHasher.svg +21 -0
- package/static/img/circuits/processMessages_2_0.svg +21 -0
- package/static/img/circuits/processOne.svg +21 -0
- package/static/img/circuits/processTopup.svg +21 -0
- package/static/img/circuits/processingAfterPollEnds.svg +21 -0
- package/static/img/circuits/quinBatchLeavesExists.svg +21 -0
- package/static/img/circuits/quinCheckRoot.svg +21 -0
- package/static/img/circuits/quinGeneratePathIndices.svg +21 -0
- package/static/img/circuits/quinSelector.svg +21 -0
- package/static/img/circuits/resultsCommitmentVerifier.svg +21 -0
- package/static/img/circuits/splicer.svg +21 -0
- package/static/img/circuits/tallyInputHasher.svg +21 -0
- package/static/img/circuits/tallyVotes.svg +21 -0
- package/static/img/circuits/unpackElement.svg +21 -0
- package/static/img/circuits/verifySignature.svg +21 -0
- package/static/img/completingAPoll.svg +4 -0
- package/static/img/contracts.svg +16 -0
- package/static/img/coordinatorComponents.svg +21 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/generateProofs.svg +4 -0
- package/static/img/hero.svg +9 -0
- package/static/img/maci-card.png +0 -0
- package/static/img/maci-rpgf-design.jpg +0 -0
- package/static/img/messageProcessingLocal.svg +21 -0
- package/static/img/offlineProcessing.svg +21 -0
- package/static/img/pse-logo-round.png +0 -0
- package/static/img/relayer-diagram.png +0 -0
- package/static/img/tallyCommitments.svg +4 -0
- package/static/img/voteTallyingLocal.svg +21 -0
- package/tsconfig.json +34 -0
- package/versioned_docs/version-v0.x/circuits.md +22 -0
- package/versioned_docs/version-v0.x/contract.md +186 -0
- package/versioned_docs/version-v0.x/faq.md +67 -0
- package/versioned_docs/version-v0.x/introduction.md +119 -0
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +138 -0
- package/versioned_docs/version-v0.x/state-root-transition-circuit.md +230 -0
- package/versioned_docs/version-v1.2/audit.md +160 -0
- package/versioned_docs/version-v1.2/ci-pipeline.md +38 -0
- package/versioned_docs/version-v1.2/circuits.md +508 -0
- package/versioned_docs/version-v1.2/cli.md +689 -0
- package/versioned_docs/version-v1.2/contracts.md +445 -0
- package/versioned_docs/version-v1.2/contributing/code-of-conduct.md +91 -0
- package/versioned_docs/version-v1.2/contributing/contributing.md +129 -0
- package/versioned_docs/version-v1.2/coordinator-processing.md +46 -0
- package/versioned_docs/version-v1.2/deployment.md +122 -0
- package/versioned_docs/version-v1.2/installation.md +175 -0
- package/versioned_docs/version-v1.2/integrating.md +200 -0
- package/versioned_docs/version-v1.2/introduction.md +94 -0
- package/versioned_docs/version-v1.2/key-change.md +182 -0
- package/versioned_docs/version-v1.2/overview.md +47 -0
- package/versioned_docs/version-v1.2/poll-types.md +68 -0
- package/versioned_docs/version-v1.2/primitives.md +216 -0
- package/versioned_docs/version-v1.2/project-ideas.md +14 -0
- package/versioned_docs/version-v1.2/purpose.md +62 -0
- package/versioned_docs/version-v1.2/solidity-docs/MACI.md +345 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessor.md +266 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessorFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/Poll.md +381 -0
- package/versioned_docs/version-v1.2/solidity-docs/PollFactory.md +50 -0
- package/versioned_docs/version-v1.2/solidity-docs/SignUpToken.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Subsidy.md +218 -0
- package/versioned_docs/version-v1.2/solidity-docs/SubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Tally.md +311 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQv.md +296 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQvFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TopupCredit.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/VkRegistry.md +457 -0
- package/versioned_docs/version-v1.2/solidity-docs/benchmarks/HasherBenchmarks.md +44 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Hasher.md +125 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/IVerifier.md +11 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/MockVerifier.md +17 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Pairing.md +85 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT3.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT4.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT5.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT6.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkCommon.md +16 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkConstants.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Verifier.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/EASGatekeeper.md +121 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/FreeForAllSignUpGatekeeper.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpGatekeeper.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpTokenGatekeeper.md +93 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperBase.md +79 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperMultiple.md +48 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperSingle.md +42 -0
- package/versioned_docs/version-v1.2/solidity-docs/index.md +4 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/InitialVoiceCreditProxy.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IEAS.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IHats.md +103 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMPFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMessageProcessor.md +31 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPoll.md +217 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPollFactory.md +29 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallyFactory.md +28 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallySubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVerifier.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVkRegistry.md +70 -0
- package/versioned_docs/version-v1.2/solidity-docs/mocks/MockHatsProtocol.md +133 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueue.md +464 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary.md +60 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinaryMaci.md +34 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary.md +75 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryBlankSl.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryMaci.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/EmptyBallotRoots.md +13 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/CommonUtilities.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/DomainObjs.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Params.md +36 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Utilities.md +79 -0
- package/versioned_docs/version-v1.2/spec.md +944 -0
- package/versioned_docs/version-v1.2/testing-in-detail.md +209 -0
- package/versioned_docs/version-v1.2/testing.md +472 -0
- package/versioned_docs/version-v1.2/topup.md +43 -0
- package/versioned_docs/version-v1.2/troubleshooting.md +51 -0
- package/versioned_docs/version-v1.2/trusted-setup.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/cli/index.md +15 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/AirdropArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployPollArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployedContracts.md +130 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenLocalStateArgs.md +168 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenProofsArgs.md +388 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IGenKeypairArgs.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IRegisteredUserArgs.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeMessagesArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeSignupsArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PollContracts.md +53 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/ProveOnChainArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PublishArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SignupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SubsidyData.md +73 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TallyData.md +166 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TopupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/VerifyArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/modules.md +556 -0
- package/versioned_docs/version-v1.2/typedoc/core/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/MaciState.md +295 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/Poll.md +1098 -0
- package/versioned_docs/version-v1.2/typedoc/core/index.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/BatchSizes.md +50 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IJsonMaciState.md +77 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IProcessMessagesCircuitInputs.md +242 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ISubsidyCircuitInputs.md +198 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ITallyCircuitInputs.md +231 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/MaxValues.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/TreeDepths.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/core/modules.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/AccQueue.md +770 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G1Point.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G2Point.md +140 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/IncrementalQuinTree.md +470 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/index.md +44 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Keypair.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/PoseidonFuncs.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Queue.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Signature.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/modules.md +913 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Ballot.md +274 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Keypair.md +181 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Message.md +244 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PCommand.md +409 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PrivKey.md +206 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PubKey.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/StateLeaf.md +340 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/TCommand.md +200 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/VerifyingKey.md +240 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/index.md +81 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/ICommand.md +104 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG1ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG2ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonBallot.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonCommand.md +32 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonKeyPair.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonPCommand.md +111 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonStateLeaf.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonTCommand.md +67 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IMessageContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeaf.md +39 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeafContractParams.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkContractParams.md +64 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkObjectParams.md +108 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/Proof.md +46 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/VoteOptionTreeLeaf.md +24 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/modules.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/index.md +4 -0
- package/versioned_docs/version-v1.2/versioning.md +94 -0
- package/versioned_docs/version-v1.2/workflow.md +142 -0
- package/versioned_docs/version-v2.x/case-studies.md +35 -0
- package/versioned_docs/version-v2.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v2.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v2.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v2.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v2.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v2.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v2.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +23 -0
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +106 -0
- package/versioned_docs/version-v2.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v2.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +142 -0
- package/versioned_docs/version-v2.x/getting-started.md +313 -0
- package/versioned_docs/version-v2.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/compile-circuits.md +163 -0
- package/versioned_docs/version-v2.x/guides/frontend.md +99 -0
- package/versioned_docs/version-v2.x/guides/integrating.md +73 -0
- package/versioned_docs/version-v2.x/guides/maciWrapper.md +173 -0
- package/versioned_docs/version-v2.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v2.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +203 -0
- package/versioned_docs/version-v2.x/guides/testing/testing.md +163 -0
- package/versioned_docs/version-v2.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v2.x/introduction.md +146 -0
- package/versioned_docs/version-v2.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v2.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v2.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v2.x/resources.md +33 -0
- package/versioned_docs/version-v2.x/security/_category_.json +4 -0
- package/versioned_docs/version-v2.x/security/audit.md +167 -0
- package/versioned_docs/version-v2.x/security/trusted-setup.md +166 -0
- package/versioned_docs/version-v2.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +1108 -0
- package/versioned_docs/version-v2.x/supported-networks/supported-networks.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +21 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Gatekeepers.md +40 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +152 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +32 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +104 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +43 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +45 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +57 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v2.x/technical-references/technical-references.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/cli.md +699 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +107 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/setup.md +101 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +37 -0
- package/versioned_docs/version-v2.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v2.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v2.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v2.x/use-cases/public-goods.md +65 -0
- package/versioned_docs/version-v3.x/case-studies.md +35 -0
- package/versioned_docs/version-v3.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v3.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v3.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v3.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v3.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v3.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v3.x/core-concepts/coordinator-service.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v3.x/core-concepts/merkle-trees.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/offchain-voting.md +14 -0
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +58 -0
- package/versioned_docs/version-v3.x/core-concepts/polls.md +81 -0
- package/versioned_docs/version-v3.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +149 -0
- package/versioned_docs/version-v3.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +175 -0
- package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
- package/versioned_docs/version-v3.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v3.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +191 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +158 -0
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v3.x/introduction.md +153 -0
- package/versioned_docs/version-v3.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v3.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v3.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v3.x/quick-start.md +318 -0
- package/versioned_docs/version-v3.x/resources.md +33 -0
- package/versioned_docs/version-v3.x/security/_category_.json +4 -0
- package/versioned_docs/version-v3.x/security/audit.md +167 -0
- package/versioned_docs/version-v3.x/security/trusted-setup.md +172 -0
- package/versioned_docs/version-v3.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +112 -0
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +53 -0
- package/versioned_docs/version-v3.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +10 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/index.md +51 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/installation.md +109 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +160 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +39 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +170 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +62 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +48 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +52 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +106 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +96 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +42 -0
- package/versioned_docs/version-v3.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v3.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v3.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v3.x/use-cases/public-goods.md +65 -0
- package/versioned_sidebars/version-v0.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v1.2-sidebars.json +8 -0
- package/versioned_sidebars/version-v2.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v3.x-sidebars.json +8 -0
- package/versions.json +1 -0
|
@@ -0,0 +1,913 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Crypto Module
|
|
3
|
+
sidebar_label: module
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of contents
|
|
8
|
+
|
|
9
|
+
### Classes
|
|
10
|
+
|
|
11
|
+
- [AccQueue](classes/AccQueue.md)
|
|
12
|
+
- [G1Point](classes/G1Point.md)
|
|
13
|
+
- [G2Point](classes/G2Point.md)
|
|
14
|
+
- [IncrementalQuinTree](classes/IncrementalQuinTree.md)
|
|
15
|
+
|
|
16
|
+
### Interfaces
|
|
17
|
+
|
|
18
|
+
- [Keypair](interfaces/Keypair.md)
|
|
19
|
+
- [PoseidonFuncs](interfaces/PoseidonFuncs.md)
|
|
20
|
+
- [Queue](interfaces/Queue.md)
|
|
21
|
+
- [Signature](interfaces/Signature.md)
|
|
22
|
+
|
|
23
|
+
### Type Aliases
|
|
24
|
+
|
|
25
|
+
- [Ciphertext](modules.md#ciphertext)
|
|
26
|
+
- [EcdhSharedKey](modules.md#ecdhsharedkey)
|
|
27
|
+
- [Leaf](modules.md#leaf)
|
|
28
|
+
- [PathElements](modules.md#pathelements)
|
|
29
|
+
- [Plaintext](modules.md#plaintext)
|
|
30
|
+
- [Point](modules.md#point)
|
|
31
|
+
- [PrivKey](modules.md#privkey)
|
|
32
|
+
- [PubKey](modules.md#pubkey)
|
|
33
|
+
|
|
34
|
+
### Variables
|
|
35
|
+
|
|
36
|
+
- [NOTHING_UP_MY_SLEEVE](modules.md#nothing_up_my_sleeve)
|
|
37
|
+
- [SNARK_FIELD_SIZE](modules.md#snark_field_size)
|
|
38
|
+
|
|
39
|
+
### Functions
|
|
40
|
+
|
|
41
|
+
- [bigInt2Buffer](modules.md#bigint2buffer)
|
|
42
|
+
- [calcDepthFromNumLeaves](modules.md#calcdepthfromnumleaves)
|
|
43
|
+
- [deepCopyBigIntArray](modules.md#deepcopybigintarray)
|
|
44
|
+
- [formatPrivKeyForBabyJub](modules.md#formatprivkeyforbabyjub)
|
|
45
|
+
- [genEcdhSharedKey](modules.md#genecdhsharedkey)
|
|
46
|
+
- [genKeypair](modules.md#genkeypair)
|
|
47
|
+
- [genPrivKey](modules.md#genprivkey)
|
|
48
|
+
- [genPubKey](modules.md#genpubkey)
|
|
49
|
+
- [genRandomBabyJubValue](modules.md#genrandombabyjubvalue)
|
|
50
|
+
- [genRandomSalt](modules.md#genrandomsalt)
|
|
51
|
+
- [genTreeCommitment](modules.md#gentreecommitment)
|
|
52
|
+
- [genTreeProof](modules.md#gentreeproof)
|
|
53
|
+
- [hash13](modules.md#hash13)
|
|
54
|
+
- [hash2](modules.md#hash2)
|
|
55
|
+
- [hash3](modules.md#hash3)
|
|
56
|
+
- [hash4](modules.md#hash4)
|
|
57
|
+
- [hash5](modules.md#hash5)
|
|
58
|
+
- [hashLeftRight](modules.md#hashleftright)
|
|
59
|
+
- [hashN](modules.md#hashn)
|
|
60
|
+
- [hashOne](modules.md#hashone)
|
|
61
|
+
- [packPubKey](modules.md#packpubkey)
|
|
62
|
+
- [poseidonDecrypt](modules.md#poseidondecrypt)
|
|
63
|
+
- [poseidonDecryptWithoutCheck](modules.md#poseidondecryptwithoutcheck)
|
|
64
|
+
- [poseidonEncrypt](modules.md#poseidonencrypt)
|
|
65
|
+
- [sha256Hash](modules.md#sha256hash)
|
|
66
|
+
- [sign](modules.md#sign)
|
|
67
|
+
- [stringifyBigInts](modules.md#stringifybigints)
|
|
68
|
+
- [unpackPubKey](modules.md#unpackpubkey)
|
|
69
|
+
- [unstringifyBigInts](modules.md#unstringifybigints)
|
|
70
|
+
- [verifySignature](modules.md#verifysignature)
|
|
71
|
+
|
|
72
|
+
## Type Aliases
|
|
73
|
+
|
|
74
|
+
### Ciphertext
|
|
75
|
+
|
|
76
|
+
Ƭ **Ciphertext**\<`N`\>: `N`[]
|
|
77
|
+
|
|
78
|
+
#### Type parameters
|
|
79
|
+
|
|
80
|
+
| Name | Type |
|
|
81
|
+
| :--- | :------- |
|
|
82
|
+
| `N` | `bigint` |
|
|
83
|
+
|
|
84
|
+
#### Defined in
|
|
85
|
+
|
|
86
|
+
[crypto/ts/types.ts:21](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L21)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### EcdhSharedKey
|
|
91
|
+
|
|
92
|
+
Ƭ **EcdhSharedKey**\<`N`\>: [`N`, `N`]
|
|
93
|
+
|
|
94
|
+
#### Type parameters
|
|
95
|
+
|
|
96
|
+
| Name | Type |
|
|
97
|
+
| :--- | :------- |
|
|
98
|
+
| `N` | `bigint` |
|
|
99
|
+
|
|
100
|
+
#### Defined in
|
|
101
|
+
|
|
102
|
+
[crypto/ts/types.ts:12](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L12)
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### Leaf
|
|
107
|
+
|
|
108
|
+
Ƭ **Leaf**: `bigint`
|
|
109
|
+
|
|
110
|
+
#### Defined in
|
|
111
|
+
|
|
112
|
+
[crypto/ts/types.ts:64](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L64)
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### PathElements
|
|
117
|
+
|
|
118
|
+
Ƭ **PathElements**: `bigint`[][]
|
|
119
|
+
|
|
120
|
+
#### Defined in
|
|
121
|
+
|
|
122
|
+
[crypto/ts/types.ts:24](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L24)
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### Plaintext
|
|
127
|
+
|
|
128
|
+
Ƭ **Plaintext**\<`N`\>: `N`[]
|
|
129
|
+
|
|
130
|
+
#### Type parameters
|
|
131
|
+
|
|
132
|
+
| Name | Type |
|
|
133
|
+
| :--- | :------- |
|
|
134
|
+
| `N` | `bigint` |
|
|
135
|
+
|
|
136
|
+
#### Defined in
|
|
137
|
+
|
|
138
|
+
[crypto/ts/types.ts:18](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L18)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### Point
|
|
143
|
+
|
|
144
|
+
Ƭ **Point**\<`N`\>: [`N`, `N`]
|
|
145
|
+
|
|
146
|
+
#### Type parameters
|
|
147
|
+
|
|
148
|
+
| Name | Type |
|
|
149
|
+
| :--- | :--------------- |
|
|
150
|
+
| `N` | `SnarkBigNumber` |
|
|
151
|
+
|
|
152
|
+
#### Defined in
|
|
153
|
+
|
|
154
|
+
[crypto/ts/types.ts:15](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L15)
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### PrivKey
|
|
159
|
+
|
|
160
|
+
Ƭ **PrivKey**: `SnarkBigNumber`
|
|
161
|
+
|
|
162
|
+
#### Defined in
|
|
163
|
+
|
|
164
|
+
[crypto/ts/types.ts:6](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L6)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### PubKey
|
|
169
|
+
|
|
170
|
+
Ƭ **PubKey**\<`N`\>: [`N`, `N`]
|
|
171
|
+
|
|
172
|
+
#### Type parameters
|
|
173
|
+
|
|
174
|
+
| Name | Type |
|
|
175
|
+
| :--- | :------- |
|
|
176
|
+
| `N` | `bigint` |
|
|
177
|
+
|
|
178
|
+
#### Defined in
|
|
179
|
+
|
|
180
|
+
[crypto/ts/types.ts:9](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/types.ts#L9)
|
|
181
|
+
|
|
182
|
+
## Variables
|
|
183
|
+
|
|
184
|
+
### NOTHING_UP_MY_SLEEVE
|
|
185
|
+
|
|
186
|
+
• `Const` **NOTHING_UP_MY_SLEEVE**: `bigint`
|
|
187
|
+
|
|
188
|
+
#### Defined in
|
|
189
|
+
|
|
190
|
+
[crypto/ts/constants.ts:10](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/constants.ts#L10)
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### SNARK_FIELD_SIZE
|
|
195
|
+
|
|
196
|
+
• `Const` **SNARK_FIELD_SIZE**: `bigint` = `r`
|
|
197
|
+
|
|
198
|
+
#### Defined in
|
|
199
|
+
|
|
200
|
+
[crypto/ts/constants.ts:6](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/constants.ts#L6)
|
|
201
|
+
|
|
202
|
+
## Functions
|
|
203
|
+
|
|
204
|
+
### bigInt2Buffer
|
|
205
|
+
|
|
206
|
+
▸ **bigInt2Buffer**(`i`): `Buffer`
|
|
207
|
+
|
|
208
|
+
Convert a BigInt to a Buffer
|
|
209
|
+
|
|
210
|
+
#### Parameters
|
|
211
|
+
|
|
212
|
+
| Name | Type | Description |
|
|
213
|
+
| :--- | :------- | :-------------------- |
|
|
214
|
+
| `i` | `bigint` | the bigint to convert |
|
|
215
|
+
|
|
216
|
+
#### Returns
|
|
217
|
+
|
|
218
|
+
`Buffer`
|
|
219
|
+
|
|
220
|
+
the buffer
|
|
221
|
+
|
|
222
|
+
#### Defined in
|
|
223
|
+
|
|
224
|
+
[crypto/ts/bigIntUtils.ts:127](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/bigIntUtils.ts#L127)
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### calcDepthFromNumLeaves
|
|
229
|
+
|
|
230
|
+
▸ **calcDepthFromNumLeaves**(`hashLength`, `numLeaves`): `number`
|
|
231
|
+
|
|
232
|
+
Calculate the depth of a tree given the number of leaves
|
|
233
|
+
|
|
234
|
+
#### Parameters
|
|
235
|
+
|
|
236
|
+
| Name | Type | Description |
|
|
237
|
+
| :----------- | :------- | :-------------------------------- |
|
|
238
|
+
| `hashLength` | `number` | the hashing function param length |
|
|
239
|
+
| `numLeaves` | `number` | how many leaves |
|
|
240
|
+
|
|
241
|
+
#### Returns
|
|
242
|
+
|
|
243
|
+
`number`
|
|
244
|
+
|
|
245
|
+
the depth
|
|
246
|
+
|
|
247
|
+
#### Defined in
|
|
248
|
+
|
|
249
|
+
[crypto/ts/utils.ts:10](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/utils.ts#L10)
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### deepCopyBigIntArray
|
|
254
|
+
|
|
255
|
+
▸ **deepCopyBigIntArray**(`arr`): `bigint`[]
|
|
256
|
+
|
|
257
|
+
Create a copy of a bigint array
|
|
258
|
+
|
|
259
|
+
#### Parameters
|
|
260
|
+
|
|
261
|
+
| Name | Type | Description |
|
|
262
|
+
| :---- | :--------- | :--------------------------- |
|
|
263
|
+
| `arr` | `bigint`[] | the array of bigints to copy |
|
|
264
|
+
|
|
265
|
+
#### Returns
|
|
266
|
+
|
|
267
|
+
`bigint`[]
|
|
268
|
+
|
|
269
|
+
a deep copy of the array
|
|
270
|
+
|
|
271
|
+
#### Defined in
|
|
272
|
+
|
|
273
|
+
[crypto/ts/bigIntUtils.ts:110](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/bigIntUtils.ts#L110)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### formatPrivKeyForBabyJub
|
|
278
|
+
|
|
279
|
+
▸ **formatPrivKeyForBabyJub**(`privKey`): `bigint`
|
|
280
|
+
|
|
281
|
+
An internal function which formats a random private key to be compatible
|
|
282
|
+
with the BabyJub curve. This is the format which should be passed into the
|
|
283
|
+
PubKey and other circuits.
|
|
284
|
+
|
|
285
|
+
#### Parameters
|
|
286
|
+
|
|
287
|
+
| Name | Type | Description |
|
|
288
|
+
| :-------- | :--------------- | :----------------------------------------- |
|
|
289
|
+
| `privKey` | `SnarkBigNumber` | A private key generated using genPrivKey() |
|
|
290
|
+
|
|
291
|
+
#### Returns
|
|
292
|
+
|
|
293
|
+
`bigint`
|
|
294
|
+
|
|
295
|
+
A BabyJub-compatible private key.
|
|
296
|
+
|
|
297
|
+
#### Defined in
|
|
298
|
+
|
|
299
|
+
[crypto/ts/keys.ts:28](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L28)
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### genEcdhSharedKey
|
|
304
|
+
|
|
305
|
+
▸ **genEcdhSharedKey**(`privKey`, `pubKey`): [`EcdhSharedKey`](modules.md#ecdhsharedkey)
|
|
306
|
+
|
|
307
|
+
Generates an Elliptic-Curve Diffie–Hellman (ECDH) shared key given a private
|
|
308
|
+
key and a public key.
|
|
309
|
+
|
|
310
|
+
#### Parameters
|
|
311
|
+
|
|
312
|
+
| Name | Type | Description |
|
|
313
|
+
| :-------- | :---------------------------- | :----------------------------------------- |
|
|
314
|
+
| `privKey` | `SnarkBigNumber` | A private key generated using genPrivKey() |
|
|
315
|
+
| `pubKey` | [`PubKey`](modules.md#pubkey) | A public key generated using genPubKey() |
|
|
316
|
+
|
|
317
|
+
#### Returns
|
|
318
|
+
|
|
319
|
+
[`EcdhSharedKey`](modules.md#ecdhsharedkey)
|
|
320
|
+
|
|
321
|
+
The ECDH shared key.
|
|
322
|
+
|
|
323
|
+
#### Defined in
|
|
324
|
+
|
|
325
|
+
[crypto/ts/keys.ts:76](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L76)
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
### genKeypair
|
|
330
|
+
|
|
331
|
+
▸ **genKeypair**(): [`Keypair`](interfaces/Keypair.md)
|
|
332
|
+
|
|
333
|
+
Generates a keypair.
|
|
334
|
+
|
|
335
|
+
#### Returns
|
|
336
|
+
|
|
337
|
+
[`Keypair`](interfaces/Keypair.md)
|
|
338
|
+
|
|
339
|
+
a keypair
|
|
340
|
+
|
|
341
|
+
#### Defined in
|
|
342
|
+
|
|
343
|
+
[crypto/ts/keys.ts:60](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L60)
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
### genPrivKey
|
|
348
|
+
|
|
349
|
+
▸ **genPrivKey**(): `bigint`
|
|
350
|
+
|
|
351
|
+
Generate a private key
|
|
352
|
+
|
|
353
|
+
#### Returns
|
|
354
|
+
|
|
355
|
+
`bigint`
|
|
356
|
+
|
|
357
|
+
A random seed for a private key.
|
|
358
|
+
|
|
359
|
+
#### Defined in
|
|
360
|
+
|
|
361
|
+
[crypto/ts/keys.ts:13](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L13)
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
### genPubKey
|
|
366
|
+
|
|
367
|
+
▸ **genPubKey**(`privKey`): [`PubKey`](modules.md#pubkey)
|
|
368
|
+
|
|
369
|
+
#### Parameters
|
|
370
|
+
|
|
371
|
+
| Name | Type | Description |
|
|
372
|
+
| :-------- | :--------------- | :----------------------------------------- |
|
|
373
|
+
| `privKey` | `SnarkBigNumber` | A private key generated using genPrivKey() |
|
|
374
|
+
|
|
375
|
+
#### Returns
|
|
376
|
+
|
|
377
|
+
[`PubKey`](modules.md#pubkey)
|
|
378
|
+
|
|
379
|
+
A public key associated with the private key
|
|
380
|
+
|
|
381
|
+
#### Defined in
|
|
382
|
+
|
|
383
|
+
[crypto/ts/keys.ts:51](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L51)
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
### genRandomBabyJubValue
|
|
388
|
+
|
|
389
|
+
▸ **genRandomBabyJubValue**(): `bigint`
|
|
390
|
+
|
|
391
|
+
Returns a BabyJub-compatible random value. We create it by first generating
|
|
392
|
+
a random value (initially 256 bits large) modulo the snark field size as
|
|
393
|
+
described in EIP197. This results in a key size of roughly 253 bits and no
|
|
394
|
+
more than 254 bits. To prevent modulo bias, we then use this efficient
|
|
395
|
+
algorithm:
|
|
396
|
+
http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/crypt/arc4random_uniform.c
|
|
397
|
+
|
|
398
|
+
#### Returns
|
|
399
|
+
|
|
400
|
+
`bigint`
|
|
401
|
+
|
|
402
|
+
A BabyJub-compatible random value.
|
|
403
|
+
|
|
404
|
+
#### Defined in
|
|
405
|
+
|
|
406
|
+
[crypto/ts/babyjub.ts:115](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/babyjub.ts#L115)
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
### genRandomSalt
|
|
411
|
+
|
|
412
|
+
▸ **genRandomSalt**(): `bigint`
|
|
413
|
+
|
|
414
|
+
Generate a random value
|
|
415
|
+
|
|
416
|
+
#### Returns
|
|
417
|
+
|
|
418
|
+
`bigint`
|
|
419
|
+
|
|
420
|
+
A BabyJub-compatible salt.
|
|
421
|
+
|
|
422
|
+
#### Defined in
|
|
423
|
+
|
|
424
|
+
[crypto/ts/keys.ts:19](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L19)
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### genTreeCommitment
|
|
429
|
+
|
|
430
|
+
▸ **genTreeCommitment**(`leaves`, `salt`, `depth`): `bigint`
|
|
431
|
+
|
|
432
|
+
A helper function which hashes a list of results with a salt and returns the
|
|
433
|
+
hash.
|
|
434
|
+
|
|
435
|
+
#### Parameters
|
|
436
|
+
|
|
437
|
+
| Name | Type | Description |
|
|
438
|
+
| :------- | :--------- | :--------------- |
|
|
439
|
+
| `leaves` | `bigint`[] | A list of values |
|
|
440
|
+
| `salt` | `bigint` | A random salt |
|
|
441
|
+
| `depth` | `number` | The tree depth |
|
|
442
|
+
|
|
443
|
+
#### Returns
|
|
444
|
+
|
|
445
|
+
`bigint`
|
|
446
|
+
|
|
447
|
+
The hash of the leaves and the salt, with the salt last
|
|
448
|
+
|
|
449
|
+
#### Defined in
|
|
450
|
+
|
|
451
|
+
[crypto/ts/utils.ts:30](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/utils.ts#L30)
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### genTreeProof
|
|
456
|
+
|
|
457
|
+
▸ **genTreeProof**(`index`, `leaves`, `depth`): `bigint`[][]
|
|
458
|
+
|
|
459
|
+
A helper function to generate the tree proof for the value at the given index in the leaves
|
|
460
|
+
|
|
461
|
+
#### Parameters
|
|
462
|
+
|
|
463
|
+
| Name | Type | Description |
|
|
464
|
+
| :------- | :--------- | :----------------------------------------------- |
|
|
465
|
+
| `index` | `number` | The index of the value to generate the proof for |
|
|
466
|
+
| `leaves` | `bigint`[] | A list of values |
|
|
467
|
+
| `depth` | `number` | The tree depth |
|
|
468
|
+
|
|
469
|
+
#### Returns
|
|
470
|
+
|
|
471
|
+
`bigint`[][]
|
|
472
|
+
|
|
473
|
+
The proof
|
|
474
|
+
|
|
475
|
+
#### Defined in
|
|
476
|
+
|
|
477
|
+
[crypto/ts/utils.ts:47](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/utils.ts#L47)
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
### hash13
|
|
482
|
+
|
|
483
|
+
▸ **hash13**(`elements`): `bigint`
|
|
484
|
+
|
|
485
|
+
A convenience function to use Poseidon to hash a Plaintext with
|
|
486
|
+
no more than 13 elements
|
|
487
|
+
|
|
488
|
+
#### Parameters
|
|
489
|
+
|
|
490
|
+
| Name | Type | Description |
|
|
491
|
+
| :--------- | :---------------------------------- | :------------------- |
|
|
492
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) | The elements to hash |
|
|
493
|
+
|
|
494
|
+
#### Returns
|
|
495
|
+
|
|
496
|
+
`bigint`
|
|
497
|
+
|
|
498
|
+
The hash of the elements
|
|
499
|
+
|
|
500
|
+
#### Defined in
|
|
501
|
+
|
|
502
|
+
[crypto/ts/hashing.ts:130](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L130)
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
### hash2
|
|
507
|
+
|
|
508
|
+
▸ **hash2**(`elements`): `bigint`
|
|
509
|
+
|
|
510
|
+
#### Parameters
|
|
511
|
+
|
|
512
|
+
| Name | Type |
|
|
513
|
+
| :--------- | :---------------------------------- |
|
|
514
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) |
|
|
515
|
+
|
|
516
|
+
#### Returns
|
|
517
|
+
|
|
518
|
+
`bigint`
|
|
519
|
+
|
|
520
|
+
#### Defined in
|
|
521
|
+
|
|
522
|
+
[crypto/ts/hashing.ts:119](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L119)
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
### hash3
|
|
527
|
+
|
|
528
|
+
▸ **hash3**(`elements`): `bigint`
|
|
529
|
+
|
|
530
|
+
#### Parameters
|
|
531
|
+
|
|
532
|
+
| Name | Type |
|
|
533
|
+
| :--------- | :---------------------------------- |
|
|
534
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) |
|
|
535
|
+
|
|
536
|
+
#### Returns
|
|
537
|
+
|
|
538
|
+
`bigint`
|
|
539
|
+
|
|
540
|
+
#### Defined in
|
|
541
|
+
|
|
542
|
+
[crypto/ts/hashing.ts:120](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L120)
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
|
|
546
|
+
### hash4
|
|
547
|
+
|
|
548
|
+
▸ **hash4**(`elements`): `bigint`
|
|
549
|
+
|
|
550
|
+
#### Parameters
|
|
551
|
+
|
|
552
|
+
| Name | Type |
|
|
553
|
+
| :--------- | :---------------------------------- |
|
|
554
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) |
|
|
555
|
+
|
|
556
|
+
#### Returns
|
|
557
|
+
|
|
558
|
+
`bigint`
|
|
559
|
+
|
|
560
|
+
#### Defined in
|
|
561
|
+
|
|
562
|
+
[crypto/ts/hashing.ts:121](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L121)
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
### hash5
|
|
567
|
+
|
|
568
|
+
▸ **hash5**(`elements`): `bigint`
|
|
569
|
+
|
|
570
|
+
#### Parameters
|
|
571
|
+
|
|
572
|
+
| Name | Type |
|
|
573
|
+
| :--------- | :---------------------------------- |
|
|
574
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) |
|
|
575
|
+
|
|
576
|
+
#### Returns
|
|
577
|
+
|
|
578
|
+
`bigint`
|
|
579
|
+
|
|
580
|
+
#### Defined in
|
|
581
|
+
|
|
582
|
+
[crypto/ts/hashing.ts:122](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L122)
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
### hashLeftRight
|
|
587
|
+
|
|
588
|
+
▸ **hashLeftRight**(`left`, `right`): `bigint`
|
|
589
|
+
|
|
590
|
+
Hash two BigInts with the Poseidon hash function
|
|
591
|
+
|
|
592
|
+
#### Parameters
|
|
593
|
+
|
|
594
|
+
| Name | Type | Description |
|
|
595
|
+
| :------ | :------- | :----------------------------- |
|
|
596
|
+
| `left` | `bigint` | The left-hand element to hash |
|
|
597
|
+
| `right` | `bigint` | The right-hand element to hash |
|
|
598
|
+
|
|
599
|
+
#### Returns
|
|
600
|
+
|
|
601
|
+
`bigint`
|
|
602
|
+
|
|
603
|
+
The hash of the two elements
|
|
604
|
+
|
|
605
|
+
#### Defined in
|
|
606
|
+
|
|
607
|
+
[crypto/ts/hashing.ts:85](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L85)
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
### hashN
|
|
612
|
+
|
|
613
|
+
▸ **hashN**(`numElements`, `elements`): `bigint`
|
|
614
|
+
|
|
615
|
+
Hash up to N elements
|
|
616
|
+
|
|
617
|
+
#### Parameters
|
|
618
|
+
|
|
619
|
+
| Name | Type | Description |
|
|
620
|
+
| :------------ | :---------------------------------- | :----------------------------- |
|
|
621
|
+
| `numElements` | `number` | The number of elements to hash |
|
|
622
|
+
| `elements` | [`Plaintext`](modules.md#plaintext) | The elements to hash |
|
|
623
|
+
|
|
624
|
+
#### Returns
|
|
625
|
+
|
|
626
|
+
`bigint`
|
|
627
|
+
|
|
628
|
+
The hash of the elements
|
|
629
|
+
|
|
630
|
+
#### Defined in
|
|
631
|
+
|
|
632
|
+
[crypto/ts/hashing.ts:101](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L101)
|
|
633
|
+
|
|
634
|
+
---
|
|
635
|
+
|
|
636
|
+
### hashOne
|
|
637
|
+
|
|
638
|
+
▸ **hashOne**(`preImage`): `bigint`
|
|
639
|
+
|
|
640
|
+
Hash a single BigInt with the Poseidon hash function
|
|
641
|
+
|
|
642
|
+
#### Parameters
|
|
643
|
+
|
|
644
|
+
| Name | Type | Description |
|
|
645
|
+
| :--------- | :------- | :------------------ |
|
|
646
|
+
| `preImage` | `bigint` | The element to hash |
|
|
647
|
+
|
|
648
|
+
#### Returns
|
|
649
|
+
|
|
650
|
+
`bigint`
|
|
651
|
+
|
|
652
|
+
The hash of the element
|
|
653
|
+
|
|
654
|
+
#### Defined in
|
|
655
|
+
|
|
656
|
+
[crypto/ts/hashing.ts:160](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L160)
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
### packPubKey
|
|
661
|
+
|
|
662
|
+
▸ **packPubKey**(`pubKey`): `bigint`
|
|
663
|
+
|
|
664
|
+
Losslessly reduces the size of the representation of a public key
|
|
665
|
+
|
|
666
|
+
#### Parameters
|
|
667
|
+
|
|
668
|
+
| Name | Type | Description |
|
|
669
|
+
| :------- | :---------------------------- | :--------------------- |
|
|
670
|
+
| `pubKey` | [`PubKey`](modules.md#pubkey) | The public key to pack |
|
|
671
|
+
|
|
672
|
+
#### Returns
|
|
673
|
+
|
|
674
|
+
`bigint`
|
|
675
|
+
|
|
676
|
+
A packed public key
|
|
677
|
+
|
|
678
|
+
#### Defined in
|
|
679
|
+
|
|
680
|
+
[crypto/ts/keys.ts:35](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L35)
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
684
|
+
### poseidonDecrypt
|
|
685
|
+
|
|
686
|
+
▸ **poseidonDecrypt**(`ciphertext`, `key`, `nonce`, `length`): `PlainText`\<`bigint`\>
|
|
687
|
+
|
|
688
|
+
Decrypt some ciphertext using poseidon encryption
|
|
689
|
+
|
|
690
|
+
#### Parameters
|
|
691
|
+
|
|
692
|
+
| Name | Type | Description |
|
|
693
|
+
| :----------- | :-------------------------- | :-------------------------- |
|
|
694
|
+
| `ciphertext` | `CipherText`\<`bigint`\> | the ciphertext to decrypt |
|
|
695
|
+
| `key` | `EncryptionKey`\<`bigint`\> | the key to decrypt with |
|
|
696
|
+
| `nonce` | `bigint` | the nonce used to encrypt |
|
|
697
|
+
| `length` | `number` | the length of the plaintext |
|
|
698
|
+
|
|
699
|
+
#### Returns
|
|
700
|
+
|
|
701
|
+
`PlainText`\<`bigint`\>
|
|
702
|
+
|
|
703
|
+
the plaintext
|
|
704
|
+
|
|
705
|
+
#### Defined in
|
|
706
|
+
|
|
707
|
+
node_modules/.pnpm/@zk-kit+poseidon-cipher@0.2.1/node_modules/@zk-kit/poseidon-cipher/dist/types/poseidonCipher.d.ts:18
|
|
708
|
+
|
|
709
|
+
---
|
|
710
|
+
|
|
711
|
+
### poseidonDecryptWithoutCheck
|
|
712
|
+
|
|
713
|
+
▸ **poseidonDecryptWithoutCheck**(`ciphertext`, `key`, `nonce`, `length`): `PlainText`\<`bigint`\>
|
|
714
|
+
|
|
715
|
+
Decrypt some ciphertext using poseidon encryption
|
|
716
|
+
|
|
717
|
+
#### Parameters
|
|
718
|
+
|
|
719
|
+
| Name | Type | Description |
|
|
720
|
+
| :----------- | :-------------------------- | :-------------------------- |
|
|
721
|
+
| `ciphertext` | `CipherText`\<`bigint`\> | the ciphertext to decrypt |
|
|
722
|
+
| `key` | `EncryptionKey`\<`bigint`\> | the key to decrypt with |
|
|
723
|
+
| `nonce` | `bigint` | the nonce used to encrypt |
|
|
724
|
+
| `length` | `number` | the length of the plaintext |
|
|
725
|
+
|
|
726
|
+
#### Returns
|
|
727
|
+
|
|
728
|
+
`PlainText`\<`bigint`\>
|
|
729
|
+
|
|
730
|
+
the plaintext
|
|
731
|
+
|
|
732
|
+
**`Dev`**
|
|
733
|
+
|
|
734
|
+
Do not throw if the plaintext is invalid
|
|
735
|
+
|
|
736
|
+
#### Defined in
|
|
737
|
+
|
|
738
|
+
node_modules/.pnpm/@zk-kit+poseidon-cipher@0.2.1/node_modules/@zk-kit/poseidon-cipher/dist/types/poseidonCipher.d.ts:28
|
|
739
|
+
|
|
740
|
+
---
|
|
741
|
+
|
|
742
|
+
### poseidonEncrypt
|
|
743
|
+
|
|
744
|
+
▸ **poseidonEncrypt**(`msg`, `key`, `nonce`): `CipherText`\<`bigint`\>
|
|
745
|
+
|
|
746
|
+
Encrypt some plaintext using poseidon encryption
|
|
747
|
+
|
|
748
|
+
#### Parameters
|
|
749
|
+
|
|
750
|
+
| Name | Type | Description |
|
|
751
|
+
| :------ | :-------------------------- | :-------------------------------- |
|
|
752
|
+
| `msg` | `PlainText`\<`bigint`\> | the message to encrypt |
|
|
753
|
+
| `key` | `EncryptionKey`\<`bigint`\> | the key to encrypt with |
|
|
754
|
+
| `nonce` | `bigint` | the nonce to avoid replay attacks |
|
|
755
|
+
|
|
756
|
+
#### Returns
|
|
757
|
+
|
|
758
|
+
`CipherText`\<`bigint`\>
|
|
759
|
+
|
|
760
|
+
the ciphertext
|
|
761
|
+
|
|
762
|
+
#### Defined in
|
|
763
|
+
|
|
764
|
+
node_modules/.pnpm/@zk-kit+poseidon-cipher@0.2.1/node_modules/@zk-kit/poseidon-cipher/dist/types/poseidonCipher.d.ts:9
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
768
|
+
### sha256Hash
|
|
769
|
+
|
|
770
|
+
▸ **sha256Hash**(`input`): `bigint`
|
|
771
|
+
|
|
772
|
+
Hash an array of uint256 values the same way that the EVM does.
|
|
773
|
+
|
|
774
|
+
#### Parameters
|
|
775
|
+
|
|
776
|
+
| Name | Type | Description |
|
|
777
|
+
| :------ | :--------- | :-------------------------- |
|
|
778
|
+
| `input` | `bigint`[] | the array of values to hash |
|
|
779
|
+
|
|
780
|
+
#### Returns
|
|
781
|
+
|
|
782
|
+
`bigint`
|
|
783
|
+
|
|
784
|
+
a EVM compatible sha256 hash
|
|
785
|
+
|
|
786
|
+
#### Defined in
|
|
787
|
+
|
|
788
|
+
[crypto/ts/hashing.ts:15](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/hashing.ts#L15)
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
### sign
|
|
793
|
+
|
|
794
|
+
▸ **sign**(`privateKey`, `message`): `Signature`\<`string`\>
|
|
795
|
+
|
|
796
|
+
Signs a message using the provided private key, employing Poseidon hashing and
|
|
797
|
+
EdDSA with the Baby Jubjub elliptic curve.
|
|
798
|
+
|
|
799
|
+
#### Parameters
|
|
800
|
+
|
|
801
|
+
| Name | Type | Description |
|
|
802
|
+
| :----------- | :------------- | :---------------------------------------- |
|
|
803
|
+
| `privateKey` | `BigNumberish` | The private key used to sign the message. |
|
|
804
|
+
| `message` | `BigNumberish` | The message to be signed. |
|
|
805
|
+
|
|
806
|
+
#### Returns
|
|
807
|
+
|
|
808
|
+
`Signature`\<`string`\>
|
|
809
|
+
|
|
810
|
+
The signature object, containing properties relevant to EdDSA signatures, such as 'R8' and 'S' values.
|
|
811
|
+
|
|
812
|
+
#### Defined in
|
|
813
|
+
|
|
814
|
+
node_modules/.pnpm/@zk-kit+eddsa-poseidon@0.5.1/node_modules/@zk-kit/eddsa-poseidon/dist/types/eddsa-poseidon.d.ts:32
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
818
|
+
### stringifyBigInts
|
|
819
|
+
|
|
820
|
+
▸ **stringifyBigInts**(`input`): `StringifiedBigInts`
|
|
821
|
+
|
|
822
|
+
Given an input of bigint values, convert them to their string representations
|
|
823
|
+
|
|
824
|
+
#### Parameters
|
|
825
|
+
|
|
826
|
+
| Name | Type | Description |
|
|
827
|
+
| :------ | :--------------- | :------------------- |
|
|
828
|
+
| `input` | `BigIntVariants` | The input to convert |
|
|
829
|
+
|
|
830
|
+
#### Returns
|
|
831
|
+
|
|
832
|
+
`StringifiedBigInts`
|
|
833
|
+
|
|
834
|
+
The input with bigint values converted to string
|
|
835
|
+
|
|
836
|
+
#### Defined in
|
|
837
|
+
|
|
838
|
+
[crypto/ts/bigIntUtils.ts:78](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/bigIntUtils.ts#L78)
|
|
839
|
+
|
|
840
|
+
---
|
|
841
|
+
|
|
842
|
+
### unpackPubKey
|
|
843
|
+
|
|
844
|
+
▸ **unpackPubKey**(`packed`): [`PubKey`](modules.md#pubkey)
|
|
845
|
+
|
|
846
|
+
Restores the original PubKey from its packed representation
|
|
847
|
+
|
|
848
|
+
#### Parameters
|
|
849
|
+
|
|
850
|
+
| Name | Type | Description |
|
|
851
|
+
| :------- | :------- | :------------------ |
|
|
852
|
+
| `packed` | `bigint` | The value to unpack |
|
|
853
|
+
|
|
854
|
+
#### Returns
|
|
855
|
+
|
|
856
|
+
[`PubKey`](modules.md#pubkey)
|
|
857
|
+
|
|
858
|
+
The unpacked public key
|
|
859
|
+
|
|
860
|
+
#### Defined in
|
|
861
|
+
|
|
862
|
+
[crypto/ts/keys.ts:42](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/keys.ts#L42)
|
|
863
|
+
|
|
864
|
+
---
|
|
865
|
+
|
|
866
|
+
### unstringifyBigInts
|
|
867
|
+
|
|
868
|
+
▸ **unstringifyBigInts**(`input`): `BigIntVariants`
|
|
869
|
+
|
|
870
|
+
Given an input containing string values, convert them
|
|
871
|
+
to bigint
|
|
872
|
+
|
|
873
|
+
#### Parameters
|
|
874
|
+
|
|
875
|
+
| Name | Type | Description |
|
|
876
|
+
| :------ | :------------------- | :------------------- |
|
|
877
|
+
| `input` | `StringifiedBigInts` | The input to convert |
|
|
878
|
+
|
|
879
|
+
#### Returns
|
|
880
|
+
|
|
881
|
+
`BigIntVariants`
|
|
882
|
+
|
|
883
|
+
the input with string values converted to bigint
|
|
884
|
+
|
|
885
|
+
#### Defined in
|
|
886
|
+
|
|
887
|
+
[crypto/ts/bigIntUtils.ts:9](https://github.com/privacy-scaling-explorations/maci/blob/6a905de08/crypto/ts/bigIntUtils.ts#L9)
|
|
888
|
+
|
|
889
|
+
---
|
|
890
|
+
|
|
891
|
+
### verifySignature
|
|
892
|
+
|
|
893
|
+
▸ **verifySignature**(`message`, `signature`, `publicKey`): `boolean`
|
|
894
|
+
|
|
895
|
+
Verifies an EdDSA signature using the Baby Jubjub elliptic curve and Poseidon hash function.
|
|
896
|
+
|
|
897
|
+
#### Parameters
|
|
898
|
+
|
|
899
|
+
| Name | Type | Description |
|
|
900
|
+
| :---------- | :------------- | :----------------------------------------------------------------------- |
|
|
901
|
+
| `message` | `BigNumberish` | The original message that was be signed. |
|
|
902
|
+
| `signature` | `Signature` | The EdDSA signature to be verified. |
|
|
903
|
+
| `publicKey` | `Point` | The public key associated with the private key used to sign the message. |
|
|
904
|
+
|
|
905
|
+
#### Returns
|
|
906
|
+
|
|
907
|
+
`boolean`
|
|
908
|
+
|
|
909
|
+
Returns true if the signature is valid and corresponds to the message and public key, false otherwise.
|
|
910
|
+
|
|
911
|
+
#### Defined in
|
|
912
|
+
|
|
913
|
+
node_modules/.pnpm/@zk-kit+eddsa-poseidon@0.5.1/node_modules/@zk-kit/eddsa-poseidon/dist/types/eddsa-poseidon.d.ts:40
|