public class Keccak512 extends DigestEngine
Constructor and Description |
---|
Keccak512()
Create the engine.
|
Modifier and Type | Method and Description |
---|---|
Digest |
copy()
Clone the current state.
|
protected Digest |
copyState(org.tron.common.crypto.cryptohash.KeccakCore dst) |
protected void |
doInit()
This function is called at object creation time; the implementation should use it to perform
initialization tasks.
|
protected void |
doPadding(byte[] out,
int off)
Perform the final padding and store the result in the provided buffer.
|
protected byte[] |
engineDigest() |
int |
engineGetDigestLength() |
protected void |
engineReset()
Reset the hash algorithm state.
|
protected void |
engineUpdate(byte input) |
protected void |
engineUpdate(byte[] input,
int offset,
int len) |
int |
getBlockLength()
Return the "block length" for the hash function.
|
protected void |
processBlock(byte[] data)
Process one block of data.
|
String |
toString()
Get the display name for this function (e.g.
|
copyState, digest, digest, digest, flush, getBlockBuffer, getBlockCount, getInternalBlockLength, reset, update, update, update
clone, getAlgorithm, getDigestLength, getInstance, getInstance, getInstance, getProvider, isEqual, update
engineDigest, engineUpdate
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDigestLength
public Digest copy()
Digest
public int engineGetDigestLength()
engineGetDigestLength
in class MessageDigestSpi
protected byte[] engineDigest()
engineDigest
in class MessageDigestSpi
protected void engineUpdate(byte input)
engineUpdate
in class MessageDigestSpi
protected void engineUpdate(byte[] input, int offset, int len)
engineUpdate
in class MessageDigestSpi
protected void engineReset()
DigestEngine
engineReset
in class DigestEngine
protected void processBlock(byte[] data)
DigestEngine
processBlock
in class DigestEngine
data
- the data blockprotected void doPadding(byte[] out, int off)
DigestEngine
DigestEngine.flush()
and then DigestEngine.update(byte)
with the appropriate padding data in order to getData
the full input data.doPadding
in class DigestEngine
out
- the output bufferoff
- the output offsetprotected void doInit()
DigestEngine
MessageDigestSpi.engineGetDigestLength()
doInit
in class DigestEngine
public int getBlockLength()
Digest
Return the "block length" for the hash function. This value is naturally defined for
iterated hash functions (Merkle-Damgard). It is used in HMAC (that's what the HMAC specification names the "B
"
parameter).
If the function is "block-less" then this function may return -n
where n
is an integer such that the block length for HMAC ("B
") will be
inferred from the key length, by selecting the smallest multiple of n
which is no
smaller than the key length. For instance, for the Fugue-xxx hash functions, this function
returns -4: the virtual block length B is the HMAC key length, rounded up to the next multiple
of 4.
-n
protected Digest copyState(org.tron.common.crypto.cryptohash.KeccakCore dst)
Copyright © 2020. All rights reserved.