Return an infinite iterator that starts at `start` and iterates by 1 over
  integers between 0 and 2^64 - 1 cyclically, returning on each iteration the
  result of combining each number with `nonce` using function `f`.
  
  `nonce` should be an random 64-bit integer that is used to make the counter
  unique.
  
  `f` should be a function that takes two 64-bit integers, the first being the
  `nonce`, and combines the two in a lossless manner (i.e. xor, addition, etc.)
  The returned value should be a 64-bit integer.
  
  `start` should be a number less than 2^64.

def ctr_counter(nonce, f, start = 0):
  """
  Return an infinite iterator that starts at `start` and iterates by 1 over
  integers between 0 and 2^64 - 1 cyclically, returning on each iteration the
  result of combining each number with `nonce` using function `f`.
  
  `nonce` should be an random 64-bit integer that is used to make the counter
  unique.
  
  `f` should be a function that takes two 64-bit integers, the first being the
  `nonce`, and combines the two in a lossless manner (i.e. xor, addition, etc.)
  The returned value should be a 64-bit integer.
  
  `start` should be a number less than 2^64.
  """
  for n in range(start, 2**64):
    yield f(nonce, n)
  while True:
    for n in range(0, 2**64):
      yield f(nonce, n)