Documentation
¶
Index ¶
- func BallotIndex(voterIndex uint64) (uint64, error)
- func BallotInputsHashRTE(processID *big.Int, ballotMode BallotMode, encryptionKeyX *big.Int, ...) (*big.Int, error)
- func StateRoot(processID, censusOrigin, pubKeyX, pubKeyY, ballotMode *big.Int) (*big.Int, error)
- func VoteID(processID, address, k *big.Int) (uint64, error)
- type BallotMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BallotIndex ¶
BallotIndex returns a BallotIndex on the lower half of the 64 bit space, between BallotMin and BallotMax.
BallotIndex = BallotMin + voterIndex
func BallotInputsHashRTE ¶
func BallotInputsHashRTE( processID *big.Int, ballotMode BallotMode, encryptionKeyX *big.Int, encryptionKeyY *big.Int, address *big.Int, voteID uint64, ballot []*big.Int, weight *big.Int, ) (*big.Int, error)
BallotInputsHashRTE computes the ballot inputs hash using RTE-encoded points.
Types ¶
type BallotMode ¶
type BallotMode struct {
NumFields uint8 `json:"numFields" cbor:"0,keyasint,omitempty"`
GroupSize uint8 `json:"groupSize" cbor:"1,keyasint,omitempty"`
UniqueValues bool `json:"uniqueValues" cbor:"2,keyasint,omitempty"`
CostFromWeight bool `json:"costFromWeight" cbor:"3,keyasint,omitempty"`
CostExponent uint8 `json:"costExponent" cbor:"4,keyasint,omitempty"`
MaxValue uint64 `json:"maxValue" cbor:"5,keyasint,omitempty"`
MinValue uint64 `json:"minValue" cbor:"6,keyasint,omitempty"`
MaxValueSum uint64 `json:"maxValueSum" cbor:"7,keyasint,omitempty"`
MinValueSum uint64 `json:"minValueSum" cbor:"8,keyasint,omitempty"`
}
BallotMode defines the ballot configuration fields used by the spec.
func (BallotMode) Pack ¶
func (bm BallotMode) Pack() (*big.Int, error)
Pack packs the ballot mode fields into a single field element.
func (BallotMode) String ¶
func (bm BallotMode) String() string
String returns a string representation of the ballot mode.
func (BallotMode) Validate ¶
func (bm BallotMode) Validate() error
Validate validates the ballot mode fields for basic consistency.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.