Closed Neotamandua closed 9 months ago
My suggestion would be to have the Signatures
generic over a constant generator G
(or two generators in case of DoubleSignature
)
I revert from the above suggestion to make the signatures and public keys generic over the generator(s). The reason behind is that, with the generic approach, when de-serializing a signature: we would need to know the generator before we de-serialize. This is not possible since the generator(s) can be any element of our sub-group of jubjub points.
Summary
For this library to work with Zedger keys and signing, we need to be able to pass custom generators
G
.Detailed Description
The NoteSecretKey consists of a JubJubScalar. The NotePublicKey gets derived by multiplying the Scalar with a const
GENERATOR_EXTENDED
. The signing, verify and other relevant functions therefore also use this same constGENERATOR_EXTENDED
.Zedger keys have different generators
G
on a per-key basis. Because of that we need to have the possibility to use custom generators in all relevant parts of dusk-schnorr for signing purposes in Zedger. Right now I could create a NotePublicKey through thefrom_raw_unchecked
function where I pass a JubJubExtended which got calculated with a different Generator, but the signing and verification is still not possible then.Possible Solutions
G
to all relevant parts so that users of the library can pass the different argument values for derivation, signing and verification (sign_double
and related parts also have a constGENERATOR_NUMS_EXTENDED
which needs to be checked).from_with_custom_g()
for verification e.g.,verify_with_custom_g()