Top Inners Fields Constructors Methods
org.bouncycastle.operator.bc

public Class BcDefaultDigestProvider

extends Object
implements BcDigestProvider
Class Inheritance
All Implemented Interfaces
org.bouncycastle.operator.bc.BcDigestProvider
Imports
java.util.Collections, .HashMap, .Map, org.bouncycastle.asn1.ASN1Integer, org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers, org.bouncycastle.asn1.gm.GMObjectIdentifiers, org.bouncycastle.asn1.misc.MiscObjectIdentifiers, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.rosstandart.RosstandartObjectIdentifiers, org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.crypto.ExtendedDigest, .Xof, org.bouncycastle.crypto.digests.Blake3Digest, .GOST3411Digest, .GOST3411_2012_256Digest, .GOST3411_2012_512Digest, .MD2Digest, .MD4Digest, .MD5Digest, .RIPEMD128Digest, .RIPEMD160Digest, .RIPEMD256Digest, .SHA1Digest, .SHA224Digest, .SHA256Digest, .SHA384Digest, .SHA3Digest, .SHA512Digest, .SHAKEDigest, .SM3Digest, org.bouncycastle.operator.OperatorCreationException

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
BcDefaultDigestProvider.AdjustedXof

-len OIDs for SHAKE include an integer representing the bitlength in of the output.

Field Summary

Modifier and TypeField and Description
public static final BcDigestProvider
private static final Map<K, V>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Map<K, V>
public ExtendedDigest
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final BcDigestProvider INSTANCE
lookupback to summary
private static final Map<K, V> lookup

Constructor Detail

BcDefaultDigestProviderback to summary
private BcDefaultDigestProvider()

Method Detail

createTableback to summary
private static Map<K, V> createTable()
getback to summary
public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) throws OperatorCreationException

Implements org.bouncycastle.operator.bc.BcDigestProvider.get.

org.bouncycastle.operator.bc back to summary

private Class BcDefaultDigestProvider.AdjustedXof

extends Object
implements Xof
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.operator.bc.BcDefaultDigestProvider.AdjustedXof
All Implemented Interfaces
org.bouncycastle.crypto.Xof, org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest

-len OIDs for SHAKE include an integer representing the bitlength in of the output.

Field Summary

Modifier and TypeField and Description
private final int
private final Xof

Constructor Summary

AccessConstructor and Description
pack-priv
AdjustedXof(Xof xof, int length)

Method Summary

Modifier and TypeMethod and Description
public int
doFinal(byte[]
the array the digest is to be copied into.
out
,
int
the offset into the out array the digest is to start at.
outOff
)

Implements org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value.

public int
doFinal(byte[]
output array to write the output bytes to.
out
,
int
offset to start writing the bytes at.
outOff
,
int
the number of output bytes requested.
outLen
)

Implements org.bouncycastle.crypto.Xof.doFinal.

Output the results of the final calculation for this digest to outLen number of bytes.

public int
doOutput(byte[]
output array to write the output bytes to.
out
,
int
offset to start writing the bytes at.
outOff
,
int
the number of output bytes requested.
outLen
)

Implements org.bouncycastle.crypto.Xof.doOutput.

Start outputting the results of the final calculation for this digest.

public String
public int
getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

public int
getDigestSize()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

public void
reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

public void
update(byte
the input byte to be entered.
in
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.

public void
update(byte[]
the byte array containing the data.
in
,
int
the offset into the byte array where the data starts.
inOff
,
int
the length of the data.
len
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lengthback to summary
private final int length
xofback to summary
private final Xof xof

Constructor Detail

AdjustedXofback to summary
pack-priv AdjustedXof(Xof xof, int length)

Method Detail

doFinalback to summary
public int doFinal(byte[] out, int outOff)

Implements org.bouncycastle.crypto.Digest.doFinal.

Doc from org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value. The doFinal call leaves the digest reset.

Parameters
out:byte[]

the array the digest is to be copied into.

outOff:int

the offset into the out array the digest is to start at.

doFinalback to summary
public int doFinal(byte[] out, int outOff, int outLen)

Implements org.bouncycastle.crypto.Xof.doFinal.

Doc from org.bouncycastle.crypto.Xof.doFinal.

Output the results of the final calculation for this digest to outLen number of bytes.

Parameters
out:byte[]

output array to write the output bytes to.

outOff:int

offset to start writing the bytes at.

outLen:int

the number of output bytes requested.

Returns:int

the number of bytes written

doOutputback to summary
public int doOutput(byte[] out, int outOff, int outLen)

Implements org.bouncycastle.crypto.Xof.doOutput.

Doc from org.bouncycastle.crypto.Xof.doOutput.

Start outputting the results of the final calculation for this digest. Unlike doFinal, this method will continue producing output until the Xof is explicitly reset, or signals otherwise.

Parameters
out:byte[]

output array to write the output bytes to.

outOff:int

offset to start writing the bytes at.

outLen:int

the number of output bytes requested.

Returns:int

the number of bytes written

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

Doc from org.bouncycastle.crypto.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

getByteLengthback to summary
public int getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Doc from org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

Returns:int

byte length of the digests internal buffer.

getDigestSizeback to summary
public int getDigestSize()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

Doc from org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

Returns:int

the size, in bytes, of the digest produced by this message digest.

resetback to summary
public void reset()

Implements org.bouncycastle.crypto.Digest.reset.

Doc from org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

updateback to summary
public void update(byte in)

Implements org.bouncycastle.crypto.Digest.update.

Doc from org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.

Parameters
in:byte

the input byte to be entered.

updateback to summary
public void update(byte[] in, int inOff, int len)

Implements org.bouncycastle.crypto.Digest.update.

Doc from org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.

Parameters
in:byte[]

the byte array containing the data.

inOff:int

the offset into the byte array where the data starts.

len:int

the length of the data.