public class Blake2sDigest extends java.lang.Object implements ExtendedDigest
Constructor and Description |
---|
Blake2sDigest()
BLAKE2s-256 for hashing.
|
Blake2sDigest(Blake2sDigest digest) |
Blake2sDigest(byte[] key)
BLAKE2s for authentication ("Prefix-MAC mode").
|
Blake2sDigest(byte[] key,
CryptoServicePurpose purpose) |
Blake2sDigest(byte[] key,
int digestBytes,
byte[] salt,
byte[] personalization)
BLAKE2s with key, required digest length, salt and personalization.
|
Blake2sDigest(byte[] key,
int digestBytes,
byte[] salt,
byte[] personalization,
CryptoServicePurpose purpose) |
Blake2sDigest(int digestSize)
Basic sized constructor - size in bits.
|
Blake2sDigest(int digestBits,
CryptoServicePurpose purpose)
BLAKE2s for hashing.
|
Modifier and Type | Method and Description |
---|---|
void |
clearKey()
Overwrite the key if it is no longer used (zeroization).
|
void |
clearSalt()
Overwrite the salt (pepper) if it is secret and no longer used
(zeroization).
|
int |
doFinal(byte[] out,
int outOffset)
Close the digest, producing the final digest value.
|
java.lang.String |
getAlgorithmName()
Return the algorithm name.
|
int |
getByteLength()
Return the size in bytes of the internal buffer the digest applies its
compression function to.
|
int |
getDigestSize()
Return the size in bytes of the digest produced by this message digest.
|
void |
reset()
Reset the digest back to its initial state.
|
protected void |
setAsLastNode() |
void |
update(byte b)
Update the message digest with a single byte.
|
void |
update(byte[] message,
int offset,
int len)
Update the message digest with a block of bytes.
|
public Blake2sDigest()
public Blake2sDigest(int digestSize)
digestSize
- size of digest (in bits)public Blake2sDigest(Blake2sDigest digest)
public Blake2sDigest(int digestBits, CryptoServicePurpose purpose)
digestBits
- the desired digest length in bits. Must be a multiple of 8 and less than 256.purpose
- usage purpose.public Blake2sDigest(byte[] key)
key
- a key up to 32 bytes or nullpublic Blake2sDigest(byte[] key, CryptoServicePurpose purpose)
public Blake2sDigest(byte[] key, int digestBytes, byte[] salt, byte[] personalization)
key
- a key up to 32 bytes or nulldigestBytes
- from 1 up to 32 bytessalt
- 8 bytes or nullpersonalization
- 8 bytes or nullpublic Blake2sDigest(byte[] key, int digestBytes, byte[] salt, byte[] personalization, CryptoServicePurpose purpose)
public void update(byte b)
public void update(byte[] message, int offset, int len)
public int doFinal(byte[] out, int outOffset)
public void reset()
protected void setAsLastNode()
public java.lang.String getAlgorithmName()
getAlgorithmName
in interface Digest
public int getDigestSize()
getDigestSize
in interface Digest
public int getByteLength()
getByteLength
in interface ExtendedDigest
public void clearKey()
public void clearSalt()