Package-level declarations

Types

Link copied to clipboard
@Serializable
sealed class CardOp
Link copied to clipboard
Link copied to clipboard
@Serializable
data class CardState(val ciphertext: ByteArray, val encryptedBy: GSet<PlayerId>, val strippedBy: GSet<PlayerId>, val visibilityQuorum: Set<PlayerId>, val allPlayers: Set<PlayerId>)
Link copied to clipboard
class CommitmentViolation(val peer: PeerId, val expectedHash: ByteArray, val actualHash: ByteArray) : Exception

Thrown when a peer's revealed secret does not match its earlier commitment hash.

Link copied to clipboard
Link copied to clipboard
class DealSession(seam: Seam, scheme: CommutativeScheme, myKey: SchemeKeyPair, allPlayers: Set<PlayerId>, myId: PlayerId, scope: CoroutineScope) : ScopedCloseable

Drives a cryptographically fair card deal over a Seam, as an op-based CRDT.

Link copied to clipboard
@Serializable
data class DeckState(val cards: List<CardState>)
Link copied to clipboard
@Serializable
class EncryptedKey(val bytes: ByteArray)
Link copied to clipboard
@Serializable
class EncryptProof(val bytes: ByteArray)
Link copied to clipboard
class FairRandom(seam: Seam, peers: Set<PeerId>, tamperedReveal: Boolean = false, fixedSecret: ByteArray? = null, fixedNonce: ByteArray? = null)

Two-phase commit-reveal protocol for deriving a shared random Long seed.

Link copied to clipboard
interface KeyEscrow
Link copied to clipboard
typealias PlayerId = PeerId
Link copied to clipboard
@Serializable
class SchemeKey(val raw: ByteArray)
Link copied to clipboard
data class SchemeKeyPair(val encryptKey: SchemeKey, val stripKey: SchemeKey)
Link copied to clipboard

SRA (Shamir–Rivest–Adleman) commutative encryption scheme.

Link copied to clipboard
@Serializable
class StripProof(val bytes: ByteArray)

Functions

Link copied to clipboard

Returns the next CardState after applying op, or null if op is invalid.

Link copied to clipboard

Returns true iff op is valid to apply to this CardState.

Link copied to clipboard

Inverse of encodePlaintext: drops the 0x01 marker byte.

Link copied to clipboard

Encode arbitrary card plaintext into the SRA domain for SraScheme.