Home | History | Annotate | Download | only in cipher

Lines Matching refs:block

5 // Cipher block chaining (CBC) mode.
7 // CBC provides confidentiality by xoring (chaining) each plaintext block
8 // with the previous ciphertext block before applying the block cipher.
15 b Block
21 func newCBC(b Block, iv []byte) *cbc {
40 // NewCBCEncrypter returns a BlockMode which encrypts in cipher block chaining
41 // mode, using the given Block. The length of iv must be the same as the
42 // Block's block size.
43 func NewCBCEncrypter(b Block, iv []byte) BlockMode {
45 panic("cipher.NewCBCEncrypter: IV length must equal block size")
70 // Move to the next block with this block as the next iv.
97 // NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining
98 // mode, using the given Block. The length of iv must be the same as the
99 // Block's block size and must match the iv used to encrypt the data.
100 func NewCBCDecrypter(b Block, iv []byte) BlockMode {
102 panic("cipher.NewCBCDecrypter: IV length must equal block size")
123 // For each block, we need to xor the decrypted data with the previous block's ciphertext (the iv).
129 // Copy the last block of ciphertext in preparation as the new iv.
132 // Loop over all but the first block.
142 // The first block is special because it uses the saved iv.
146 // Set the new iv to the first block we copied earlier.