This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

elliptic curve cryptography on 8051

Hey guys, I am working on making Elliptic Curve Cryptography El-Gamal in 8051 MCU using Keil uvision 4. I want to make it 128 bit, so I need to use GMP library. However, to use GMP I usually download it in mingw-get-setup first, so I think it won't run if I just copy the gmp.h to my project in Keil.

My questions are :

1. how can I use gmp in 8051 using Keil?

2. Or should I compile it first in gcc, then just download the hex file to 8051? How to program the register in gcc?

Thanks for your attention :D

Best regards

Parents
  • Anyone who plans to implement any big number library would see it as a trivial exercise to also implement an assign function that can work on an ASCII string of arbitrary number base.

    So:

    void bignum_set(bignum_t *num,uint8_t base,const char *value);
    void bignum_set_raw(bignum_t *num,uint8_t value,size_t bytes);
    
    uint8_t bignum_data[] = {0xf3,0x12,0x73,0x00,0x03,0x4a };
    
    bignum_set(num1,4,"033303210021111111130203302");
    bignum_set(num2,16,"fa3032faccca");
    bignum_set(num3,2,"011110100100001110111010110010011010101001010101101000101010");
    bignum_set_raw(num4,bignum_data,sizeof(bignum_data));
    

Reply
  • Anyone who plans to implement any big number library would see it as a trivial exercise to also implement an assign function that can work on an ASCII string of arbitrary number base.

    So:

    void bignum_set(bignum_t *num,uint8_t base,const char *value);
    void bignum_set_raw(bignum_t *num,uint8_t value,size_t bytes);
    
    uint8_t bignum_data[] = {0xf3,0x12,0x73,0x00,0x03,0x4a };
    
    bignum_set(num1,4,"033303210021111111130203302");
    bignum_set(num2,16,"fa3032faccca");
    bignum_set(num3,2,"011110100100001110111010110010011010101001010101101000101010");
    bignum_set_raw(num4,bignum_data,sizeof(bignum_data));
    

Children
No data