Top Description Fields Constructors Methods
org.bouncycastle.crypto.modes

public Class GCFBBlockCipher

extends StreamBlockCipher
Class Inheritance
Imports
org.bouncycastle.crypto.BlockCipher, .CipherParameters, .DataLengthException, .StreamBlockCipher, org.bouncycastle.crypto.params.KeyParameter, .ParametersWithIV, .ParametersWithRandom, .ParametersWithSBox

An implementation of the GOST CFB mode with CryptoPro key meshing as described in RFC 4357.

Field Summary

Modifier and TypeField and Description
private static final byte[]
C

private final CFBBlockCipher
private long
private boolean
private ParametersWithIV
private KeyParameter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected byte
public String
public int
getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

public void
init(boolean
if true the cipher is initialised for encryption, if false for decryption.
forEncryption
,
CipherParameters
the key and other data required by the cipher.
params
)

Implements org.bouncycastle.crypto.StreamCipher.init, org.bouncycastle.crypto.BlockCipher.init.

Initialise the cipher.

public int
processBlock(byte[]
the array containing the input data.
in
,
int
offset into the in array the data starts at.
inOff
,
byte[]
the array the output data will be copied into.
out
,
int
the offset into the out array the output will start at.
outOff
)

Implements org.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

public void
Inherited from org.bouncycastle.crypto.StreamBlockCipher:
getUnderlyingCipherprocessBytesreturnByte

Field Detail

Cback to summary
private static final byte[] C
cfbEngineback to summary
private final CFBBlockCipher cfbEngine
counterback to summary
private long counter
forEncryptionback to summary
private boolean forEncryption
initParamsback to summary
private ParametersWithIV initParams
keyback to summary
private KeyParameter key

Constructor Detail

GCFBBlockCipherback to summary
public GCFBBlockCipher(BlockCipher engine)

Method Detail

calculateByteback to summary
protected byte calculateByte(byte b)

Implements abstract org.bouncycastle.crypto.StreamBlockCipher.calculateByte.

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.StreamCipher.getAlgorithmName, org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Doc from org.bouncycastle.crypto.StreamCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

Returns:String

the name of the algorithm the cipher implements.

getBlockSizeback to summary
public int getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Doc from org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

Returns:int

the block size for this cipher in bytes.

initback to summary
public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException

Implements org.bouncycastle.crypto.StreamCipher.init, org.bouncycastle.crypto.BlockCipher.init.

Doc from org.bouncycastle.crypto.StreamCipher.init.

Initialise the cipher.

Parameters
forEncryption:boolean

if true the cipher is initialised for encryption, if false for decryption.

params:CipherParameters

the key and other data required by the cipher.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
processBlockback to summary
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException

Implements org.bouncycastle.crypto.BlockCipher.processBlock.

Doc from org.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

Parameters
in:byte[]

the array containing the input data.

inOff:int

offset into the in array the data starts at.

out:byte[]

the array the output data will be copied into.

outOff:int

the offset into the out array the output will start at.

Returns:int

the number of bytes processed and produced.

Exceptions
DataLengthException:
if there isn't enough data in input , or space in out.
IllegalStateException:
if the cipher isn't initialised.
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.StreamCipher.reset, org.bouncycastle.crypto.BlockCipher.reset.

Doc from org.bouncycastle.crypto.StreamCipher.reset.

reset the cipher. This leaves it in the same state it was at after the last init (if there was one).