| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Grain128AEADEngine. | |
| private boolean | |
| private int[] | |
| private int[] | |
| private boolean | |
| private int[] | |
| private int[] | |
| private static final int | STATE_SIZE
Constants |
| private byte[] | |
| private byte[] | workingKey
Variables to hold the state of the engine during encryption and decryption |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public int | doFinal(byte[]
space for any resulting output data. out, int offset into out to start copying the data at. outOff)Implements org. Finish the operation either appending or verifying the MAC at the end of the data. |
| private void | |
| private void | |
| private int | |
| private int | |
| private int | |
| public int | getOutputSize(int
the length of the input. len)Implements org. 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. return the size of the output buffer required for a processBytes an input of len bytes. |
| protected void | init(byte[] key, byte[] iv)
Implements abstract org. Initialize a Grain-128AEAD cipher. |
| private void | |
| private void | |
| private static int | |
| public void | processAADByte(byte
the byte to be processed. in)Implements org. 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. Add a sequence of bytes to the associated data check. |
| 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. process a block of bytes from in putting the result into out. |
| protected void | |
| private void | |
| private int[] | Returns: The shifted array with val added to index.length - 1.The array to shift. array, int The value to shift in. val)Shift array 1 bit and add val to index.length - 1. |
| private void |
| aadData | back to summary |
|---|---|
| private final Grain128AEADEngine. | |
| aadFinished | back to summary |
|---|---|
| private boolean aadFinished | |
| authAcc | back to summary |
|---|---|
| private int[] authAcc | |
| authSr | back to summary |
|---|---|
| private int[] authSr | |
| initialised | back to summary |
|---|---|
| private boolean initialised | |
| lfsr | back to summary |
|---|---|
| private int[] lfsr | |
| nfsr | back to summary |
|---|---|
| private int[] nfsr | |
| STATE_SIZE | back to summary |
|---|---|
| private static final int STATE_SIZE Constants | |
| workingIV | back to summary |
|---|---|
| private byte[] workingIV | |
| workingKey | back to summary |
|---|---|
| private byte[] workingKey Variables to hold the state of the engine during encryption and decryption | |
| Grain128AEADEngine | back to summary |
|---|---|
| public Grain128AEADEngine() | |
| accumulate | back to summary |
|---|---|
| private void accumulate() | |
| authShift | back to summary |
|---|---|
| private void authShift(int val) | |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff) throws IllegalStateException, InvalidCipherTextException Implements org. Doc from org. Finish the operation either appending or verifying the MAC at the end of the data.
| |
| doProcessAADBytes | back to summary |
|---|---|
| private void doProcessAADBytes(byte[] input, int len) | |
| getKeyStream | back to summary |
|---|---|
| private void getKeyStream(byte[] input, int inOff, int len, byte[] ciphertext, int outOff) | |
| getOutput | back to summary |
|---|---|
| private int getOutput() Get output from output function h(x).
| |
| getOutputLFSR | back to summary |
|---|---|
| private int getOutputLFSR() Get output from linear function f(x).
| |
| getOutputNFSR | back to summary |
|---|---|
| private int getOutputNFSR() Get output from non-linear function g(x).
| |
| getOutputSize | back to summary |
|---|---|
| public int getOutputSize(int len) Implements org. Doc from org. 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
| |
| getUpdateOutputSize | back to summary |
|---|---|
| public int getUpdateOutputSize(int len) Implements org. Doc from org. 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.
| |
| init | back to summary |
|---|---|
| protected void init(byte[] key, byte[] iv) throws IllegalArgumentException Implements abstract org. Initialize a Grain-128AEAD cipher.
| |
| initGrain | back to summary |
|---|---|
| private void initGrain() 320 clocks initialization phase. | |
| initGrain | back to summary |
|---|---|
| private void initGrain(int[] auth) | |
| len_length | back to summary |
|---|---|
| private static int len_length(int v) | |
| processAADByte | back to summary |
|---|---|
| public void processAADByte(byte in) Implements org. Doc from org. Add a single byte to the associated data check.
| |
| processAADBytes | back to summary |
|---|---|
| public void processAADBytes(byte[] input, int inOff, int len) Implements org. Doc from org. Add a sequence of bytes to the associated data check.
| |
| processBytes | back to summary |
|---|---|
| public int processBytes(byte[] input, int inOff, int len, byte[] output, int outOff) throws DataLengthException Implements org. Doc from org. process a block of bytes from in putting the result into out.
| |
| reset | back to summary |
|---|---|
| protected void reset(boolean clearMac) Overrides org. | |
| setKey | back to summary |
|---|---|
| private void setKey(byte[] keyBytes, byte[] ivBytes) Set keys, reset cipher.
| |
| shift | back to summary |
|---|---|
| private int[] shift(int[] array, int val) Shift array 1 bit and add val to index.length - 1.
| |
| updateInternalState | back to summary |
|---|---|
| private void updateInternalState(int input_i_j) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] |
| ErasableOutputStream | back to summary |
|---|---|
| public ErasableOutputStream() | |
| getBuf | back to summary |
|---|---|
| public byte[] getBuf() | |