Skip to main content

Module types

Module types 

Source
Expand description

Public data types exchanged across the API boundary.

All four types in this module are thin wrappers around their underlying curve / scalar representation. They exist so that:

  • the public API never leaks curve25519_dalek types directly, which would force every caller to take a dependency on the same version of that crate;
  • every value has exactly one canonical byte and hex encoding;
  • the type system stops you from accidentally passing, say, a KeyImage where a PublicKey is expected — they are both 32-byte Ristretto points, but they mean different things in the protocol.

Everything serialises to a fixed-size byte array (or a Vec<u8> for signatures whose size depends on the ring). The encoding is the curve25519-dalek canonical encoding for points (compressed Ristretto) and the little-endian canonical encoding for scalars.

Structs§

KeyImage
The protocol’s “linking tag” — what the host stores to prevent double voting.
Nonce
A verifier-chosen nonce for an ownership proof (Operation D).
OwnershipProof
A proof of ownership of a KeyImage, produced by crate::prove_ownership and checked by crate::verify_ownership.
PublicKey
A voter’s public identity. Safe to publish.
SecretKey
A voter’s secret key.
Signature
A ring signature produced by crate::sign_vote.
VoteProof
The full bundle returned by crate::sign_vote: the proof and the linking tag.