de.flexiprovider.pqc.hbc.ots
Class LMOTS

java.lang.Object
  |
  +--de.flexiprovider.pqc.hbc.ots.LMOTS
All Implemented Interfaces:
OTS

public class LMOTS
extends java.lang.Object
implements OTS


Constructor Summary
LMOTS()
          Constructor.
 
Method Summary
 boolean canComputeVerificationKeyFromSignature()
          The verification key of come one-time signature schemes can be computes from the signature.
 byte[] computeVerificationKey(byte[] bytes, 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[] bytes)
          Generate a one-time signature of the given message using the private key generated via generateKeyPair(byte[]).
 boolean verify(byte[] message, byte[] signedMessage, byte[] verificationKey)
          Verify a one-time signature of the given message using the verification key generated via generateKeyPair(byte[]).
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LMOTS

public LMOTS()
Constructor.
Method Detail

canComputeVerificationKeyFromSignature

public boolean canComputeVerificationKeyFromSignature()
Description copied from interface: OTS
The verification key of come one-time signature schemes can be computes from the signature.
Specified by:
canComputeVerificationKeyFromSignature in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Returns:
true if that is the case and false otherwise

computeVerificationKey

public byte[] computeVerificationKey(byte[] bytes,
                                     byte[] sigBytes)
Description copied from interface: OTS
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.
Specified by:
computeVerificationKey in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
mBytes - the message
sigBytes - the one-time signature
Returns:
the verification OTS key

generateKeyPair

public void generateKeyPair(byte[] seed)
Description copied from interface: OTS
Generate an OTS key pair using the given seed and the message digest and PRNG specified via OTS.init(MessageDigest, PRNG).
Specified by:
generateKeyPair in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
seed - the seed for the PRGN

generateSignatureKey

public void generateSignatureKey(byte[] seed)
Description copied from interface: OTS
Generate an OTS signature key the given seed and the message digest and PRNG specified via OTS.init(MessageDigest, PRNG).
Specified by:
generateSignatureKey in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
seed - the seed for the PRGN

generateVerificationKey

public void generateVerificationKey()
Description copied from interface: OTS
Generate an OTS verification key from the previously generated signature key given the message digest specified via OTS.init(MessageDigest, PRNG).
Specified by:
generateVerificationKey in interface OTS

getSignatureLength

public int getSignatureLength()
Specified by:
getSignatureLength in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Returns:
the length of the one-time signature

getVerificationKey

public byte[] getVerificationKey()
Specified by:
getVerificationKey in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Returns:
the verification key generated via OTS.generateKeyPair(byte[])

getVerificationKeyLength

public int getVerificationKeyLength()
Specified by:
getVerificationKeyLength in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Returns:
the length of the one-time verification key

init

public void init(MessageDigest md,
                 PRNG rng)
Description copied from interface: OTS
Initialize the OTS.
Specified by:
init in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
md - the hash function for the OTS
rng - the name of the PRNG used for key pair generation

sign

public byte[] sign(byte[] bytes)
Description copied from interface: OTS
Generate a one-time signature of the given message using the private key generated via OTS.generateKeyPair(byte[]).
Specified by:
sign in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
mBytes - the message
Returns:
the one-time signature of the message

verify

public boolean verify(byte[] message,
                      byte[] signedMessage,
                      byte[] verificationKey)
Description copied from interface: OTS
Verify a one-time signature of the given message using the verification key generated via OTS.generateKeyPair(byte[]).
Specified by:
verify in interface OTS
Following copied from interface: de.flexiprovider.pqc.hbc.ots.OTS
Parameters:
mBytes - the message
sBytes - the signature
pBytes - the verification key
Returns:
true if signature is valid and false otherwise