Options
All
  • Public
  • Public/Protected
  • All
Menu

electionguard

Index

Type Aliases

CryptoHashable: string | number | bigint | undefined | CryptoHashableString | CryptoHashableElement | Iterable<CryptoHashable>
ManifestElectionType: typeof ManifestElectionTypeStrings[number]

typed union of acceptable strings

ManifestReportingUnitType: typeof ManifestReportingUnitTypeStrings[number]

typed union of acceptable strings

ManifestVoteVariationType: typeof ManifestVoteVariationTypeStrings[number]

typed union of acceptable strings

Variables

ManifestElectionTypeStrings: string[] = ...

The type of election.

see
[Civics Common Standard Data Specification](https://developers.google.com/elections-data/reference/election-type)
ManifestReportingUnitTypeStrings: string[] = ...

The type of geopolitical unit.

see
[Civics Common Standard Data Specification](https://developers.google.com/elections-data/reference/reporting-unit-type)
ManifestVoteVariationTypeStrings: string[] = ...

Enumeration for contest algorithm or rules in the contest.

see
[Civics Common Standard Data Specification](https://developers.google.com/elections-data/reference/vote-variation)

Functions

  • ElectionGuard GroupContext using bigint as the underlying engine and implementing the "pretty-much-full-strength" 3072-bit group (which can run 1.8x faster than the 4096-bit group) for modular exponentiations.

    Returns GroupContext

  • eitherRightOrFail<T>(input: Either<DecodeError, T>): T
  • Breaks the beautiful functional aspects of using a codec decoder and either gives us the actual value or throws an error. Useful for tests or when we really do want to throw an error.

    Type Parameters

    • T

    Parameters

    • input: Either<DecodeError, T>

    Returns T

  • Encrypt a PlaintextBallot into a CiphertextBallot.

    This method accepts a ballot representation that only includes true selections. It will fill missing selections for a contest with false values, and generate placeholder selections to represent the number of seats available for a given contest.

    This method also allows for ballots to exclude passing contests for which the voter made no selections. It will fill missing contests with false selections and generate placeholder selections that are marked true.

    The timestamp should be in the form of the number of seconds since the Unix epoch, e.g., equivalent to calling Math.floor(Date.now() / 1000). If it's left out, it will be set to the current time.

    Parameters

    Returns CiphertextBallot

Generated using TypeDoc