Table of Contents

Class HMacDsaKCalculator

Namespace
Org.BouncyCastle.Crypto.Signers
Assembly
BouncyCastle.Cryptography.dll
public class HMacDsaKCalculator : IDsaKCalculator
Inheritance
HMacDsaKCalculator
Implements
Inherited Members

Constructors

HMacDsaKCalculator(IDigest)

public HMacDsaKCalculator(IDigest digest)

Parameters

digest IDigest

Properties

IsDeterministic

Return true if this calculator is deterministic, false otherwise.

@return true if deterministic, otherwise false.

public virtual bool IsDeterministic { get; }

Property Value

bool

Methods

Init(BigInteger, BigInteger, byte[])

Deterministic initialiser.

@param n the order of the DSA group. @param d the DSA private value. @param message the message being signed.

public void Init(BigInteger n, BigInteger d, byte[] message)

Parameters

n BigInteger
d BigInteger
message byte[]

Init(BigInteger, SecureRandom)

Non-deterministic initialiser.

@param n the order of the DSA group. @param random a source of randomness.

public virtual void Init(BigInteger n, SecureRandom random)

Parameters

n BigInteger
random SecureRandom

InitAdditionalInput0(HMac)

Supply additional input to HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1)).

protected virtual void InitAdditionalInput0(HMac hmac0)

Parameters

hmac0 HMac

The HMac to which the additional input should be added.

Remarks

RFC 6979 3.6. Additional data may be added to the input of HMAC [..]. A use case may be a protocol that requires a non-deterministic signature algorithm on a system that does not have access to a high-quality random source. It suffices that the additional data[..] is non-repeating(e.g., a signature counter or a monotonic clock) to ensure "random-looking" signatures are indistinguishable, in a cryptographic way, from plain (EC)DSA signatures.

By default there is no additional input. Override this method to supply additional input, bearing in mind that this calculator may be used for many signatures.

InitAdditionalInput1(HMac)

Supply additional input to HMAC_K(V || 0x01 || int2octets(x) || bits2octets(h1)).

protected virtual void InitAdditionalInput1(HMac hmac1)

Parameters

hmac1 HMac

The HMac to which the additional input should be added.

Remarks

Refer to comments for InitAdditionalInput0(HMac).

NextK()

Return the next valid value of K.

@return a K value.

public virtual BigInteger NextK()

Returns

BigInteger