Stores verifying keys for the circuits.
Each circuit has a signature which is its compile-time constants represented
as a uint256.
processVerifyingKeys
mapping(enum DomainObjs.Mode => mapping(uint256 => struct SnarkCommon.VerifyingKey)) processVerifyingKeys
processVerifyingKeysSet
mapping(enum DomainObjs.Mode => mapping(uint256 => bool)) processVerifyingKeysSet
tallyVerifyingKeys
mapping(enum DomainObjs.Mode => mapping(uint256 => struct SnarkCommon.VerifyingKey)) tallyVerifyingKeys
tallyVerifyingKeysSet
mapping(enum DomainObjs.Mode => mapping(uint256 => bool)) tallyVerifyingKeysSet
pollJoiningVerifyingKeys
mapping(uint256 => struct SnarkCommon.VerifyingKey) pollJoiningVerifyingKeys
pollJoiningVerifyingKeysSet
mapping(uint256 => bool) pollJoiningVerifyingKeysSet
pollJoinedVerifyingKeys
mapping(uint256 => struct SnarkCommon.VerifyingKey) pollJoinedVerifyingKeys
pollJoinedVerifyingKeysSet
mapping(uint256 => bool) pollJoinedVerifyingKeysSet
PollJoiningVerifyingKeySet
event PollJoiningVerifyingKeySet(uint256 _signature)
PollJoinedVerifyingKeySet
event PollJoinedVerifyingKeySet(uint256 _signature)
ProcessVerifyingKeySet
event ProcessVerifyingKeySet(uint256 _signature, enum DomainObjs.Mode _mode)
TallyVerifyingKeySet
event TallyVerifyingKeySet(uint256 _signature, enum DomainObjs.Mode _mode)
VerifyingKeyAlreadySet
error VerifyingKeyAlreadySet()
VerifyingKeyNotSet
error VerifyingKeyNotSet()
InvalidKeysParams
error InvalidKeysParams()
constructor
constructor() public payable
Create a new instance of the VerifyingKeysRegistry contract
isPollJoiningVerifyingKeySet
function isPollJoiningVerifyingKeySet(uint256 _signature) public view returns (bool isSet)
Check if the poll joining verifying key is set
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
isPollJoinedVerifyingKeySet
function isPollJoinedVerifyingKeySet(uint256 _signature) public view returns (bool isSet)
Check if the poll joined verifying key is set
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
isProcessVerifyingKeySet
function isProcessVerifyingKeySet(uint256 _signature, enum DomainObjs.Mode _mode) public view returns (bool isSet)
Check if the process verifying key is set
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
isTallyVerifyingKeySet
function isTallyVerifyingKeySet(uint256 _signature, enum DomainObjs.Mode _mode) public view returns (bool isSet)
Check if the tally verifying key is set
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
generatePollJoiningVerifyingKeySignature
function generatePollJoiningVerifyingKeySignature(uint256 _stateTreeDepth) public pure returns (uint256 signature)
generate the signature for the poll joining verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
generatePollJoinedVerifyingKeySignature
function generatePollJoinedVerifyingKeySignature(uint256 _stateTreeDepth) public pure returns (uint256 signature)
generate the signature for the poll joined verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
generateProcessVerifyingKeySignature
function generateProcessVerifyingKeySignature(uint256 _stateTreeDepth, uint256 _voteOptionTreeDepth, uint8 _messageBatchSize) public pure returns (uint256 signature)
generate the signature for the process verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_messageBatchSize | uint8 | The message batch size |
generateTallyVerifyingKeySignature
function generateTallyVerifyingKeySignature(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public pure returns (uint256 signature)
generate the signature for the tally verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_intStateTreeDepth | uint256 | The intermediate state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
Return Values
Name | Type | Description |
---|
signature | uint256 | The signature |
setVerifyingKeysBatch
function setVerifyingKeysBatch(struct IVerifyingKeysRegistry.SetVerifyingKeysBatchArgs _args) public
Set the process and tally verifying keys for a certain combination
of parameters and modes
Parameters
Name | Type | Description |
---|
_args | struct IVerifyingKeysRegistry.SetVerifyingKeysBatchArgs | The verifying keys arguments |
setVerifyingKeys
function setVerifyingKeys(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth, uint8 _messageBatchSize, enum DomainObjs.Mode _mode, struct SnarkCommon.VerifyingKey _processVerifyingKey, struct SnarkCommon.VerifyingKey _tallyVerifyingKey) public
Set the process and tally verifying keys for a certain combination
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_intStateTreeDepth | uint256 | The intermediate state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_messageBatchSize | uint8 | The message batch size |
_mode | enum DomainObjs.Mode | QV or Non-QV |
_processVerifyingKey | struct SnarkCommon.VerifyingKey | The process verifying key |
_tallyVerifyingKey | struct SnarkCommon.VerifyingKey | The tally verifying key |
setProcessVerifyingKeyKey
function setProcessVerifyingKeyKey(uint256 _stateTreeDepth, uint256 _voteOptionTreeDepth, uint8 _messageBatchSize, enum DomainObjs.Mode _mode, struct SnarkCommon.VerifyingKey _processVerifyingKey) public
Set the process verifying key for a certain combination of parameters
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_messageBatchSize | uint8 | The message batch size |
_mode | enum DomainObjs.Mode | QV or Non-QV |
_processVerifyingKey | struct SnarkCommon.VerifyingKey | The process verifying key |
setTallyVerifyingKeyKey
function setTallyVerifyingKeyKey(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth, enum DomainObjs.Mode _mode, struct SnarkCommon.VerifyingKey _tallyVerifyingKey) public
Set the tally verifying key for a certain combination of parameters
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_intStateTreeDepth | uint256 | The intermediate state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_mode | enum DomainObjs.Mode | QV or Non-QV |
_tallyVerifyingKey | struct SnarkCommon.VerifyingKey | The tally verifying key |
setPollJoiningVerifyingKeyKey
function setPollJoiningVerifyingKeyKey(uint256 _stateTreeDepth, struct SnarkCommon.VerifyingKey _pollJoiningVerifyingKey) public
Set the poll joining verifying key for a certain combination of parameters
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_pollJoiningVerifyingKey | struct SnarkCommon.VerifyingKey | The poll joining verifying key |
setPollJoinedVerifyingKeyKey
function setPollJoinedVerifyingKeyKey(uint256 _stateTreeDepth, struct SnarkCommon.VerifyingKey _pollJoinedVerifyingSignature) public
Set the poll joined verifying key for a certain combination of parameters
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_pollJoinedVerifyingSignature | struct SnarkCommon.VerifyingKey | The poll joined verifying key |
hasProcessVerifyingKey
function hasProcessVerifyingKey(uint256 _stateTreeDepth, uint256 _voteOptionTreeDepth, uint8 _messageBatchSize, enum DomainObjs.Mode _mode) public view returns (bool isSet)
Check if the process verifying key is set
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_messageBatchSize | uint8 | The message batch size |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
getProcessVerifyingKeyBySignature
function getProcessVerifyingKeyBySignature(uint256 _signature, enum DomainObjs.Mode _mode) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the process verifying key by signature
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getProcessVerifyingKey
function getProcessVerifyingKey(uint256 _stateTreeDepth, uint256 _voteOptionTreeDepth, uint8 _messageBatchSize, enum DomainObjs.Mode _mode) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the process verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_messageBatchSize | uint8 | The message batch size |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
hasTallyVerifyingKey
function hasTallyVerifyingKey(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth, enum DomainObjs.Mode _mode) public view returns (bool isSet)
Check if the tally verifying key is set
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_intStateTreeDepth | uint256 | The intermediate state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
isSet | bool | whether the verifying key is set |
getTallyVerifyingKeyBySignature
function getTallyVerifyingKeyBySignature(uint256 _signature, enum DomainObjs.Mode _mode) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the tally verifying key by signature
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getTallyVerifyingKey
function getTallyVerifyingKey(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth, enum DomainObjs.Mode _mode) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the tally verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
_intStateTreeDepth | uint256 | The intermediate state tree depth |
_voteOptionTreeDepth | uint256 | The vote option tree depth |
_mode | enum DomainObjs.Mode | QV or Non-QV |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getPollJoiningVerifyingKeyBySignature
function getPollJoiningVerifyingKeyBySignature(uint256 _signature) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the poll joining verifying key by signature
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getPollJoinedVerifyingKeyBySignature
function getPollJoinedVerifyingKeyBySignature(uint256 _signature) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the poll joined verifying key by signature
Parameters
Name | Type | Description |
---|
_signature | uint256 | The signature |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getPollJoiningVerifyingKey
function getPollJoiningVerifyingKey(uint256 _stateTreeDepth) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the poll joining verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |
getPollJoinedVerifyingKey
function getPollJoinedVerifyingKey(uint256 _stateTreeDepth) public view returns (struct SnarkCommon.VerifyingKey verifyingKey)
Get the poll joined verifying key
Parameters
Name | Type | Description |
---|
_stateTreeDepth | uint256 | The state tree depth |
Return Values
Name | Type | Description |
---|
verifyingKey | struct SnarkCommon.VerifyingKey | The verifying key |