Lines Matching defs:el
123 const struct lws_gencrypto_keyelem *el)
140 bn_x = BN_bin2bn(el[LWS_GENCRYPTO_EC_KEYEL_X].buf,
141 (int)el[LWS_GENCRYPTO_EC_KEYEL_X].len, NULL);
146 bn_y = BN_bin2bn(el[LWS_GENCRYPTO_EC_KEYEL_Y].buf,
147 (int)el[LWS_GENCRYPTO_EC_KEYEL_Y].len, NULL);
178 if (el[LWS_GENCRYPTO_EC_KEYEL_D].len) {
179 bn_d = BN_bin2bn(el[LWS_GENCRYPTO_EC_KEYEL_D].buf,
180 (int)el[LWS_GENCRYPTO_EC_KEYEL_D].len, NULL);
223 const struct lws_gencrypto_keyelem *el)
228 if (el[LWS_GENCRYPTO_EC_KEYEL_CRV].len < 4)
232 (char *)el[LWS_GENCRYPTO_EC_KEYEL_CRV].buf);
236 if ((el[LWS_GENCRYPTO_EC_KEYEL_D].len &&
237 el[LWS_GENCRYPTO_EC_KEYEL_D].len != curve->key_bytes) ||
238 el[LWS_GENCRYPTO_EC_KEYEL_X].len != curve->key_bytes ||
239 el[LWS_GENCRYPTO_EC_KEYEL_Y].len != curve->key_bytes)
242 ctx->has_private = !!el[LWS_GENCRYPTO_EC_KEYEL_D].len;
248 if (lws_genec_eckey_import(curve->tls_lib_nid, pkey, el)) {
301 lws_genecdh_set_key(struct lws_genec_ctx *ctx, struct lws_gencrypto_keyelem *el,
307 return lws_genec_keypair_import(ctx, ctx->curve_table, &ctx->ctx[side], el);
312 const struct lws_gencrypto_keyelem *el)
317 return lws_genec_keypair_import(ctx, ctx->curve_table, &ctx->ctx[0], el);
345 const char *curve_name, struct lws_gencrypto_keyelem *el)
414 el[LWS_GENCRYPTO_EC_KEYEL_CRV].len = (uint32_t)strlen(curve_name) + 1;
415 el[LWS_GENCRYPTO_EC_KEYEL_CRV].buf =
416 lws_malloc(el[LWS_GENCRYPTO_EC_KEYEL_CRV].len, "ec");
417 if (!el[LWS_GENCRYPTO_EC_KEYEL_CRV].buf) {
422 strcpy((char *)el[LWS_GENCRYPTO_EC_KEYEL_CRV].buf, curve_name);
426 el[n].len = curve->key_bytes;
427 el[n].buf = lws_malloc(curve->key_bytes, "ec");
428 if (!el[n].buf)
431 m = BN_bn2binpad(bn[n - 1], el[n].buf, (int32_t)el[n].len);
432 if ((uint32_t)m != el[n].len)
454 struct lws_gencrypto_keyelem *el)
459 return lws_genec_new_keypair(ctx, side, curve_name, el);
464 struct lws_gencrypto_keyelem *el)
469 return lws_genec_new_keypair(ctx, LDHS_OURS, curve_name, el);