pbc
pbc copied to clipboard
Elements of G2 in D curves should have order r.
In D curves, we save a little time when generating points in G2 by avoiding an exponentiation to make them order r.
Unfortunately this breaks element_is1 and element_cmp in G2, which are needed in cryptosystems such as ZK protocols.
To fix this, when generating an element of G2, we should ensure it has order r even for type D curves.