[−][src]Trait secp256kfun::hash::Tagged
Extension trait to "tag" a hash as described in BIP-340.
Required methods
fn tagged(&self, tag: &[u8]) -> Self
Returns the tagged (domain separated) SHA256 instance. This is meant be used on SHA256 state with an empty buffer.
Example
use digest::Digest; use secp256kfun::hash::Tagged; let mut hash = sha2::Sha256::default().tagged(b"my-domain/my-purpose"); hash.update(b"hello world"); println!("{:?}", hash.finalize());
Implementors
impl<H: BlockInput + Digest + Default + Clone> Tagged for H where
<H as BlockInput>::BlockSize: PartialDiv<H::OutputSize>,
<<H as BlockInput>::BlockSize as PartialDiv<H::OutputSize>>::Output: Unsigned,
[src]
<H as BlockInput>::BlockSize: PartialDiv<H::OutputSize>,
<<H as BlockInput>::BlockSize as PartialDiv<H::OutputSize>>::Output: Unsigned,