|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AEADBlockCipher
A block cipher mode that includes authenticated encryption with a streaming mode and optional associated data. Copied from bouncycastle.
Method Summary | |
---|---|
int |
doFinal(byte[] out,
int outOff)
Finish the operation either appending or verifying the MAC at the end of the data. |
byte[] |
getMac()
Return the value of the MAC associated with the last stream processed. |
int |
getOutputSize(int len)
|
void |
init(byte[] aad,
int macBits,
byte[] iv,
boolean forEncryption)
Initialize the block cipher. |
int |
processBytes(byte[] in,
int in_off,
int in_len,
byte[] out,
int out_off)
Proceed the next block of in_len bytes from the input. |
Methods inherited from interface org.clazzes.optional.sec.BlockCipher |
---|
getAlgorithmName, getBlockSize, getUnderlyingCipher, init, processBlock, reset |
Method Detail |
---|
void init(byte[] aad, int macBits, byte[] iv, boolean forEncryption)
aad
- The additional authenticated data or
null
, if no additional authenticated data is needed.macBits
- The length of the calculated myac in bits.iv
- The initialization (nonce) vector or
null
, if no initialization vector is needed.forEncryption
- Whether we want to encrypt. false
means to set up this cipher for decryption.int processBytes(byte[] in, int in_off, int in_len, byte[] out, int out_off)
in_len
bytes from the input.
This complements the functionality of BlockCipher.processBlock(byte[], int, byte[], int)
,
because AEAD ciphers may process arbitrary data length.
in
- The buffer where the input is stored.
BlockCipher.getBlockSize()
bytes starting with in_off
will be consumed.in_off
- The offset at which the input data starts.in_len
- The length of the input data to process.out
- The buffer where the output is stored.
BlockCipher.getBlockSize()
bytes starting with out_off
will be written.out_off
- The offset at which the output will be stored.
int doFinal(byte[] out, int outOff) throws InvalidCipherTextException
out
- space for any resulting output data.outOff
- offset into out to start copying the data at.
InvalidCipherTextException
- if the MAC fails to match.byte[] getMac()
int getOutputSize(int len)
len
- The length of the input data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |