Class GBAUCipher

java.lang.Object
uicc.usim.gba_u.GBAUCipher
Direct Known Subclasses:
GBAUCipher.OneShot

public abstract class GBAUCipher extends Object
The GBAUCipher class is the abstract base class for Cipher algorithms. Implementations of Cipher algorithms must extend this class and implement all the abstract methods.

The term "pad" is used in the public key cipher algorithms below to refer to all the operations specified in the referenced scheme to transform the message block into the cipher block size.

Ks_int_NAF keys, internal keys generated during GBA_U process (see 3GPP TS 31.102 and 3GPP TS 33.220), are the only ones used in this class.
Ks_int_NAF keys are 256 bits symmetric keys then all asymmetric key algorithms are not supported.

A tear or card reset event resets an initialized GBAUCipher object to the state it was in when previously initialized via a call to init(). For algorithms which support keys with transient key data sets, AES, and Korean SEED the GBAUCipher object key becomes uninitialized on clear events associated with the key with the appropriate NAF ID (the Ks_int_NAF key) used to initialize the GBAUCipher object.

Even if a transaction is in progress, update of intermediate result state in the implementation instance shall not participate in the transaction.

Note:
  • On a tear or card reset event, the AES, Korean SEED and SM4 algorithms in CBC mode reset the initial vector(IV) to 0. The initial vector(IV) can be re-initialized using the init() methods.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The OneShot class is a specialization of the GBAUCipher class intended to support efficient one-shot ciphering and deciphering operations that may avoid persistent memory writes entirely.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Protected constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract short
    doFinal(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset)
    Generates encrypted/decrypted output from all/last input data using Ks_int_NAF linked to NAF ID given in init().
    abstract byte
    Gets the cipher algorithm.
    abstract byte
    Gets the raw cipher algorithm.
    static GBAUCipher
    getInstance(byte algorithm, boolean externalAccess)
    Create an instance of the GBAUCipher class with the selected cipher algorithm and padding algorithm.
    static GBAUCipher
    getInstance(byte cipherAlgorithm, byte paddingAlgorithm, boolean externalAccess)
    Create an instance of the GBAUCipher class.
    abstract byte
    Gets the padding algorithm.
    abstract void
    init(byte theMode, byte[] adfAID, short adfAIDOff, short adfAIDLen, byte[] nafID, short nafIDOff, short nafIDLen)
    Initializes the GBAUCipher object with the appropriate NAF ID (then Ks_int_NAF key).
    abstract void
    init(byte theMode, byte[] adfAID, short adfAIDOff, short adfAIDLen, byte[] nafID, short nafIDOff, short nafIDLen, byte[] bArray, short bOff, short bLen)
    Initializes the GBAUCipher object with the appropriate NAF ID (then Ks_int_NAF key) and algorithm specific parameters.
    abstract void
    init(byte theMode, byte[] adfAID, short adfAIDOff, short adfAIDLen, byte[] nafID, short nafIDOff, short nafIDLen, byte[] bArray, short bOff, short bLen, short keyLength)
    Initializes the GBAUCipher object with the appropriate NAF ID (then Ks_int_NAF key) and algorithm specific parameters.
    abstract void
    init(byte theMode, byte[] adfAID, short adfAIDOff, short adfAIDLen, byte[] nafID, short nafIDOff, short nafIDLen, short keyLength)
    Initializes the GBAUCipher object with the appropriate NAF ID (then Ks_int_NAF key).
    abstract short
    update(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset)
    Continues a multiple-part encryption or decryption operation, processing additional input data using Ks_int_NAF linked to NAF ID given in init().

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait