lyra2re2.go
func Sum(data []byte) ([]byte, error) {
	blake := blake256.New()
	if _, err := blake.Write(data); err != nil {
		return nil, err
	}
	resultBlake := blake.Sum(nil)

	keccak := sha3.NewKeccak256()
	if _, err := keccak.Write(resultBlake); err != nil {
		return nil, err
	}
	resultkeccak := keccak.Sum(nil)

	resultcube := cubehash256(resultkeccak)
	lyra2result := make([]byte, 32)
	lyra2(lyra2result, resultcube, resultcube, 1, 4, 4)
	var skeinresult [32]byte
	skein.Sum256(&skeinresult, lyra2result, nil)
	resultcube2 := cubehash256(skeinresult[:])
	resultbmw := bmw256(resultcube2)
	return resultbmw, nil
}
func Sum(data []byte) ([]byte, error) {
	blake := blake256.New()
	if _, err := blake.Write(data); err != nil {
		return nil, err
	}
	resultBlake := blake.Sum(nil)

	keccak := sha3.NewKeccak256()
	if _, err := keccak.Write(resultBlake); err != nil {
		return nil, err
	}
	resultkeccak := keccak.Sum(nil)

	resultcube := cubehash256(resultkeccak)
	lyra2result := make([]byte, 32)
	lyra2(lyra2result, resultcube, resultcube, 1, 4, 4)
	var skeinresult [32]byte
	skein.Sum256(&skeinresult, lyra2result, nil)
	resultcube2 := cubehash256(skeinresult[:])
	resultbmw := bmw256(resultcube2)
	return resultbmw, nil
}
//Sum returns the result of Lyra2re2 hash.