-
Notifications
You must be signed in to change notification settings - Fork 94
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
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
Introduce Absorb/Challenge traits #636
Comments
Stale issue message |
have some start here: 4a95a2d. I'm missing some of useful implementations here that we should implement, also I chose a different name to differentiate absorption between different sponges |
I think what would be even more useful:
|
Stale issue message |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Currently the
Sponge
type looks like this:Meaning there is a method for every type you can absorb and every type you can squeeze. I suggest getting rid of this in favor of using two traits: one for "absorbable" objects and one for "squeezable" objects.
Concretely I suggest adding traits like these:
And changing the sponge type so it looks more like this:
In addition we provide a few special implementations of
Challenge<F>
andAbsorb<F>
:This enables describing/deriving absorbing/squeezing of more complex types elsewhere in terms of these "base" implementation, e.g.
Without changing the
Sponge
type/trait, this also enables implementing the traits for new types outside the module. In particular the above allows:For a sequence of points (exactly like
sponge.absorb_g
currently), but also enablessponge.absorb(&field_elements)
without changing the sponge type.The text was updated successfully, but these errors were encountered: