GMac is an invocation of the GCM mode where no data is encrypted (i.e. all input data to the Mac is processed as additional authenticated data with the underlying GCM block cipher).
| Modifier and Type | Field and Description |
|---|---|
| private final AEADBlockCipher | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | GMac(final AEADBlockCipher
the cipher to be used in GCM mode to generate the MAC. cipher)Creates a GMAC based on the operation of a block cipher in GCM mode. |
| public | GMac(final AEADBlockCipher
the cipher to be used in GCM mode to generate the MAC. cipher, final int the mac size to generate, in bits. Must be a multiple of 8 and >= 32 and <= 128.
Sizes less than 96 are not recommended, but are supported for specialized applications. macSizeBits)Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode. |
| Modifier and Type | Method and Description |
|---|---|
| public int | doFinal(byte[]
the array the MAC is to be output to. out, int the offset into the out buffer the output is to start at. outOff)Implements org. |
| public String | getAlgorithmName()
Implements org. |
| public int | getMacSize()
Implements org. |
| public void | init(final CipherParameters
the key and other data required by the MAC. params)Implements org. ParametersWithIV providing a KeyParameterImpl
and a nonce.
|
| public void | |
| public void | update(byte
the byte to be processed. in)Implements org. |
| public void | update(byte[]
the array containing the input. in, int the index in the array the data begins at. inOff, int the length of the input starting at inOff. len)Implements org. |
| cipher | back to summary |
|---|---|
| private final AEADBlockCipher cipher | |
| macSizeBits | back to summary |
|---|---|
| private final int macSizeBits | |
| GMac | back to summary |
|---|---|
| public GMac(final AEADBlockCipher cipher) Creates a GMAC based on the operation of a block cipher in GCM mode. This will produce an authentication code the length of the block size of the cipher.
| |
| GMac | back to summary |
|---|---|
| public GMac(final AEADBlockCipher cipher, final int macSizeBits) Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode.
| |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException Implements org. Doc from org. Compute the final stage of the MAC writing the output to the out parameter. doFinal leaves the MAC in the same state it was after the last init.
| |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Implements org. Doc from org. Return the name of the algorithm the MAC implements.
| |
| getMacSize | back to summary |
|---|---|
| public int getMacSize() Implements org. Doc from org. Return the block size for this MAC (in bytes).
| |
| init | back to summary |
|---|---|
| public void init(final CipherParameters params) throws IllegalArgumentException Implements org. Initialises the GMAC - requires a
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Doc from org. Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one). | |
| update | back to summary |
|---|---|
| public void update(byte in) throws IllegalStateException Implements org. Doc from org. add a single byte to the mac for processing.
| |
| update | back to summary |
|---|---|
| public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException Implements org.
| |