I am using the pycryptodome package to implement a cryptographic voting protocol. I am using the Nist256 curve and would like to create a second generator, independent of the default generator i.e. not related to it by scalar multiplication.
The common way to do this is by the try-and-increment method (if there is another method which works with pycryptodome then please tell) which involves basically:
- Create some unique hash with context specific information and some padding. Treat this as the x coordinate of the generator.
- Find the equivalent y coordinate of the point using the curve equation
- If this point is on the curve, then bingo you've found a new generator. If this point is not on the curve, then increment the padding and go back to step 1.
The problem I have is that I cannot instantiate a pycryptodome EccPoint without knowledge of both the x and y coordinates. I cannot work out what the y coordinate is according to the curve equation because I cannot reproduce the curve equation with the parameters in the private EccCurve._curve attribute.
The _curve attribute contains p, b, order, the default generator and some other information. I cannot see how to reconstruct the curve equation from this information, is there a way to do this?
Perhaps there is a better way to go about doing this that I'm missing? Or maybe it just isn't possible to create a second independent generator using pycryptodome?
Many thanks in advance for any input.