mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-28 23:34:59 +00:00
fix big-endian merkleization for UintN arrays
UintN arrays were incorrectly merkleized on big-endian. This was fixed by making sure to use the correct buffer to store the final chunk.
This commit is contained in:
parent
4a3e94702e
commit
9b334c31f1
@ -464,7 +464,7 @@ func chunkedHashTreeRootForBasicTypes[T](merkleizer: var SszMerkleizerImpl,
|
|||||||
if remainingValues > 0:
|
if remainingValues > 0:
|
||||||
var lastChunk: array[bytesPerChunk, byte]
|
var lastChunk: array[bytesPerChunk, byte]
|
||||||
for i in 0 ..< remainingValues:
|
for i in 0 ..< remainingValues:
|
||||||
chunk.writeBytesLE(i * sizeof(T), arr[writtenValues + i])
|
lastChunk.writeBytesLE(i * sizeof(T), arr[writtenValues + i])
|
||||||
merkleizer.addChunk lastChunk
|
merkleizer.addChunk lastChunk
|
||||||
|
|
||||||
getFinalHash(merkleizer)
|
getFinalHash(merkleizer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user