Hello, maybe it's not so proper to ask this question here... anyway, I'm trying to use the gmp library for the implementation of DH, but the problem here I got is:
Once, when I was doing the tests to observe the output, although big values of prime and the private keys were selected:
- p was about more than 300 digits long in decimal
- a, b were about 100 digits long
finally I got a shared secret key which was extremely small, perhaps smaller than 10^8 in decimal...
This problem didn't show up many times, in fact, during all the observation, it appeared just once...but still, this was not so good at all.
So I wonder if there are some methods which can avoid this... Thanx a lot