|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cumulus4j.crypto.AbstractCipher
org.cumulus4j.crypto.internal.symmetric.AEADBlockCipherImpl
public class AEADBlockCipherImpl
Constructor Summary | |
---|---|
AEADBlockCipherImpl(String transformation,
AEADBlockCipher delegate)
|
Method Summary | |
---|---|
protected void |
_init(CipherOperationMode mode,
CipherParameters parameters)
|
int |
doFinal(byte[] out,
int outOff)
Process the last block in the buffer. |
int |
getInputBlockSize()
Get the input block size for this cipher (in bytes). |
int |
getIVSize()
Get the required size of the IV (in bytes). |
int |
getOutputBlockSize()
Get the output block size for this cipher (in bytes). |
int |
getOutputSize(int length)
Return the size of the output buffer required for an update plus a
doFinal with an input of length bytes. |
int |
getUpdateOutputSize(int length)
Return the size of the output buffer required for an update
of an input of length bytes. |
void |
reset()
Reset this cipher. |
int |
update(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
Update this cipher with multiple bytes. |
int |
update(byte in,
byte[] out,
int outOff)
Update this cipher with a single byte. |
Methods inherited from class org.cumulus4j.crypto.AbstractCipher |
---|
doFinal, getMode, getParameters, getTransformation, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AEADBlockCipherImpl(String transformation, AEADBlockCipher delegate)
Method Detail |
---|
public void reset()
Cipher
initialised
.
public int getInputBlockSize()
Cipher
Cipher.getOutputBlockSize()
.
public int getOutputBlockSize()
Cipher
Cipher.getInputBlockSize()
.
public int getUpdateOutputSize(int length)
Cipher
update
of an input of length
bytes.
length
- the size of the input (in bytes) that is to be passed to Cipher.update(byte[], int, int, byte[], int)
.
public int getOutputSize(int length)
Cipher
update
plus a
doFinal
with an input of length
bytes.
length
- the size of the input (in bytes) that is to be passed to Cipher.update(byte[], int, int, byte[], int)
.
public int update(byte in, byte[] out, int outOff) throws DataLengthException, IllegalStateException, CryptoException
Cipher
Update this cipher with a single byte. This is synonymous to calling Cipher.update(byte[], int, int, byte[], int)
with an in
byte array of length 1 and inOff = 0
and inLen = 1
.
Note that data might still be unprocessed in this cipher when this method returns. That is because many ciphers work
with blocks and keep a block unprocessed until it is filled up. Call Cipher.doFinal(byte[], int)
after you finished
updating this cipher (i.e. all input was passed completely).
in
- the input to be encrypted or decrypted (or a part of the input).out
- the buffer receiving the output (data is written into this byte-array). Must not be null
.outOff
- the array-index in out
at which to start writing. Must be >=0.
out
.
DataLengthException
- if the buffer out
is insufficient.
IllegalStateException
- if this cipher has not yet been initialised
.
CryptoException
- if there is a cryptographic error happening while processing the input. For example when
decrypting a padding might be wrong or an authenticating block mode (like GCM) might recognize that the ciphertext has
been manipulated/corrupted.Cipher.update(byte[], int, int, byte[], int)
,
Cipher.doFinal(byte[], int)
public int update(byte[] in, int inOff, int inLen, byte[] out, int outOff) throws DataLengthException, IllegalStateException, CryptoException
Cipher
Update this cipher with multiple bytes.
Note that data might still be unprocessed in this cipher when this method returns. That is because many ciphers work
with blocks and keep a block unprocessed until it is filled up. Call Cipher.doFinal(byte[], int)
after you finished
updating this cipher (i.e. all input was passed completely).
in
- the input to be encrypted or decrypted (or a part of the input). Must not be null
.inOff
- the array-index in in
at which to start reading. Must be >=0.inLen
- the number of bytes that should be read from in
.out
- the buffer receiving the output (data is written into this byte-array). Must not be null
.outOff
- the array-index in out
at which to start writing. Must be >=0.
out
.
DataLengthException
- if the buffer out
is insufficient or if inOff + inLen
exceeds the
input byte array.
IllegalStateException
- if this cipher has not yet been initialised
.
CryptoException
- if there is a cryptographic error happening while processing the input. For example when
decrypting a padding might be wrong or an authenticating block mode (like GCM) might recognize that the ciphertext has
been manipulated/corrupted.Cipher.update(byte, byte[], int)
,
Cipher.doFinal(byte[], int)
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException, CryptoException
Cipher
Cipher.reset()
implicitly.
out
- the buffer receiving the output (data is written into this byte-array). Must not be null
.outOff
- the array-index in out
at which to start writing. Must be >=0.
out
.
DataLengthException
- if the buffer out
is insufficient or if inOff + inLen
exceeds the
input byte array.
IllegalStateException
- if this cipher has not yet been initialised
.
CryptoException
- if there is a cryptographic error happening while processing the input. For example when
decrypting a padding might be wrong or an authenticating block mode (like GCM) might recognize that the ciphertext has
been manipulated/corrupted.Cipher.update(byte, byte[], int)
,
Cipher.update(byte[], int, int, byte[], int)
,
Cipher.doFinal(byte[])
public int getIVSize()
Cipher
protected void _init(CipherOperationMode mode, CipherParameters parameters) throws IllegalArgumentException
_init
in class AbstractCipher
IllegalArgumentException
|
Cumulus4j API (1.0.1) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |