Package org.bouncycastle.pqc.crypto.gmss

## Class GMSSPrivateKeyParameters

- java.lang.Object
- - org.bouncycastle.crypto.params.AsymmetricKeyParameter
  - - org.bouncycastle.pqc.crypto.gmss.GMSSKeyParameters
    - - org.bouncycastle.pqc.crypto.gmss.GMSSPrivateKeyParameters

- All Implemented Interfaces:
    `CipherParameters`

      public class GMSSPrivateKeyParameters
      extends GMSSKeyParameters

  This class provides a specification for a GMSS private key.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---

    `GMSSPrivateKeyParameters​(byte[][] currentSeed, byte[][] nextNextSeed, byte[][][] currentAuthPath, byte[][][] nextAuthPath, Treehash[][] currentTreehash, Treehash[][] nextTreehash, java.util.Vector[] currentStack, java.util.Vector[] nextStack, java.util.Vector[][] currentRetain, java.util.Vector[][] nextRetain, byte[][] nextRoot, byte[][] currentRootSig, GMSSParameters gmssParameterset, GMSSDigestProvider digestProvider)`

    Generates a new GMSS private key

    `GMSSPrivateKeyParameters​(int[] index, byte[][] currentSeeds, byte[][] nextNextSeeds, byte[][][] currentAuthPaths, byte[][][] nextAuthPaths, byte[][][] keep, Treehash[][] currentTreehash, Treehash[][] nextTreehash, java.util.Vector[] currentStack, java.util.Vector[] nextStack, java.util.Vector[][] currentRetain, java.util.Vector[][] nextRetain, GMSSLeaf[] nextNextLeaf, GMSSLeaf[] upperLeaf, GMSSLeaf[] upperTreehashLeaf, int[] minTreehash, byte[][] nextRoot, GMSSRootCalc[] nextNextRoot, byte[][] currentRootSig, GMSSRootSig[] nextRootSig, GMSSParameters gmssParameterset, GMSSDigestProvider digestProvider)`

    /**

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `byte[][][]` | `getCurrentAuthPaths()` |
    `byte[][]` | `getCurrentSeeds()` |
    `int[]` | `getIndex()` |
    `int` | `getIndex​(int i)` |
    `GMSSDigestProvider` | `getName()` |
    `int` | `getNumLeafs​(int i)` |
    `byte[]` | `getSubtreeRootSig​(int i)` |
    `boolean` | `isUsed()` |
    `void` | `markUsed()` |
    `GMSSPrivateKeyParameters` | `nextKey()` |

    - ### Methods inherited from class org.bouncycastle.pqc.crypto.gmss.GMSSKeyParameters

      `getParameters`

    - ### Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter

      `isPrivate`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GMSSPrivateKeyParameters

          public GMSSPrivateKeyParameters​(byte[][] currentSeed,
                                          byte[][] nextNextSeed,
                                          byte[][][] currentAuthPath,
                                          byte[][][] nextAuthPath,
                                          Treehash[][] currentTreehash,
                                          Treehash[][] nextTreehash,
                                          java.util.Vector[] currentStack,
                                          java.util.Vector[] nextStack,
                                          java.util.Vector[][] currentRetain,
                                          java.util.Vector[][] nextRetain,
                                          byte[][] nextRoot,
                                          byte[][] currentRootSig,
                                          GMSSParameters gmssParameterset,
                                          GMSSDigestProvider digestProvider)

      Generates a new GMSS private key
      Parameters:
        `currentSeed` - seed for the generation of private OTS keys for the current subtrees
        `nextNextSeed` - seed for the generation of private OTS keys for the next subtrees
        `currentAuthPath` - array of current authentication paths
        `nextAuthPath` - array of next authentication paths
        `currentTreehash` - array of current treehash instances
        `nextTreehash` - array of next treehash instances
        `currentStack` - array of current shared stacks
        `nextStack` - array of next shared stacks
        `currentRetain` - array of current retain stacks
        `nextRetain` - array of next retain stacks
        `nextRoot` - the roots of the next subtree
        `currentRootSig` - array of signatures of the roots of the current subtrees
        `gmssParameterset` - the GMSS Parameterset
      See Also:
        `GMSSKeyPairGenerator`

    - #### GMSSPrivateKeyParameters

          public GMSSPrivateKeyParameters​(int[] index,
                                          byte[][] currentSeeds,
                                          byte[][] nextNextSeeds,
                                          byte[][][] currentAuthPaths,
                                          byte[][][] nextAuthPaths,
                                          byte[][][] keep,
                                          Treehash[][] currentTreehash,
                                          Treehash[][] nextTreehash,
                                          java.util.Vector[] currentStack,
                                          java.util.Vector[] nextStack,
                                          java.util.Vector[][] currentRetain,
                                          java.util.Vector[][] nextRetain,
                                          GMSSLeaf[] nextNextLeaf,
                                          GMSSLeaf[] upperLeaf,
                                          GMSSLeaf[] upperTreehashLeaf,
                                          int[] minTreehash,
                                          byte[][] nextRoot,
                                          GMSSRootCalc[] nextNextRoot,
                                          byte[][] currentRootSig,
                                          GMSSRootSig[] nextRootSig,
                                          GMSSParameters gmssParameterset,
                                          GMSSDigestProvider digestProvider)

      /**
      Parameters:
        `index` - tree indices
        `keep` - keep array for the authPath algorithm
        `currentTreehash` - treehash for authPath algorithm of current tree
        `nextTreehash` - treehash for authPath algorithm of next tree (TREE+)
        `currentStack` - shared stack for authPath algorithm of current tree
        `nextStack` - shared stack for authPath algorithm of next tree (TREE+)
        `currentRetain` - retain stack for authPath algorithm of current tree
        `nextRetain` - retain stack for authPath algorithm of next tree (TREE+)
        `nextNextLeaf` - array of upcoming leafs of the tree after next (LEAF++) of each layer
        `upperLeaf` - needed for precomputation of upper nodes
        `upperTreehashLeaf` - needed for precomputation of upper treehash nodes
        `minTreehash` - index of next treehash instance to receive an update
        `nextRoot` - the roots of the next trees (ROOT+)
        `nextNextRoot` - the roots of the tree after next (ROOT++)
        `currentRootSig` - array of signatures of the roots of the current subtrees (SIG)
        `nextRootSig` - array of signatures of the roots of the next subtree (SIG+)
        `gmssParameterset` - the GMSS Parameterset

  - ### Method Detail

    - #### isUsed

          public boolean isUsed()

    - #### markUsed

          public void markUsed()

    - #### nextKey

          public GMSSPrivateKeyParameters nextKey()

    - #### getIndex

          public int[] getIndex()

    - #### getIndex

          public int getIndex​(int i)

      Returns:
        The current index of layer i

    - #### getCurrentSeeds

          public byte[][] getCurrentSeeds()

    - #### getCurrentAuthPaths

          public byte[][][] getCurrentAuthPaths()

    - #### getSubtreeRootSig

          public byte[] getSubtreeRootSig​(int i)

      Returns:
        The one-time signature of the root of the current subtree

    - #### getName

          public GMSSDigestProvider getName()

    - #### getNumLeafs

          public int getNumLeafs​(int i)

      Returns:
        The number of leafs of each tree of layer i