solidity/test/formal/byte_big.py

20 lines
266 B
Python
Raw Normal View History

from opcodes import BYTE
2021-08-09 15:40:48 +00:00
from rule import Rule
from z3 import BitVec
2021-08-09 15:40:48 +00:00
"""
byte(A, X) -> 0
given A >= WordSize / 8
"""
rule = Rule()
n_bits = 256
# Input vars
X = BitVec('X', n_bits)
A = BitVec('A', n_bits)
rule.require(A >= n_bits / 8)
rule.check(BYTE(A, X), 0)