comparison dss.c @ 378:a124aff0cbf1

merge of '182c2d8dbd5321ef4d1df8758936f4dc7127015f' and '31dcd7a22983ef19d6c63248e415e71d292dd0ec'
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Dec 2006 13:11:41 +0000
parents ed910547d449 454a34b2dfd1
children b50f0107e505 76097ec1a29a
comparison
equal deleted inserted replaced
377:1bfa65fed772 378:a124aff0cbf1
339 sha512_done(&hs, proto_k); 339 sha512_done(&hs, proto_k);
340 340
341 /* generate k */ 341 /* generate k */
342 m_mp_init(&dss_protok); 342 m_mp_init(&dss_protok);
343 bytes_to_mp(&dss_protok, proto_k, SHA512_HASH_SIZE); 343 bytes_to_mp(&dss_protok, proto_k, SHA512_HASH_SIZE);
344 mp_mod(&dss_protok, key->q, &dss_k); 344 if (mp_mod(&dss_protok, key->q, &dss_k) != MP_OKAY) {
345 dropbear_exit("dss error");
346 }
345 mp_clear(&dss_protok); 347 mp_clear(&dss_protok);
346 m_burn(proto_k, SHA512_HASH_SIZE); 348 m_burn(proto_k, SHA512_HASH_SIZE);
347 #else /* DSS_PROTOK not defined*/ 349 #else /* DSS_PROTOK not defined*/
348 gen_random_mpint(key->q, &dss_k); 350 gen_random_mpint(key->q, &dss_k);
349 #endif 351 #endif