use big endian, a more standard interpretation

main
SI 2023-08-20 01:16:10 +00:00
parent d175acecd6
commit 92fb1016d8
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ contract CryptoCTF10 {
require(contests[contestID].players[msg.sender].status == PlayerStatus.Verified, "You are unverified or banned in this contest"); require(contests[contestID].players[msg.sender].status == PlayerStatus.Verified, "You are unverified or banned in this contest");
// the correct signature is an ECDSA signature where (1) the message (hash) is the sender address and (2) the private key is the flag; // the correct signature is an ECDSA signature where (1) the message (hash) is the sender address and (2) the private key is the flag;
// (2) is checked by testing against the public key, which can then be public information // (2) is checked by testing against the public key, which can then be public information
address recoveredSigner = recoverSigner(bytes32(abi.encodePacked(msg.sender)), signature); address recoveredSigner = recoverSigner(bytes32(uint256(uint160(msg.sender))), signature);
require(recoveredSigner != address(0), "Invalid signature"); require(recoveredSigner != address(0), "Invalid signature");
require(recoveredSigner == contests[contestID].challenges[challengeID].obscuredFlag, "Wrong answer"); require(recoveredSigner == contests[contestID].challenges[challengeID].obscuredFlag, "Wrong answer");
require(!contests[contestID].solves[msg.sender][challengeID], "You have already solved this challenge of this contest"); require(!contests[contestID].solves[msg.sender][challengeID], "You have already solved this challenge of this contest");