Package org.bouncycastle.crypto.signers
Class HMacDSAKCalculator
- java.lang.Object
-
- org.bouncycastle.crypto.signers.HMacDSAKCalculator
-
- All Implemented Interfaces:
DSAKCalculator
public class HMacDSAKCalculator extends java.lang.Object implements DSAKCalculator
A deterministic K calculator based on the algorithm in section 3.2 of RFC 6979.
-
-
Constructor Summary
Constructors Constructor Description HMacDSAKCalculator(Digest digest)Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(java.math.BigInteger n, java.math.BigInteger d, byte[] message)Deterministic initialiser.voidinit(java.math.BigInteger n, java.security.SecureRandom random)Non-deterministic initialiser.booleanisDeterministic()Return true if this calculator is deterministic, false otherwise.java.math.BigIntegernextK()Return the next valid value of K.
-
-
-
Constructor Detail
-
HMacDSAKCalculator
public HMacDSAKCalculator(Digest digest)
Base constructor.- Parameters:
digest- digest to build the HMAC on.
-
-
Method Detail
-
isDeterministic
public boolean isDeterministic()
Description copied from interface:DSAKCalculatorReturn true if this calculator is deterministic, false otherwise.- Specified by:
isDeterministicin interfaceDSAKCalculator- Returns:
- true if deterministic, otherwise false.
-
init
public void init(java.math.BigInteger n, java.security.SecureRandom random)Description copied from interface:DSAKCalculatorNon-deterministic initialiser.- Specified by:
initin interfaceDSAKCalculator- Parameters:
n- the order of the DSA group.random- a source of randomness.
-
init
public void init(java.math.BigInteger n, java.math.BigInteger d, byte[] message)Description copied from interface:DSAKCalculatorDeterministic initialiser.- Specified by:
initin interfaceDSAKCalculator- Parameters:
n- the order of the DSA group.d- the DSA private value.message- the message being signed.
-
nextK
public java.math.BigInteger nextK()
Description copied from interface:DSAKCalculatorReturn the next valid value of K.- Specified by:
nextKin interfaceDSAKCalculator- Returns:
- a K value.
-
-