... | ... | @@ -148,10 +148,16 @@ constraints |
|
|
|
|
|
- Mulmod
|
|
|
|
|
|
- Length
|
|
|
输入:length,offset,data_size
|
|
|
输出:normal_length, zero_length
|
|
|
计算方式:
|
|
|
- Length
|
|
|
arithmetic中的布局:
|
|
|
|tag| cnt | operand_0_hi | operand_0_lo | operand_1_hi | operand_1_lo |
|
|
|
| :--:| :--:| :--:| :--:| :--:| :--:|
|
|
|
| Length | 0 | length | offset | data_size | 0 |
|
|
|
| Length | 1 | normal_length | zero_length | 0 | 0 |
|
|
|
|
|
|
输入:length,offset,data_size
|
|
|
输出:normal_length, zero_length
|
|
|
计算方式:
|
|
|
以codecopy为例,length:为要copy的长度,offset为bytecode偏移量(即复制起始位置),data_size为bytecode的总长度
|
|
|
```rust
|
|
|
fn length(length: u64, offset: u64, data_size: u64) -> (normal_length: u64, zero_length: u64) {
|
... | ... | |