Lines Matching refs:cipher

20     private BlockCipher         cipher;
26 * create a standard MAC based on a CBC block cipher. This will produce an
27 * authentication code half the length of the block size of the cipher.
29 * @param cipher the cipher to be used as the basis of the MAC generation.
32 BlockCipher cipher)
34 this(cipher, (cipher.getBlockSize() * 8) / 2, null);
38 * create a standard MAC based on a CBC block cipher. This will produce an
39 * authentication code half the length of the block size of the cipher.
41 * @param cipher the cipher to be used as the basis of the MAC generation.
45 BlockCipher cipher,
48 this(cipher, (cipher.getBlockSize() * 8) / 2, padding);
52 * create a standard MAC based on a block cipher with the size of the
58 * and in general should be less than the size of the block cipher as it reduces
61 * @param cipher the cipher to be used as the basis of the MAC generation.
65 BlockCipher cipher,
68 this(cipher, macSizeInBits, null);
72 * create a standard MAC based on a block cipher with the size of the
78 * and in general should be less than the size of the block cipher as it reduces
81 * @param cipher the cipher to be used as the basis of the MAC generation.
86 BlockCipher cipher,
95 this.cipher = new CBCBlockCipher(cipher);
99 mac = new byte[cipher.getBlockSize()];
101 buf = new byte[cipher.getBlockSize()];
107 return cipher.getAlgorithmName();
115 cipher.init(true, params);
128 cipher.processBlock(buf, 0, mac, 0);
145 int blockSize = cipher.getBlockSize();
152 cipher.processBlock(buf, 0, mac, 0);
160 cipher.processBlock(in, inOff, mac, 0);
176 int blockSize = cipher.getBlockSize();
193 cipher.processBlock(buf, 0, mac, 0);
200 cipher.processBlock(buf, 0, mac, 0);
225 * reset the underlying cipher.
227 cipher.reset();