2

I have BIGNUM structure from what contains really big positive integer. I'm converting this BIGNUM to array of bytes using BN_bn2bin function:

BIGNUM *bigInteger = ...
BN_bn2bin(bigInteger, bigIntegerBytes);

I noticed that bigIntegerBytes is in unsigned value representation. I would like to covert this integer from unsinged value representation to Two's complement representation. Can you tell me please how to do that?

PS. I'm using objective-c so maybe there is any way to do that using NSData.

jww
  • 97,681
  • 90
  • 411
  • 885
Sayaki
  • 769
  • 14
  • 36

0 Answers0