-
Notifications
You must be signed in to change notification settings - Fork 2
Adds new indifferentiable hash function for hashing to BarretoNaehrig G1 and G2 #102
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
Conversation
|
One current problem is that the indifferentiability requires two independent random oracles to F_q. I am currently just using two |
Prefixing every input to the hash function does do what you need, e.g. H_1(x) = H(1||x) and H_2(x) = H(2||x) are two independent random oracles (if H is modeled as a random oracle). |
|
Hey, maybe it would be cool if one could just pass a prefix to the VariableOutputLengthHashFunction's constructor so that one could use the "two independent hash functions" functionality without prefixing every input manually. |
Problem is that I also might use any other hash function that is passed to the class, not just Considering that, it seems simpler to keep the input prefixing to the hash class. |
|
Hey. I'll review this later. Just at a quick glance: I'm not a huge fan of having a public multiplyWithCofactor method for GroupElements. The abstraction for a specific GroupElement should be that whatever value it holds is actually a valid element of the group. So it's weird to add a method that is only useful to call on "malformed" GroupElements - those shouldn't exist! I'd prefer a constructor or a static method to map given x-y coordinates into the group using cofactor multiplication. Anything that keeps the "an instance of this is a valid group element (in the right subgroup)" abstraction :) |
|
The original method did only accept coordinate arguments, I just added the Perhaps we should then also change the |
|
Coordinate argument version can be public, no issue. ad |
getElementUnsafeOk, so I started by adding a protected An option would be to make Making Cofactor multiplicationAn annoyance with making the cofactor multiplication coordinate-only is that I now need two cofactor multiplications for the hashing, and not just one. I used to be able to map to the curve, but not to the group, and then execute the Some options for keeping the single cofactor multiplication:
|
|
Give me some time to comment on this 🙈. It’s a complicated discussion. Will do later. |
New hash functions will be admissible in the sense that they can be used to replace a random oracle in any scheme in the ROM.
Done
BarretoNaehrigHashToSourceGroupImpl. Cofactor multiplication is used fromPairingSourceGroupImpl. To enable that, I had to make the cofactor multiplication method public so the hash class can access it.TODO