public class SPSEQSignatureScheme extends java.lang.Object implements StructurePreservingSignatureEQScheme
Bilinear map type: 3
[1] Georg Fuchsbauer and Christian Hanser and Daniel Slamanig, "Structure-Preserving Signatures on Equivalence Classes and Constant-Size Anonymous Credentials", in Cryptology ePrint Archive, Report 2014/944, 2014.
| Modifier and Type | Field and Description |
|---|---|
protected SPSEQPublicParameters |
pp
Public parameters of the signature scheme.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SPSEQSignatureScheme() |
|
SPSEQSignatureScheme(org.cryptimeleon.math.serialization.Representation repr) |
|
SPSEQSignatureScheme(SPSEQPublicParameters pp) |
| Modifier and Type | Method and Description |
|---|---|
Signature |
chgRep(Signature signature,
org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu,
VerificationKey publicKey)
Returns a signature for the new representative computed based on the previous representative and the given
scalar
mu. |
PlainText |
chgRepMessage(PlainText plainText,
org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu)
Computes and returns the new representative computed based on the previous representative
plainText
and the given scalar mu. |
Signature |
chgRepWithVerify(PlainText plainText,
Signature signature,
org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu,
VerificationKey publicKey)
Same as
StructurePreservingSignatureEQScheme.chgRep(Signature, Zn.ZnElement, VerificationKey) but verifies the signature before
changing representative. |
boolean |
equals(java.lang.Object other) |
SignatureKeyPair<SPSEQVerificationKey,SPSEQSigningKey> |
generateKeyPair(int numberOfMessages)
Generates a key pair for signing a block of
numberOfMessages messages
with each signature. |
int |
getMaxNumberOfBytesForMapToPlaintext()
Returns the maximal number of bytes that can be mapped injectively to a
PlainText by
SignatureScheme.mapToPlaintext(byte[], SigningKey) and SignatureScheme.mapToPlaintext(byte[], VerificationKey). |
SPSEQPublicParameters |
getPp() |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
MessageBlock |
mapToPlaintext(byte[] bytes,
SigningKey sk)
Provides an injective mapping of the given bytes to a
PlainText usable with this scheme (which may be a
MessageBlock). |
MessageBlock |
mapToPlaintext(byte[] bytes,
VerificationKey pk)
Provides an injective mapping of the given bytes to a
PlainText usable with this scheme (which may be a
MessageBlock). |
MessageBlock |
restorePlainText(org.cryptimeleon.math.serialization.Representation repr) |
SPSEQSignature |
restoreSignature(org.cryptimeleon.math.serialization.Representation repr) |
SPSEQSigningKey |
restoreSigningKey(org.cryptimeleon.math.serialization.Representation repr) |
SPSEQVerificationKey |
restoreVerificationKey(org.cryptimeleon.math.serialization.Representation repr) |
Signature |
sign(PlainText plainText,
SigningKey secretKey)
Signs the giving plaintext using the given signing key.
|
java.lang.Boolean |
verify(PlainText plainText,
Signature signature,
VerificationKey publicKey)
Verifies the given signature for the given plaintext using the given verification key.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitsign, sign, verify, verifygenerateKeyPairsign, sign, verify, verifyrestoreFromRepresentation, sign, verifyprotected SPSEQPublicParameters pp
protected SPSEQSignatureScheme()
public SPSEQSignatureScheme(SPSEQPublicParameters pp)
public SPSEQSignatureScheme(org.cryptimeleon.math.serialization.Representation repr)
public SignatureKeyPair<SPSEQVerificationKey,SPSEQSigningKey> generateKeyPair(int numberOfMessages)
StandardMultiMessageSignatureSchemenumberOfMessages messages
with each signature.generateKeyPair in interface StandardMultiMessageSignatureSchemenumberOfMessages - the number of messages as input to sign supported by this key pairpublic Signature sign(PlainText plainText, SigningKey secretKey)
SignatureSchemesign in interface SignatureSchemeplainText - the message to signsecretKey - the secret signing keyplainText computed using secretKeypublic java.lang.Boolean verify(PlainText plainText, Signature signature, VerificationKey publicKey)
SignatureSchemeverify in interface SignatureSchemeplainText - the plaintext the signature should validate againstsignature - the signature to verifypublicKey - the verification key to verify withpublic Signature chgRep(Signature signature, org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu, VerificationKey publicKey)
StructurePreservingSignatureEQSchememu.
If you have not yet verified the signature on the plaintext under the given verification key, use
StructurePreservingSignatureEQScheme.chgRepWithVerify(PlainText, Signature, Zn.ZnElement, VerificationKey) instead.
This method returns a signature matching the new representative of \([M]_R\), where \(M\) is the orignal plaintext.
The new representative of \([M]_R\) is supposed to be generated externally by using \(M\) and element \(\mu\).
The matching signature \(\sigma'\) for the new representative \(\mu \cdot M\) of \([M]_R\) is computed such that
verify(M.pow(), sigma') == true.
See paper [1] for details.
chgRep in interface StructurePreservingSignatureEQSchemepublic Signature chgRepWithVerify(PlainText plainText, Signature signature, org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu, VerificationKey publicKey)
StructurePreservingSignatureEQSchemeStructurePreservingSignatureEQScheme.chgRep(Signature, Zn.ZnElement, VerificationKey) but verifies the signature before
changing representative.chgRepWithVerify in interface StructurePreservingSignatureEQSchemeplainText under publicKey,
else a valid signature on the new representativeStructurePreservingSignatureEQScheme.chgRep(Signature, Zn.ZnElement, VerificationKey)public PlainText chgRepMessage(PlainText plainText, org.cryptimeleon.math.structures.rings.zn.Zn.ZnElement mu)
StructurePreservingSignatureEQSchemeplainText
and the given scalar mu.chgRepMessage in interface StructurePreservingSignatureEQSchemepublic org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representablepublic MessageBlock restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
restorePlainText in interface SignatureSchemepublic SPSEQSignature restoreSignature(org.cryptimeleon.math.serialization.Representation repr)
restoreSignature in interface SignatureSchemepublic SPSEQSigningKey restoreSigningKey(org.cryptimeleon.math.serialization.Representation repr)
restoreSigningKey in interface SignatureSchemepublic SPSEQVerificationKey restoreVerificationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreVerificationKey in interface SignatureSchemepublic SPSEQPublicParameters getPp()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic MessageBlock mapToPlaintext(byte[] bytes, VerificationKey pk)
SignatureSchemePlainText 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.
The contract is that VerificationKey pk and SigningKey sk are compatible
(in the sense that verify(m,sign(m, sk),pk) == true),
then mapToPlaintext(bytes, pk)) equals mapToPlaintext(bytes, sk) for all bytes.
mapToPlaintext in interface SignatureSchemebytes - bytes to be mapped to a PlainTextpk - the verification key for which the resulting PlainText should be valid
(note that the plaintext space may differ for different verification keys).public MessageBlock mapToPlaintext(byte[] bytes, SigningKey sk)
SignatureSchemePlainText 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.
The contract is that VerificationKey pk and SigningKey sk are compatible
(in the sense that verify(m,sign(m, sk),pk) == true),
then mapToPlaintext(bytes, pk)) equals mapToPlaintext(bytes, sk) for all bytes.
mapToPlaintext in interface SignatureSchemebytes - bytes to be mapped to a PlainTextsk - the signing key for which the resulting PlainText should be valid
(note that the plaintext space may differ for different signing keys).public int getMaxNumberOfBytesForMapToPlaintext()
SignatureSchemePlainText by
SignatureScheme.mapToPlaintext(byte[], SigningKey) and SignatureScheme.mapToPlaintext(byte[], VerificationKey).
As described in SignatureScheme.mapToPlaintext(byte[], org.cryptimeleon.craco.sig.VerificationKey) 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 SignatureSchemeSignatureScheme.mapToPlaintext(byte[], org.cryptimeleon.craco.sig.VerificationKey).