Home | History | Annotate | Download | only in macs

Lines Matching refs:cipher

12  * DES based CBC Block Cipher MAC according to ISO9797, algorithm 3 (ANSI X9.19 Retail MAC)
25 private BlockCipher cipher;
33 * create a Retail-MAC based on a CBC block cipher. This will produce an
34 * authentication code of the length of the block size of the cipher.
36 * @param cipher the cipher to be used as the basis of the MAC generation. This must
40 BlockCipher cipher)
42 this(cipher, cipher.getBlockSize() * 8, null);
46 * create a Retail-MAC based on a CBC block cipher. This will produce an
47 * authentication code of the length of the block size of the cipher.
49 * @param cipher the cipher to be used as the basis of the MAC generation.
53 BlockCipher cipher,
56 this(cipher, cipher.getBlockSize() * 8, padding);
60 * create a Retail-MAC based on a block cipher with the size of the
66 * and in general should be less than the size of the block cipher as it reduces
69 * @param cipher the cipher to be used as the basis of the MAC generation.
73 BlockCipher cipher,
76 this(cipher, macSizeInBits, null);
80 * create a standard MAC based on a block cipher with the size of the
87 * and in general should be less than the size of the block cipher as it reduces
90 * @param cipher the cipher to be used as the basis of the MAC generation.
95 BlockCipher cipher,
104 if (!(cipher instanceof DESEngine))
106 throw new IllegalArgumentException("cipher must be instance of DESEngine");
109 this.cipher = new CBCBlockCipher(cipher);
113 mac = new byte[cipher.getBlockSize()];
115 buf = new byte[cipher.getBlockSize()];
135 // however the underlying cipher is a single DES. The middle and
160 cipher.init(true, key1);
175 resultLen = cipher.processBlock(buf, 0, mac, 0);
193 int blockSize = cipher.getBlockSize();
201 resultLen += cipher.processBlock(buf, 0, mac, 0);
209 resultLen += cipher.processBlock(in, inOff, mac, 0);
225 int blockSize = cipher.getBlockSize();
242 cipher.processBlock(buf, 0, mac, 0);
249 cipher.processBlock(buf, 0, mac, 0);
285 * reset the underlying cipher.
287 cipher.reset();