function tapTweakHash(pubKey, h) {
  return bcrypto.taggedHash(
    'TapTweak',
    tools.concat(h ? [pubKey, h] : [pubKey]),
  );
}
Computes the taproot tweak hash for a given public key and optional hash.
If a hash is provided, the public key and hash are concatenated before computing the hash.
If no hash is provided, only the public key is used to compute the hash.

@param pubKey - The public key buffer.
@param h - The optional hash buffer.
@returns The taproot tweak hash.