Package org.bouncycastle.pqc.crypto.gmss
Class GMSSRootSig
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.gmss.GMSSRootSig
-
public class GMSSRootSig extends java.lang.Object
This class implements the distributed signature generation of the Winternitz one-time signature scheme (OTSS), described in C.Dods, N.P. Smart, and M. Stam, "Hash Based Digital Signature Schemes", LNCS 3796, pages 96–115, 2005. The class is used by the GMSS classes.
-
-
Constructor Summary
Constructors Constructor Description GMSSRootSig(Digest digest, byte[][] statByte, int[] statInt)
This constructor regenerates a prior GMSSRootSig object used by the GMSSPrivateKeyASN.1 classGMSSRootSig(Digest digest, int w, int height)
The constructor generates the PRNG and initializes some variables
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLog(int intValue)
This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integerintValue
.byte[]
getSig()
byte[][]
getStatByte()
This method returns the status byte arrayint[]
getStatInt()
This method returns the status int arraybyte[]
getStatLong()
Converts the long parameters into byte arrays to store it in statByte-Arrayvoid
initSign(byte[] seed0, byte[] message)
This method initializes the distributed sigature calculation.java.lang.String
toString()
returns a string representation of the instanceboolean
updateSign()
This Method performssteps
steps of distributed signature calculaion
-
-
-
Constructor Detail
-
GMSSRootSig
public GMSSRootSig(Digest digest, byte[][] statByte, int[] statInt)
This constructor regenerates a prior GMSSRootSig object used by the GMSSPrivateKeyASN.1 class- Parameters:
digest
- an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providersstatByte
- status byte arraystatInt
- status int array
-
GMSSRootSig
public GMSSRootSig(Digest digest, int w, int height)
The constructor generates the PRNG and initializes some variables- Parameters:
digest
- an array of strings, containing the digest of the used hash function, the digest of the PRGN and the names of the corresponding providersw
- the winternitz parameterheight
- the heigth of the tree
-
-
Method Detail
-
initSign
public void initSign(byte[] seed0, byte[] message)
This method initializes the distributed sigature calculation. Variables are reseted and necessary steps are calculated- Parameters:
seed0
- the initial OTSseedmessage
- the massage which will be signed
-
updateSign
public boolean updateSign()
This Method performssteps
steps of distributed signature calculaion- Returns:
- true if signature is generated completly, else false
-
getSig
public byte[] getSig()
- Returns:
- The private OTS key
-
getLog
public int getLog(int intValue)
This method returns the least integer that is greater or equal to the logarithm to the base 2 of an integerintValue
.- Parameters:
intValue
- an integer- Returns:
- The least integer greater or equal to the logarithm to the base 2
of
intValue
-
getStatByte
public byte[][] getStatByte()
This method returns the status byte array- Returns:
- statBytes
-
getStatInt
public int[] getStatInt()
This method returns the status int array- Returns:
- statInt
-
getStatLong
public byte[] getStatLong()
Converts the long parameters into byte arrays to store it in statByte-Array
-
toString
public java.lang.String toString()
returns a string representation of the instance- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of the instance
-
-