Return a HashWriter primed for tagged hashes (as specified in BIP 340).

Synopsis

Declared in <hash.h>

HashWriter
TaggedHash(std::string const& tag);

Description

The returned object will have SHA256(tag) written to it twice (= 64 bytes). A tagged hash can be computed by feeding the message into this object, and then calling HashWriter::GetSHA256().

Return Value

A HashWriter primed with the tag hash.

Parameters

Name

Description

tag

The tag string that identifies the hash domain.

Created with MrDocs