... | ... | @@ -148,13 +148,13 @@ constraints |
|
|
|
|
|
- Mulmod
|
|
|
|
|
|
- Normallength
|
|
|
- Length
|
|
|
输入:length,offset,data_size
|
|
|
输出:normal_length, zero_length
|
|
|
计算方式:
|
|
|
以codecopy为例,length:为要copy的长度,offset为bytecode偏移量(即复制起始位置),data_size为bytecode的总长度
|
|
|
```rust
|
|
|
fn normal_length(length: u64, offset: u64, data_size: u64) -> (normal_length: u64, zero_length: u64) {
|
|
|
fn length(length: u64, offset: u64, data_size: u64) -> (normal_length: u64, zero_length: u64) {
|
|
|
if offset > data_size {
|
|
|
return 0, length
|
|
|
} else if offset + length < data_size {
|
... | ... | |