APIdia Launch Partner
Top Fields Constructors Methods
sun.security.provider

public Class HashDrbg

extends AbstractHashDrbg
Class Inheritance
Imports
java.math.BigInteger, java.security.DigestException, .MessageDigest, .NoSuchAlgorithmException, .NoSuchProviderException, .SecureRandomParameters, java.util.ArrayList, .Arrays, .HexFormat, .List

Field Summary

Modifier and TypeField and Description
private byte[]
c

private MessageDigest
private static final byte[]
private byte[]
v

private static final byte[]
Inherited from sun.security.provider.AbstractHashDrbg:
outLenseedLen

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
addBytes(byte[]
existing array
out
,
int len, byte[]...
more arrays, can be of different length
data
)

Adds byte arrays into an existing one.

public final synchronized void
generateAlgorithm(byte[]
the array to be filled in with random bytes.
result
,
byte[] additionalInput)

Implements abstract sun.security.provider.AbstractDrbg.generateAlgorithm.

Generates a user-specified number of random bytes.

private byte[]
hashDf(int requested, List<byte[]> inputs)

public static byte[]

Returns:

the condensed/expanded output
hashDf
(MessageDigest
a MessageDigest object in reset state
digest
,
int outLen, int
requested output length, in bytes
requested
,
List<byte[]>
input data
inputs
)

A hash-based derivation function defined in NIST SP 800-90Ar1 10.3.1.

private void
hashGen(byte[] output, byte[] v)

protected final synchronized void
hashReseedInternal(List<byte[]> inputs)

Implements abstract sun.security.provider.AbstractHashDrbg.hashReseedInternal.

Operates on multiple inputs.

protected void
initEngine()

Implements abstract sun.security.provider.AbstractDrbg.initEngine.

This call, used by the constructors, instantiates the digest.

private void
Inherited from sun.security.provider.AbstractHashDrbg:
chooseAlgorithmAndStrengthinstantiateAlgorithmreseedAlgorithm

Field Detail

cback to summary
private byte[] c
digestback to summary
private MessageDigest digest
ONEback to summary
private static final byte[] ONE
vback to summary
private byte[] v
ZEROback to summary
private static final byte[] ZERO

Constructor Detail

HashDrbgback to summary
public HashDrbg(SecureRandomParameters params)
Annotations
@SuppressWarnings:this-escape

Method Detail

addBytesback to summary
private static void addBytes(byte[] out, int len, byte[]... data)

Adds byte arrays into an existing one.

Parameters
out:byte[]

existing array

data:byte[][]

more arrays, can be of different length

generateAlgorithmback to summary
public final synchronized void generateAlgorithm(byte[] result, byte[] additionalInput)

Implements abstract sun.security.provider.AbstractDrbg.generateAlgorithm.

Generates a user-specified number of random bytes.

Parameters
result:byte[]

the array to be filled in with random bytes.

Annotations
@Override
hashDfback to summary
private byte[] hashDf(int requested, List<byte[]> inputs)
hashDfback to summary
public static byte[] hashDf(MessageDigest digest, int outLen, int requested, List<byte[]> inputs)

A hash-based derivation function defined in NIST SP 800-90Ar1 10.3.1. The function is used inside Hash_DRBG, and can also be used as an approved conditioning function as described in 800-90B 6.4.2.2.

Note

In each current call, requested is seedLen, therefore small, no need to worry about overflow.

Parameters
digest:MessageDigest

a MessageDigest object in reset state

outLen:int

MessageDigest#getDigestLength of digest

requested:int

requested output length, in bytes

inputs:List<byte[]>

input data

Returns:byte[]

the condensed/expanded output

hashGenback to summary
private void hashGen(byte[] output, byte[] v)
hashReseedInternalback to summary
protected final synchronized void hashReseedInternal(List<byte[]> inputs)

Implements abstract sun.security.provider.AbstractHashDrbg.hashReseedInternal.

Doc from sun.security.provider.AbstractHashDrbg.hashReseedInternal.

Operates on multiple inputs.

Annotations
@Override
initEngineback to summary
protected void initEngine()

Implements abstract sun.security.provider.AbstractDrbg.initEngine.

This call, used by the constructors, instantiates the digest.

Annotations
@Override
statusback to summary
private void status()