diff --git a/networks/ethereum/schnorr/contracts/Schnorr.sol b/networks/ethereum/schnorr/contracts/Schnorr.sol index 69dc208a..247e0fbe 100644 --- a/networks/ethereum/schnorr/contracts/Schnorr.sol +++ b/networks/ethereum/schnorr/contracts/Schnorr.sol @@ -15,7 +15,7 @@ library Schnorr { // message := the message signed // c := Schnorr signature challenge // s := Schnorr signature solution - function verify(bytes32 px, bytes memory message, bytes32 c, bytes32 s) + function verify(bytes32 px, bytes32 message, bytes32 c, bytes32 s) internal pure returns (bool) diff --git a/networks/ethereum/schnorr/contracts/tests/Schnorr.sol b/networks/ethereum/schnorr/contracts/tests/Schnorr.sol index 11a3c3bc..412786a3 100644 --- a/networks/ethereum/schnorr/contracts/tests/Schnorr.sol +++ b/networks/ethereum/schnorr/contracts/tests/Schnorr.sol @@ -9,6 +9,6 @@ contract TestSchnorr { pure returns (bool) { - return Schnorr.verify(public_key, message, c, s); + return Schnorr.verify(public_key, keccak256(message), c, s); } } diff --git a/networks/ethereum/schnorr/src/signature.rs b/networks/ethereum/schnorr/src/signature.rs index cd467cea..1af1d60f 100644 --- a/networks/ethereum/schnorr/src/signature.rs +++ b/networks/ethereum/schnorr/src/signature.rs @@ -38,7 +38,7 @@ impl Signature { &Keccak256::digest(x_and_y_coordinates)[12 ..] }); hash.update(key.eth_repr()); - hash.update(message); + hash.update(Keccak256::digest(message)); >::reduce_bytes(&hash.finalize()) }