public abstract class ProofOfPartialKnowledge extends java.lang.Object implements SigmaProtocol
SendFirstValue (e.g., a Pedersen commitment to some values) that is sent alongside the first message of this Sigma protocol.
From this SendFirstValue, prover and verifier set up the appropriate subprotocols and tree structure (similarly to SendThenDelegateFragment).
Then those subprotocols are run in a way that respects the desired AND/OR compositions.
[CDS94] Cramer, Ronald, Ivan Damgård, and Berry Schoenmakers. "Proofs of partial knowledge and simplified design of witness hiding protocols". CRYPTO 1994
PROVER_ROLE, VERIFIER_ROLE| Constructor and Description |
|---|
ProofOfPartialKnowledge() |
| Modifier and Type | Method and Description |
|---|---|
protected ProofOfPartialKnowledge.ProtocolTree |
and(ProofOfPartialKnowledge.ProtocolTree protocol1,
ProofOfPartialKnowledge.ProtocolTree protocol2)
Construct a tree that AND-combines two subtrees.
|
org.cryptimeleon.math.expressions.bool.BooleanExpression |
checkTranscriptAsExpression(CommonInput commonInput,
Announcement announcement,
Challenge challenge,
Response response)
Used by the verifier to check whether the given transcript is accepting.
|
void |
debugProof(CommonInput commonInput,
SecretInput secretInput)
Checks if commonInput and secretInput are valid inputs for this protocol.
|
Announcement |
generateAnnouncement(CommonInput commonInput,
SecretInput secretInput,
AnnouncementSecret announcementSecret)
Used by the prover to generate an announcement (the first message sent in the protocol).
|
AnnouncementSecret |
generateAnnouncementSecret(CommonInput commonInput,
SecretInput secretInput)
Used by the prover to generate a secret value that will be input for future method calls.
|
Response |
generateResponse(CommonInput commonInput,
SecretInput secretInput,
Announcement announcement,
AnnouncementSecret announcementSecret,
Challenge challenge)
Used by the prover to generate a response (the third and last message sent in the protocol).
|
SigmaProtocolTranscript |
generateSimulatedTranscript(CommonInput commonInput,
Challenge challenge)
Generates a random transcript with the same distribution as an honestly generated one that contains the given
Challenge. |
protected ProofOfPartialKnowledge.ProtocolTree |
leaf(java.lang.String name,
SigmaProtocol protocol,
CommonInput commonInput)
Construct a tree that contains a single subprotocol to run.
|
protected ProofOfPartialKnowledge.ProtocolTree |
or(ProofOfPartialKnowledge.ProtocolTree protocol1,
ProofOfPartialKnowledge.ProtocolTree protocol2)
Construct a tree that OR-combines two subtrees.
|
protected abstract org.cryptimeleon.math.expressions.bool.BooleanExpression |
provideAdditionalCheck(CommonInput commonInput,
SendFirstValue sendFirstValue)
Returns true if the given sendFirstValue is well-formed and valid.
|
protected abstract ProofOfPartialKnowledge.ProtocolTree |
provideProtocolTree(CommonInput commonInput,
SendFirstValue sendFirstValue)
Sets up the desired subprotocols and returns the
ProofOfPartialKnowledge.ProtocolTree that encodes the AND/OR relations between them. |
protected abstract ProofOfPartialKnowledge.ProverSpec |
provideProverSpec(CommonInput commonInput,
SecretInput secretInput,
ProofOfPartialKnowledge.ProverSpecBuilder builder)
Sets up the
ProofOfPartialKnowledge.ProverSpec. |
Announcement |
restoreAnnouncement(CommonInput commonInput,
org.cryptimeleon.math.serialization.Representation repr) |
Response |
restoreResponse(CommonInput commonInput,
Announcement announcement,
Challenge challenge,
org.cryptimeleon.math.serialization.Representation repr) |
protected abstract SendFirstValue |
restoreSendFirstValue(CommonInput commonInput,
org.cryptimeleon.math.serialization.Representation repr)
Restores a
SendFirstValue from representation. |
protected abstract SendFirstValue |
simulateSendFirstValue(CommonInput commonInput)
Simulates the
SendFirstValue, i.e. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckTranscript, checkTranscript, compressTranscript, decompressTranscript, generateChallenge, getChallengeSpace, getFirstMessageRole, getProverInstance, getVerifierInstance, instantiateProtocol, restoreChallenge, restoreTranscriptgetRoleNames, instantiateProver, instantiateVerifierrunProtocolLocallyprotected abstract ProofOfPartialKnowledge.ProtocolTree provideProtocolTree(CommonInput commonInput, SendFirstValue sendFirstValue)
ProofOfPartialKnowledge.ProtocolTree that encodes the AND/OR relations between them.
Implementors should build the ProofOfPartialKnowledge.ProtocolTree using leaf(java.lang.String, org.cryptimeleon.craco.protocols.arguments.sigma.SigmaProtocol, org.cryptimeleon.craco.protocols.CommonInput), and(org.cryptimeleon.craco.protocols.arguments.sigma.partial.ProofOfPartialKnowledge.ProtocolTree, org.cryptimeleon.craco.protocols.arguments.sigma.partial.ProofOfPartialKnowledge.ProtocolTree), and or(org.cryptimeleon.craco.protocols.arguments.sigma.partial.ProofOfPartialKnowledge.ProtocolTree, org.cryptimeleon.craco.protocols.arguments.sigma.partial.ProofOfPartialKnowledge.ProtocolTree).commonInput - the public input to this ProofOfPartialKnowledge (can be anything appropriate for the concrete protocol implemented).sendFirstValue - the value sent by the prover before the subprotocols start running.protected abstract ProofOfPartialKnowledge.ProverSpec provideProverSpec(CommonInput commonInput, SecretInput secretInput, ProofOfPartialKnowledge.ProverSpecBuilder builder)
ProofOfPartialKnowledge.ProverSpec.
SendFirstValue the prover wants to send (can be SendFirstValue.EmptySendFirstValue.ProofOfPartialKnowledge.ProverSpecBuilder.putSecretInput(String, SecretInput) for it.
provideProtocolTree(CommonInput, SendFirstValue).
commonInput - the public input to this ProofOfPartialKnowledge (can be anything appropriate for the concrete protocol implemented).secretInput - the secret input to this ProofOfPartialKnowledge (can be anything appropriate for the concrete protocol implemented).builder - an object to use to build the ProofOfPartialKnowledge.ProverSpec.builder.protected abstract SendFirstValue restoreSendFirstValue(CommonInput commonInput, org.cryptimeleon.math.serialization.Representation repr)
SendFirstValue from representation.protected abstract SendFirstValue simulateSendFirstValue(CommonInput commonInput)
SendFirstValue, i.e. returns one with a distribution that indistinguishable from an honest prover's.protected abstract org.cryptimeleon.math.expressions.bool.BooleanExpression provideAdditionalCheck(CommonInput commonInput, SendFirstValue sendFirstValue)
return BooleanExpression.TRUE if no additional checks are needed.protected final ProofOfPartialKnowledge.ProtocolTree leaf(java.lang.String name, SigmaProtocol protocol, CommonInput commonInput)
name - name of the protocol (must be unique, i.e. don't call leaf() twice with the same name in the same execution of provideProtocolTree(org.cryptimeleon.craco.protocols.CommonInput, org.cryptimeleon.craco.protocols.arguments.sigma.schnorr.SendFirstValue)).protocol - the subprotocolcommonInput - the common input for the subprotocol.protected final ProofOfPartialKnowledge.ProtocolTree and(ProofOfPartialKnowledge.ProtocolTree protocol1, ProofOfPartialKnowledge.ProtocolTree protocol2)
protected final ProofOfPartialKnowledge.ProtocolTree or(ProofOfPartialKnowledge.ProtocolTree protocol1, ProofOfPartialKnowledge.ProtocolTree protocol2)
public AnnouncementSecret generateAnnouncementSecret(CommonInput commonInput, SecretInput secretInput)
SigmaProtocolFor example, for an implementation of the original Schnorr protocol, the announcement secret would be a random exponent r.
generateAnnouncementSecret in interface SigmaProtocolcommonInput - input to the overall protocol that both prover and verifier usesecretInput - input to the overall protocol that only the prover getspublic Announcement generateAnnouncement(CommonInput commonInput, SecretInput secretInput, AnnouncementSecret announcementSecret)
SigmaProtocolgenerateAnnouncement in interface SigmaProtocolpublic Response generateResponse(CommonInput commonInput, SecretInput secretInput, Announcement announcement, AnnouncementSecret announcementSecret, Challenge challenge)
SigmaProtocolgenerateResponse in interface SigmaProtocolpublic org.cryptimeleon.math.expressions.bool.BooleanExpression checkTranscriptAsExpression(CommonInput commonInput, Announcement announcement, Challenge challenge, Response response)
SigmaProtocolcheckTranscriptAsExpression in interface SigmaProtocolpublic SigmaProtocolTranscript generateSimulatedTranscript(CommonInput commonInput, Challenge challenge)
SigmaProtocolChallenge.generateSimulatedTranscript in interface SigmaProtocolpublic Announcement restoreAnnouncement(CommonInput commonInput, org.cryptimeleon.math.serialization.Representation repr)
restoreAnnouncement in interface SigmaProtocolpublic Response restoreResponse(CommonInput commonInput, Announcement announcement, Challenge challenge, org.cryptimeleon.math.serialization.Representation repr)
restoreResponse in interface SigmaProtocolpublic void debugProof(CommonInput commonInput, SecretInput secretInput)
InteractiveArgumentdebugProof in interface InteractiveArgument