public boolean verifySignature(byte[] message, byte[] signature)
{
XMSSSignature sig = new XMSSSignature.Builder(params).withSignature(signature).build();
int index = sig.getIndex();
params.getWOTSPlus().importKeys(new byte[params.getDigestSize()], publicKey.getPublicSeed());
byte[] concatenated = Arrays.concatenate(sig.getRandom(), publicKey.getRoot(),
XMSSUtil.toBytesBigEndian(index, params.getDigestSize()));
byte[] messageDigest = khf.HMsg(concatenated, message);
int xmssHeight = params.getHeight();
int indexLeaf = XMSSUtil.getLeafIndex(index, xmssHeight);
OTSHashAddress otsHashAddress = (OTSHashAddress)new OTSHashAddress.Builder().withOTSAddress(index).build();
XMSSNode rootNodeFromSignature = XMSSVerifierUtil.getRootNodeFromSignature(params.getWOTSPlus(), xmssHeight, messageDigest, sig, otsHashAddress, indexLeaf);
return Arrays.constantTimeAreEqual(rootNodeFromSignature.getValue(), publicKey.getRoot());
}