public class Blake2sDigest extends Object implements org.bouncycastle.crypto.ExtendedDigest
| Constructor and Description |
|---|
Blake2sDigest()
BLAKE2s-256 for hashing.
|
Blake2sDigest(Blake2sDigest digest) |
Blake2sDigest(byte[] key)
BLAKE2s for authentication ("Prefix-MAC mode").
|
Blake2sDigest(byte[] key,
int digestBytes,
byte[] salt,
byte[] personalization)
BLAKE2s with key, required digest length, salt and personalization.
|
Blake2sDigest(int digestBits)
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.
|
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.
|
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(Blake2sDigest digest)
public Blake2sDigest(int digestBits)
digestBits - the desired digest length in bits. Must be a multiple of 8 and less than 256.public Blake2sDigest(byte[] key)
key - a key up to 32 bytes or nullpublic 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 void update(byte b)
update in interface org.bouncycastle.crypto.Digestb - the input byte to be entered.public void update(byte[] message,
int offset,
int len)
update in interface org.bouncycastle.crypto.Digestmessage - the byte array containing the data.offset - the offset into the byte array where the data starts.len - the length of the data.public int doFinal(byte[] out,
int outOffset)
doFinal in interface org.bouncycastle.crypto.Digestout - the array the digest is to be copied into.outOffset - the offset into the out array the digest is to start at.public void reset()
reset in interface org.bouncycastle.crypto.Digestpublic String getAlgorithmName()
getAlgorithmName in interface org.bouncycastle.crypto.Digestpublic int getDigestSize()
getDigestSize in interface org.bouncycastle.crypto.Digestpublic int getByteLength()
getByteLength in interface org.bouncycastle.crypto.ExtendedDigestpublic void clearKey()
public void clearSalt()
Copyright © 2019. All rights reserved.