diff --git a/opentimestamps/core/secp256k1.py b/opentimestamps/core/secp256k1.py index d9d5194..58cfcc5 100644 --- a/opentimestamps/core/secp256k1.py +++ b/opentimestamps/core/secp256k1.py @@ -30,9 +30,10 @@ def _do_op_call(self, msg): raise MsgValueError("Missing secp256k1 point") pt = Point.decode(msg[0:33]) + assert(pt.encode() == msg[0:33]) hasher = hashlib.sha256() - hasher.update(pt.encode()) + hasher.update(msg[0:33]) hasher.update(msg[33:]) tweak = int.from_bytes(hasher.digest(), 'big') tweak_pt = SECP256K1_GEN.scalar_mul(tweak)