summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lcl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lcl.h')
-rw-r--r--src/lib/libcrypto/bn/bn_lcl.h39
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
125struct 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" {
398void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb); 412void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb);
399void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); 413void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b);
400void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); 414void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b);
401void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp); 415void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp);
402void bn_sqr_comba8(BN_ULONG *r,BN_ULONG *a); 416void bn_sqr_comba8(BN_ULONG *r,const BN_ULONG *a);
403void bn_sqr_comba4(BN_ULONG *r,BN_ULONG *a); 417void bn_sqr_comba4(BN_ULONG *r,const BN_ULONG *a);
404int bn_cmp_words(BN_ULONG *a,BN_ULONG *b,int n); 418int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n);
405void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,BN_ULONG *t); 419int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
420 int cl, int dl);
421void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
422 int dna,int dnb,BN_ULONG *t);
406void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, 423void 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);
408void bn_sqr_recursive(BN_ULONG *r,BN_ULONG *a, int n2, BN_ULONG *t); 425void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t);
409void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n); 426void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n);
410void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2, 427void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
411 BN_ULONG *t); 428 BN_ULONG *t);
412void bn_mul_high(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,BN_ULONG *l,int n2, 429void 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);
431BN_ULONG bn_add_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
432 int cl, int dl);
433BN_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}