Natspec, slither Deployer, Router

This commit is contained in:
Luke Parker
2024-10-30 21:35:43 -04:00
parent ce1689b325
commit 2a427382f1
8 changed files with 481 additions and 163 deletions

View File

@@ -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);
}
}