def BLS_H(m): h = hashlib.shake_256() h.update(bytes(m, 'utf-8')) hm = big.from_bytes(h.digest(curve.EFS)) HM = ECp() while not HM.set(hm): hm = hm + 1 HM = curve.CurveCof * HM return HM
def H(mpin_id): p = curve.p h = hashlib.new(curve.SHA) h.update(bytes(mpin_id, 'utf-8')) x = big.from_bytes(h.digest()) x %= p P = ECp() while not P.set(x): x = x + 1 P = curve.CurveCof * P return P