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

public Class PhotonBeetleEngine

extends AEADBufferBaseEngine
Class Inheritance
Imports
org.bouncycastle.crypto.DataLengthException

Photon-Beetle, https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/finalist-round/updated-spec-doc/photon-beetle-spec-final.pdf

Photon-Beetle with reference to C Reference Impl from: https://github.com/PHOTON-Beetle/Software

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private int
private final int
D

private boolean
private byte[]
K

private final int
private int
private final byte[][]
private byte[]
N

private final int
private final byte[][]
private final byte[]
private byte[]
private byte[][]
private final int
Inherited from org.bouncycastle.crypto.engines.AEADBufferBaseEngine:
AADBufferSizeaadFinishedBlockSizeinitialisedm_aadm_aadPosm_bufm_bufPosm_state

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
init(byte[] key, byte[] iv)

Implements abstract org.bouncycastle.crypto.engines.AEADBaseEngine.init.

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

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processAADByte.

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
)

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processAADBytes.

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

Add a sequence of bytes to the associated data check.

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

Implements abstract org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processBuffer.

protected void
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
)

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processBytes.

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

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

protected void
protected void
protected void
private void
rhoohr(byte[] ciphertext, int outOff, byte[] plaintext, int inOff, int DBlen_inbytes)

private byte
select(boolean condition1, boolean condition2, byte option3, byte option4)

private void
XOR(byte[] in_right, int rOff, int iolen_inbytes)

Inherited from org.bouncycastle.crypto.engines.AEADBufferBaseEngine:
bufferResetcheckAADcheckDatadoFinalgetBlockSizegetOutputSizegetUpdateOutputSizevalidateAndProcessBuffer

Field Detail

aadLenback to summary
private int aadLen
Dback to summary
private final int D
input_emptyback to summary
private boolean input_empty
Kback to summary
private byte[] K
LAST_THREE_BITS_OFFSETback to summary
private final int LAST_THREE_BITS_OFFSET
messageLenback to summary
private int messageLen
MixColMatrixback to summary
private final byte[][] MixColMatrix
Nback to summary
private byte[] N
RATE_INBYTES_HALFback to summary
private final int RATE_INBYTES_HALF
RCback to summary
private final byte[][] RC
sboxback to summary
private final byte[] sbox
stateback to summary
private byte[] state
state_2dback to summary
private byte[][] state_2d
STATE_INBYTESback to summary
private final int STATE_INBYTES

Constructor Detail

PhotonBeetleEngineback to summary
public PhotonBeetleEngine(PhotonBeetleEngine.PhotonBeetleParameters pbp)

Method Detail

initback to summary
protected void init(byte[] key, byte[] iv) throws IllegalArgumentException

Implements abstract org.bouncycastle.crypto.engines.AEADBaseEngine.init.

Annotations
@Override
PHOTON_Permutationback to summary
private void PHOTON_Permutation()
processAADByteback to summary
public void processAADByte(byte input)

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processAADByte.

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)

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processAADBytes.

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 void processBuffer(byte[] input, int inOff, byte[] output, int outOff)

Implements abstract org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processBuffer.

processBufferAADback to summary
protected void processBufferAAD(byte[] input, int inOff)

Implements abstract org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processBufferAAD.

processBytesback to summary
public int processBytes(byte[] input, int inOff, int len, byte[] output, int outOff) throws DataLengthException

Overrides org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processBytes.

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 void processFinalAAD()

Implements abstract org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processFinalAAD.

processFinalBlockback to summary
protected void processFinalBlock(byte[] output, int outOff)

Implements abstract org.bouncycastle.crypto.engines.AEADBufferBaseEngine.processFinalBlock.

Annotations
@Override
resetback to summary
protected void reset(boolean clearMac)

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

rhoohrback to summary
private void rhoohr(byte[] ciphertext, int outOff, byte[] plaintext, int inOff, int DBlen_inbytes)
selectback to summary
private byte select(boolean condition1, boolean condition2, byte option3, byte option4)
XORback to summary
private void XOR(byte[] in_right, int rOff, int iolen_inbytes)
org.bouncycastle.crypto.engines back to summary

public final Enum PhotonBeetleEngine.PhotonBeetleParameters

extends Enum<PhotonBeetleEngine.PhotonBeetleParameters>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final PhotonBeetleEngine.PhotonBeetleParameters
public static final PhotonBeetleEngine.PhotonBeetleParameters

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

pb128back to summary
public static final PhotonBeetleEngine.PhotonBeetleParameters pb128
pb32back to summary
public static final PhotonBeetleEngine.PhotonBeetleParameters pb32

Constructor Detail

PhotonBeetleParametersback to summary
private PhotonBeetleParameters()

Method Detail

valueOfback to summary
public static PhotonBeetleEngine.PhotonBeetleParameters valueOf(String name)
valuesback to summary
public static PhotonBeetleEngine.PhotonBeetleParameters[] values()