Closed eddiew closed 5 years ago
I think this is overall a good idea -- one thing to consider though is that if hash_to_prime
is a bottleneck, people might want to cache its Integer
results for use with the accumulator functions.
Granted, hard to say if people will be doing that in practice...
For example, we can generalize
Accumulator<G: UnknownOrderGroup>
toAccumulator<T: Hash, G: UnknownOrderGroup>
and add goes from
fn add(self, elems: &[Integer]) -> (Self, MembershipProof<G>)
tofn add(self, elems: &[T]) -> (Self, MembershipProof<T, G>)
The type parameter T in the accumulator struct would be a phantom type to help prevent mixing accumulators for different element types