Add ecp_genkey(), prettier wrapper
diff --git a/library/ecp.c b/library/ecp.c
index 0c66d35..80a10ba 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -1669,6 +1669,20 @@
return( ecp_mul( grp, Q, d, &grp->G, f_rng, p_rng ) );
}
+/*
+ * Generate a keypair, prettier wrapper
+ */
+int ecp_gen_key( ecp_group_id grp_id, ecp_keypair *key,
+ int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
+{
+ int ret;
+
+ if( ( ret = ecp_use_known_dp( &key->grp, grp_id ) ) != 0 )
+ return( ret );
+
+ return( ecp_gen_keypair( &key->grp, &key->d, &key->Q, f_rng, p_rng ) );
+}
+
#if defined(POLARSSL_ECP_NIST_OPTIM)
/*
* Fast reduction modulo the primes used by the NIST curves.