public abstract class BaseProtocolInstance extends java.lang.Object implements TwoPartyProtocolInstance
TwoPartyProtocolInstance implementation that allows for subprotocol execution.| Constructor and Description |
|---|
BaseProtocolInstance(BaseProtocol protocol,
java.lang.String role) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doRoundForFirstRole(int round) |
protected abstract void |
doRoundForSecondRole(int round) |
TwoPartyProtocol |
getProtocol() |
java.lang.String |
getRoleName() |
boolean |
hasTerminated()
Returns true if the protocol is done, meaning no further calls to
nextMessage() are necessary. |
protected void |
internalDoRound(int round) |
org.cryptimeleon.math.serialization.Representation |
nextMessage(org.cryptimeleon.math.serialization.Representation received)
Outputs the next message this protocol instance demands to be sent to the other party.
|
protected org.cryptimeleon.math.serialization.Representation |
receive(java.lang.String id) |
protected void |
runArgumentConcurrently(java.lang.String instanceName,
InteractiveArgumentInstance instance)
Runs the subprotocol argument and has the verifier throw an exception if the proof fails
|
protected void |
runSubprotocolConcurrently(java.lang.String instanceName,
TwoPartyProtocolInstance instance) |
protected void |
send(java.lang.String id,
org.cryptimeleon.math.serialization.Representation repr) |
protected void |
terminate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendsFirstMessagepublic BaseProtocolInstance(BaseProtocol protocol, java.lang.String role)
public TwoPartyProtocol getProtocol()
getProtocol in interface TwoPartyProtocolInstanceprotected void runSubprotocolConcurrently(java.lang.String instanceName,
TwoPartyProtocolInstance instance)
protected void runArgumentConcurrently(java.lang.String instanceName,
InteractiveArgumentInstance instance)
instanceName - name for the protocol (same for prover and verifier)instance - the instance to runprotected void send(java.lang.String id,
org.cryptimeleon.math.serialization.Representation repr)
protected org.cryptimeleon.math.serialization.Representation receive(java.lang.String id)
protected void terminate()
public org.cryptimeleon.math.serialization.Representation nextMessage(org.cryptimeleon.math.serialization.Representation received)
TwoPartyProtocolInstancenextMessage in interface TwoPartyProtocolInstancereceived - the message recently received from the other party
or null if this is the first round and no messages have been sent yetm to be sent to the other party (who then calls nextMessage(m) on their end).
If nextMessage returns null, the protocol has terminatedprotected void internalDoRound(int round)
protected abstract void doRoundForFirstRole(int round)
protected abstract void doRoundForSecondRole(int round)
public boolean hasTerminated()
TwoPartyProtocolInstancenextMessage() are necessary.hasTerminated in interface TwoPartyProtocolInstancepublic java.lang.String getRoleName()
getRoleName in interface TwoPartyProtocolInstance