'Read up to size bytes using the given callback.
As a side effect, update the verifier\'s hash (excluding the last 20
bytes read).
:param read: The read callback to read from.
:param size: The maximum number of bytes to read; the particular
behavior is callback-specific.'

def _read(self, read, size):

    data = read(size)
    n = len(data)
    self._offset += n
    tn = len(self._trailer)
    if (n >= 20):
        to_pop = tn
        to_add = 20
    else:
        to_pop = max(((n + tn) - 20), 0)
        to_add = n
    self.sha.update(bytes(bytearray([self._trailer.popleft() for _ in range(to_pop)])))
    self._trailer.extend(data[(- to_add):])
    self.sha.update(data[:(- to_add)])
    return data
