dh_init and crypto_mod_exp: clarification

raghunathan.kailasanathan at wipro.com raghunathan.kailasanathan
Fri Jun 8 11:32:26 PDT 2012


>What makes you believe that the values used by dh_init() are in little
>endian format?

Well, er..yes, i got it wrong.. dh_init() does pass it in big-endian format. What is
puzzling me is that the private key data and dh prime on my machine get corrupted in
the mp_read_unsigned_bin() function. For example the prime in the a->dp[] array looks 
as below (looks corrupted every 4th byte or something..)

ff ff ff 0f ff ff ff 0f ff 27 73 03 a2 8c c0 06 74 f1 04 08 c9 ab e4 04 35 0c 67 0d 66 
69 09 07 07 29 d5 0e b9 2b 55 08 20 56 f3 02 c6 61 d9 0a a3 dc 23 0d 55 36 f8 05 cf 24 
fd 08 fa 63 91 06 9a d3 55 0c 61 83 a4 0d 98 05 bf 03 16 8a cb 07 00 c2 3d 0b 45 ce 1e 
05 66 28 49 06 fe b1 c4 07 11 24 9f 0e 5a fa 99 08 5a fb 6b 08 e3 de 7e 0b 06 f4 b6 0c 
f5 bf b0 06 ed 37 a6 09 2e c4 44 0f c6 7e 5e 02 66 57 5b 08 e4 45 c2 01 d5 d6 56 03 e1 
4f 37 04 f1 25 df 06 0a 2b 30 0b 31 a4 d3 0c b3 19 95 0f de 4d 40 03 8e 79 08 0a 14 25 
b2 09 13 3b a6 0e bb 20 40 07 cc 67 8a 08 e0 24 90 02 d1 1c dc 00 b8 28 66 0c c4 34 c2 
08 16 22 aa 0d 0f c9 ff 0f ff ff ff 0f ff ff ff

Is there some architecture specific porting required in the libtommath ? (I have maintained
all macros as default, including MP_PREC and DIGITBIT). I am running a RTOS on my 120MHz 
ARM9

Regards
Raghu



Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com



More information about the Hostap mailing list