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.
| Modifier and Type | Field and Description |
|---|---|
| private static final long[] | |
| private static final byte[][] | |
| private static final int | |
| private byte[] | |
| private int | |
| private long[] | |
| private int | |
| private int | |
| private long | |
| private long | |
| private int | |
| private int | |
| private long[] | |
| private boolean | |
| private byte[] | |
| private int | |
| private int | |
| private int | |
| private long | |
| private byte[] | |
| private final CryptoServicePurpose | |
| private static int | |
| private byte[] | |
| private long | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | Blake2bDigest(int
size of the digest in bits digestSize, CryptoServicePurpose usage purpose. purpose)Basic sized constructor with purpose. |
| public | Blake2bDigest(byte[]
A key up to 64 bytes or null key)Blake2b for authentication ("Prefix-MAC mode"). |
| public | |
| public | Blake2bDigest(byte[]
A key up to 64 bytes or null key, int from 1 up to 64 bytes digestLength, byte[] 16 bytes or null salt, byte[] 16 bytes or null personalization)Blake2b with key, required digest length (in bytes), salt and personalization. |
| public | Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization, CryptoServicePurpose purpose)
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private void | |
| public int | doFinal(byte[]
the array the digest is to be copied into. out, int the offset into the out array the digest is to start at. outOffset)Implements org. |
| private void | |
| public String | Returns: the algorithm nameImplements org. |
| public int | Returns: byte length of the digests internal buffer.Implements org. |
| public int | Returns: the size, in bytes, of the digest produced by this message digest.Implements org. |
| private void | |
| private void | |
| public void | reset()
Implements org. |
| protected void | |
| public void | update(byte
the input byte to be entered. b)Implements org. |
| public void | update(byte[]
the byte array containing the data. message, int the offset into the byte array where the data starts. offset, int the length of the data. len)Implements org. |
| blake2b_IV | back to summary |
|---|---|
| private static final long[] blake2b_IV | |
| blake2b_sigma | back to summary |
|---|---|
| private static final byte[][] blake2b_sigma | |
| BLOCK_LENGTH_BYTES | back to summary |
|---|---|
| private static final int BLOCK_LENGTH_BYTES | |
| buffer | back to summary |
|---|---|
| private byte[] buffer | |
| bufferPos | back to summary |
|---|---|
| private int bufferPos | |
| chainValue | back to summary |
|---|---|
| private long[] chainValue | |
| depth | back to summary |
|---|---|
| private int depth | |
| digestLength | back to summary |
|---|---|
| private int digestLength | |
| f0 | back to summary |
|---|---|
| private long f0 | |
| f1 | back to summary |
|---|---|
| private long f1 | |
| fanout | back to summary |
|---|---|
| private int fanout | |
| innerHashLength | back to summary |
|---|---|
| private int innerHashLength | |
| internalState | back to summary |
|---|---|
| private long[] internalState | |
| isLastNode | back to summary |
|---|---|
| private boolean isLastNode | |
| key | back to summary |
|---|---|
| private byte[] key | |
| keyLength | back to summary |
|---|---|
| private int keyLength | |
| leafLength | back to summary |
|---|---|
| private int leafLength | |
| nodeDepth | back to summary |
|---|---|
| private int nodeDepth | |
| nodeOffset | back to summary |
|---|---|
| private long nodeOffset | |
| personalization | back to summary |
|---|---|
| private byte[] personalization | |
| purpose | back to summary |
|---|---|
| private final CryptoServicePurpose purpose | |
| ROUNDS | back to summary |
|---|---|
| private static int ROUNDS | |
| salt | back to summary |
|---|---|
| private byte[] salt | |
| t0 | back to summary |
|---|---|
| private long t0 | |
| t1 | back to summary |
|---|---|
| private long t1 | |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest() | |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(int digestSize) Basic sized constructor - size in bits.
| |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(Blake2bDigest digest) | |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(int digestSize, CryptoServicePurpose purpose) Basic sized constructor with purpose.
| |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(byte[] key) Blake2b for authentication ("Prefix-MAC mode"). After calling the doFinal() method, the key will remain to be used for further computations of this instance. The key can be overwritten using the clearKey() method.
| |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(byte[] key, CryptoServicePurpose purpose) | |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization) Blake2b with key, required digest length (in bytes), salt and personalization. After calling the doFinal() method, the key, the salt and the personal string will remain and might be used for further computations with this instance. The key can be overwritten using the clearKey() method, the salt (pepper) can be overwritten using the clearSalt() method.
| |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization, CryptoServicePurpose purpose) | |
| Blake2bDigest | back to summary |
|---|---|
| public Blake2bDigest(byte[] key, byte[] param) | |
| clearKey | back to summary |
|---|---|
| public void clearKey() Overwrite the key if it is no longer used (zeroization) | |
| clearSalt | back to summary |
|---|---|
| public void clearSalt() Overwrite the salt (pepper) if it is secret and no longer used (zeroization) | |
| compress | back to summary |
|---|---|
| private void compress(byte[] message, int messagePos) | |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOffset) Implements org. close the digest, producing the final digest value. The doFinal call leaves the digest reset. Key, salt and personal string remain.
| |
| G | back to summary |
|---|---|
| private void G(long m1, long m2, int posA, int posB, int posC, int posD) | |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Implements org. return the algorithm name
| |
| getByteLength | back to summary |
|---|---|
| public int getByteLength() Implements org. Return the size in bytes of the internal buffer the digest applies it's compression function to.
| |
| getDigestSize | back to summary |
|---|---|
| public int getDigestSize() Implements org. return the size, in bytes, of the digest produced by this message digest.
| |
| init | back to summary |
|---|---|
| private void init() | |
| initializeInternalState | back to summary |
|---|---|
| private void initializeInternalState() | |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Reset the digest back to it's initial state. The key, the salt and the personal string will remain for further computations. | |
| setAsLastNode | back to summary |
|---|---|
| protected void setAsLastNode() | |
| update | back to summary |
|---|---|
| public void update(byte b) Implements org. update the message digest with a single byte.
| |
| update | back to summary |
|---|---|
| public void update(byte[] message, int offset, int len) Implements org. update the message digest with a block of bytes.
| |