de.flexiprovider.pqc.hbc.ots
Interface OTS

All Known Implementing Classes:
CoronadoOTS, LMOTS, WinternitzPRFOTS, WinternitzOTS, MerkleOTS, BiBaOTS

public interface OTS

This is an interface for the different one-time signature schemes used by CMSS.


Method Summary
 boolean canComputeVerificationKeyFromSignature()
          The verification key of come one-time signature schemes can be computes from the signature.
 byte[] computeVerificationKey(byte[] mBytes, byte[] sigBytes)
          Compute the verification OTS key from the one-time signature of a message.
 void generateKeyPair(byte[] seed)
          Generate an OTS key pair using the given seed and the message digest and PRNG specified via init(MessageDigest, PRNG).
 void generateSignatureKey(byte[] seed)
          Generate an OTS signature key the given seed and the message digest and PRNG specified via init(MessageDigest, PRNG).
 void generateVerificationKey()
          Generate an OTS verification key from the previously generated signature key given the message digest specified via init(MessageDigest, PRNG).
 int getSignatureLength()
           
 byte[] getVerificationKey()
           
 int getVerificationKeyLength()
           
 void init(MessageDigest md, PRNG rng)
          Initialize the OTS.
 byte[] sign(byte[] mBytes)
          Generate a one-time signature of the given message using the private key generated via generateKeyPair(byte[]).
 boolean verify(byte[] mBytes, byte[] sBytes, byte[] pBytes)
          Verify a one-time signature of the given message using the verification key generated via generateKeyPair(byte[]).
 

Method Detail

init

public void init(MessageDigest md,
                 PRNG rng)
Initialize the OTS.
Parameters:
md - the hash function for the OTS
rng - the name of the PRNG used for key pair generation

generateKeyPair

public void generateKeyPair(byte[] seed)
Generate an OTS key pair using the given seed and the message digest and PRNG specified via init(MessageDigest, PRNG).
Parameters:
seed - the seed for the PRGN

generateSignatureKey

public void generateSignatureKey(byte[] seed)
Generate an OTS signature key the given seed and the message digest and PRNG specified via init(MessageDigest, PRNG).
Parameters:
seed - the seed for the PRGN

generateVerificationKey

public void generateVerificationKey()
Generate an OTS verification key from the previously generated signature key given the message digest specified via init(MessageDigest, PRNG).

getVerificationKey

public byte[] getVerificationKey()
Returns:
the verification key generated via generateKeyPair(byte[])

getSignatureLength

public int getSignatureLength()
Returns:
the length of the one-time signature

getVerificationKeyLength

public int getVerificationKeyLength()
Returns:
the length of the one-time verification key

sign

public byte[] sign(byte[] mBytes)
Generate a one-time signature of the given message using the private key generated via generateKeyPair(byte[]).
Parameters:
mBytes - the message
Returns:
the one-time signature of the message

verify

public boolean verify(byte[] mBytes,
                      byte[] sBytes,
                      byte[] pBytes)
Verify a one-time signature of the given message using the verification key generated via generateKeyPair(byte[]).
Parameters:
mBytes - the message
sBytes - the signature
pBytes - the verification key
Returns:
true if signature is valid and false otherwise

computeVerificationKey

public byte[] computeVerificationKey(byte[] mBytes,
                                     byte[] sigBytes)
Compute the verification OTS key from the one-time signature of a message. This is *NOT* a complete OTS signature verification, but it suffices for usage with CMSS.
Parameters:
mBytes - the message
sigBytes - the one-time signature
Returns:
the verification OTS key

canComputeVerificationKeyFromSignature

public boolean canComputeVerificationKeyFromSignature()
The verification key of come one-time signature schemes can be computes from the signature.
Returns:
true if that is the case and false otherwise