Menu

Getting Element from JSON

Help
2017-10-26
2017-10-29
  • FRANCISCO MARTINS MAGALHÃES

    I've been working with JPBC for a while. Now I'm stuck in one little problem. I need to receive a String representation of a generated element from G1 group. So I randomly generated (using newRandomElement()) this element g.

    However, g cannot be converted to BigInteger (Exception: Cannot convert to BigInteger) because at some point it contains "401329,3521518".

    The receiver gets a String representation of g and then has to instantiate a new Element but it's not possible to do that using a Big Integer as parameter (as I just told you) and there's no way to do it using a String as parameter.

    Thank you!

     
  • FRANCISCO MARTINS MAGALHÃES

    Okay I got it, just use Base64 encoding and decoding from jpbc library

     

Log in to post a comment.