diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lcl.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn_lcl.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bn/bn_lcl.h b/src/lib/libcrypto/bn/bn_lcl.h index 9c959921b4..8a4dba375a 100644 --- a/src/lib/libcrypto/bn/bn_lcl.h +++ b/src/lib/libcrypto/bn/bn_lcl.h | |||
@@ -119,6 +119,20 @@ extern "C" { | |||
119 | #endif | 119 | #endif |
120 | 120 | ||
121 | 121 | ||
122 | /* Used for temp variables */ | ||
123 | #define BN_CTX_NUM 32 | ||
124 | #define BN_CTX_NUM_POS 12 | ||
125 | struct bignum_ctx | ||
126 | { | ||
127 | int tos; | ||
128 | BIGNUM bn[BN_CTX_NUM]; | ||
129 | int flags; | ||
130 | int depth; | ||
131 | int pos[BN_CTX_NUM_POS]; | ||
132 | int too_many; | ||
133 | } /* BN_CTX */; | ||
134 | |||
135 | |||
122 | /* | 136 | /* |
123 | * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions | 137 | * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions |
124 | * | 138 | * |
@@ -171,7 +185,7 @@ extern "C" { | |||
171 | #define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ | 185 | #define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ |
172 | #define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ | 186 | #define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ |
173 | 187 | ||
174 | #if !defined(NO_ASM) && !defined(NO_INLINE_ASM) && !defined(PEDANTIC) | 188 | #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) |
175 | /* | 189 | /* |
176 | * BN_UMULT_HIGH section. | 190 | * BN_UMULT_HIGH section. |
177 | * | 191 | * |
@@ -217,7 +231,7 @@ extern "C" { | |||
217 | ret; }) | 231 | ret; }) |
218 | # endif /* compiler */ | 232 | # endif /* compiler */ |
219 | # endif /* cpu */ | 233 | # endif /* cpu */ |
220 | #endif /* NO_ASM */ | 234 | #endif /* OPENSSL_NO_ASM */ |
221 | 235 | ||
222 | /************************************************************* | 236 | /************************************************************* |
223 | * Using the long long type | 237 | * Using the long long type |
@@ -398,19 +412,26 @@ extern "C" { | |||
398 | void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb); | 412 | void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb); |
399 | void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); | 413 | void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); |
400 | void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); | 414 | void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); |
401 | void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp); | 415 | void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp); |
402 | void bn_sqr_comba8(BN_ULONG *r,BN_ULONG *a); | 416 | void bn_sqr_comba8(BN_ULONG *r,const BN_ULONG *a); |
403 | void bn_sqr_comba4(BN_ULONG *r,BN_ULONG *a); | 417 | void bn_sqr_comba4(BN_ULONG *r,const BN_ULONG *a); |
404 | int bn_cmp_words(BN_ULONG *a,BN_ULONG *b,int n); | 418 | int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n); |
405 | void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,BN_ULONG *t); | 419 | int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, |
420 | int cl, int dl); | ||
421 | void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, | ||
422 | int dna,int dnb,BN_ULONG *t); | ||
406 | void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, | 423 | void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, |
407 | int tn, int n,BN_ULONG *t); | 424 | int n,int tna,int tnb,BN_ULONG *t); |
408 | void bn_sqr_recursive(BN_ULONG *r,BN_ULONG *a, int n2, BN_ULONG *t); | 425 | void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t); |
409 | void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n); | 426 | void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n); |
410 | void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, | 427 | void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, |
411 | BN_ULONG *t); | 428 | BN_ULONG *t); |
412 | void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, | 429 | void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, |
413 | BN_ULONG *t); | 430 | BN_ULONG *t); |
431 | BN_ULONG bn_add_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
432 | int cl, int dl); | ||
433 | BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
434 | int cl, int dl); | ||
414 | 435 | ||
415 | #ifdef __cplusplus | 436 | #ifdef __cplusplus |
416 | } | 437 | } |