Top Description Methods
org.bouncycastle.crypto

public Interface Xof

extends ExtendedDigest
Known Direct Implementers
org.bouncycastle.crypto.macs.KMAC, org.bouncycastle.crypto.digests.AsconXof, org.bouncycastle.crypto.digests.Blake2xsDigest, org.bouncycastle.crypto.digests.Blake3Digest, org.bouncycastle.crypto.digests.Kangaroo.KangarooBase, org.bouncycastle.crypto.digests.ParallelHash, org.bouncycastle.crypto.digests.SHAKEDigest, org.bouncycastle.crypto.digests.TupleHash

With FIPS PUB 202 a new kind of message digest was announced which supported extendable output, or variable digest sizes. This interface provides the extra method required to support variable output on an extended digest implementation.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of bytes written
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
)

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

public int

Returns:

the number of bytes written
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
)

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

Inherited from org.bouncycastle.crypto.ExtendedDigest:
getByteLength

Method Detail

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

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)

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