Lines Matching defs:bn
97 ctx->bn[n] = BN_bin2bn(el[n].buf, (int)el[n].len, NULL);
98 if (!ctx->bn[n]) {
116 if (RSA_set0_key(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N],
117 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_E],
118 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_D]) != 1) {
122 RSA_set0_factors(ctx->rsa, ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P],
123 ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_Q]);
125 ctx->rsa->e = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_E];
126 ctx->rsa->n = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_N];
127 ctx->rsa->d = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_D];
128 ctx->rsa->p = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_P];
129 ctx->rsa->q = ctx->bn[LWS_GENCRYPTO_RSA_KEYEL_Q];
137 if (ctx->bn[n]) {
138 BN_clear_free(ctx->bn[n]);
139 ctx->bn[n] = NULL;
155 BIGNUM *bn;
168 bn = BN_new();
169 if (!bn)
171 if (BN_set_word(bn, RSA_F4) != 1) {
172 BN_free(bn);
176 n = RSA_generate_key_ex(ctx->rsa, bits, bn, NULL);
177 BN_clear_free(bn);