public class GCTR extends java.lang.Object implements GCMConstants
Modifier and Type | Field and Description |
---|---|
static int |
AES_BLOCK_SIZE |
static int[] |
AES_KEYSIZES |
DEFAULT_TAG_LENGTH, GCM_TAG_LENGTHS
Constructor and Description |
---|
GCTR() |
Modifier and Type | Method and Description |
---|---|
byte[] |
gcm_ad(byte[] IV,
byte[] C,
byte[] A,
byte[] T)
Performs an AES GCM decryption.
|
byte[] |
gcm_ae(byte[] IV,
byte[] P,
byte[] A,
byte[] C_out)
Performs an AES GCM encryption.
|
void |
initKey(java.security.Key k)
Initializes the key.
|
void |
setT(int t)
Sets the length of the tag in bits.
|
public static final int AES_BLOCK_SIZE
public static final int[] AES_KEYSIZES
public void initKey(java.security.Key k) throws java.security.InvalidKeyException
k
- the keyjava.security.InvalidKeyException
public void setT(int t)
t
- the length of the tag in bitspublic byte[] gcm_ae(byte[] IV, byte[] P, byte[] A, byte[] C_out) throws javax.crypto.IllegalBlockSizeException
IV
- initialization vectorP
- plain textA
- additional authentication dataC_out
- cipher textjavax.crypto.IllegalBlockSizeException
public byte[] gcm_ad(byte[] IV, byte[] C, byte[] A, byte[] T) throws javax.crypto.IllegalBlockSizeException, java.security.InvalidAlgorithmParameterException, javax.crypto.BadPaddingException
IV
- initialization vectorC
- cipher textA
- additional authentication dataT
- tagjavax.crypto.IllegalBlockSizeException
java.security.InvalidAlgorithmParameterException
javax.crypto.BadPaddingException
© Portions Copyright 2003, 2012 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2012, Oracle and/or its affiliates. All rights reserved.