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

pack-priv abstract Class AsconBaseEngine

extends AEADBaseEngine
Class Inheritance
Known Direct Subclasses
org.bouncycastle.crypto.engines.AsconEngine, org.bouncycastle.crypto.engines.AsconAEAD128
Imports
org.bouncycastle.crypto.DataLengthException, .InvalidCipherTextException, .OutputLengthException, org.bouncycastle.util.Arrays, .Longs

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum

Field Summary

Modifier and TypeField and Description
protected int
protected long
protected long
protected long
protected long
protected byte[]
protected int
protected int
protected AsconBaseEngine.State
protected long
protected long
protected int
protected long
protected long
protected long
protected long
protected long
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 abstract void
protected void
protected boolean
public int
doFinal(byte[]
space for any resulting output data.
outBytes
,
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 abstract String
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.

protected abstract long
loadBytes(byte[] in, int inOff)

protected void
p(int nr)

protected abstract long
pad(int i)

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

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

Add a single byte to the associated data check.

public void
processAADBytes(byte[]
the input byte array.
inBytes
,
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 void
processBufferAAD(byte[] buffer, int inOff)

protected void
processBufferDecrypt(byte[] buffer, int bufOff, byte[] output, int outOff)

protected void
processBufferEncrypt(byte[] buffer, int bufOff, byte[] output, int outOff)

public int
processBytes(byte[]
the input byte array.
inBytes
,
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.
outBytes
,
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
processFinalDecrypt(byte[] input, int inLen, byte[] output, int outOff)

protected abstract void
processFinalEncrypt(byte[] input, int inLen, byte[] output, int outOff)

protected void
private void
round(long C)

protected abstract void
setBytes(long n, byte[] bs, int off)

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

Field Detail

ASCON_AEAD_RATEback to summary
protected int ASCON_AEAD_RATE
ASCON_IVback to summary
protected long ASCON_IV
dsepback to summary
protected long dsep
K0back to summary
protected long K0
K1back to summary
protected long K1
m_bufback to summary
protected byte[] m_buf
m_bufferSizeDecryptback to summary
protected int m_bufferSizeDecrypt
m_bufPosback to summary
protected int m_bufPos
m_stateback to summary
protected AsconBaseEngine.State m_state
N0back to summary
protected long N0
N1back to summary
protected long N1
nrback to summary
protected int nr
x0back to summary
protected long x0
x1back to summary
protected long x1
x2back to summary
protected long x2
x3back to summary
protected long x3
x4back to summary
protected long x4

Constructor Detail

AsconBaseEngineback to summary
pack-priv AsconBaseEngine()

Method Detail

ascon_aeadinitback to summary
protected abstract void ascon_aeadinit()
checkAADback to summary
protected void checkAAD()
checkDataback to summary
protected boolean checkData()
doFinalback to summary
public int doFinal(byte[] outBytes, int outOff) throws IllegalStateException, InvalidCipherTextException, DataLengthException

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
outBytes: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.

Exceptions
IllegalStateException:
if the cipher is in an inappropriate state.
InvalidCipherTextException:
if the MAC fails to match.
finishAADback to summary
private void finishAAD(AsconBaseEngine.State nextState)
getAlgorithmVersionback to summary
public abstract String getAlgorithmVersion()
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.

loadBytesback to summary
protected abstract long loadBytes(byte[] in, int inOff)
pback to summary
protected void p(int nr)
padback to summary
protected abstract long pad(int i)
processAADByteback to summary
public void processAADByte(byte in)

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
in:byte

the byte to be processed.

processAADBytesback to summary
public void processAADBytes(byte[] inBytes, 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
inBytes: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.

processBufferAADback to summary
protected void processBufferAAD(byte[] buffer, int inOff)
processBufferDecryptback to summary
protected void processBufferDecrypt(byte[] buffer, int bufOff, byte[] output, int outOff)
processBufferEncryptback to summary
protected void processBufferEncrypt(byte[] buffer, int bufOff, byte[] output, int outOff)
processBytesback to summary
public int processBytes(byte[] inBytes, int inOff, int len, byte[] outBytes, 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
inBytes: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.

outBytes: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.

Exceptions
DataLengthException:
if the output buffer is too small.
processFinalAadBlockback to summary
protected abstract void processFinalAadBlock()
processFinalDecryptback to summary
protected abstract void processFinalDecrypt(byte[] input, int inLen, byte[] output, int outOff)
processFinalEncryptback to summary
protected abstract void processFinalEncrypt(byte[] input, int inLen, byte[] output, int outOff)
resetback to summary
protected void reset(boolean clearMac)

Overrides org.bouncycastle.crypto.engines.AEADBaseEngine.reset.

roundback to summary
private void round(long C)
setBytesback to summary
protected abstract void setBytes(long n, byte[] bs, int off)
org.bouncycastle.crypto.engines back to summary

protected final Enum AsconBaseEngine.State

extends Enum<AsconBaseEngine.State>
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

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

Constructor Detail

Stateback to summary
private State()

Method Detail

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