• Home
  • Raw
  • Download

Lines Matching refs:rsa

45 rsa_pkey_wrap(struct lws_genrsa_ctx *ctx, RSA *rsa)  in rsa_pkey_wrap()  argument
57 if (EVP_PKEY_assign_RSA(pkey, rsa) != 1) { in rsa_pkey_wrap()
109 ctx->rsa = RSA_new(); in lws_genrsa_create()
110 if (!ctx->rsa) { in lws_genrsa_create()
116 if (RSA_set0_key(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N], in lws_genrsa_create()
122 RSA_set0_factors(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P], in lws_genrsa_create()
125 ctx->rsa->e = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_E]; in lws_genrsa_create()
126 ctx->rsa->n = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N]; in lws_genrsa_create()
127 ctx->rsa->d = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_D]; in lws_genrsa_create()
128 ctx->rsa->p = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P]; in lws_genrsa_create()
129 ctx->rsa->q = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_Q]; in lws_genrsa_create()
132 if (!rsa_pkey_wrap(ctx, ctx->rsa)) in lws_genrsa_create()
142 if (ctx->rsa) { in lws_genrsa_create()
143 RSA_free(ctx->rsa); in lws_genrsa_create()
144 ctx->rsa = NULL; in lws_genrsa_create()
162 ctx->rsa = RSA_new();
163 if (!ctx->rsa) {
176 n = RSA_generate_key_ex(ctx->rsa, bits, bn, NULL);
185 RSA_get0_key(ctx->rsa, &mpi[LWS_GENCRYPTO_RSA_KEYEL_N],
187 RSA_get0_factors(ctx->rsa, &mpi[LWS_GENCRYPTO_RSA_KEYEL_P],
191 BIGNUM *mpi[5] = { ctx->rsa->e, ctx->rsa->n, ctx->rsa->d,
192 ctx->rsa->p, ctx->rsa->q, };
205 if (!rsa_pkey_wrap(ctx, ctx->rsa))
213 RSA_free(ctx->rsa);
214 ctx->rsa = NULL;
228 int n = RSA_public_encrypt((int)in_len, in, out, ctx->rsa,
243 int n = RSA_private_encrypt((int)in_len, in, out, ctx->rsa,
258 int n = RSA_public_decrypt((int)in_len, in, out, ctx->rsa,
272 int n = RSA_private_decrypt((int)in_len, in, out, ctx->rsa,
298 (unsigned int)sig_len, ctx->rsa);
306 n = RSA_verify_pss_mgf1(ctx->rsa, in, h, md, NULL, -1,
309 n = RSA_verify_PKCS1_PSS(ctx->rsa, in, md, (uint8_t *)sig,
343 if (RSA_sign(n, in, (unsigned int)h, sig, &used, ctx->rsa) != 1) {
412 ctx->rsa = NULL;