Protocol Specifications for (Oracle) Reductions #
This file defines the ProtocolSpec type, which is used to specify the protocol between the prover
and the verifier.
A protocol specification for an interactive protocol with n steps consists of:
- A vector of directions
dirfor each step, which is either.P_to_V(the prover sends a message to the verifier) or.V_to_P(the verifier sends a challenge to the prover). - A vector of types
«Type»for each step, which is the type of the message or challenge sent in that step.
The direction of each message in the protocol.
The type of each message in the protocol.
Instances For
The empty protocol specification, with no messages or challenges, written as !p[].
Instances For
The empty protocol specification, with no messages or challenges, written as !p[].
Instances For
Subtype of Fin n for the indices corresponding to messages in a protocol specification
Instances For
Subtype of Fin n for the indices corresponding to challenges in a protocol specification
Instances For
The type of the i-th message in a protocol specification.
This does not distinguish between messages received in full or as an oracle.
Instances For
Unbundled version of Message, which supplies the proof separately from the index.
Instances For
The type of the i-th challenge in a protocol specification
Instances For
Unbundled version of Challenge, which supplies the proof separately from the index.
Instances For
The type of all messages in a protocol specification. Uncurried version of Message.
Instances For
Unbundled version of Messages, which supplies the proof separately from the index.
Instances For
The type of all challenges in a protocol specification
Instances For
Unbundled version of Challenges, which supplies the proof separately from the index.
Instances For
The (full)) transcript of an interactive protocol, which is a list of messages and challenges.
Note that this is definitionally equal to Transcript (Fin.last n) pSpec.
Instances For
Take the first m ≤ n rounds of a ProtocolSpec n
Instances For
Take the last m ≤ n rounds of a ProtocolSpec n
Instances For
Drop the first m ≤ n rounds of a ProtocolSpec n
Instances For
Drop the last m ≤ n rounds of a ProtocolSpec n
Instances For
Extract the slice of the rounds of a ProtocolSpec n from start to stop - 1.
Instances For
Take the first m ≤ n rounds of a (full) transcript for a protocol specification pSpec
Instances For
Take the last m ≤ n rounds of a (full) transcript for a protocol specification pSpec
Instances For
Instances For
Instances For
Instances For
Subtype of Fin k for the indices corresponding to messages in a protocol specification up to
round k
Instances For
Subtype of Fin k for the indices corresponding to challenges in a protocol specification up to
round k
Instances For
The indexed family of messages from the prover up to round k.
Instances For
The indexed family of challenges from the verifier up to round k.
Instances For
The type of all messages from the prover up to round k.
Instances For
The type of all challenges from the verifier up to round k.
Instances For
A (partial) transcript of a protocol specification, indexed by some k : Fin (n + 1), is a
list of messages from the protocol for all indices i less than k.
This is defined as the full transcript of the protocol specification up to round k.
Instances For
There is only one protocol specification with 0 messages (the empty one)
For a tuple of messages up to round k, take the messages up to round j : Fin (k + 1)
Instances For
Take the messages up to round j : Fin (n + 1)
Instances For
For a tuple of challenges up to round k, take the challenges up to round j : Fin (k + 1)
Instances For
Take the challenges up to round j : Fin (n + 1)
Instances For
There is only one transcript for the empty protocol,
represented as default : ProtocolSpec 0
There is only one transcript for the empty protocol, represented as ![]
There is only one transcript for any protocol specification with cutoff index 0
Instances For
Concatenate the k-th message to the end of the tuple of messages up to round k, assuming
round k is a message round.
Instances For
Extend the tuple of messages up to round k to up to round k + 1, assuming round k is a
challenge round (so no message from the prover is sent).
Instances For
There is only one transcript for the empty protocol,
represented as default : ProtocolSpec 0
There is only one transcript for the empty protocol, represented as ![]
There is only one transcript for any protocol specification with cutoff index 0
Instances For
Concatenate the k-th challenge to the end of the tuple of challenges up to round k, assuming
round k is a challenge round.
Instances For
Extend the tuple of challenges up to round k to up to round k + 1, assuming round k is a
message round (so no challenge from the verifier is sent).
Instances For
There is only one transcript for the empty protocol
There is only one transcript for the empty protocol, represented as ![]
There is only one transcript for any protocol with cutoff index 0
Concatenate a message to the end of a partial transcript. This is definitionally equivalent to
Fin.snoc.
Instances For
Extract messages from a transcript up to round k
Instances For
Extract challenges from a transcript up to round k
Instances For
Instances For
Instances For
An equivalence between transcripts up to round k and the tuple of messages and challenges up
to round k.
Instances For
Instances For
Instances For
There is only one full transcript (the empty one) for an empty protocol
Convert a full transcript to the tuple of messages and challenges
Instances For
Convert the tuple of messages and challenges to a full transcript
Instances For
An equivalence between full transcripts and the tuple of messages and challenges.
Instances For
The specification of whether each message in a protocol specification is available in full
(None) or received as an oracle (Some (instOracleInterface (pSpec.Message i))).
This is defined as a type class for notational convenience.
- oracleInterfaces (i : pSpec.MessageIdx) : Option (OracleInterface (pSpec.Message i))
Instances
Subtype of pSpec.MessageIdx for messages that are received as oracles
Instances For
The oracle interface instances for messages that are received as oracles
Subtype of pSpec.MessageIdx for messages that are received in full
Instances For
The type of messages that are received in full
Instances For
The type of messages that are received as oracles
Instances For
Instances For
Instances For
Turn each verifier's challenge into an oracle, where querying a unit type gives back the challenge.
This is the default instance for the challenge oracle interface. It may be overridden by
challengeOracleInterface{SR/FS} for state-restoration and/or Fiat-Shamir.
Instances For
Query a verifier's challenge for a given challenge round i, given the default challenge
oracle interface challengeOracleInterface.
This is the default version for getting challenges, where we query the default
challengeOracleInterface, which accepts trivial input. In contrast, getChallenge{SR/FS}
requires an input statement and prior messages up to that round.
Instances For
Define the query implementation for the verifier's challenge in terms of ProbComp.
This is a randomness oracle: it simply calls the selectElem method inherited from the
SampleableType instance on the challenge types.
Instances For
The oracle interface for state-restoration and (basic) Fiat-Shamir.
This is the version where we hash the input statement and the entire transcript up to the point of deriving a new challenge. To be precise:
- The domain of the oracle is
Statement × pSpec.MessagesUpTo i.1.castSucc - The range of the oracle is
pSpec.Challenge i - The oracle just returns the challenge
Instances For
Alias of ProtocolSpec.challengeOracleInterfaceSR.
The oracle interface for state-restoration and (basic) Fiat-Shamir.
This is the version where we hash the input statement and the entire transcript up to the point of deriving a new challenge. To be precise:
- The domain of the oracle is
Statement × pSpec.MessagesUpTo i.1.castSucc - The range of the oracle is
pSpec.Challenge i - The oracle just returns the challenge
Instances For
The oracle interface for Fiat-Shamir.
This is the (inefficient) version where we hash the input statement and the entire transcript up to the point of deriving a new challenge. To be precise:
- The domain of the oracle is
Statement × pSpec.MessagesUpTo i.1.castSucc - The range of the oracle is
pSpec.Challenge i
Some variants of Fiat-Shamir takes in a salt each round. We assume that such salts are included in the input statement (i.e. we can always transform a given reduction into one where every round has a random salt).
Instances For
Alias of ProtocolSpec.srChallengeOracle.
The oracle interface for Fiat-Shamir.
This is the (inefficient) version where we hash the input statement and the entire transcript up to the point of deriving a new challenge. To be precise:
- The domain of the oracle is
Statement × pSpec.MessagesUpTo i.1.castSucc - The range of the oracle is
pSpec.Challenge i
Some variants of Fiat-Shamir takes in a salt each round. We assume that such salts are included in the input statement (i.e. we can always transform a given reduction into one where every round has a random salt).
Instances For
Decidable equality for the state-restoration / (slow) Fiat-Shamir oracle
Define the query implementation for the state-restoration / (slow) Fiat-Shamir oracle (returns a
challenge given messages up to that point) in terms of ProbComp.
This is a randomness oracle: it simply calls the selectElem method inherited from the
SampleableType instance on the challenge types. We may then augment this with withCaching to
obtain a function-like implementation (caches and replays previous queries).
For implementation with caching, we add withCaching.
For implementation where the whole function is sampled ahead of time, and we answer with that
function, see srChallengeQueryImpl'.
Instances For
Alternate version of query implementation that takes in a cached function f and returns
the result and the updated function.
TODO: upstream this as a more general construction in VCVio
Instances For
Alias of ProtocolSpec.srChallengeQueryImpl'.
Alternate version of query implementation that takes in a cached function f and returns
the result and the updated function.
TODO: upstream this as a more general construction in VCVio
Instances For
Auxiliary function for deriving the transcript up to round k from the (full) messages, via
querying the state-restoration / Fiat-Shamir oracle for the challenges.
This is used to define deriveTranscriptFS.
Instances For
Derive the transcript up to round k from the (full) messages, via querying the
state-restoration / Fiat-Shamir oracle for the challenges.
Instances For
Alias of ProtocolSpec.MessagesUpTo.deriveTranscriptSR.
Derive the transcript up to round k from the (full) messages, via querying the
state-restoration / Fiat-Shamir oracle for the challenges.
Instances For
Derive the transcript up to round k from the (full) messages, via querying the
state-restoration / Fiat-Shamir oracle for the challenges.
Instances For
Alias of ProtocolSpec.Messages.deriveTranscriptSR.
Derive the transcript up to round k from the (full) messages, via querying the
state-restoration / Fiat-Shamir oracle for the challenges.