|
Bouncy Castle Cryptography Library 1.77.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.crypto.digests.Blake2bDigest
Implementation of the cryptographic hash function Blakbe2b.
Blake2b offers a built-in keying mechanism to be used directly for authentication ("Prefix-MAC") rather than a HMAC construction.
Blake2b offers a built-in support for a salt for randomized hashing and a personal string for defining a unique hash function for each application.
BLAKE2b is optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes.
Constructor Summary | |
Blake2bDigest()
|
|
Blake2bDigest(Blake2bDigest digest)
|
|
Blake2bDigest(byte[] key)
Blake2b for authentication ("Prefix-MAC mode"). |
|
Blake2bDigest(byte[] key,
byte[] param)
|
|
Blake2bDigest(byte[] key,
CryptoServicePurpose purpose)
|
|
Blake2bDigest(byte[] key,
int digestLength,
byte[] salt,
byte[] personalization)
Blake2b with key, required digest length (in bytes), salt and personalization. |
|
Blake2bDigest(byte[] key,
int digestLength,
byte[] salt,
byte[] personalization,
CryptoServicePurpose purpose)
|
|
Blake2bDigest(int digestSize)
Basic sized constructor - size in bits. |
|
Blake2bDigest(int digestSize,
CryptoServicePurpose purpose)
Basic sized constructor with purpose. |
Method Summary | |
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 it's 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 it's 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Blake2bDigest()
public Blake2bDigest(int digestSize)
digestSize
- size of digest (in bits)public Blake2bDigest(Blake2bDigest digest)
public Blake2bDigest(int digestSize, CryptoServicePurpose purpose)
digestSize
- size of the digest in bitspurpose
- usage purpose.public Blake2bDigest(byte[] key)
key
- A key up to 64 bytes or nullpublic Blake2bDigest(byte[] key, CryptoServicePurpose purpose)
public Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization)
key
- A key up to 64 bytes or nulldigestLength
- from 1 up to 64 bytessalt
- 16 bytes or nullpersonalization
- 16 bytes or nullpublic Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization, CryptoServicePurpose purpose)
public Blake2bDigest(byte[] key, byte[] param)
Method Detail |
public void update(byte b)
update
in interface Digest
b
- the input byte to be entered.public void update(byte[] message, int offset, int len)
update
in interface Digest
message
- 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 Digest
out
- 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 Digest
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()
|
Bouncy Castle Cryptography Library 1.77.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |