diff options
author | jsing <> | 2014-05-08 13:20:49 +0000 |
---|---|---|
committer | jsing <> | 2014-05-08 13:20:49 +0000 |
commit | 2e8879604fe3abbc2431ca79a4a923f1e87da75e (patch) | |
tree | 18398455223278c0cb2bd44f57e4499a4370f665 /src/lib/libcrypto/bn/bn.h | |
parent | f7d9a959949e5f3918c1cf2b27fb4cd7b62d07d5 (diff) | |
download | openbsd-2e8879604fe3abbc2431ca79a4a923f1e87da75e.tar.gz openbsd-2e8879604fe3abbc2431ca79a4a923f1e87da75e.tar.bz2 openbsd-2e8879604fe3abbc2431ca79a4a923f1e87da75e.zip |
Emergency knfectomie requested by tedu@.
Diffstat (limited to 'src/lib/libcrypto/bn/bn.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 197 |
1 files changed, 99 insertions, 98 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index 74005ed254..2a73bbbecc 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -63,7 +63,7 @@ | |||
63 | * are met: | 63 | * are met: |
64 | * | 64 | * |
65 | * 1. Redistributions of source code must retain the above copyright | 65 | * 1. Redistributions of source code must retain the above copyright |
66 | * notice, this list of conditions and the following disclaimer. | 66 | * notice, this list of conditions and the following disclaimer. |
67 | * | 67 | * |
68 | * 2. Redistributions in binary form must reproduce the above copyright | 68 | * 2. Redistributions in binary form must reproduce the above copyright |
69 | * notice, this list of conditions and the following disclaimer in | 69 | * notice, this list of conditions and the following disclaimer in |
@@ -111,13 +111,13 @@ | |||
111 | /* ==================================================================== | 111 | /* ==================================================================== |
112 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 112 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
113 | * | 113 | * |
114 | * Portions of the attached software ("Contribution") are developed by | 114 | * Portions of the attached software ("Contribution") are developed by |
115 | * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. | 115 | * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. |
116 | * | 116 | * |
117 | * The Contribution is licensed pursuant to the Eric Young open source | 117 | * The Contribution is licensed pursuant to the Eric Young open source |
118 | * license provided above. | 118 | * license provided above. |
119 | * | 119 | * |
120 | * The binary polynomial arithmetic software is originally written by | 120 | * The binary polynomial arithmetic software is originally written by |
121 | * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. | 121 | * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. |
122 | * | 122 | * |
123 | */ | 123 | */ |
@@ -251,19 +251,17 @@ typedef struct bn_recp_ctx_st BN_RECP_CTX; | |||
251 | typedef struct bn_gencb_st BN_GENCB; | 251 | typedef struct bn_gencb_st BN_GENCB; |
252 | #endif | 252 | #endif |
253 | 253 | ||
254 | struct bignum_st | 254 | struct bignum_st { |
255 | { | ||
256 | BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ | 255 | BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ |
257 | int top; /* Index of last used d +1. */ | 256 | int top; /* Index of last used d +1. */ |
258 | /* The next are internal book keeping for bn_expand. */ | 257 | /* The next are internal book keeping for bn_expand. */ |
259 | int dmax; /* Size of the d array. */ | 258 | int dmax; /* Size of the d array. */ |
260 | int neg; /* one if the number is negative */ | 259 | int neg; /* one if the number is negative */ |
261 | int flags; | 260 | int flags; |
262 | }; | 261 | }; |
263 | 262 | ||
264 | /* Used for montgomery multiplication */ | 263 | /* Used for montgomery multiplication */ |
265 | struct bn_mont_ctx_st | 264 | struct bn_mont_ctx_st { |
266 | { | ||
267 | int ri; /* number of bits in R */ | 265 | int ri; /* number of bits in R */ |
268 | BIGNUM RR; /* used to convert to montgomery form */ | 266 | BIGNUM RR; /* used to convert to montgomery form */ |
269 | BIGNUM N; /* The modulus */ | 267 | BIGNUM N; /* The modulus */ |
@@ -272,33 +270,30 @@ struct bn_mont_ctx_st | |||
272 | BN_ULONG n0[2];/* least significant word(s) of Ni; | 270 | BN_ULONG n0[2];/* least significant word(s) of Ni; |
273 | (type changed with 0.9.9, was "BN_ULONG n0;" before) */ | 271 | (type changed with 0.9.9, was "BN_ULONG n0;" before) */ |
274 | int flags; | 272 | int flags; |
275 | }; | 273 | }; |
276 | 274 | ||
277 | /* Used for reciprocal division/mod functions | 275 | /* Used for reciprocal division/mod functions |
278 | * It cannot be shared between threads | 276 | * It cannot be shared between threads |
279 | */ | 277 | */ |
280 | struct bn_recp_ctx_st | 278 | struct bn_recp_ctx_st { |
281 | { | ||
282 | BIGNUM N; /* the divisor */ | 279 | BIGNUM N; /* the divisor */ |
283 | BIGNUM Nr; /* the reciprocal */ | 280 | BIGNUM Nr; /* the reciprocal */ |
284 | int num_bits; | 281 | int num_bits; |
285 | int shift; | 282 | int shift; |
286 | int flags; | 283 | int flags; |
287 | }; | 284 | }; |
288 | 285 | ||
289 | /* Used for slow "generation" functions. */ | 286 | /* Used for slow "generation" functions. */ |
290 | struct bn_gencb_st | 287 | struct bn_gencb_st { |
291 | { | ||
292 | unsigned int ver; /* To handle binary (in)compatibility */ | 288 | unsigned int ver; /* To handle binary (in)compatibility */ |
293 | void *arg; /* callback-specific data */ | 289 | void *arg; /* callback-specific data */ |
294 | union | 290 | union { |
295 | { | ||
296 | /* if(ver==1) - handles old style callbacks */ | 291 | /* if(ver==1) - handles old style callbacks */ |
297 | void (*cb_1)(int, int, void *); | 292 | void (*cb_1)(int, int, void *); |
298 | /* if(ver==2) - new callback style */ | 293 | /* if(ver==2) - new callback style */ |
299 | int (*cb_2)(int, int, BN_GENCB *); | 294 | int (*cb_2)(int, int, BN_GENCB *); |
300 | } cb; | 295 | } cb; |
301 | }; | 296 | }; |
302 | /* Wrapper function to make using BN_GENCB easier, */ | 297 | /* Wrapper function to make using BN_GENCB easier, */ |
303 | int BN_GENCB_call(BN_GENCB *cb, int a, int b); | 298 | int BN_GENCB_call(BN_GENCB *cb, int a, int b); |
304 | /* Macro to populate a BN_GENCB structure with an "old"-style callback */ | 299 | /* Macro to populate a BN_GENCB structure with an "old"-style callback */ |
@@ -368,8 +363,8 @@ void BN_CTX_free(BN_CTX *c); | |||
368 | void BN_CTX_start(BN_CTX *ctx); | 363 | void BN_CTX_start(BN_CTX *ctx); |
369 | BIGNUM *BN_CTX_get(BN_CTX *ctx); | 364 | BIGNUM *BN_CTX_get(BN_CTX *ctx); |
370 | void BN_CTX_end(BN_CTX *ctx); | 365 | void BN_CTX_end(BN_CTX *ctx); |
371 | int BN_rand(BIGNUM *rnd, int bits, int top,int bottom); | 366 | int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); |
372 | int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom); | 367 | int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); |
373 | int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); | 368 | int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); |
374 | int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); | 369 | int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); |
375 | int BN_num_bits(const BIGNUM *a); | 370 | int BN_num_bits(const BIGNUM *a); |
@@ -379,19 +374,19 @@ void BN_init(BIGNUM *); | |||
379 | void BN_clear_free(BIGNUM *a); | 374 | void BN_clear_free(BIGNUM *a); |
380 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); | 375 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); |
381 | void BN_swap(BIGNUM *a, BIGNUM *b); | 376 | void BN_swap(BIGNUM *a, BIGNUM *b); |
382 | BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret); | 377 | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); |
383 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); | 378 | int BN_bn2bin(const BIGNUM *a, unsigned char *to); |
384 | BIGNUM *BN_mpi2bn(const unsigned char *s,int len,BIGNUM *ret); | 379 | BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); |
385 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); | 380 | int BN_bn2mpi(const BIGNUM *a, unsigned char *to); |
386 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | 381 | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); |
387 | int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | 382 | int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); |
388 | int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | 383 | int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); |
389 | int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); | 384 | int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); |
390 | int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 385 | int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
391 | int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx); | 386 | int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); |
392 | /** BN_set_negative sets sign of a BIGNUM | 387 | /** BN_set_negative sets sign of a BIGNUM |
393 | * \param b pointer to the BIGNUM object | 388 | * \param b pointer to the BIGNUM object |
394 | * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise | 389 | * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise |
395 | */ | 390 | */ |
396 | void BN_set_negative(BIGNUM *b, int n); | 391 | void BN_set_negative(BIGNUM *b, int n); |
397 | /** BN_is_negative returns 1 if the BIGNUM is negative | 392 | /** BN_is_negative returns 1 if the BIGNUM is negative |
@@ -401,7 +396,7 @@ void BN_set_negative(BIGNUM *b, int n); | |||
401 | #define BN_is_negative(a) ((a)->neg != 0) | 396 | #define BN_is_negative(a) ((a)->neg != 0) |
402 | 397 | ||
403 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, | 398 | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, |
404 | BN_CTX *ctx); | 399 | BN_CTX *ctx); |
405 | #define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) | 400 | #define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) |
406 | int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); | 401 | int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); |
407 | int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); | 402 | int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); |
@@ -409,7 +404,7 @@ int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM * | |||
409 | int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); | 404 | int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); |
410 | int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); | 405 | int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); |
411 | int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 406 | int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, |
412 | const BIGNUM *m, BN_CTX *ctx); | 407 | const BIGNUM *m, BN_CTX *ctx); |
413 | int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | 408 | int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); |
414 | int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); | 409 | int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); |
415 | int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); | 410 | int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); |
@@ -429,23 +424,23 @@ void BN_free(BIGNUM *a); | |||
429 | int BN_is_bit_set(const BIGNUM *a, int n); | 424 | int BN_is_bit_set(const BIGNUM *a, int n); |
430 | int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); | 425 | int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); |
431 | int BN_lshift1(BIGNUM *r, const BIGNUM *a); | 426 | int BN_lshift1(BIGNUM *r, const BIGNUM *a); |
432 | int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx); | 427 | int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); |
433 | 428 | ||
434 | int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 429 | int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
435 | const BIGNUM *m,BN_CTX *ctx); | 430 | const BIGNUM *m, BN_CTX *ctx); |
436 | int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 431 | int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
437 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 432 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
438 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | 433 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, |
439 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); | 434 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); |
440 | int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, | 435 | int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, |
441 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 436 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
442 | int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, | 437 | int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, |
443 | const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m, | 438 | const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, |
444 | BN_CTX *ctx,BN_MONT_CTX *m_ctx); | 439 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
445 | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 440 | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
446 | const BIGNUM *m,BN_CTX *ctx); | 441 | const BIGNUM *m, BN_CTX *ctx); |
447 | 442 | ||
448 | int BN_mask_bits(BIGNUM *a,int n); | 443 | int BN_mask_bits(BIGNUM *a, int n); |
449 | #ifndef OPENSSL_NO_FP_API | 444 | #ifndef OPENSSL_NO_FP_API |
450 | int BN_print_fp(FILE *fp, const BIGNUM *a); | 445 | int BN_print_fp(FILE *fp, const BIGNUM *a); |
451 | #endif | 446 | #endif |
@@ -467,59 +462,59 @@ char * BN_bn2dec(const BIGNUM *a); | |||
467 | int BN_hex2bn(BIGNUM **a, const char *str); | 462 | int BN_hex2bn(BIGNUM **a, const char *str); |
468 | int BN_dec2bn(BIGNUM **a, const char *str); | 463 | int BN_dec2bn(BIGNUM **a, const char *str); |
469 | int BN_asc2bn(BIGNUM **a, const char *str); | 464 | int BN_asc2bn(BIGNUM **a, const char *str); |
470 | int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); | 465 | int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
471 | int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ | 466 | int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ |
472 | BIGNUM *BN_mod_inverse(BIGNUM *ret, | 467 | BIGNUM *BN_mod_inverse(BIGNUM *ret, |
473 | const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); | 468 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); |
474 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, | 469 | BIGNUM *BN_mod_sqrt(BIGNUM *ret, |
475 | const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); | 470 | const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); |
476 | 471 | ||
477 | void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); | 472 | void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); |
478 | 473 | ||
479 | /* Deprecated versions */ | 474 | /* Deprecated versions */ |
480 | #ifndef OPENSSL_NO_DEPRECATED | 475 | #ifndef OPENSSL_NO_DEPRECATED |
481 | BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, | 476 | BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, |
482 | const BIGNUM *add, const BIGNUM *rem, | 477 | const BIGNUM *add, const BIGNUM *rem, |
483 | void (*callback)(int,int,void *),void *cb_arg); | 478 | void (*callback)(int, int, void *), void *cb_arg); |
484 | int BN_is_prime(const BIGNUM *p,int nchecks, | 479 | int BN_is_prime(const BIGNUM *p, int nchecks, |
485 | void (*callback)(int,int,void *), | 480 | void (*callback)(int, int, void *), |
486 | BN_CTX *ctx,void *cb_arg); | 481 | BN_CTX *ctx, void *cb_arg); |
487 | int BN_is_prime_fasttest(const BIGNUM *p,int nchecks, | 482 | int BN_is_prime_fasttest(const BIGNUM *p, int nchecks, |
488 | void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, | 483 | void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg, |
489 | int do_trial_division); | 484 | int do_trial_division); |
490 | #endif /* !defined(OPENSSL_NO_DEPRECATED) */ | 485 | #endif /* !defined(OPENSSL_NO_DEPRECATED) */ |
491 | 486 | ||
492 | /* Newer versions */ | 487 | /* Newer versions */ |
493 | int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add, | 488 | int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, |
494 | const BIGNUM *rem, BN_GENCB *cb); | 489 | const BIGNUM *rem, BN_GENCB *cb); |
495 | int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb); | 490 | int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb); |
496 | int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, | 491 | int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, |
497 | int do_trial_division, BN_GENCB *cb); | 492 | int do_trial_division, BN_GENCB *cb); |
498 | 493 | ||
499 | int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); | 494 | int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); |
500 | 495 | ||
501 | int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, | 496 | int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, |
502 | const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, | 497 | const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, |
503 | const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); | 498 | const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); |
504 | int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, | 499 | int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, |
505 | BIGNUM *Xp1, BIGNUM *Xp2, | 500 | BIGNUM *Xp1, BIGNUM *Xp2, |
506 | const BIGNUM *Xp, | 501 | const BIGNUM *Xp, |
507 | const BIGNUM *e, BN_CTX *ctx, | 502 | const BIGNUM *e, BN_CTX *ctx, |
508 | BN_GENCB *cb); | 503 | BN_GENCB *cb); |
509 | 504 | ||
510 | BN_MONT_CTX *BN_MONT_CTX_new(void ); | 505 | BN_MONT_CTX *BN_MONT_CTX_new(void ); |
511 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); | 506 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); |
512 | int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, | 507 | int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, |
513 | BN_MONT_CTX *mont, BN_CTX *ctx); | 508 | BN_MONT_CTX *mont, BN_CTX *ctx); |
514 | #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ | 509 | #define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ |
515 | (r),(a),&((mont)->RR),(mont),(ctx)) | 510 | (r),(a),&((mont)->RR),(mont),(ctx)) |
516 | int BN_from_montgomery(BIGNUM *r,const BIGNUM *a, | 511 | int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, |
517 | BN_MONT_CTX *mont, BN_CTX *ctx); | 512 | BN_MONT_CTX *mont, BN_CTX *ctx); |
518 | void BN_MONT_CTX_free(BN_MONT_CTX *mont); | 513 | void BN_MONT_CTX_free(BN_MONT_CTX *mont); |
519 | int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); | 514 | int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); |
520 | BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); | 515 | BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); |
521 | BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, | 516 | BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, |
522 | const BIGNUM *mod, BN_CTX *ctx); | 517 | const BIGNUM *mod, BN_CTX *ctx); |
523 | 518 | ||
524 | /* BN_BLINDING flags */ | 519 | /* BN_BLINDING flags */ |
525 | #define BN_BLINDING_NO_UPDATE 0x00000001 | 520 | #define BN_BLINDING_NO_UPDATE 0x00000001 |
@@ -527,7 +522,7 @@ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, | |||
527 | 522 | ||
528 | BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); | 523 | BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); |
529 | void BN_BLINDING_free(BN_BLINDING *b); | 524 | void BN_BLINDING_free(BN_BLINDING *b); |
530 | int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx); | 525 | int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); |
531 | int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); | 526 | int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); |
532 | int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); | 527 | int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); |
533 | int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); | 528 | int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); |
@@ -540,30 +535,30 @@ CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); | |||
540 | unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); | 535 | unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); |
541 | void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); | 536 | void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); |
542 | BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, | 537 | BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, |
543 | const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, | 538 | const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, |
544 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 539 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
545 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), | 540 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), |
546 | BN_MONT_CTX *m_ctx); | 541 | BN_MONT_CTX *m_ctx); |
547 | 542 | ||
548 | #ifndef OPENSSL_NO_DEPRECATED | 543 | #ifndef OPENSSL_NO_DEPRECATED |
549 | void BN_set_params(int mul,int high,int low,int mont); | 544 | void BN_set_params(int mul, int high, int low, int mont); |
550 | int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ | 545 | int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ |
551 | #endif | 546 | #endif |
552 | 547 | ||
553 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); | 548 | void BN_RECP_CTX_init(BN_RECP_CTX *recp); |
554 | BN_RECP_CTX *BN_RECP_CTX_new(void); | 549 | BN_RECP_CTX *BN_RECP_CTX_new(void); |
555 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); | 550 | void BN_RECP_CTX_free(BN_RECP_CTX *recp); |
556 | int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx); | 551 | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); |
557 | int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, | 552 | int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, |
558 | BN_RECP_CTX *recp,BN_CTX *ctx); | 553 | BN_RECP_CTX *recp, BN_CTX *ctx); |
559 | int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 554 | int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
560 | const BIGNUM *m, BN_CTX *ctx); | 555 | const BIGNUM *m, BN_CTX *ctx); |
561 | int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, | 556 | int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, |
562 | BN_RECP_CTX *recp, BN_CTX *ctx); | 557 | BN_RECP_CTX *recp, BN_CTX *ctx); |
563 | 558 | ||
564 | #ifndef OPENSSL_NO_EC2M | 559 | #ifndef OPENSSL_NO_EC2M |
565 | 560 | ||
566 | /* Functions for arithmetic over binary polynomials represented by BIGNUMs. | 561 | /* Functions for arithmetic over binary polynomials represented by BIGNUMs. |
567 | * | 562 | * |
568 | * The BIGNUM::neg property of BIGNUMs representing binary polynomials is | 563 | * The BIGNUM::neg property of BIGNUMs representing binary polynomials is |
569 | * ignored. | 564 | * ignored. |
@@ -575,17 +570,23 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, | |||
575 | int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/ | 570 | int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/ |
576 | #define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) | 571 | #define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) |
577 | int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/ | 572 | int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/ |
578 | int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 573 | int |
574 | BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | ||
579 | const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */ | 575 | const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */ |
580 | int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 576 | int |
577 | BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
581 | BN_CTX *ctx); /* r = (a * a) mod p */ | 578 | BN_CTX *ctx); /* r = (a * a) mod p */ |
582 | int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, | 579 | int |
580 | BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, | ||
583 | BN_CTX *ctx); /* r = (1 / b) mod p */ | 581 | BN_CTX *ctx); /* r = (1 / b) mod p */ |
584 | int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 582 | int |
583 | BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | ||
585 | const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */ | 584 | const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */ |
586 | int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 585 | int |
586 | BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | ||
587 | const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */ | 587 | const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */ |
588 | int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 588 | int |
589 | BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
589 | BN_CTX *ctx); /* r = sqrt(a) mod p */ | 590 | BN_CTX *ctx); /* r = sqrt(a) mod p */ |
590 | int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | 591 | int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
591 | BN_CTX *ctx); /* r^2 + r = a mod p */ | 592 | BN_CTX *ctx); /* r^2 + r = a mod p */ |
@@ -596,12 +597,12 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | |||
596 | * where m = p[0] > p[1] > ... > p[k] = 0. | 597 | * where m = p[0] > p[1] > ... > p[k] = 0. |
597 | */ | 598 | */ |
598 | int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]); | 599 | int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]); |
599 | /* r = a mod p */ | 600 | /* r = a mod p */ |
600 | int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 601 | int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, |
601 | const int p[], BN_CTX *ctx); /* r = (a * b) mod p */ | 602 | const int p[], BN_CTX *ctx); /* r = (a * b) mod p */ |
602 | int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], | 603 | int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], |
603 | BN_CTX *ctx); /* r = (a * a) mod p */ | 604 | BN_CTX *ctx); /* r = (a * a) mod p */ |
604 | int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[], | 605 | int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[], |
605 | BN_CTX *ctx); /* r = (1 / b) mod p */ | 606 | BN_CTX *ctx); /* r = (1 / b) mod p */ |
606 | int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, | 607 | int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, |
607 | const int p[], BN_CTX *ctx); /* r = (a / b) mod p */ | 608 | const int p[], BN_CTX *ctx); /* r = (a / b) mod p */ |
@@ -616,7 +617,7 @@ int BN_GF2m_arr2poly(const int p[], BIGNUM *a); | |||
616 | 617 | ||
617 | #endif | 618 | #endif |
618 | 619 | ||
619 | /* faster mod functions for the 'NIST primes' | 620 | /* faster mod functions for the 'NIST primes' |
620 | * 0 <= a < p^2 */ | 621 | * 0 <= a < p^2 */ |
621 | int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); | 622 | int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); |
622 | int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); | 623 | int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); |
@@ -676,7 +677,7 @@ BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */ | |||
676 | #ifdef BN_DEBUG_RAND | 677 | #ifdef BN_DEBUG_RAND |
677 | /* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ | 678 | /* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ |
678 | #ifndef RAND_pseudo_bytes | 679 | #ifndef RAND_pseudo_bytes |
679 | int RAND_pseudo_bytes(unsigned char *buf,int num); | 680 | int RAND_pseudo_bytes(unsigned char *buf, int num); |
680 | #define BN_DEBUG_TRIX | 681 | #define BN_DEBUG_TRIX |
681 | #endif | 682 | #endif |
682 | #define bn_pollute(a) \ | 683 | #define bn_pollute(a) \ |
@@ -742,12 +743,12 @@ int RAND_pseudo_bytes(unsigned char *buf,int num); | |||
742 | bn_pollute(a); \ | 743 | bn_pollute(a); \ |
743 | } | 744 | } |
744 | 745 | ||
745 | BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); | 746 | BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); |
746 | BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); | 747 | BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); |
747 | void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); | 748 | void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); |
748 | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d); | 749 | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d); |
749 | BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); | 750 | BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, int num); |
750 | BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); | 751 | BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, int num); |
751 | 752 | ||
752 | /* Primes from RFC 2409 */ | 753 | /* Primes from RFC 2409 */ |
753 | BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); | 754 | BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); |
@@ -761,7 +762,7 @@ BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); | |||
761 | BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); | 762 | BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); |
762 | BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); | 763 | BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); |
763 | 764 | ||
764 | int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom); | 765 | int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); |
765 | 766 | ||
766 | /* BEGIN ERROR CODES */ | 767 | /* BEGIN ERROR CODES */ |
767 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 768 | /* The following lines are auto generated by the script mkerr.pl. Any changes |