Lines Matching refs:BIGNUM
70 void BN_set_flags(BIGNUM *b, int n);
71 int BN_get_flags(const BIGNUM *b, int n);
83 * get a clone of a BIGNUM with changed flags, for *temporary* use only (the
85 * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that
88 void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);
183 int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
184 int BN_is_zero(const BIGNUM *a);
185 int BN_is_one(const BIGNUM *a);
186 int BN_is_word(const BIGNUM *a, const BN_ULONG w);
187 int BN_is_odd(const BIGNUM *a);
191 void BN_zero_ex(BIGNUM *a);
199 const BIGNUM *BN_value_one(void);
205 BIGNUM *BN_CTX_get(BN_CTX *ctx);
207 int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
208 int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
209 int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
210 int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range);
211 int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
212 int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
213 int BN_num_bits(const BIGNUM *a);
216 BIGNUM *BN_new(void);
217 BIGNUM *BN_secure_new(void);
218 void BN_clear_free(BIGNUM *a);
219 BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
220 void BN_swap(BIGNUM *a, BIGNUM *b);
221 BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
222 int BN_bn2bin(const BIGNUM *a, unsigned char *to);
223 int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
224 BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
225 int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
226 BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
227 int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
228 int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
229 int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
230 int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
231 int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
232 int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
233 int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
234 /** BN_set_negative sets sign of a BIGNUM
235 * \param b pointer to the BIGNUM object
236 * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
238 void BN_set_negative(BIGNUM *b, int n);
239 /** BN_is_negative returns 1 if the BIGNUM is negative
240 * \param b pointer to the BIGNUM object
243 int BN_is_negative(const BIGNUM *b);
245 int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
248 int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
249 int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
251 int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
252 const BIGNUM *m);
253 int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
255 int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
256 const BIGNUM *m);
257 int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
259 int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
260 int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
261 int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
262 int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
264 int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
266 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
267 BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
268 int BN_mul_word(BIGNUM *a, BN_ULONG w);
269 int BN_add_word(BIGNUM *a, BN_ULONG w);
270 int BN_sub_word(BIGNUM *a, BN_ULONG w);
271 int BN_set_word(BIGNUM *a, BN_ULONG w);
272 BN_ULONG BN_get_word(const BIGNUM *a);
274 int BN_cmp(const BIGNUM *a, const BIGNUM *b);
275 void BN_free(BIGNUM *a);
276 int BN_is_bit_set(const BIGNUM *a, int n);
277 int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
278 int BN_lshift1(BIGNUM *r, const BIGNUM *a);
279 int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
281 int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
282 const BIGNUM *m, BN_CTX *ctx);
283 int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
284 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
285 int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
286 const BIGNUM *m, BN_CTX *ctx,
288 int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
289 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
290 int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
291 const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
293 int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
294 const BIGNUM *m, BN_CTX *ctx);
296 int BN_mask_bits(BIGNUM *a, int n);
298 int BN_print_fp(FILE *fp, const BIGNUM *a);
300 int BN_print(BIO *bio, const BIGNUM *a);
301 int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
302 int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
303 int BN_rshift1(BIGNUM *r, const BIGNUM *a);
304 void BN_clear(BIGNUM *a);
305 BIGNUM *BN_dup(const BIGNUM *a);
306 int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
307 int BN_set_bit(BIGNUM *a, int n);
308 int BN_clear_bit(BIGNUM *a, int n);
309 char *BN_bn2hex(const BIGNUM *a);
310 char *BN_bn2dec(const BIGNUM *a);
311 int BN_hex2bn(BIGNUM **a, const char *str);
312 int BN_dec2bn(BIGNUM **a, const char *str);
313 int BN_asc2bn(BIGNUM **a, const char *str);
314 int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
315 int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns
318 BIGNUM *BN_mod_inverse(BIGNUM *ret,
319 const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
320 BIGNUM *BN_mod_sqrt(BIGNUM *ret,
321 const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
323 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
326 DEPRECATEDIN_0_9_8(BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
327 const BIGNUM *add,
328 const BIGNUM *rem,
333 BN_is_prime(const BIGNUM *p, int nchecks,
337 BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
343 int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
344 const BIGNUM *rem, BN_GENCB *cb);
345 int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
346 int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
349 int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
351 int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
352 const BIGNUM *Xp, const BIGNUM *Xp1,
353 const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
355 int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
356 BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
360 int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
362 int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
364 int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
367 int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
370 const BIGNUM *mod, BN_CTX *ctx);
376 BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
379 int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
380 int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
381 int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
382 int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
393 const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
394 int (*bn_mod_exp) (BIGNUM *r,
395 const BIGNUM *a,
396 const BIGNUM *p,
397 const BIGNUM *m,
408 int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
409 int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
411 int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
412 const BIGNUM *m, BN_CTX *ctx);
413 int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
420 * The BIGNUM::neg property of BIGNUMs representing binary polynomials is
428 int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
433 int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);
435 int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
436 const BIGNUM *p, BN_CTX *ctx);
438 int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
440 int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
442 int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
443 const BIGNUM *p, BN_CTX *ctx);
445 int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
446 const BIGNUM *p, BN_CTX *ctx);
448 int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
451 int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
461 int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);
463 int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
466 int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
469 int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],
472 int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
475 int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
478 int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
481 int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
483 int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
484 int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
491 int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
492 int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
493 int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
494 int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
495 int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
497 const BIGNUM *BN_get0_nist_prime_192(void);
498 const BIGNUM *BN_get0_nist_prime_224(void);
499 const BIGNUM *BN_get0_nist_prime_256(void);
500 const BIGNUM *BN_get0_nist_prime_384(void);
501 const BIGNUM *BN_get0_nist_prime_521(void);
503 int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a,
504 const BIGNUM *field, BN_CTX *ctx);
506 int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
507 const BIGNUM *priv, const unsigned char *message,
511 BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn);
512 BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn);
515 BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn);
516 BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
517 BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
518 BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
519 BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
520 BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
533 int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);