@@ -114,6 +114,11 @@ struct lws_ec_curves {
114114 * .name = NULL, of curves you want to allow
115115 *
116116 * Initializes a genecdh
117+ *
118+ * \p ctx must be zeroed (eg, using memset) before it is passed to create
119+ * apis the first time; if the ctx is still live from an earlier create, the
120+ * call fails and returns nonzero. After lws_genec_destroy() the same ctx
121+ * can be passed to the create apis again.
117122 */
118123LWS_VISIBLE LWS_EXTERN int
119124lws_genecdh_create (struct lws_genec_ctx * ctx , struct lws_context * context ,
@@ -159,7 +164,9 @@ lws_genecdh_compute_shared_secret(struct lws_genec_ctx *ctx, uint8_t *ss,
159164 * struct lws_ec_curves array, terminated by an entry with
160165 * .name = NULL, of curves you want to allow
161166 *
162- * Initializes a genecdh
167+ * Initializes a genecdsa. \p ctx follows the same lifetime rules as for
168+ * lws_genecdh_create(): zeroed before first use, and create over a ctx that
169+ * is still live fails until lws_genec_destroy() is called on it.
163170 */
164171LWS_VISIBLE LWS_EXTERN int
165172lws_genecdsa_create (struct lws_genec_ctx * ctx , struct lws_context * context ,
@@ -248,7 +255,9 @@ lws_genecdsa_hash_sign_jws(struct lws_genec_ctx *ctx, const uint8_t *in,
248255 * struct lws_ec_curves array, terminated by an entry with
249256 * .name = NULL, of curves you want to allow
250257 *
251- * Initializes a geneddsa
258+ * Initializes a geneddsa. \p ctx follows the same lifetime rules as for
259+ * lws_genecdh_create(): zeroed before first use, and create over a ctx that
260+ * is still live fails until lws_genec_destroy() is called on it.
252261 */
253262LWS_VISIBLE LWS_EXTERN int
254263lws_geneddsa_create (struct lws_genec_ctx * ctx , struct lws_context * context ,
0 commit comments