mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Natspec, slither Deployer, Router
This commit is contained in:
@@ -8,19 +8,23 @@ import "../Schnorr.sol";
|
||||
/// @author Elizabeth Binks <elizabethjbinks@gmail.com>
|
||||
contract TestSchnorr {
|
||||
/// @notice Verifies a Schnorr signature for the specified public key
|
||||
/// @dev The y-coordinate of the public key is assumed to be even
|
||||
/// @dev The x-coordinate of the public key is assumed to be less than the order of secp256k1
|
||||
/// @dev The challenge is calculated as `keccak256(abi.encodePacked(address(R), public_key, message))` where `R` is the commitment to the Schnorr signature's nonce
|
||||
/// @param public_key The x-coordinate of the public key
|
||||
/**
|
||||
* @dev The y-coordinate of the public key is assumed to be even. The x-coordinate of the public
|
||||
* key is assumed to be less than the order of secp256k1.
|
||||
*
|
||||
* The challenge is calculated as `keccak256(abi.encodePacked(address(R), publicKey, message))`
|
||||
* where `R` is the commitment to the Schnorr signature's nonce.
|
||||
*/
|
||||
/// @param publicKey The x-coordinate of the public key
|
||||
/// @param message The (hash of the) message signed
|
||||
/// @param c The challenge for the Schnorr signature
|
||||
/// @param s The response to the challenge for the Schnorr signature
|
||||
/// @return If the signature is valid
|
||||
function verify(bytes32 public_key, bytes calldata message, bytes32 c, bytes32 s)
|
||||
function verify(bytes32 publicKey, bytes calldata message, bytes32 c, bytes32 s)
|
||||
external
|
||||
pure
|
||||
returns (bool)
|
||||
{
|
||||
return Schnorr.verify(public_key, keccak256(message), c, s);
|
||||
return Schnorr.verify(publicKey, keccak256(message), c, s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user