mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
28 lines
628 B
Go
28 lines
628 B
Go
package htr
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
|
)
|
|
|
|
func Test_VectorizedSha256(t *testing.T) {
|
|
largeSlice := make([][32]byte, 32*minSliceSizeToParallelize)
|
|
secondLargeSlice := make([][32]byte, 32*minSliceSizeToParallelize)
|
|
hash1 := make([][32]byte, 16*minSliceSizeToParallelize)
|
|
wg := sync.WaitGroup{}
|
|
wg.Add(1)
|
|
go func() {
|
|
defer wg.Done()
|
|
tempHash := VectorizedSha256(largeSlice)
|
|
copy(hash1, tempHash)
|
|
}()
|
|
wg.Wait()
|
|
hash2 := VectorizedSha256(secondLargeSlice)
|
|
require.Equal(t, len(hash1), len(hash2))
|
|
for i, r := range hash1 {
|
|
require.Equal(t, r, hash2[i])
|
|
}
|
|
}
|