herumi / mcl

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

How to map "char*" to “GT” and how to inverse? #91

Closed szcnnn closed 3 years ago

herumi commented 3 years ago

"cha*" means serialization, then use mclBnGT_serialize and mclBnGT_deserialize. If it means a string, then use mclBnFp_getStr and mclBnFp_setStr for each member d[0], ..., d[11]`.

szcnnn commented 3 years ago

Is the outputs of mclBnGT_getStr a point on GT?

herumi commented 3 years ago

GT has 12 elements of Fp (Fp d[12]), so it outputs d[0] d[1] d[2] ... d[11].