two's compliment in libtommath library
<p>I am using libtommath library for bigInteger calculation for my iphone application. I have used libtommath library to implement Diffie-Hellman key exchange. </p>

<p>On server sider, the code is in java, which uses Biginteger class.  In Biginteger class, there is a function toByteArray. This function takes the two's compliment and returns the byte array. </p>

<p>I want to do similar stuff on my iphone app. Can anyone tell me how to take two's compliment in big integer calculated by libtommath. </p>

<p>In other words, 
Say Output of my calculation is in NSString *bobkey = "325522525225322525234444445646456564564654654654654654654744797239797297421749179472974721974127439729749274972974927497297439274972974927497274927497329473927497294729847289749827917974291734927149792749724972397927394797324927493274927";</p>

<p>Now how do i get two's compliment of above number that matches with the byte array of BigInteger ?  </p>
