macro_rules! sha256t_tag {
($(#[$($tag_attr:tt)*])* $tag_vis:vis struct $tag:ident = $constructor:tt($($tag_value:tt)+);) => { ... };
}
Expand description
Macro used to define a tag.
Defines new struct and implements Tag
for it.
The syntax is:
sha256t_tag! {
/// Optional documentation details here.
/// Summary is always generated.
pub struct FooTag = hash_str("foo");
}
The hash_str
marker says the midstate should be generated by hashing the supplied string in a
way described in BIP-341. Alternatively, you can supply hash_bytes
to hash raw bytes. If you
have the midstate already pre-computed and prefer compiler performance to readability you
may use raw(MIDSTATE_BYTES, HASHED_BYTES_LENGTH)
instead, note that HASHED_BYTES_LENGTH must
be a multiple of 64.