public class TCGAKOT15CommitmentScheme extends java.lang.Object implements CommitmentScheme
SPSFSP2SignatureScheme,
the implementation can be used on its own, where it is gamma-collision resistant
under the Double Pairing assumption as defined in [1].
Note: The calculation of the commitments differs slightly when the scheme is used in the context of
SPSFSP2SignatureScheme:
As the scheme combines TCAKOT15CommitmentScheme -- which is
based on this scheme -- with SPSXSIGSignatureScheme,
the scheme must calculate 2 additional elements for its commitments (with are then signed by XSIG).
Note: While the message space of the verification function is M := {M_i \in G_1}, this implementation will
also accept messages containing elements \in Z_p and will calculate the appropriate G_1 elements automatically.
[1] Abe et al.: Fully Structure-Preserving Signatures and Shrinking Commitments.
https://eprint.iacr.org/2015/076.pdf| Modifier and Type | Field and Description |
|---|---|
AKOT15SharedPublicParameters |
pp
The public parameters for this scheme
|
| Constructor and Description |
|---|
TCGAKOT15CommitmentScheme(AKOT15SharedPublicParameters pp) |
TCGAKOT15CommitmentScheme(org.cryptimeleon.math.serialization.Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
CommitmentPair |
commit(PlainText plainText)
Commit to a given message
|
boolean |
equals(java.lang.Object o) |
TCGAKOT15CommitmentKey |
getCommitmentKey() |
int |
getMaxNumberOfBytesForMapToPlaintext()
Returns the maximal number of bytes that can be mapped injectively to a
PlainText by
CommitmentScheme.mapToPlaintext(byte[]) |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
PlainText |
mapToPlaintext(byte[] bytes)
Provides an injective mapping of the given
byte[] to a PlainText usable with this scheme
(which may be a MessageBlock). |
Commitment |
restoreCommitment(org.cryptimeleon.math.serialization.Representation repr) |
OpenValue |
restoreOpenValue(org.cryptimeleon.math.serialization.Representation repr) |
boolean |
verify(Commitment commitment,
OpenValue openValue,
PlainText plainText)
Verifies that the given announced
PlainText equals the result of opening
the Commitment with the OpenValue. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitrestoreCommitmentPair, restoreFromRepresentationpublic AKOT15SharedPublicParameters pp
public TCGAKOT15CommitmentScheme(AKOT15SharedPublicParameters pp)
public TCGAKOT15CommitmentScheme(org.cryptimeleon.math.serialization.Representation repr)
public CommitmentPair commit(PlainText plainText)
commit in interface CommitmentSchemeplainText - the message blockpublic boolean verify(Commitment commitment, OpenValue openValue, PlainText plainText)
CommitmentSchemePlainText equals the result of opening
the Commitment with the OpenValue.
A commitment scheme such as HashThenCommitCommitmentScheme may also hash the message before committing
to it. This method can take this into account, i.e. by hashing the given announced plaintext before comparing.
verify in interface CommitmentSchemecommitment - commitment to verifyopenValue - used to open the commitment and reveal the contentplainText - the hash of this will be compared with the opened commitment messagepublic TCGAKOT15CommitmentKey getCommitmentKey()
public PlainText mapToPlaintext(byte[] bytes)
CommitmentSchemebyte[] to a PlainText usable with this scheme
(which may be a MessageBlock).
It only guarantees injectivity for arrays of the same length.
Applications that would like to use mapToPlaintext with multiple different array lengths
may want to devise a padding method and then only call mapToPlaintext with
byte arrays of the same (padded) length.mapToPlaintext in interface CommitmentSchemebytes - byte[] to map to a PlainText that can be committed to using this commitment schemePlainText usable with this commitment schemepublic int getMaxNumberOfBytesForMapToPlaintext()
CommitmentSchemePlainText by
CommitmentScheme.mapToPlaintext(byte[])
As described in CommitmentScheme.mapToPlaintext(byte[]) there might be no injective PlainText for some byte arrays, e.g.
if the byte array is too long. Therefore, this method provides the maximal number of bytes that can be mapped
injectively to a PlainText.
getMaxNumberOfBytesForMapToPlaintext in interface CommitmentSchemeCommitmentScheme.mapToPlaintext(byte[]).public Commitment restoreCommitment(org.cryptimeleon.math.serialization.Representation repr)
restoreCommitment in interface CommitmentSchemepublic OpenValue restoreOpenValue(org.cryptimeleon.math.serialization.Representation repr)
restoreOpenValue in interface CommitmentSchemepublic org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representablepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object