We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The signed right shift operator (>>$) produces the wrong result when given a shift amount too large to fit in a Haskell Int (2^63 or higher).
(>>$)
Int
Cryptol> 0x55 >>$ 0x8000000000000000 0x55
Both the concrete and symbolic evaluation backends have this problem:
Cryptol> :prove \(x:[8]) -> x >>$ 0x8000000000000000 == x Q.E.D. (Total Elapsed Time: 0.008s, using "Z3") Cryptol> :exhaust \(x:[8]) -> x >>$ 0x8000000000000000 == x Using exhaustive testing. Passed 256 tests. Q.E.D.
Here is the offending function from the concrete backend. It includes an unsafe use of fromInteger (#637).
fromInteger
cryptol/src/Cryptol/Eval/Concrete.hs
Lines 279 to 288 in 7e841e9
The text was updated successfully, but these errors were encountered:
The situation is a bit complicated in the symbolic backend. It appears that the bug only shows up when the shift amount is concrete.
Cryptol> :prove \(i:[64]) -> (0x55 >>$ i == 0x55) == (i == 0) Q.E.D. (Total Elapsed Time: 0.010s, using "Z3")
Sorry, something went wrong.
Fixed via #724.
No branches or pull requests
The signed right shift operator
(>>$)
produces the wrong result when given a shift amount too large to fit in a HaskellInt
(2^63 or higher).Both the concrete and symbolic evaluation backends have this problem:
Here is the offending function from the concrete backend. It includes an unsafe use of
fromInteger
(#637).cryptol/src/Cryptol/Eval/Concrete.hs
Lines 279 to 288 in 7e841e9
The text was updated successfully, but these errors were encountered: