MCPcopy Create free account
hub / github.com/chain/txvm / TupleHash256

Function TupleHash256

crypto/sha3/tuple_hash.go:49–53  ·  view source on GitHub ↗

TupleHash256 hashes a tuple with a given customization string s. Output is written to `out`. len(out) determines the output size.

(tuple [][]byte, s []byte, out []byte)

Source from the content-addressed store, hash-verified

47// TupleHash256 hashes a tuple with a given customization string s.
48// Output is written to `out`. len(out) determines the output size.
49func TupleHash256(tuple [][]byte, s []byte, out []byte) {
50 shake := newTupleHash(256, tuple, s)
51 rightEncode(shake, uint64(len(out)*8))
52 shake.Read(out)
53}
54
55// TupleHashXOF128 provides an arbitrary-length output.
56func TupleHashXOF128(tuple [][]byte, s []byte) io.Reader {

Callers 3

TestTupleHashNISTSample4Function · 0.85
TestTupleHashNISTSample5Function · 0.85
TestTupleHashNISTSample6Function · 0.85

Calls 3

newTupleHashFunction · 0.85
rightEncodeFunction · 0.85
ReadMethod · 0.45

Tested by 3

TestTupleHashNISTSample4Function · 0.68
TestTupleHashNISTSample5Function · 0.68
TestTupleHashNISTSample6Function · 0.68