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
What 8051 implementation would this be?
Have you coded something similar on a PC? How large was the code? Would something of equivalent size fit inside the 8051 part you have chosen?
You would need to get ALL the source code, you'd need to get ALL of it into your Keil project, and you'd need to compile it there. You are unlikely to be able to take a mishmash of code/libraries compiled for different processors, with different tools, and have them build into a usable form.
Take a step back, and a deep breath, and THINK about what you are doing.
Personally, I'd prefer a 32-bit ARM chip for this task. The general register bank and the better suited instruction set makes it so much simpler for a compiler to build this kind of code. And it would be noticeable in the processing speed too.
Thanks guys for your replies. Actually I have to use this micro for my project. And since 8051 is 8 bit, I need to make many functions , such as addition in 128 bit. Do you guys have any reference about the functions such as addition,multiplication,division in 128 bit for 8051? Thanks a lot
For higher precision math you'd simply use the addition/subtraction with carry propagation,. and extend the bit-wise multiply and divide implementations to accommodate the size of your numbers.
users.utcluj.ro/.../SSCE-Shift-Mult.pdf
The algorithms for doing multiply/divide should be available for 8051 and other 8-bit micros of the era. And explained in most texts about said processors.
Again, WHAT 8051 part are you using?
The concept is trivial - even easier than using decimal numbers.
But the amount of code grows. And the amount of processor instructions needed to produce one output result grows.
So a 8051 will not be a speed demon. And this is a situation where it helps to have more than one index register for the memory accesses. C = A+B is short when everything fits in a register. But with big numbers, each number is an array of bytes.
But the compiler is up to the task, if the developer is up to the task and the code and data spaces are large enough.
View all questions in Keil forum