secp256k1_tagged_sha256

Compute a tagged hash as defined in BIP-340.

This is useful for creating a message hash and achieving domain separation through an application-specific tag. This function returns SHA256(SHA256(tag)||SHA256(tag)||msg). Therefore, tagged hash implementations optimized for a specific tag can precompute the SHA256 state after hashing the tag hashes.

Returns 0 if the arguments are invalid and 1 otherwise. Args: ctx: pointer to a context object Out: hash32: pointer to a 32-byte array to store the resulting hash In: tag: pointer to an array containing the tag taglen: length of the tag array msg: pointer to an array containing the message msglen: length of the message array

extern (C)
int
secp256k1_tagged_sha256
(,
ubyte* hash32
,
const(ubyte)* tag
,
size_t taglen
,
const(ubyte)* msg
,
size_t msglen
)

Meta