File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,14 @@ var (
4242
4343func GetTreeKey (address []byte , treeIndex * uint256.Int , subIndex byte ) []byte {
4444 var poly [256 ]fr.Element
45- verkle .FromLEBytes (& poly [0 ], []byte {1 })
46- verkle .FromLEBytes (& poly [0 ], []byte {2 , 63 })
45+ verkle .FromLEBytes (& poly [0 ], []byte {2 , 64 }) // little endian, 64 bytes
4746 verkle .FromLEBytes (& poly [1 ], address [:16 ])
4847 verkle .FromLEBytes (& poly [2 ], address [16 :])
48+ // little-endian, 32-byte aligned treeIndex
4949 var index [32 ]byte
50- copy (index [:], treeIndex .Bytes ())
50+ for i , b := range treeIndex .Bytes () {
51+ index [len (treeIndex .Bytes ())- 1 - i ] = b
52+ }
5153 verkle .FromLEBytes (& poly [3 ], index [:16 ])
5254 verkle .FromLEBytes (& poly [4 ], index [16 :])
5355 for i := 5 ; i < len (poly ); i ++ {
You can’t perform that action at this time.
0 commit comments