Top Inners Fields Constructors Methods
org.bouncycastle.crypto.engines

pack-priv abstract Class AEADBufferBaseEngine

extends AEADBaseEngine
Class Inheritance
Known Direct Subclasses
org.bouncycastle.crypto.engines.PhotonBeetleEngine, org.bouncycastle.crypto.engines.SparkleEngine, org.bouncycastle.crypto.engines.XoodyakEngine, org.bouncycastle.crypto.engines.ISAPEngine
Imports
org.bouncycastle.crypto.DataLengthException, .InvalidCipherTextException, .OutputLengthException, org.bouncycastle.util.Arrays

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum

Field Summary

Modifier and TypeField and Description
protected int
protected boolean
protected int
protected boolean
protected byte[]
protected int
protected byte[]
protected int
protected AEADBufferBaseEngine.State
Inherited from org.bouncycastle.crypto.engines.AEADBaseEngine:
algorithmNameforEncryptioninitialAssociatedTextIV_SIZEKEY_SIZEmacMAC_SIZE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected boolean
public int
doFinal(byte[]
space for any resulting output data.
output
,
int
offset into out to start copying the data at.
outOff
)

Implements org.bouncycastle.crypto.modes.AEADCipher.doFinal.

Finish the operation either appending or verifying the MAC at the end of the data.

private void
public int
public int
getOutputSize(int
the length of the input.
len
)

Implements org.bouncycastle.crypto.modes.AEADCipher.getOutputSize.

return the size of the output buffer required for a processBytes plus a doFinal with an input of len bytes.

public int
getUpdateOutputSize(int
the length of the input.
len
)

Implements org.bouncycastle.crypto.modes.AEADCipher.getUpdateOutputSize.

return the size of the output buffer required for a processBytes an input of len bytes.

public void
processAADByte(byte
the byte to be processed.
input
)

Implements org.bouncycastle.crypto.modes.AEADCipher.processAADByte.

Add a single byte to the associated data check.

public void
processAADBytes(byte[]
the input byte array.
input
,
int
the offset into the in array where the data to be processed starts.
inOff
,
int
the number of bytes to be processed.
len
)

Implements org.bouncycastle.crypto.modes.AEADCipher.processAADBytes.

Add a sequence of bytes to the associated data check.

protected abstract void
processBuffer(byte[] input, int inOff, byte[] output, int outOff)

protected abstract void
processBufferAAD(byte[] input, int inOff)

public int
processBytes(byte[]
the input byte array.
input
,
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.
output
,
int
the offset into the output byte array the processed data starts at.
outOff
)

Implements org.bouncycastle.crypto.modes.AEADCipher.processBytes.

process a block of bytes from in putting the result into out.

protected abstract void
protected abstract void
processFinalBlock(byte[] output, int outOff)

protected void
validateAndProcessBuffer(byte[] input, int inOff, byte[] output, int outOff)

Inherited from org.bouncycastle.crypto.engines.AEADBaseEngine:
getAlgorithmNamegetIVBytesSizegetKeyBytesSizegetMacinitinitprocessByteresetreset

Field Detail

AADBufferSizeback to summary
protected int AADBufferSize
aadFinishedback to summary
protected boolean aadFinished
BlockSizeback to summary
protected int BlockSize
initialisedback to summary
protected boolean initialised
m_aadback to summary
protected byte[] m_aad
m_aadPosback to summary
protected int m_aadPos
m_bufback to summary
protected byte[] m_buf
m_bufPosback to summary
protected int m_bufPos
m_stateback to summary
protected AEADBufferBaseEngine.State m_state

Constructor Detail

AEADBufferBaseEngineback to summary
pack-priv AEADBufferBaseEngine()

Method Detail

bufferResetback to summary
protected void bufferReset()
checkAADback to summary
protected void checkAAD()
checkDataback to summary
protected boolean checkData()
doFinalback to summary
public int doFinal(byte[] output, int outOff) throws IllegalStateException, InvalidCipherTextException

Implements org.bouncycastle.crypto.modes.AEADCipher.doFinal.

Doc from org.bouncycastle.crypto.modes.AEADCipher.doFinal.

Finish the operation either appending or verifying the MAC at the end of the data.

Parameters
output:byte[]

space for any resulting output data.

outOff:int

offset into out to start copying the data at.

Returns:int

number of bytes written into out.

