Return an iterator that encrypts `data` using the Cipher-Block Chaining
    (CBC) mode of operation.
    
    CBC mode can only operate on `data` that is a multiple of the block-size
    in length.
    
    Each iteration returns a block-sized :obj:`bytes` object (i.e. 8 bytes)
    containing the encrypted bytes of the corresponding block in `data`.
    
    `init_vector` is the initialization vector and should be a
    :obj:`bytes`-like object with exactly 8 bytes.
    If it is not, a :exc:`ValueError` exception is raised.
    
    `data` should be a :obj:`bytes`-like object that is a multiple of the
    block-size in length (i.e. 8, 16, 32, etc.).
    If it is not, a :exc:`ValueError` exception is raised.

def encrypt_cbc(self, data, init_vector):
    """
    Return an iterator that encrypts `data` using the Cipher-Block Chaining
    (CBC) mode of operation.
    
    CBC mode can only operate on `data` that is a multiple of the block-size
    in length.
    
    Each iteration returns a block-sized :obj:`bytes` object (i.e. 8 bytes)
    containing the encrypted bytes of the corresponding block in `data`.
    
    `init_vector` is the initialization vector and should be a
    :obj:`bytes`-like object with exactly 8 bytes.
    If it is not, a :exc:`ValueError` exception is raised.
    
    `data` should be a :obj:`bytes`-like object that is a multiple of the
    block-size in length (i.e. 8, 16, 32, etc.).
    If it is not, a :exc:`ValueError` exception is raised.
    """
    S1, S2, S3, S4 = self.S
    P = self.P
    
    u4_1_pack = self._u4_1_pack
    u1_4_unpack = self._u1_4_unpack
    encrypt = self._encrypt
    
    u4_2_pack = self._u4_2_pack
    
    try:
      prev_cipher_L, prev_cipher_R = self._u4_2_unpack(init_vector)
    except struct_error:
      raise ValueError("initialization vector is not 8 bytes in length")
    
    try:
      LR_iter = self._u4_2_iter_unpack(data)
    except struct_error:
      raise ValueError("data is not a multiple of the block-size in length")
    
    for plain_L, plain_R in LR_iter:
      prev_cipher_L, prev_cipher_R = encrypt(
        prev_cipher_L ^ plain_L,
        prev_cipher_R ^ plain_R,
        P, S1, S2, S3, S4,
        u4_1_pack, u1_4_unpack
      )
      yield u4_2_pack(prev_cipher_L, prev_cipher_R)