code: function encryptCBC(userKey, plainText) {
          if (utils.isAnArray(userKey) &&
            utils.isAnArray(plainText)) {
  
            userKey = new Uint8Array(userKey);
            plainText = new Uint8Array(plainText);
          } else {
  
            throw 'Inputs must be an array';
          }
          userKey = makeKey(userKey);
  
          var result = []
            , loops = plainText.length / BLOCK_SIZE
            , pos = 0
            , cBuffer = []
            , buffer1 = []
            , buffer2 = []
            , vector = initializingVector
            , index = 0
            , secondIndex = 0
            , tmpCBuffer
            , nVal
            , position;
  
          for (; index < loops; index += 1) {
  
            cBuffer = plainText.subarray(pos, pos + BLOCK_SIZE);
            if (cBuffer.length < BLOCK_SIZE) {
  
              tmpCBuffer = [];
              for (paddingIndex = 0; paddingIndex < BLOCK_SIZE; paddingIndex += 1) {
  
                nVal = cBuffer[paddingIndex];
                if (nVal !== undefined) {
  
                  tmpCBuffer.push(nVal);
                } else {
  
                  tmpCBuffer.push(0x00);
                }
              }
              cBuffer = tmpCBuffer;
            }
            buffer1 = xorBuffers(cBuffer, vector);
            buffer2 = blockEncrypt(buffer1, 0, userKey);
  
            for (secondIndex = pos; secondIndex < buffer2.length + pos; secondIndex += 1) {
  
              position = secondIndex - pos;
              if (buffer2[position] !== undefined) {
  
                result.splice(secondIndex, 0, buffer2[position]);
              }
            }
            vector = buffer2;
            pos += BLOCK_SIZE;
          }
  
          return result;
        }
docs: /* eslint-enable no-shadow /* eslint-disable no-bitwise