comparison common-kex.c @ 1692:1051e4eea25a

Update LibTomMath to 1.2.0 (#84) * update C files * update other files * update headers * update makefiles * remove mp_set/get_double() * use ltm 1.2.0 API * update ltm_desc * use bundled tommath if system-tommath is too old * XMALLOC etc. were changed to MP_MALLOC etc.
author Steffen Jaeckel <s@jaeckel.eu>
date Tue, 26 May 2020 17:36:47 +0200
parents 41bf8f216644
children 56f636f84bf5
comparison
equal deleted inserted replaced
1691:2d3745d58843 1692:1051e4eea25a
568 m_mp_init_multi(&param->pub, &param->priv, &dh_g, &dh_p, &dh_q, NULL); 568 m_mp_init_multi(&param->pub, &param->priv, &dh_g, &dh_p, &dh_q, NULL);
569 569
570 /* read the prime and generator*/ 570 /* read the prime and generator*/
571 load_dh_p(&dh_p); 571 load_dh_p(&dh_p);
572 572
573 if (mp_set_int(&dh_g, DH_G_VAL) != MP_OKAY) { 573 mp_set_ul(&dh_g, DH_G_VAL);
574 dropbear_exit("Diffie-Hellman error");
575 }
576 574
577 /* calculate q = (p-1)/2 */ 575 /* calculate q = (p-1)/2 */
578 /* dh_priv is just a temp var here */ 576 /* dh_priv is just a temp var here */
579 if (mp_sub_d(&dh_p, 1, &param->priv) != MP_OKAY) { 577 if (mp_sub_d(&dh_p, 1, &param->priv) != MP_OKAY) {
580 dropbear_exit("Diffie-Hellman error"); 578 dropbear_exit("Diffie-Hellman error");