Implementations of this interface may operate in a packet mode (where all input data is buffered and
processed during the call to doFinal(byte[], int)), or in a streaming mode (where output data is
incrementally produced with each call to processByte(byte, byte[], int) or
processBytes(byte[], int, int, byte[], int).
doFinal(byte[], int) that results in an authentication
failure. The higher level protocol utilising this cipher must ensure the plaintext data is handled
appropriately until the end of data is reached and the entire ciphertext is authenticated.
org.bouncycastle.crypto.params.AEADParameters
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: number of bytes written into out.space for any resulting output data. out, int offset into out to start copying the data at. outOff)Finish the operation either appending or verifying the MAC at the end of the data. |
| public String | |
| public byte[] | Returns: MAC for plaintext data.Return the value of the MAC associated with the last stream processed. |
| public int | Returns: the space required to accommodate a call to processBytes and doFinal with len bytes of input.the length of the input. len)return the size of the output buffer required for a processBytes plus a doFinal with an input of len bytes. |
| public int | Returns: the space required to accommodate a call to processBytes with len bytes of input.the length of the input. len)return the size of the output buffer required for a processBytes an input of len bytes. |
| public void | init(boolean
true if we are setting up for encryption, false otherwise. forEncryption, CipherParameters the necessary parameters for the underlying cipher to be initialised. params)initialise the underlying cipher. |
| public void | |
| public void | processAADBytes(byte[]
the input byte array. in, int the offset into the in array where the data to be processed starts. inOff, int the number of bytes to be processed. len)Add a sequence of bytes to the associated data check. |
| public int | Returns: the number of bytes written to out.the byte to be processed. in, byte[] the output buffer the processed byte goes into. out, int the offset into the output byte array the processed data starts at. outOff)encrypt/decrypt a single byte. |
| public int | Returns: the number of bytes written to out.the input byte array. in, int the offset into the in array where the data to be processed starts. inOff, int the number of bytes to be processed. len, byte[] the output buffer the processed bytes go into. out, int the offset into the output byte array the processed data starts at. outOff)process a block of bytes from in putting the result into out. |
| public void |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff) throws IllegalStateException, InvalidCipherTextException Finish the operation either appending or verifying the MAC at the end of the data.
| |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Return the name of the algorithm.
| |
| getMac | back to summary |
|---|---|
| public byte[] getMac() Return the value of the MAC associated with the last stream processed.
| |
| getOutputSize | back to summary |
|---|---|
| public int getOutputSize(int len) return the size of the output buffer required for a processBytes plus a doFinal with an input of len bytes.
The returned size may be dependent on the initialisation of this cipher
and may not be accurate once subsequent input data is processed - this method
should be invoked immediately prior to a call to final processing of input data
and a call to
| |
| getUpdateOutputSize | back to summary |
|---|---|
| public int getUpdateOutputSize(int len) return the size of the output buffer required for a processBytes an input of len bytes. The returned size may be dependent on the initialisation of this cipher and may not be accurate once subsequent input data is processed - this method should be invoked immediately prior to input data being processed.
| |
| init | back to summary |
|---|---|
| public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException initialise the underlying cipher. Parameter can either be an AEADParameters or a ParametersWithIV object.
| |
| processAADByte | back to summary |
|---|---|
| public void processAADByte(byte in) Add a single byte to the associated data check.
| |
| processAADBytes | back to summary |
|---|---|
| public void processAADBytes(byte[] in, int inOff, int len) Add a sequence of bytes to the associated data check.
| |
| processByte | back to summary |
|---|---|
| public int processByte(byte in, byte[] out, int outOff) throws DataLengthException encrypt/decrypt a single byte.
| |
| processBytes | back to summary |
|---|---|
| public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException process a block of bytes from in putting the result into out.
| |
| reset | back to summary |
|---|---|
| public void reset() Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one). | |