Class BDS
- java.lang.Object
-
- org.bouncycastle.crypto.signers.xmss.BDS
-
- All Implemented Interfaces:
java.io.Serializable
public final class BDS extends java.lang.Object implements java.io.SerializableBDS.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BDS(XMSSParameters params, int maxIndex, int index)Place holder BDS for when state is exhausted.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex()intgetMaxIndex()voidvalidate(XMSSParameters params)voidvalidate(XMSSParameters params, int expectedIndex)voidvalidateRoot(byte[] expectedRoot)Confirm the root this state carries is the one the enclosing private key declares.BDSwithMaxIndex(int maxIndex, ASN1ObjectIdentifier digestName)BDSwithMaxIndex(int maxIndex, ASN1ObjectIdentifier digestName, int digestSize)BDSwithWOTSDigest(ASN1ObjectIdentifier digestName)BDSwithWOTSDigest(ASN1ObjectIdentifier digestName, int digestSize)
-
-
-
Constructor Detail
-
BDS
public BDS(XMSSParameters params, int maxIndex, int index)
Place holder BDS for when state is exhausted.- Parameters:
params- tree parametersindex- the index that has been reached.
-
-
Method Detail
-
validate
public void validate(XMSSParameters params)
-
validateRoot
public void validateRoot(byte[] expectedRoot)
Confirm the root this state carries is the one the enclosing private key declares. The two are independent copies of the same value in one encoding and always agree on a genuine key, so a disagreement means the stored key has been corrupted. Left unchecked, a corrupted root is accepted and then poisons every signature the key makes - the root is hashed into the message digest, so the signature simply does not verify, with nothing to say why (github #2414).A null root on either side is not compared: BDS.validate tolerates an absent root node, and a key built without one carries zeros.
- Parameters:
expectedRoot- the root the private key declares.
-
validate
public void validate(XMSSParameters params, int expectedIndex)
-
getIndex
public int getIndex()
-
getMaxIndex
public int getMaxIndex()
-
withWOTSDigest
public BDS withWOTSDigest(ASN1ObjectIdentifier digestName)
-
withWOTSDigest
public BDS withWOTSDigest(ASN1ObjectIdentifier digestName, int digestSize)
-
withMaxIndex
public BDS withMaxIndex(int maxIndex, ASN1ObjectIdentifier digestName)
-
withMaxIndex
public BDS withMaxIndex(int maxIndex, ASN1ObjectIdentifier digestName, int digestSize)
-
-