herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

How can i get generator "g1" of G1 and generator "g2" of G2 in Java? #111

Closed Henzi96 closed 3 years ago

Henzi96 commented 3 years ago

Hello, I am trying to implement Weak Boneh Boyah signature. There is a step, where generators "g1" and "g2" form G1/G2 groups are needed. How can i get them in Java ? Thanks

herumi commented 3 years ago

hashAndMapToG1 and hashAndMapToG2 always generate a generator of G1 and G2.

Henzi96 commented 3 years ago

Hm, ok. My friend told me: "Use this as a generator of G1": 1 .....regarding to: 1 ; affine coordinate g1(X) : 2523648240000001BA344D80000000086121000000000013A700000000000012 g1(Y) : 0000000000000000000000000000000000000000000000000000000000000001

Is it correct ? I am working with BN254 curve in Java

herumi commented 3 years ago
G1 P = new G1();
P.setStr("1 2523648240000001BA344D80000000086121000000000013A700000000000012 0000000000000000000000000000000000000000000000000000000000000001", 16);
Henzi96 commented 3 years ago

Exactly. Thanks