From 63cdc72acccfc0c6b9724feadf718d33696a46d9 Mon Sep 17 00:00:00 2001 From: olegfomenko Date: Wed, 8 May 2024 15:32:23 +0300 Subject: [PATCH] fixed Schnorr signature: including R into challenge (hash) --- contracts/pedersen/native/UTXO.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/pedersen/native/UTXO.sol b/contracts/pedersen/native/UTXO.sol index c683321..3559d9d 100644 --- a/contracts/pedersen/native/UTXO.sol +++ b/contracts/pedersen/native/UTXO.sol @@ -130,7 +130,7 @@ contract UTXO is IUTXO { bytes32 _hash ) public view { EllipticCurve.ECPoint memory _p1 = EllipticCurve.ecBaseMul(_witness._s); - _hash = hash(abi.encodePacked(_hash, _key._x, _key._y)); + _hash = hash(abi.encodePacked(_hash, _key._x, _key._y, _witness._r._x, _witness._r._y)); EllipticCurve.ECPoint memory _p2 = _key.ecMul(uint256(_hash)); _p2 = _witness._r.ecSub(_p2);