Open rrtoledo opened 1 week ago
I think the interfaces of hash functions h0, h1, h2 could be improved. Right now we have to pass parameters like n_p, sec_param, setup, etc, which makes code less readable and more prone to error than interfaces with only essential parameters like in the paper. We could make a struct that takes these "setup" parameters in its constructor and has a hash function that takes only essential parameters.
E.g.,
struct H0 {
setup variables here
}
impl H0 {
func new(setup: &Setup) -> Self {}
func hash(self: &Self, element: Element) -> Option
struct H1 {
setup variables here
}
impl H1 {
func new(setup: &Setup) -> Self {}
func hash_head(self: &Self, v, t) -> (Hash, Option
We pass sec_param here but store n_p in Round, both are used only for h1. Either we should 1) pass both here, 2) store both in Round, or ideally 3) store a hash function in Round instead of auxiliary parameters for it.
We can leave it for future work, but the way it is right now feels clunky. We can address it when optimizing DFS not to copy elements list for every step. The way I usually do this is by creating a struct just for the DFS that has a mutable elements list as a member and a recursive dfs function. Feels like, we can improve code structure during that task.
I think a long string like "Telescope-H1" is not necessary. Suggest this at the top of the file.
mod hash_domain { const H0: u8 = 0; const H1: u8 = 1; const H2: u8 = 2; }
Why
Support user provided hash functions so that they can address domain separation when using Alba certificates several times in the same application.
What