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