def H(x): # random oracle h = int(hashlib.sha512(str(x)).hexdigest(), 16) out = vector([0]*k, Zmod(q)) for i in range(0, k) : out[i] = h%b h /= b i += 1 return out