Annotations
@Override
Exceptions
IllegalStateException:
if the cipher is in an inappropriate state.
InvalidCipherTextException:
if the MAC fails to match.
finishAADback to summary
private void finishAAD(AEADBufferBaseEngine.State nextState)
getBlockSizeback to summary
public int getBlockSize()
getOutputSizeback to summary
public int getOutputSize(int len)

Implements org.bouncycastle.crypto.modes.AEADCipher.getOutputSize.

Doc from org.bouncycastle.crypto.modes.AEADCipher.getOutputSize.

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 doFinal(byte[], int).

Parameters
len:int

the length of the input.

Returns:int

the space required to accommodate a call to processBytes and doFinal with len bytes of input.

getUpdateOutputSizeback to summary
public int getUpdateOutputSize(int len)

Implements org.bouncycastle.crypto.modes.AEADCipher.getUpdateOutputSize.

Doc from org.bouncycastle.crypto.modes.AEADCipher.getUpdateOutputSize.

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.

Parameters
len:int

the length of the input.

Returns:int

the space required to accommodate a call to processBytes with len bytes of input.

processAADByteback to summary
public void processAADByte(byte input)

Implements org.bouncycastle.crypto.modes.AEADCipher.processAADByte.

Doc from org.bouncycastle.crypto.modes.AEADCipher.processAADByte.

Add a single byte to the associated data check.
If the implementation supports it, this will be an online operation and will not retain the associated data.

Parameters
input:byte

the byte to be processed.

Annotations
@Override
processAADBytesback to summary
public void processAADBytes(byte[] input, int inOff, int len)

Implements org.bouncycastle.crypto.modes.AEADCipher.processAADBytes.

Doc from org.bouncycastle.crypto.modes.AEADCipher.processAADBytes.

Add a sequence of bytes to the associated data check.
If the implementation supports it, this will be an online operation and will not retain the associated data.

Parameters
input:byte[]

the input byte array.

inOff:int

the offset into the in array where the data to be processed starts.

len:int

the number of bytes to be processed.

Annotations
@Override
processBufferback to summary
protected abstract void processBuffer(byte[] input, int inOff, byte[] output, int outOff)
processBufferAADback to summary
protected abstract void processBufferAAD(byte[] input, int inOff)
processBytesback to summary
public int processBytes(byte[] input, int inOff, int len, byte[] output, int outOff) throws DataLengthException

Implements org.bouncycastle.crypto.modes.AEADCipher.processBytes.

Doc from org.bouncycastle.crypto.modes.AEADCipher.processBytes.

process a block of bytes from in putting the result into out.

Parameters
input:byte[]

the input byte array.

inOff:int

the offset into the in array where the data to be processed starts.

len:int

the number of bytes to be processed.

output:byte[]

the output buffer the processed bytes go into.

outOff:int

the offset into the output byte array the processed data starts at.

Returns:int

the number of bytes written to out.

Annotations
@Override
Exceptions
DataLengthException:
if the output buffer is too small.
processFinalAADback to summary
protected abstract void processFinalAAD()
processFinalBlockback to summary
protected abstract void processFinalBlock(byte[] output, int outOff)
validateAndProcessBufferback to summary
protected void validateAndProcessBuffer(byte[] input, int inOff, byte[] output, int outOff)
org.bouncycastle.crypto.engines back to summary

protected final Enum AEADBufferBaseEngine.State

extends Enum<AEADBufferBaseEngine.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State
public static final AEADBufferBaseEngine.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AEADBufferBaseEngine.State
public static AEADBufferBaseEngine.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DecAadback to summary
public static final AEADBufferBaseEngine.State DecAad
DecDataback to summary
public static final AEADBufferBaseEngine.State DecData
DecFinalback to summary
public static final AEADBufferBaseEngine.State DecFinal
DecInitback to summary
public static final AEADBufferBaseEngine.State DecInit
EncAadback to summary
public static final AEADBufferBaseEngine.State EncAad
EncDataback to summary
public static final AEADBufferBaseEngine.State EncData
EncFinalback to summary
public static final AEADBufferBaseEngine.State EncFinal
EncInitback to summary
public static final AEADBufferBaseEngine.State EncInit
Uninitializedback to summary
public static final AEADBufferBaseEngine.State Uninitialized

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static AEADBufferBaseEngine.State valueOf(String name)
valuesback to summary
public static AEADBufferBaseEngine.State[] values()