Trait secp256kfun::hash::AddTag[][src]

pub trait AddTag {
    fn add_protocol_tag(self, tag: &str) -> Self;
fn add_application_tag(self, tag: &str) -> Self; }

Trait for things that can domain separate themselves.

i.e. given a protocol or application tag can produce a new version that will not give the same outputs for a given input if the tags are different.

Required methods

fn add_protocol_tag(self, tag: &str) -> Self[src]

Tells the invocant to return a new version of itself modifies with the protocol tag. This is to ensure that the AddTag does not produce the same outputs for tow different protocols even if they have the same public inputs. By “protocol” we mean type of cryptographic scheme. For example, for the BIP-340 signature scheme you would use “BIP340” as the tag.

fn add_application_tag(self, tag: &str) -> Self[src]

Tells the AddTag to further domain separate itself for a particular application. This is useful when you are domain separating signatures in your application from other signatures.

Loading content...

Implementations on Foreign Types

impl AddTag for ()[src]

AddTag is implemented for () so you can use implement things generically for AddTag even for things that have some field set to () (for example NonceGen when you’re doing verification only).

Loading content...

Implementors

impl<H: Tagged> AddTag for Deterministic<H>[src]

impl<H: Tagged, NG: AddTag> AddTag for NonceChallengeBundle<H, NG>[src]

fn add_protocol_tag(self, tag: &str) -> Self[src]

Tags both the NonceGen and the challenge hash with a protocol specific tag.

fn add_application_tag(self, tag: &str) -> Self[src]

Tags both the NonceGen and the challenge hash with an application specific tag.

impl<H: Tagged, R> AddTag for Synthetic<H, R>[src]

Loading content...