Class BDS

  • All Implemented Interfaces:
    java.io.Serializable

    public final class BDS
    extends java.lang.Object
    implements java.io.Serializable
    BDS.
    See Also:
    Serialized Form
    • Constructor Detail

      • BDS

        public BDS​(XMSSParameters params,
                   int maxIndex,
                   int index)
        Place holder BDS for when state is exhausted.
        Parameters:
        params - tree parameters
        index - the index that has been reached.
    • Method Detail

      • 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()