| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private KCCMBlockCipher. | |
| private static final int | |
| private byte[] | |
| private static final int | |
| private byte[] | |
| private KCCMBlockCipher. | |
| private BlockCipher | |
| private boolean | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private int | |
| private static final int | |
| private static final int | |
| private int | |
| private byte[] | |
| private byte[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | KCCMBlockCipher(BlockCipher
base cipher to use under CCM. engine, int Nb value to use. nB)Constructor allowing Nb configuration. |
| Modifier and Type | Method and Description |
|---|---|
| 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. |
| public String | getAlgorithmName()
Implements org. |
| private byte | |
| public byte[] | getMac()
Implements org. |
| public int | getOutputSize(int
the length of the input. len)Implements org. |
| public BlockCipher | getUnderlyingCipher()
Implements org. BlockCipher this object wraps.
|
| public int | getUpdateOutputSize(int
the length of the input. len)Implements org. |
| public void | init(boolean
true if we are setting up for encryption, false otherwise. forEncryption, CipherParameters the necessary parameters for the underlying cipher to be initialised. params)Implements org. |
| private void | |
| private void | |
| public void | processAADByte(byte
the byte to be processed. in)Implements org. |
| public void | processAADBytes(byte[]
the input byte array. in, 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. |
| private void | |
| public int | processByte(byte
the byte to be processed. in, byte[] the output buffer the processed byte goes into. out, int the offset into the output byte array the processed data starts at. outOff)Implements org. |
| public int | processBytes(byte[]
the input byte array. in, int the offset into the in array where the data to be processed starts. inOff, int the number of bytes to be processed. inLen, byte[] the output buffer the processed bytes go into. out, int the offset into the output byte array the processed data starts at. outOff)Implements org. |
| public int | |
| public void | |
| private void |
| associatedText | back to summary |
|---|---|
| private KCCMBlockCipher. | |
| BITS_IN_BYTE | back to summary |
|---|---|
| private static final int BITS_IN_BYTE | |
| buffer | back to summary |
|---|---|
| private byte[] buffer | |
| BYTES_IN_INT | back to summary |
|---|---|
| private static final int BYTES_IN_INT | |
| counter | back to summary |
|---|---|
| private byte[] counter | |
| data | back to summary |
|---|---|
| private KCCMBlockCipher. | |
| engine | back to summary |
|---|---|
| private BlockCipher engine | |
| forEncryption | back to summary |
|---|---|
| private boolean forEncryption | |
| G1 | back to summary |
|---|---|
| private byte[] G1 | |
| initialAssociatedText | back to summary |
|---|---|
| private byte[] initialAssociatedText | |
| mac | back to summary |
|---|---|
| private byte[] mac | |
| macBlock | back to summary |
|---|---|
| private byte[] macBlock | |
| macSize | back to summary |
|---|---|
| private int macSize | |
| MAX_MAC_BIT_LENGTH | back to summary |
|---|---|
| private static final int MAX_MAC_BIT_LENGTH | |
| MIN_MAC_BIT_LENGTH | back to summary |
|---|---|
| private static final int MIN_MAC_BIT_LENGTH | |
| Nb_ | back to summary |
|---|---|
| private int Nb_ | |
| nonce | back to summary |
|---|---|
| private byte[] nonce | |
| s | back to summary |
|---|---|
| private byte[] s | |
| KCCMBlockCipher | back to summary |
|---|---|
| public KCCMBlockCipher(BlockCipher engine) Base constructor. Nb value is set to 4.
| |
| KCCMBlockCipher | back to summary |
|---|---|
| public KCCMBlockCipher(BlockCipher engine, int nB) Constructor allowing Nb configuration. Nb is a parameter specified in CCM mode of DSTU7624 standard. This parameter specifies maximum possible length of input. It should be calculated as follows: Nb = 1/8 * (-3 + log[2]Nmax) + 1, where Nmax - length of input message in bits. For practical reasons Nmax usually less than 4Gb, e.g. for Nmax = 2^32 - 1, Nb = 4.
| |
| CalculateMac | back to summary |
|---|---|
| private void CalculateMac(byte[] authText, int authOff, int len) | |
| 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.
| |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Implements org. Doc from org. Return the name of the algorithm.
| |
| getFlag | back to summary |
|---|---|
| private byte getFlag(boolean authTextPresents, int macSize) | |
| getMac | back to summary |
|---|---|
| public byte[] getMac() Implements org. Doc from org. Return the value of the MAC associated with the last stream processed.
| |
| 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
| |
| getUnderlyingCipher | back to summary |
|---|---|
| public BlockCipher getUnderlyingCipher() Implements org. Doc from org. return the
| |
| 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 |
|---|---|
| public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException Implements org. Doc from org. initialise the underlying cipher. Parameter can either be an AEADParameters or a ParametersWithIV object.
| |
| intToBytes | back to summary |
|---|---|
| private void intToBytes(int num, byte[] outBytes, int outOff) | |
| processAAD | back to summary |
|---|---|
| private void processAAD(byte[] assocText, int assocOff, int assocLen, int dataLen) | |
| 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[] in, int inOff, int len) Implements org. Doc from org. Add a sequence of bytes to the associated data check.
| |
| ProcessBlock | back to summary |
|---|---|
| private void ProcessBlock(byte[] input, int inOff, int len, byte[] output, int outOff) | |
| processByte | back to summary |
|---|---|
| public int processByte(byte in, byte[] out, int outOff) throws DataLengthException, IllegalStateException Implements org. Doc from org. encrypt/decrypt a single byte.
| |
| processBytes | back to summary |
|---|---|
| public int processBytes(byte[] in, int inOff, int inLen, byte[] out, int outOff) throws DataLengthException, IllegalStateException Implements org. Doc from org. process a block of bytes from in putting the result into out.
| |
| processPacket | back to summary |
|---|---|
| public int processPacket(byte[] in, int inOff, int len, byte[] out, int outOff) throws IllegalStateException, InvalidCipherTextException | |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Doc from org. Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one). | |
| setNb | back to summary |
|---|---|
| private void setNb(int Nb) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] |
| ExposedByteArrayOutputStream | back to summary |
|---|---|
| public ExposedByteArrayOutputStream() | |
| getBuffer | back to summary |
|---|---|
| public byte[] getBuffer() | |