public class XMSS
extends java.lang.Object
Constructor and Description |
---|
XMSS(XMSSParameters params)
XMSS constructor...
|
Modifier and Type | Method and Description |
---|---|
byte[] |
exportPrivateKey()
Export XMSS private key.
|
byte[] |
exportPublicKey()
Export XMSS public key.
|
void |
generateKeys()
Generate a new XMSS private key / public key pair.
|
protected BDS |
getBDSState() |
int |
getIndex()
Getter XMSS index.
|
protected KeyedHashFunctions |
getKhf() |
XMSSParameters |
getParams()
Getter XMSS params.
|
byte[] |
getPublicSeed()
Getter XMSS public seed.
|
byte[] |
getRoot()
Getter XMSS root.
|
protected XMSSNode |
getRootNodeFromSignature(byte[] messageDigest,
XMSSReducedSignature signature,
OTSHashAddress otsHashAddress)
Compute a root node from a tree signature.
|
protected WOTSPlus |
getWOTSPlus()
Getter WOTS+.
|
protected byte[] |
getWOTSPlusSecretKey(OTSHashAddress otsHashAddress)
Derive WOTS+ secret key for specific index as in XMSS ref impl Andreas
Huelsing.
|
void |
importState(byte[] privateKey,
byte[] publicKey)
Import XMSS private key / public key pair.
|
protected XMSSNode |
lTree(WOTSPlusPublicKeyParameters publicKey,
LTreeAddress address)
Compresses a WOTS+ public key to a single n-byte string.
|
protected XMSSNode |
randomizeHash(XMSSNode left,
XMSSNode right,
XMSSAddress address)
Randomization of nodes in binary tree.
|
protected void |
setIndex(int index) |
protected void |
setPublicSeed(byte[] publicSeed) |
protected void |
setRoot(byte[] root) |
byte[] |
sign(byte[] message)
Sign message.
|
boolean |
verifySignature(byte[] message,
byte[] signature,
byte[] publicKey)
Verify an XMSS signature.
|
protected WOTSPlusSignature |
wotsSign(byte[] messageDigest,
OTSHashAddress otsHashAddress)
Generate a WOTS+ signature on a message without the corresponding
authentication path
|
public XMSS(XMSSParameters params)
params
- XMSSParameters.public void generateKeys()
public void importState(byte[] privateKey, byte[] publicKey) throws java.text.ParseException, java.lang.ClassNotFoundException, java.io.IOException
privateKey
- XMSS private key.publicKey
- XMSS public key.java.text.ParseException
java.lang.ClassNotFoundException
java.io.IOException
public byte[] sign(byte[] message)
message
- Message to sign.public boolean verifySignature(byte[] message, byte[] signature, byte[] publicKey) throws java.text.ParseException
message
- Message.signature
- XMSS signature.publicKey
- XMSS public key.java.text.ParseException
public byte[] exportPrivateKey()
public byte[] exportPublicKey()
protected XMSSNode randomizeHash(XMSSNode left, XMSSNode right, XMSSAddress address)
left
- Left node.right
- Right node.address
- Address.protected XMSSNode lTree(WOTSPlusPublicKeyParameters publicKey, LTreeAddress address)
publicKey
- WOTS+ public key to compress.address
- Address.protected WOTSPlusSignature wotsSign(byte[] messageDigest, OTSHashAddress otsHashAddress)
messageDigest
- Message digest of length n.otsHashAddress
- OTS hash address.protected XMSSNode getRootNodeFromSignature(byte[] messageDigest, XMSSReducedSignature signature, OTSHashAddress otsHashAddress)
messageDigest
- Message digest.signature
- XMSS signature.protected byte[] getWOTSPlusSecretKey(OTSHashAddress otsHashAddress)
otsHashAddress
- public XMSSParameters getParams()
protected WOTSPlus getWOTSPlus()
protected KeyedHashFunctions getKhf()
public byte[] getRoot()
protected void setRoot(byte[] root)
public int getIndex()
protected void setIndex(int index)
public byte[] getPublicSeed()
protected void setPublicSeed(byte[] publicSeed)
protected BDS getBDSState()