For the latest news and information visit The GNU Crypto project | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.crypto.mode.BaseMode
gnu.crypto.mode.CFB
public class CFB
extends BaseMode
I[1] = IV I[j] = LSB(b-s, I[j-1]) | C[j-1] for j = 2...n O[j] = CIPH(K, I[j]) for j = 1,2...n C[j] = P[j] ^ MSB(s, O[j]) for j = 1,2...nAnd decryption is:
I[1] = IV I[j] = LSB(b-s, I[j-1]) | C[j-1] for j = 2...n O[j] = CIPH(K, I[j]) for j = 1,2...n P[j] = C[j] ^ MSB(s, O[j]) for j = 1,2...nCFB mode requires an initialization vector, which need not be kept secret. References:
Field Summary |
Fields inherited from class gnu.crypto.mode.BaseMode | |
cipher , cipherBlockSize , iv , lock , modeBlockSize , name , state |
Fields inherited from interface gnu.crypto.cipher.IBlockCipher | |
CIPHER_BLOCK_SIZE , KEY_MATERIAL |
Fields inherited from interface gnu.crypto.mode.IMode | |
DECRYPTION , ENCRYPTION , IV , MODE_BLOCK_SIZE , STATE |
Constructor Summary | |
|
Method Summary | |
Object |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class gnu.crypto.mode.BaseMode | |
blockSizes , clone , currentBlockSize , decryptBlock , defaultBlockSize , defaultKeySize , encryptBlock , init , keySizes , name , reset , selfTest , setup , teardown , update |
(package private) CFB(IBlockCipher underlyingCipher, int cipherBlockSize)
Package-private constructor for the factory class.
- Parameters:
underlyingCipher
- The cipher implementation.cipherBlockSize
- The cipher's block size.
public void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
- Specified by:
- decryptBlock in interface IBlockCipher
- Overrides:
- decryptBlock in interface BaseMode
public void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
- Specified by:
- encryptBlock in interface IBlockCipher
- Overrides:
- encryptBlock in interface BaseMode
public void setup()
The initialisation phase of the concrete mode implementation.