solidity/test/libsolidity/smtCheckerTests/crypto/crypto_functions_not_same.sol
2021-01-12 14:57:04 +01:00

15 lines
431 B
Solidity

pragma experimental SMTChecker;
contract C {
function f(bytes memory data) public pure {
bytes32 k = keccak256(data);
fi(data, k);
}
function fi(bytes memory data, bytes32 k) internal pure {
bytes32 h = sha256(data);
assert(h == k);
}
}
// ----
// Warning 6328: (229-243): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(data)\n C.fi(data, 2437) -- internal call