We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When building domain tags we usually use a trait like this:
/// Domain Tag pub trait DomainTag<T> where T: ParameterFieldType, { /// Generates domain tag as a constant parameter. fn domain_tag() -> T::ParameterField; }
and then build custom domain tags with code like this (from manta-rs):
manta-rs
/// Utxo Commitment Scheme Domain Tag #[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct UtxoCommitmentSchemeDomainTag; impl poseidon::hash::DomainTag<Poseidon5> for UtxoCommitmentSchemeDomainTag { #[inline] fn domain_tag() -> <Poseidon5 as ParameterFieldType>::ParameterField { todo!() } } impl<COM> Constant<COM> for UtxoCommitmentSchemeDomainTag { type Type = Self; #[inline] fn new_constant(this: &Self::Type, compiler: &mut COM) -> Self { let _ = (this, compiler); Self } }
We should be able to simplify this to a generic domain tag type:
/// Domain Tag Parameter #[component] pub type DomainTagParameter; /// Domain Tag pub trait DomainTag<T> where T: DomainTagParameterType, { /// Generates a domain tag. fn domain_tag() -> T::DomainTagParameterType; }
so that an implementation looks like this:
/// Utxo Commitment Scheme Domain Tag #[domain_tag(Poseidon5)] pub struct UtxoCommitmentSchemeDomainTag;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When building domain tags we usually use a trait like this:
and then build custom domain tags with code like this (from
manta-rs
):We should be able to simplify this to a generic domain tag type:
so that an implementation looks like this:
The text was updated successfully, but these errors were encountered: