Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bignum_to_string #34

Open
jrp27514 opened this issue Mar 16, 2023 · 0 comments
Open

bignum_to_string #34

jrp27514 opened this issue Mar 16, 2023 · 0 comments

Comments

@jrp27514
Copy link

Have been working with your neat library today but struggling with simplest of things. Want to work with larger 64 byte hex ecdsa but not even having luck with simple conversions to/from small strings and back. I see a note in one test script to force even number strings

file ec.c excerpt
struct bn bn1,bn2,gX;
bignum_init(&bn1);
bignum_init(&bn2);
bignum_init(&gX);

    char s1[8];
bignum_from_string(&bn1,"01",2);
bignum_from_int(&bn2, 2);
bignum_to_string(&bn1,s1,8);
printf("tostr  %s",s1);

   I have set my WORD size in bn.h to 1,2,and 4 hoping to figure it out
  building as  gcc ec.c bn.c  -g -o  ec

 on small size strings as above I'm not getting any output. On larger strings such as below the conversion back
 to string is much shorter and all wrong
 bignum_from_string(&gX, "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",64);

Any help much appreciated. C is very problematic for me, so hoping am missing something easy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant