Skip to content

bignum_to_string #34

@jrp27514

Description

@jrp27514

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions