Open zhangyinglong3550 opened 6 years ago
What is the problem exactly? Please give more detail.
Mike
On Fri, Jan 26, 2018 at 12:21 PM, zhangyinglong3550 < notifications@github.com> wrote:
I want convert from G1/G2/GT to char* , but spill() and restore() cann't work,what can I do ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/miracl/MIRACL/issues/58, or mute the thread https://github.com/notifications/unsubscribe-auth/ACm8jtOF4GJB1TERmClaKdf6DerpPMIyks5tOcNWgaJpZM4RuO5G .
I think the question of the issuer was as the same as mine. I want to export G1, G2 or GT perhaps as bytes and import them in other programs. Is there a method for that? It is also not clear to me what spill() and restore() functions do.
Hello llkan,
Pairing-based cryptography often benefits from pre-computation. For example is a constant P in G1 is often being multiplied by different values, by pre-computing multiples of P this can be speeded up. Typically these pre-computed values can be calculated off-line just once ever, and then loaded up when a program starts. This is what "spill" and "restore" are for. The first function "spills" the pre-computed table to a byte array (which may for example be stored in a disk file), and the second function "restore" reads it back in again into the internal format.
Various pre-computations can be spilled and restored in this way.
Exporting and importing individual members of G1, G2 and GT is not supported. But it would not be hard to add this functionality. For example for G1, access the x and y coordinates as big numbers and then convert these to a byte array using to_binary().
Mike
On Sun, Mar 25, 2018 at 4:09 PM, Ilkan Esiyok notifications@github.com wrote:
I think the question of the issuer was as the same as mine. I want to export G1, G2 or GT perhaps as bytes and import them in other programs. Is there a method for that? It is also not clear to me what spill() and restore() functions do.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/miracl/MIRACL/issues/58#issuecomment-375977494, or mute the thread https://github.com/notifications/unsubscribe-auth/ACm8jtkfK1ht4dSjUMMG0TulnqfP6W-7ks5th7MdgaJpZM4RuO5G .
Hello Mike,
Thank you very much for your support, I am able to access G1's x and y coordinates and convert them to byte arrays. But the problem was that I need to create new G1 from scratch from this coordinates. Actually, now I believe I have just found my answer while I was explaining the problem to you :)
Cheers,
I want convert from G1/G2/GT to char* , but spill() and restore() cann't work,what can I do ?