Top Description Fields Constructors Methods
com.sun.crypto.provider

pack-priv final Class GCTR

extends CounterMode
implements GCM
Class Inheritance
All Implemented Interfaces
com.sun.crypto.provider.GCM
Imports
java.nio.ByteBuffer, .ByteOrder, java.util.Arrays

This class represents the GCTR function defined in NIST 800-38D under section 6.5. With a given cipher object and initial counter block, a counter mode operation is performed. Blocksize is limited to 16 bytes. If any invariant is broken, failures can occur because the AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM (see JDK-8067648 for details). The counter mode operations can be intrinsified and parallelized by using CounterMode.implCrypt() if HotSpot VM supports it on the architecture.

This function is used in the implementation of GCM mode.

Since
1.8

Field Summary

Modifier and TypeField and Description
private byte[]
private static final int
Inherited from com.sun.crypto.provider.CounterMode:
counter

Constructor Summary

AccessConstructor and Description
pack-priv
GCTR(SymmetricCipher cipher, byte[] initialCounterBlk)

Method Summary

Modifier and TypeMethod and Description
private long
private void
public int
doFinal(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)

Implements com.sun.crypto.provider.GCM.doFinal.

doFinal operation by using update() for any full block operations needed, then operating on the final bytes in the input buffer.
public int
doFinal(ByteBuffer src, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.doFinal.

doFinal operation by using update() for any full block operations needed, then operating on the final bytes in the input buffer.
pack-priv String
getFeedback()

Overrides com.sun.crypto.provider.CounterMode.getFeedback.

Gets the name of the feedback mechanism
public int
update(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)

Implements com.sun.crypto.provider.GCM.update.

Using the given inLen, this operates only on blockSize data, leaving the remainder in 'in'.
public int
update(byte[] in, int inOfs, int inLen, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.update.

Operate on only blocksize data leaving the remainder in 'in' .
public int
update(ByteBuffer src, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.update.

Operate on only blocksize data leaving the remainder in the src buffer.
Inherited from com.sun.crypto.provider.CounterMode:
decryptencryptinitresetrestoresave

Field Detail

blockback to summary
private byte[] block
MAX_LENback to summary
private static final int MAX_LEN

Constructor Detail

GCTRback to summary
pack-priv GCTR(SymmetricCipher cipher, byte[] initialCounterBlk)

Method Detail

blocksUntilRolloverback to summary
private long blocksUntilRollover()
checkBlockback to summary
private void checkBlock()
doFinalback to summary
public int doFinal(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)

Implements com.sun.crypto.provider.GCM.doFinal.

doFinal operation by using update() for any full block operations needed, then operating on the final bytes in the input buffer. This method will not write any block padding to the output buffer

doFinalback to summary
public int doFinal(ByteBuffer src, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.doFinal.

doFinal operation by using update() for any full block operations needed, then operating on the final bytes in the input buffer. If src and dst are array-backed bytebuffers, call doFinal(byte[]...) for less memory usage.

getFeedbackback to summary
pack-priv String getFeedback()

Overrides com.sun.crypto.provider.CounterMode.getFeedback.

Doc from com.sun.crypto.provider.CounterMode.getFeedback.

Gets the name of the feedback mechanism

Returns:String

the name of the feedback mechanism

Annotations
@Override
updateback to summary
public int update(byte[] in, int inOfs, int inLen, byte[] out, int outOfs)

Implements com.sun.crypto.provider.GCM.update.

Using the given inLen, this operates only on blockSize data, leaving the remainder in 'in'. The return value will be (inLen - (inLen % blockSize))

updateback to summary
public int update(byte[] in, int inOfs, int inLen, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.update.

Operate on only blocksize data leaving the remainder in 'in' .

updateback to summary
public int update(ByteBuffer src, ByteBuffer dst)

Implements com.sun.crypto.provider.GCM.update.

Operate on only blocksize data leaving the remainder in the src buffer.