Closed SilentCicero closed 7 years ago
Yeah. These are all integers. The voting key (x,y) is stored in the first three lines. The LocalCrypto contract has the code to compute the zkp and is executed using .call(). I mostly did this to ensure the creation / verification work together to experiment.
@stonecoldpat so it doesn't matter if the coordinates are "affine" or not? I couldn't find a JS equivalent for that co-ordinates method in the elliptic lib.
Also, in the Java file you are using "EDCSA" "BC", I'm not sure if by using elliptic
Sep256k1 here (EC) if that is the right approach and will work with your ZKP/Sepc256k1 Solidity version. Any thoughts on that?
"BC" is just bouncy castle which is the cryptography library used in Java (the provider). Both Java and LocalCrypto are using the same curve (Secp256k1).
The Java Code should produce an affine point (x,y) for the voting key.
Some parts of LocalCrypto might accept a Jacob point (requires three co-ordinates x,y,z). It is on my "to do" list to change these inputs such that only affine points are returned/accepted as input for simplicity.
Okay, I dont think this is a problem. The script above produces valid keys/random numbers. Thanks for the help!
I did a version of your Java file in JS.. does this look right?
I couldn't fine anything on affine coordinate generation and if that matters over normal X and Y coordinates. Perhaps you could shed some light on that.
@stonecoldpat