Top Description Fields Constructors Methods
org.bouncycastle.crypto

public abstract Class StreamBlockCipher

extends DefaultMultiBlockCipher
implements StreamCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.StreamCipher
Known Direct Subclasses
org.bouncycastle.crypto.modes.CFBBlockCipher, org.bouncycastle.crypto.modes.G3413CFBBlockCipher, org.bouncycastle.crypto.modes.G3413CTRBlockCipher, org.bouncycastle.crypto.modes.G3413OFBBlockCipher, org.bouncycastle.crypto.modes.GCFBBlockCipher, org.bouncycastle.crypto.modes.GOFBBlockCipher, org.bouncycastle.crypto.modes.KCTRBlockCipher, org.bouncycastle.crypto.modes.OFBBlockCipher, org.bouncycastle.crypto.modes.SICBlockCipher

A parent class for block cipher modes that do not require block aligned data to be processed, but can function in a streaming mode.

Field Summary

Modifier and TypeField and Description
private final BlockCipher

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract byte
calculateByte(byte b)

public BlockCipher

Returns:

the underlying block cipher that we are wrapping.
getUnderlyingCipher
()

return the underlying block cipher that we are wrapping.

public int
processBytes(byte[]
the input byte array.
in
,
int
the offset into the in array where the data to be processed starts.
inOff
,
int
the number of bytes to be processed.
len
,
byte[]
the output buffer the processed bytes go into.
out
,
int
the offset into the output byte array the processed data starts at.
outOff
)

Implements org.bouncycastle.crypto.StreamCipher.processBytes.

process a block of bytes from in putting the result into out.
public final byte
returnByte(byte
the byte to be processed.
in
)

Implements org.bouncycastle.crypto.StreamCipher.returnByte.

encrypt/decrypt a single byte returning the result.
Inherited from org.bouncycastle.crypto.DefaultMultiBlockCipher:
getMultiBlockSizeprocessBlocks

Field Detail

cipherback to summary
private final BlockCipher cipher

Constructor Detail

StreamBlockCipherback to summary
protected StreamBlockCipher(BlockCipher cipher)

Method Detail

calculateByteback to summary
protected abstract byte calculateByte(byte b)
getUnderlyingCipherback to summary
public BlockCipher getUnderlyingCipher()

return the underlying block cipher that we are wrapping.

Returns:BlockCipher

the underlying block cipher that we are wrapping.

processBytesback to summary
public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException

Implements org.bouncycastle.crypto.StreamCipher.processBytes.

Doc from org.bouncycastle.crypto.StreamCipher.processBytes.

process a block of bytes from in putting the result into out.

Parameters
in:byte[]

the input byte array.

inOff:int

the offset into the in array where the data to be processed starts.

len:int

the number of bytes to be processed.

out:byte[]

the output buffer the processed bytes go into.

outOff:int

the offset into the output byte array the processed data starts at.

Returns:int

the number of bytes produced - should always be len.

Exceptions
DataLengthException:
if the output buffer is too small.
returnByteback to summary
public final byte returnByte(byte in)

Implements org.bouncycastle.crypto.StreamCipher.returnByte.

Doc from org.bouncycastle.crypto.StreamCipher.returnByte.

encrypt/decrypt a single byte returning the result.

Parameters
in:byte

the byte to be processed.

Returns:byte

the result of processing the input byte.