... | ... | @@ -317,3 +317,29 @@ Hash: `Column<Advice>`类型,只有在length-1和length两行有值,分别 |
|
|
|
|
|
|
|
|
|
|
|
#### 其他:
|
|
|
|
|
|
为什么concat_rlc_acc = `tag_u8_final_rlc_acc*random^5 + block_tx_id_u8_final_rlc_acc*random^4 + value0_u8_final_rlc_acc*random^3 + value1_u8_final_rlc_acc*random^2 + value3_u8_rlc_final_acc*random + value3_u8_final_rlc_acc`
|
|
|
|
|
|
假如一个value被拆分成了16个字节:v1~v16,则value的rlc计算为:
|
|
|
|
|
|
```shell
|
|
|
v1, rlc1 = v1
|
|
|
v2, rlc2 = rlc1*random + v2, 即 v1*random + v2
|
|
|
v3, rlc3 = rlc2*random + v3, 即(v1*random + v2)*random + v3
|
|
|
v4, rlc4 = rlc3*random + v4, 即((v1*random + v2)*random + v3)*random + v4
|
|
|
v5, rlc5 = rlc4*random + v5, 即(((v1*random + v2)*random + v3)*random + v4)*random + v5
|
|
|
...
|
|
|
v16, rlc16=rlc15*random+v16
|
|
|
```
|
|
|
|
|
|
上面计算方式可化简为:
|
|
|
|
|
|
`rlc = v1 * random^15 + v2 * random^14 + v3 * random^13 + ... + v15*random + v16`
|
|
|
|
|
|
即,假如value被拆分为了len个字节v<sub>1</sub>~ v<sub>len</sub> ,则有
|
|
|
|
|
|
rlc= v<sub>1</sub> * random^(len-1) + v<sub>2 </sub>* random^(len-2) + ... + v<sub>len-1 </sub>* random + v<sub>len</sub>
|
|
|
|
|
|
|
|
|
|