|
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.Blake2xsDigest
Implementation of the eXtendable Output Function (XOF) BLAKE2xs.
BLAKE2xs offers a built-in keying mechanism to be used directly for authentication ("Prefix-MAC") rather than a HMAC construction. BLAKE2xs offers a built-in support for a salt for randomized hashing and a personal string for defining a unique hash function for each application. BLAKE2xs is optimized for 32-bit platforms and produces digests of any size between 1 and 2^16-2 bytes. The length can also be unknown and then the maximum length will be 2^32 blocks of 32 bytes.
Field Summary | |
static int |
UNKNOWN_DIGEST_LENGTH
Magic number to indicate an unknown length of digest |
Constructor Summary | |
Blake2xsDigest()
BLAKE2xs for hashing with unknown digest length |
|
Blake2xsDigest(Blake2xsDigest digest)
|
|
Blake2xsDigest(int digestBytes)
|
|
Blake2xsDigest(int digestBytes,
byte[] key)
BLAKE2xs with key |
|
Blake2xsDigest(int digestBytes,
byte[] key,
byte[] salt,
byte[] personalization,
CryptoServicePurpose purpose)
BLAKE2xs with key, salt and personalization |
|
Blake2xsDigest(int digestBytes,
CryptoServicePurpose purpose)
BLAKE2xs for hashing |
Method Summary | |
int |
doFinal(byte[] out,
int outOffset)
Close the digest, producing the final digest value. |
int |
doFinal(byte[] out,
int outOff,
int outLen)
Close the digest, producing the final digest value. |
int |
doOutput(byte[] out,
int outOff,
int outLen)
Start outputting the results of the final calculation for this digest. |
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. |
long |
getUnknownMaxLength()
Return the maximum size in bytes the digest can produce when the length is unknown |
void |
reset()
Reset the digest back to its initial state. |
void |
update(byte in)
Update the message digest with a single byte. |
void |
update(byte[] in,
int inOff,
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 |
Field Detail |
public static final int UNKNOWN_DIGEST_LENGTH
Constructor Detail |
public Blake2xsDigest()
public Blake2xsDigest(int digestBytes, CryptoServicePurpose purpose)
digestBytes
- The desired digest length in bytes. Must be above 1 and less than 2^16-1public Blake2xsDigest(int digestBytes)
public Blake2xsDigest(int digestBytes, byte[] key)
digestBytes
- The desired digest length in bytes. Must be above 1 and less than 2^16-1key
- A key up to 32 bytes or nullpublic Blake2xsDigest(int digestBytes, byte[] key, byte[] salt, byte[] personalization, CryptoServicePurpose purpose)
digestBytes
- The desired digest length in bytes. Must be above 1 and less than 2^16-1key
- A key up to 32 bytes or nullsalt
- 8 bytes or nullpersonalization
- 8 bytes or nullpublic Blake2xsDigest(Blake2xsDigest digest)
Method Detail |
public java.lang.String getAlgorithmName()
getAlgorithmName
in interface Digest
public int getDigestSize()
getDigestSize
in interface Digest
public int getByteLength()
getByteLength
in interface ExtendedDigest
public long getUnknownMaxLength()
public void update(byte in)
update
in interface Digest
in
- the input byte to be entered.public void update(byte[] in, int inOff, int len)
update
in interface Digest
in
- the byte array containing the data.inOff
- the offset into the byte array where the data starts.len
- the length of the data.public void reset()
reset
in interface Digest
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 int doFinal(byte[] out, int outOff, int outLen)
doFinal
in interface Xof
out
- output array to write the output bytes to.outOff
- offset to start writing the bytes at.outLen
- the number of output bytes requested.public int doOutput(byte[] out, int outOff, int outLen)
doOutput
in interface Xof
out
- output array to write the output bytes to.outOff
- offset to start writing the bytes at.outLen
- the number of output bytes requested.
|
Bouncy Castle Cryptography Library 1.77.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |