Core Module
Table of contents
Classes
Interfaces
Type Aliases
Variables
Functions
- genProcessVkSig
- genTallyVkSig
- packProcessMessageSmallVals
- packTallyVotesSmallVals
- unpackProcessMessageSmallVals
- unpackTallyVotesSmallVals
Type Aliases
CircuitInputs
Ƭ CircuitInputs: Record
<string
, string
| bigint
| bigint
[] | bigint
[][] | string
[] | bigint
[][][]>
A circuit inputs for the circom circuit
Defined in
utils/types.ts:22
Variables
MESSAGE_TREE_ARITY
• Const
MESSAGE_TREE_ARITY: 5
Defined in
utils/constants.ts:4
STATE_TREE_ARITY
• Const
STATE_TREE_ARITY: 2
Defined in
utils/constants.ts:2
Functions
genProcessVkSig
▸ genProcessVkSig(stateTreeDepth
, messageTreeDepth
, voteOptionTreeDepth
, batchSize
): bigint
This function generates the signature of a ProcessMessage Verifying Key(VK). This can be used to check if a ProcessMessages' circuit VK is registered in a smart contract that holds several VKs.
Parameters
Name | Type | Description |
---|---|---|
stateTreeDepth | number | The depth of the state tree. |
messageTreeDepth | number | The depth of the message tree. |
voteOptionTreeDepth | number | The depth of the vote option tree. |
batchSize | number | The size of the batch. |
Returns
bigint
Returns a signature for querying if a verifying key with the given parameters is already registered in the contract.
Defined in
utils/utils.ts:14
genTallyVkSig
▸ genTallyVkSig(_stateTreeDepth
, _intStateTreeDepth
, _voteOptionTreeDepth
): bigint
This function generates the signature of a Tally Verifying Key(VK). This can be used to check if a TallyVotes' circuit VK is registered in a smart contract that holds several VKs.
Parameters
Name | Type | Description |
---|---|---|
_stateTreeDepth | number | The depth of the state tree. |
_intStateTreeDepth | number | The depth of the intermediate state tree. |
_voteOptionTreeDepth | number | The depth of the vote option tree. |
Returns
bigint
Returns a signature for querying if a verifying key with the given parameters is already registered in the contract.
Defined in
utils/utils.ts:35
packProcessMessageSmallVals
▸ packProcessMessageSmallVals(maxVoteOptions
, numUsers
, batchStartIndex
, batchEndIndex
): bigint
This function packs it's parameters into a single bigint.
Parameters
Name | Type | Description |
---|---|---|
maxVoteOptions | bigint | The maximum number of vote options. |
numUsers | bigint | The number of users. |
batchStartIndex | number | The start index of the batch. |
batchEndIndex | number | The end index of the batch. |
Returns
bigint
Returns a single bigint that contains the packed values.
Defined in
utils/utils.ts:49
packTallyVotesSmallVals
▸ packTallyVotesSmallVals(batchStartIndex
, batchSize
, numSignUps
): bigint
This function packs it's parameters into a single bigint.
Parameters
Name | Type | Description |
---|---|---|
batchStartIndex | number | The start index of the batch. |
batchSize | number | The size of the batch. |
numSignUps | number | The number of signups. |
Returns
bigint
Returns a single bigint that contains the packed values.
Defined in
utils/utils.ts:103
unpackProcessMessageSmallVals
▸ unpackProcessMessageSmallVals(packedVals
): Object
This function unpacks partial values for the ProcessMessages circuit from a single bigint.
Parameters
Name | Type | Description |
---|---|---|
packedVals | bigint | The single bigint that contains the packed values. |
Returns
Object
Returns an object that contains the unpacked values.
Name | Type |
---|---|
batchEndIndex | bigint |
batchStartIndex | bigint |
maxVoteOptions | bigint |
numUsers | bigint |
Defined in
utils/utils.ts:70
unpackTallyVotesSmallVals
▸ unpackTallyVotesSmallVals(packedVals
): Object
This function unpacks partial values for the TallyVotes circuit from a single bigint.
Parameters
Name | Type | Description |
---|---|---|
packedVals | bigint | The single bigint that contains the packed values. |
Returns
Object
Returns an object that contains the unpacked values.
Name | Type |
---|---|
batchStartIndex | bigint |
numSignUps | bigint |
Defined in
utils/utils.ts:115