Skip to content

core

Low-level core helpers for arithmetic, error handling, and group constants.

Use this module when you need primitives that sit below the voting workflow surface exposed by the root package.

Raised when a participant index falls outside the supported 1..n numbering scheme used across the protocol.

  • ThresholdElGamalError

new IndexOutOfRangeError(message): IndexOutOfRangeError

string

IndexOutOfRangeError

ThresholdElGamalError.constructor


Raised when a point or public key is not a canonical member of the selected cryptographic group.

  • ThresholdElGamalError

new InvalidGroupElementError(message): InvalidGroupElementError

string

InvalidGroupElementError

ThresholdElGamalError.constructor


Raised when a payload, transcript field, manifest field, or serialized value does not satisfy the package’s canonical encoding rules.

  • ThresholdElGamalError

new InvalidPayloadError(message): InvalidPayloadError

string

InvalidPayloadError

ThresholdElGamalError.constructor


Raised when a Schnorr, DLEQ, or disjunctive proof transcript fails structural checks or cryptographic verification.

  • ThresholdElGamalError

new InvalidProofError(message): InvalidProofError

string

InvalidProofError

ThresholdElGamalError.constructor


Raised when a scalar value falls outside the expected field or subgroup domain for the current operation.

  • ThresholdElGamalError

new InvalidScalarError(message): InvalidScalarError

string

InvalidScalarError

ThresholdElGamalError.constructor


Raised when a serialized share, decrypted share envelope, or reconstructed share set fails threshold-specific validation.

  • ThresholdElGamalError

new InvalidShareError(message): InvalidShareError

string

InvalidShareError

ThresholdElGamalError.constructor


Raised when a published payload claims to belong to a protocol phase that does not match the supported ceremony state machine.

  • ThresholdElGamalError

new PhaseViolationError(message): PhaseViolationError

string

PhaseViolationError

ThresholdElGamalError.constructor


Raised when an additive plaintext falls outside the explicitly bounded domain that the current workflow promised to support.

  • ThresholdElGamalError

new PlaintextDomainError(message): PlaintextDomainError

string

PlaintextDomainError

ThresholdElGamalError.constructor


Raised when threshold parameters or participant counts violate the supported 1 <= k <= n relationship or the package’s honest-majority policy.

  • ThresholdElGamalError

new ThresholdViolationError(message): ThresholdViolationError

string

ThresholdViolationError

ThresholdElGamalError.constructor


Raised when transcript hashes, manifest hashes, or other canonical digest commitments do not match the values claimed by published payloads.

  • ThresholdElGamalError

new TranscriptMismatchError(message): TranscriptMismatchError

string

TranscriptMismatchError

ThresholdElGamalError.constructor


Raised when the requested suite or required runtime capability is unavailable in the current environment.

  • ThresholdElGamalError

new UnsupportedSuiteError(message): UnsupportedSuiteError

string

UnsupportedSuiteError

ThresholdElGamalError.constructor

EncodedPoint = Brand<string, "EncodedPoint">

Canonical 32-byte Ristretto point encoding exposed at the public boundary.

Public helpers use this branded string type to distinguish encoded points from ordinary hex strings.

const RISTRETTO_GROUP: CryptoGroup

Immutable definition of the built-in ristretto255 tally group.

Every public cryptographic workflow in this package ultimately routes through this suite definition.

modQ(value, q): bigint

Reduces a value into the range 0..q-1.

bigint

bigint

bigint

InvalidScalarError When q is not positive.