5 // #cgo !darwin CFLAGS: -I.
6 // #cgo !darwin LDFLAGS: -L. -l:./lib/cSimdTs.o -lstdc++ -lgomp -lpthread
7 // #cgo darwin CFLAGS: -I. -I/usr/local/opt/llvm/include
8 // #cgo darwin LDFLAGS: -L. -l./lib/cSimdTs.o -lstdc++ -lomp -L/usr/local/opt/llvm/lib
9 // #include "./lib/cSimdTs.h"
15 "github.com/vapor/protocol/bc"
18 func SimdAlgorithm(bh, seed *bc.Hash) *bc.Hash {
20 sdBytes := seed.Bytes()
21 bhPtr := (*C.uint8_t)(unsafe.Pointer(&bhBytes[0]))
22 seedPtr := (*C.uint8_t)(unsafe.Pointer(&sdBytes[0]))
24 resPtr := C.SimdTs(bhPtr, seedPtr)
25 resHash := bc.NewHash(*(*[32]byte)(unsafe.Pointer(resPtr)))