@staticmethod
def quarter_round(x, a, b, c, d):
    """Perform a ChaCha quarter round"""
    xa = x[a]
    xb = x[b]
    xc = x[c]
    xd = x[d]
    xa = xa + xb & 4294967295
    xd = xd ^ xa
    xd = xd << 16 & 4294967295 | xd >> 16
    xc = xc + xd & 4294967295
    xb = xb ^ xc
    xb = xb << 12 & 4294967295 | xb >> 20
    xa = xa + xb & 4294967295
    xd = xd ^ xa
    xd = xd << 8 & 4294967295 | xd >> 24
    xc = xc + xd & 4294967295
    xb = xb ^ xc
    xb = xb << 7 & 4294967295 | xb >> 25
    x[a] = xa
    x[b] = xb
    x[c] = xc
    x[d] = xd
