summaryrefslogtreecommitdiffhomepage
path: root/gendss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-05-23 22:18:16 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-05-23 22:18:16 +0800
commitd9e790e7dc7737158c9affb7087035dd2c31c003 (patch)
tree0e610eace4bd5b3f25812e30b85b0c22063c28ef /gendss.c
parent51b5cdd4308f4236d4d1453d482d0086d11a851e (diff)
Add m_mp_alloc_init_multi() helper
--HG-- branch : ecc
Diffstat (limited to 'gendss.c')
-rw-r--r--gendss.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gendss.c b/gendss.c
index be8f89f..2785aec 100644
--- a/gendss.c
+++ b/gendss.c
@@ -53,12 +53,7 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
key = m_malloc(sizeof(*key));
- key->p = (mp_int*)m_malloc(sizeof(mp_int));
- key->q = (mp_int*)m_malloc(sizeof(mp_int));
- key->g = (mp_int*)m_malloc(sizeof(mp_int));
- key->y = (mp_int*)m_malloc(sizeof(mp_int));
- key->x = (mp_int*)m_malloc(sizeof(mp_int));
- m_mp_init_multi(key->p, key->q, key->g, key->y, key->x, NULL);
+ m_mp_alloc_init_multi(&key->p, &key->q, &key->g, &key->y, &key->x, NULL);
getq(key);
getp(key, size/8);