public abstract class SendThenDelegateFragment extends java.lang.Object implements SchnorrFragment
SchnorrFragments with this Send-then-Delegate-to-Subfragments behavior.SigmaProtocol with this behavior, see SendThenDelegateProtocol. DelegateFragment or DelegateProtocol.| Modifier and Type | Class and Description |
|---|---|
static class |
SendThenDelegateFragment.ProverSpec |
static class |
SendThenDelegateFragment.ProverSpecBuilder
Helps build
SendThenDelegateFragment.ProverSpec objects to describe data contributed by the prover. |
protected static class |
SendThenDelegateFragment.SendThenDelegateAnnouncement |
static class |
SendThenDelegateFragment.SubprotocolSpec
Specifies what this Fragment shall do, i.e.
|
static class |
SendThenDelegateFragment.SubprotocolSpecBuilder
A builder to help instantiate
SendThenDelegateFragment.SubprotocolSpecs. |
static class |
SendThenDelegateFragment.WitnessValues |
| Constructor and Description |
|---|
SendThenDelegateFragment() |
| Modifier and Type | Method and Description |
|---|---|
org.cryptimeleon.math.expressions.bool.BooleanExpression |
checkTranscript(Announcement announcement,
ZnChallenge challenge,
Response response,
SchnorrVariableAssignment externalResponse)
Checks whether the fragment's transcript with the addition of externalResponse is accepting.
|
org.cryptimeleon.math.serialization.Representation |
compressTranscript(Announcement announcement,
ZnChallenge challenge,
Response response,
SchnorrVariableAssignment externalResponse)
Returns a compressed (shorter) version of the given transcript.
|
void |
debugFragment(SchnorrVariableAssignment externalWitness,
ZnChallengeSpace challengeSpace)
Checks if the given input is a valid witness for this fragment.
|
SigmaProtocolTranscript |
decompressTranscript(org.cryptimeleon.math.serialization.Representation compressedTranscript,
ZnChallenge challenge,
SchnorrVariableAssignment externalResponse)
Decompressed a transcript compressed with
SchnorrFragment.compressTranscript(org.cryptimeleon.craco.protocols.arguments.sigma.Announcement, org.cryptimeleon.craco.protocols.arguments.sigma.ZnChallenge, org.cryptimeleon.craco.protocols.arguments.sigma.Response, org.cryptimeleon.craco.protocols.arguments.sigma.schnorr.variables.SchnorrVariableAssignment)
The guarantee is that if a transcript is valid, then compressing and decompressing yields the same transcript. |
Announcement |
generateAnnouncement(SchnorrVariableAssignment externalWitnesses,
AnnouncementSecret announcementSecret,
SchnorrVariableAssignment externalRandom)
Generates an announcement.
|
AnnouncementSecret |
generateAnnouncementSecret(SchnorrVariableAssignment externalWitnesses)
Generates secret data that's passed in successive calls for the prover.
|
Response |
generateResponse(SchnorrVariableAssignment externalWitnesses,
AnnouncementSecret announcementSecret,
ZnChallenge challenge)
Generates a response.
|
SigmaProtocolTranscript |
generateSimulatedTranscript(ZnChallenge challenge,
SchnorrVariableAssignment externalRandomResponse)
Generates a simulated transcript.
|
protected abstract org.cryptimeleon.math.expressions.bool.BooleanExpression |
provideAdditionalCheck(SendFirstValue sendFirstValue)
Runs an additional check on the sendFirstValue when the verifier checks a transcript.
|
protected abstract SendThenDelegateFragment.ProverSpec |
provideProverSpec(SchnorrVariableAssignment externalWitnesses,
SendThenDelegateFragment.ProverSpecBuilder builder)
Run by the prover to set up (1) the sendFirstValue and
(2) witness values for variables this fragment proves knowledge of itself (i.e.
|
protected abstract SendThenDelegateFragment.SubprotocolSpec |
provideSubprotocolSpec(SendFirstValue sendFirstValue,
SendThenDelegateFragment.SubprotocolSpecBuilder builder)
Run by both prover and verifier to deterministically instantiate the desired subprotocols (subfragments) depending on the sendFirstValue.
For this, the given SendThenDelegateFragment.SubprotocolSpecBuilder allows you to create (1) variables (witnesses) and (2) register fragments to run. |
Announcement |
restoreAnnouncement(org.cryptimeleon.math.serialization.Representation repr) |
Response |
restoreResponse(Announcement announcement,
org.cryptimeleon.math.serialization.Representation repr) |
protected abstract SendFirstValue |
restoreSendFirstValue(org.cryptimeleon.math.serialization.Representation repr)
Restores a
SendFirstValue from Representation |
protected abstract SendFirstValue |
simulateSendFirstValue()
Returns a random
SendFirstValue with the same probability distribution as an honest prover would generate. |
protected abstract SendThenDelegateFragment.ProverSpec provideProverSpec(SchnorrVariableAssignment externalWitnesses, SendThenDelegateFragment.ProverSpecBuilder builder)
Run by the prover to set up (1) the sendFirstValue and
(2) witness values for variables this fragment proves knowledge of itself (i.e. those specified in provideSubprotocolSpec(SendFirstValue, SubprotocolSpecBuilder)).
A typical example implementation can be found in SetMembershipFragment.
externalWitnesses - the witness values for external variablesbuilder - helper object to instantiate a SendThenDelegateFragment.ProverSpecSendThenDelegateFragment.ProverSpecBuilder.build().protected abstract SendFirstValue restoreSendFirstValue(org.cryptimeleon.math.serialization.Representation repr)
SendFirstValue from Representationprotected abstract SendFirstValue simulateSendFirstValue()
SendFirstValue with the same probability distribution as an honest prover would generate.protected abstract SendThenDelegateFragment.SubprotocolSpec provideSubprotocolSpec(SendFirstValue sendFirstValue, SendThenDelegateFragment.SubprotocolSpecBuilder builder)
Run by both prover and verifier to deterministically instantiate the desired subprotocols (subfragments) depending on the sendFirstValue.
For this, the given SendThenDelegateFragment.SubprotocolSpecBuilder allows you to create (1) variables (witnesses) and (2) register fragments to run.
The SendThenDelegateFragment will then take care of proving knowledge of the desired witnesses and running the desired subfragments.
For the subfragments, the registered variables will be considered "external" (cf. SchnorrFragment).
A typical example implementation can be found in SetMembershipFragment.
sendFirstValue - the value the prover sends as his first message.builder - helper object to instantiate a SendThenDelegateFragment.SubprotocolSpecSendThenDelegateFragment.SubprotocolSpecBuilder.build().protected abstract org.cryptimeleon.math.expressions.bool.BooleanExpression provideAdditionalCheck(SendFirstValue sendFirstValue)
public AnnouncementSecret generateAnnouncementSecret(SchnorrVariableAssignment externalWitnesses)
SchnorrFragmentgenerateAnnouncementSecret in interface SchnorrFragmentexternalWitnesses - witnesses used by this protocol whose extractability is handled outside of this fragment. May contain some variables not relevant for this fragment.public Announcement generateAnnouncement(SchnorrVariableAssignment externalWitnesses, AnnouncementSecret announcementSecret, SchnorrVariableAssignment externalRandom)
SchnorrFragmentgenerateAnnouncement in interface SchnorrFragmentexternalWitnesses - witnesses used by this protocol whose extractability is handled outside of this fragment. May contain some variables not relevant for this fragment.announcementSecret - the secret generated by SchnorrFragment.generateAnnouncementSecret(SchnorrVariableAssignment)externalRandom - contains an assignment of external variables to random values.public Response generateResponse(SchnorrVariableAssignment externalWitnesses, AnnouncementSecret announcementSecret, ZnChallenge challenge)
SchnorrFragmentgenerateResponse in interface SchnorrFragmentexternalWitnesses - witnesses used by this protocol whose extractability is handled outside of this fragment. May contain some variables not relevant for this fragment.announcementSecret - the secret generated by SchnorrFragment.generateAnnouncementSecret(SchnorrVariableAssignment).challenge - the challenge of a Schnorr protocol.public org.cryptimeleon.math.expressions.bool.BooleanExpression checkTranscript(Announcement announcement, ZnChallenge challenge, Response response, SchnorrVariableAssignment externalResponse)
SchnorrFragmentcheckTranscript in interface SchnorrFragmentpublic SigmaProtocolTranscript generateSimulatedTranscript(ZnChallenge challenge, SchnorrVariableAssignment externalRandomResponse)
SchnorrFragmentgenerateSimulatedTranscript in interface SchnorrFragmentchallenge - challenge the transcript shall use.externalRandomResponse - a random assignment of external variables to random values.public Announcement restoreAnnouncement(org.cryptimeleon.math.serialization.Representation repr)
restoreAnnouncement in interface SchnorrFragmentpublic Response restoreResponse(Announcement announcement, org.cryptimeleon.math.serialization.Representation repr)
restoreResponse in interface SchnorrFragmentpublic org.cryptimeleon.math.serialization.Representation compressTranscript(Announcement announcement, ZnChallenge challenge, Response response, SchnorrVariableAssignment externalResponse)
SchnorrFragmentFiatShamirProofSystem.compressTranscript in interface SchnorrFragmentpublic SigmaProtocolTranscript decompressTranscript(org.cryptimeleon.math.serialization.Representation compressedTranscript, ZnChallenge challenge, SchnorrVariableAssignment externalResponse) throws java.lang.IllegalArgumentException
SchnorrFragmentSchnorrFragment.compressTranscript(org.cryptimeleon.craco.protocols.arguments.sigma.Announcement, org.cryptimeleon.craco.protocols.arguments.sigma.ZnChallenge, org.cryptimeleon.craco.protocols.arguments.sigma.Response, org.cryptimeleon.craco.protocols.arguments.sigma.schnorr.variables.SchnorrVariableAssignment)
The guarantee is that if a transcript is valid, then compressing and decompressing yields the same transcript.
Additionally, any transcript output by this method is valid (i.e. SigmaProtocol.checkTranscript(org.cryptimeleon.craco.protocols.CommonInput, org.cryptimeleon.craco.protocols.arguments.sigma.Announcement, org.cryptimeleon.craco.protocols.arguments.sigma.Challenge, org.cryptimeleon.craco.protocols.arguments.sigma.Response) returns true).decompressTranscript in interface SchnorrFragmentjava.lang.IllegalArgumentException - is the given compressedTranscript cannot be decompressed into a valid transcript.public void debugFragment(SchnorrVariableAssignment externalWitness, ZnChallengeSpace challengeSpace)
SchnorrFragmentdebugFragment in interface SchnorrFragment