Package org.bouncycastle.crypto.digests
Class SHAKENativeDigest
java.lang.Object
org.bouncycastle.crypto.digests.SHAKENativeDigest
- All Implemented Interfaces:
Digest,EncodableDigest,EncodableService,ExtendedDigest,SavableDigestXof,Xof,Memoable
SHAKE implementation.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSHAKENativeDigest(byte[] encoded) SHAKENativeDigest(byte[] encoded, CryptoServicePurpose purpose) SHAKENativeDigest(int bitLen) SHAKENativeDigest(int bitLen, CryptoServicePurpose purpose) SHAKENativeDigest(CryptoServicePurpose purpose) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Produce a copy of this object with its configuration and in its current state.protected CryptoServicePropertiesintdoFinal(byte[] output, int outOff) close the digest, producing the final digest value.intdoFinal(byte[] out, int outOff, int outLen) Output the results of the final calculation for this digest to outLen number of bytes.intdoOutput(byte[] out, int outOff, int outLen) Start outputting the results of the final calculation for this digest.return the algorithm nameintReturn the size in bytes of the internal buffer the digest applies it's compression function to.intreturn the size, in bytes, of the digest produced by this message digest.byte[]Return an encoded byte array for the digest's internal statevoidreset()reset the digest back to it's initial state.voidRestore a copied object state into this object.toString()voidupdate(byte in) update the message digest with a single byte.voidupdate(byte[] input, int inOff, int len) update the message digest with a block of bytes.
-
Field Details
-
nativeRef
-
-
Constructor Details
-
SHAKENativeDigest
-
SHAKENativeDigest
-
SHAKENativeDigest
public SHAKENativeDigest(int bitLen) -
SHAKENativeDigest
public SHAKENativeDigest() -
SHAKENativeDigest
-
SHAKENativeDigest
-
SHAKENativeDigest
public SHAKENativeDigest(byte[] encoded)
-
-
Method Details
-
getAlgorithmName
Description copied from interface:Digestreturn the algorithm name- Specified by:
getAlgorithmNamein interfaceDigest- Returns:
- the algorithm name
-
getDigestSize
public int getDigestSize()Description copied from interface:Digestreturn the size, in bytes, of the digest produced by this message digest.- Specified by:
getDigestSizein interfaceDigest- Returns:
- the size, in bytes, of the digest produced by this message digest.
-
update
public void update(byte in) Description copied from interface:Digestupdate the message digest with a single byte. -
update
public void update(byte[] input, int inOff, int len) Description copied from interface:Digestupdate the message digest with a block of bytes. -
doFinal
public int doFinal(byte[] output, int outOff) Description copied from interface:Digestclose the digest, producing the final digest value. The doFinal call leaves the digest reset. -
doFinal
public int doFinal(byte[] out, int outOff, int outLen) Description copied from interface:XofOutput the results of the final calculation for this digest to outLen number of bytes. -
doOutput
public int doOutput(byte[] out, int outOff, int outLen) Description copied from interface:XofStart outputting the results of the final calculation for this digest. Unlike doFinal, this method will continue producing output until the Xof is explicitly reset, or signals otherwise. -
reset
public void reset()Description copied from interface:Digestreset the digest back to it's initial state. -
getByteLength
public int getByteLength()Description copied from interface:ExtendedDigestReturn the size in bytes of the internal buffer the digest applies it's compression function to.- Specified by:
getByteLengthin interfaceExtendedDigest- Returns:
- byte length of the digests internal buffer.
-
copy
Description copied from interface:MemoableProduce a copy of this object with its configuration and in its current state.The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.
-
reset
Description copied from interface:MemoableRestore a copied object state into this object.Implementations of this method should try to avoid or minimise memory allocation to perform the reset.
-
getEncodedState
public byte[] getEncodedState()Description copied from interface:EncodableDigestReturn an encoded byte array for the digest's internal state- Specified by:
getEncodedStatein interfaceEncodableDigest- Specified by:
getEncodedStatein interfaceEncodableService- Returns:
- an encoding of the digests internal state.
-
toString
-
cryptoServiceProperties
-