Start moving to new design/API

Following discussion in the team, it was deemed preferable for the restart
context to be explicitly managed by the caller.

This commits in the first in a series moving in that directly: it starts by
only changing the public API, while still internally using the old design.
Future commits in that series will change to the new design internally.

The test function was simplified as it no longer makes sense to test for some
memory management errors since that responsibility shifted to the caller.
diff --git a/library/ecp.c b/library/ecp.c
index 19d6af0..b2c2f53 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -153,6 +153,27 @@
 }
 
 /*
+ * Initialize a restart context
+ */
+void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx )
+{
+    memset( ctx, 0, sizeof( *ctx ) );
+}
+
+/*
+ * Free the components of a restart context
+ */
+void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx )
+{
+    if( ctx == NULL )
+        return;
+
+    ecp_restart_mul_free( ctx->rsm );
+    mbedtls_free( ctx->rsm );
+    ctx->rsm = NULL;
+}
+
+/*
  * Operation counts
  */
 #define ECP_OPS_DBL     8   /* see ecp_double_jac() */
@@ -2111,6 +2132,20 @@
     return( ret );
 }
 
+#if defined(MBEDTLS_ECP_EARLY_RETURN)
+/*
+ * Restartable multiplication R = m * P
+ */
+int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
+             const mbedtls_mpi *m, const mbedtls_ecp_point *P,
+             int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
+             mbedtls_ecp_restart_ctx *rs_ctx )
+{
+    (void) rs_ctx; /* cheating for now */
+    return( mbedtls_ecp_mul( grp, R, m, P, f_rng, p_rng ) );
+}
+#endif
+
 #if defined(ECP_SHORTWEIERSTRASS)
 /*
  * Check that an affine point is valid as a public key,