... | ... | @@ -95,3 +95,26 @@ pub struct BitwiseCircuitConfig<F: Field> { |
|
|
|
|
|
注:只对Tag不为Nil的行进行LookUp
|
|
|
|
|
|
### ACC计算
|
|
|
|
|
|
应该使用u128.to_be_bytes,即大端序来计算,例如:0x123456789a计算acc
|
|
|
|
|
|
```shell
|
|
|
---->u128.to_be_bytes()
|
|
|
---->小端序[u8;16]: 内存地址增长方向:低--------------------->高
|
|
|
----> [154,120,86,52,18, 0, 0...0, 0]
|
|
|
----> 即[0x9a,0x78,0x56,0x34,0x12, 0, 0...0, 0]
|
|
|
---->遍历[u8;16], acc = cur_byte + acc_pre
|
|
|
---->0x9a785634120000000000000000000000
|
|
|
```
|
|
|
|
|
|
```shell
|
|
|
---->u128.to_be_bytes()
|
|
|
---->大端序[u8;16]:内存地址增长方向:高<---------------------低
|
|
|
---->[0, 0...18,52,86,120,154]
|
|
|
---->即[0, 0...0x12,0x34,0x56,0x78,0x9a]
|
|
|
---->遍历[u8;16], acc = cur_byte + acc_pre
|
|
|
----> 0x0000000000000000000000123456789a
|
|
|
```
|
|
|
|
|
|
即u128的大端序的[u8;16]计算acc是所求的数值 |