public class LinearStatementFragment extends java.lang.Object implements SchnorrFragment
homomorphicExpression(variables) = publicConstant
holds.
Use LinearExponentStatementFragment for linear equations over exponents.| Modifier and Type | Class and Description |
|---|---|
static class |
LinearStatementFragment.LinearStatementAnnouncement |
| Constructor and Description |
|---|
LinearStatementFragment(org.cryptimeleon.math.expressions.group.GroupElementExpression homomorphicPart,
org.cryptimeleon.math.structures.groups.GroupElement target)
Instantiates this fragment to prove that
homomorphicPart(witness) = target;
|
LinearStatementFragment(org.cryptimeleon.math.expressions.bool.GroupEqualityExpr equation)
Instantiates this fragment to prove that
the given equation is fulfilled.
|
| 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.
|
Announcement |
restoreAnnouncement(org.cryptimeleon.math.serialization.Representation repr) |
Response |
restoreResponse(Announcement announcement,
org.cryptimeleon.math.serialization.Representation repr) |
public LinearStatementFragment(org.cryptimeleon.math.expressions.group.GroupElementExpression homomorphicPart,
org.cryptimeleon.math.structures.groups.GroupElement target)
homomorphicPart - an expression which is linear in its SchnorrVariables.target - the desired (public) image of homomorphicPart.public LinearStatementFragment(org.cryptimeleon.math.expressions.bool.GroupEqualityExpr equation)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if equation is not supported (i.e. framework is unable to write it as linear(variables) = constant)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