Replies: 2 comments
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think what would be even more useful:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.Beta Was this translation helpful? Give feedback.
All reactions