herumi / bls

288 stars 132 forks source link

How to get public key? #70

Closed bartwell closed 3 years ago

bartwell commented 3 years ago

I am trying to retrieve public key using this code:

blsGetPublicKey(&pub, &sec);
char *address = new char[100];
blsPublicKeyGetHexStr(address, 100, &pub);
__android_log_write(ANDROID_LOG_ERROR, "test", address);

It works but returns corrupted string: 1 15a11bcb263b9dff6e3f4a171f60f38351b115e155b5ce223fdc2b441259b77d1e3706491a10bc84f7e7dbf10380f3ee

It should be: b5a11bcb263b9dff6e3f4a171f60f38351b115e155b5ce223fdc2b441259b77d1e3706491a10bc84f7e7dbf10380f3ee.

As you see here is 1 1 instead of b in beginning. Why? Is it bug? Or I am doing something wrong?