Package org.bouncycastle.crypto
Class StreamBlockCipher
java.lang.Object
org.bouncycastle.crypto.DefaultMultiBlockCipher
org.bouncycastle.crypto.StreamBlockCipher
- All Implemented Interfaces:
BlockCipher
,MultiBlockCipher
,StreamCipher
- Direct Known Subclasses:
CFBBlockCipher
,G3413CFBBlockCipher
,G3413CTRBlockCipher
,G3413OFBBlockCipher
,GCFBBlockCipher
,GOFBBlockCipher
,KCTRBlockCipher
,OFBBlockCipher
,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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract byte
calculateByte
(byte b) return the underlying block cipher that we are wrapping.int
processBytes
(byte[] in, int inOff, int len, byte[] out, int outOff) process a block of bytes from in putting the result into out.final byte
returnByte
(byte in) encrypt/decrypt a single byte returning the result.Methods inherited from class org.bouncycastle.crypto.DefaultMultiBlockCipher
getMultiBlockSize, processBlocks
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bouncycastle.crypto.BlockCipher
getAlgorithmName, getBlockSize, init, processBlock, reset
Methods inherited from interface org.bouncycastle.crypto.StreamCipher
getAlgorithmName, init, reset
-
Constructor Details
-
StreamBlockCipher
-
-
Method Details
-
getUnderlyingCipher
return the underlying block cipher that we are wrapping.- Returns:
- the underlying block cipher that we are wrapping.
-
returnByte
public final byte returnByte(byte in) Description copied from interface:StreamCipher
encrypt/decrypt a single byte returning the result.- Specified by:
returnByte
in interfaceStreamCipher
- Parameters:
in
- the byte to be processed.- Returns:
- the result of processing the input byte.
-
processBytes
public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException Description copied from interface:StreamCipher
process a block of bytes from in putting the result into out.- Specified by:
processBytes
in interfaceStreamCipher
- Parameters:
in
- the input byte array.inOff
- the offset into the in array where the data to be processed starts.len
- the number of bytes to be processed.out
- the output buffer the processed bytes go into.outOff
- the offset into the output byte array the processed data starts at.- Returns:
- the number of bytes produced - should always be len.
- Throws:
DataLengthException
- if the output buffer is too small.
-
calculateByte
protected abstract byte calculateByte(byte b)
-