public class SPSPOSSignatureScheme extends java.lang.Object implements MultiMessageStructurePreservingSignatureScheme, SPSMessageSpaceVerifier
SPSFSP2SignatureScheme,
the implementation can be used on its own, where it is one-time CMA secure
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).
[1] Abe et al.: Fully Structure-Preserving Signatures and Shrinking Commitments.
https://eprint.iacr.org/2015/076.pdf| Constructor and Description |
|---|
SPSPOSSignatureScheme(AKOT15SharedPublicParameters pp) |
SPSPOSSignatureScheme(org.cryptimeleon.math.serialization.Representation repr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
SignatureKeyPair<SPSPOSVerificationKey,SPSPOSSigningKey> |
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). |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
PlainText |
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). |
PlainText |
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). |
PlainText |
restorePlainText(org.cryptimeleon.math.serialization.Representation repr) |
Signature |
restoreSignature(org.cryptimeleon.math.serialization.Representation repr) |
SigningKey |
restoreSigningKey(org.cryptimeleon.math.serialization.Representation repr) |
VerificationKey |
restoreVerificationKey(org.cryptimeleon.math.serialization.Representation repr) |
SPSPOSSignature |
sign(PlainText plainText,
SigningKey secretKey)
Signs the giving plaintext using the given signing key.
|
SPSPOSSignature |
sign(PlainText plainText,
SigningKey secretKey,
org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement oneTimeKey)
While a one-time key is stored in the
secretKey, the scheme allows for a separate one-time key
to be passed to the scheme. |
void |
updateOneTimeKey(SignatureKeyPair<SPSPOSVerificationKey,SPSPOSSigningKey> keyPair)
Updates the given keyPair with a new set of one-time keys.
|
java.lang.Boolean |
verify(PlainText plainText,
Signature signature,
VerificationKey publicKey)
Verifies the given signature for the given plaintext using the given verification key.
|
java.lang.Boolean |
verify(PlainText plainText,
Signature signature,
VerificationKey publicKey,
org.cryptimeleon.math.structures.groups.GroupElement oneTimeVerificationKey)
While a one-time key is stored in the
publicKey, the scheme allows for a separate one-time key
to be passed to the scheme. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitsign, sign, verify, verifygenerateKeyPairsign, sign, verify, verifyrestoreFromRepresentation, sign, verifydoMessageCheckspublic SPSPOSSignatureScheme(AKOT15SharedPublicParameters pp)
public SPSPOSSignatureScheme(org.cryptimeleon.math.serialization.Representation repr)
public SignatureKeyPair<SPSPOSVerificationKey,SPSPOSSigningKey> 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 void updateOneTimeKey(SignatureKeyPair<SPSPOSVerificationKey,SPSPOSSigningKey> keyPair)
public SPSPOSSignature sign(PlainText plainText, SigningKey secretKey)
SignatureSchemesign in interface SignatureSchemeplainText - the message to signsecretKey - the secret signing keyplainText computed using secretKeypublic SPSPOSSignature sign(PlainText plainText, SigningKey secretKey, org.cryptimeleon.math.structures.rings.zn.Zp.ZpElement oneTimeKey)
secretKey, the scheme allows for a separate one-time key
to be passed to the scheme. This makes it easier to use this scheme as a building block.
Note: Implementations using this scheme are responsible for ensuring that the one-time keys are not reused.public 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 java.lang.Boolean verify(PlainText plainText, Signature signature, VerificationKey publicKey, org.cryptimeleon.math.structures.groups.GroupElement oneTimeVerificationKey)
publicKey, the scheme allows for a separate one-time key
to be passed to the scheme. This makes it easier to use this scheme as a building block.
Note: Implementations using this scheme are responsible for ensuring that the one-time keys are not reused.public PlainText restorePlainText(org.cryptimeleon.math.serialization.Representation repr)
restorePlainText in interface SignatureSchemepublic Signature restoreSignature(org.cryptimeleon.math.serialization.Representation repr)
restoreSignature in interface SignatureSchemepublic SigningKey restoreSigningKey(org.cryptimeleon.math.serialization.Representation repr)
restoreSigningKey in interface SignatureSchemepublic VerificationKey restoreVerificationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreVerificationKey in interface SignatureSchemepublic PlainText 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 PlainText 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).public 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