Lines Matching refs:cipher

9  * A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to
10 * be used to produce cipher text which is the same length as the plain text.
18 * Create a buffered block cipher that uses Cipher Text Stealing
20 * @param cipher the underlying block cipher this buffering object wraps.
23 BlockCipher cipher)
25 if ((cipher instanceof OFBBlockCipher) || (cipher instanceof CFBBlockCipher) || (cipher instanceof SICBlockCipher))
27 // TODO: This is broken - need to introduce marker interface to differentiate block cipher primitive from mode?
31 this.cipher = cipher;
33 blockSize = cipher.getBlockSize();
83 * @exception IllegalStateException if the cipher isn't initialised.
95 resultLen = cipher.processBlock(buf, 0, out, outOff);
116 * @exception IllegalStateException if the cipher isn't initialised.
149 resultLen += cipher.processBlock(buf, 0, out, outOff);
160 resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen);
183 * @exception IllegalStateException if the underlying cipher is not
185 * @exception InvalidCipherTextException if cipher text decrypts wrongly (in
198 int blockSize = cipher.getBlockSize();
209 cipher.processBlock(buf, 0, block, 0);
223 if (cipher instanceof CBCBlockCipher)
225 BlockCipher c = ((CBCBlockCipher)cipher).getUnderlyingCipher();
231 cipher.processBlock(buf, blockSize, out, outOff);
252 if (cipher instanceof CBCBlockCipher)
254 BlockCipher c = ((CBCBlockCipher)cipher).getUnderlyingCipher();
260 cipher.processBlock(buf, 0, block, 0);
270 cipher.processBlock(block, 0, out, outOff);
275 cipher.processBlock(buf, 0, block, 0);