Lines Matching refs:bn
96 ctx->bn[n] = BN_bin2bn(el[n].buf, el[n].len, NULL); in lws_genrsa_create()
97 if (!ctx->bn[n]) { in lws_genrsa_create()
115 if (RSA_set0_key(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N], in lws_genrsa_create()
116 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_E], in lws_genrsa_create()
117 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_D]) != 1) { in lws_genrsa_create()
121 RSA_set0_factors(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P], in lws_genrsa_create()
122 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_Q]); in lws_genrsa_create()
124 ctx->rsa->e = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_E]; in lws_genrsa_create()
125 ctx->rsa->n = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N]; in lws_genrsa_create()
126 ctx->rsa->d = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_D]; in lws_genrsa_create()
127 ctx->rsa->p = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P]; in lws_genrsa_create()
128 ctx->rsa->q = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_Q]; in lws_genrsa_create()
136 if (ctx->bn[n]) { in lws_genrsa_create()
137 BN_clear_free(ctx->bn[n]); in lws_genrsa_create()
138 ctx->bn[n] = NULL; in lws_genrsa_create()
154 BIGNUM *bn; local
167 bn = BN_new();
168 if (!bn)
170 if (BN_set_word(bn, RSA_F4) != 1) {
171 BN_free(bn);
175 n = RSA_generate_key_ex(ctx->rsa, bits, bn, NULL);
176 BN_clear_free(bn);