#include "crypt/osconfig.h"
#include "bn/bn.h"
Go to the source code of this file.
|
#define | BN_window_bits_for_exponent_size(b) |
|
#define | MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH ( 64 ) |
|
#define | MOD_EXP_CTIME_MIN_CACHE_LINE_MASK (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1) |
|
#define | BN_window_bits_for_ctime_exponent_size(b) |
|
#define | BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (6) |
|
#define | BN_MULL_SIZE_NORMAL (16) /* 32 */ |
|
#define | BN_MUL_RECURSIVE_SIZE_NORMAL (16) /* 32 less than */ |
|
#define | BN_SQR_RECURSIVE_SIZE_NORMAL (16) /* 32 */ |
|
#define | BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ |
|
#define | BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ |
|
#define | Lw(t) (((BN_ULONG)(t))&BN_MASK2) |
|
#define | Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2) |
|
#define | bn_clear_top2max(a) |
|
#define | LBITS(a) ((a)&BN_MASK2l) |
|
#define | HBITS(a) (((a)>>BN_BITS4)&BN_MASK2l) |
|
#define | L2HBITS(a) (((a)<<BN_BITS4)&BN_MASK2) |
|
#define | LLBITS(a) ((a)&BN_MASKl) |
|
#define | LHBITS(a) (((a)>>BN_BITS2)&BN_MASKl) |
|
#define | LL2HBITS(a) ((BN_ULLONG)((a)&BN_MASKl)<<BN_BITS2) |
|
#define | mul64(l, h, bl, bh) |
|
#define | sqr64(lo, ho, in) |
|
#define | mul_add(r, a, bl, bh, c) |
|
#define | mul(r, a, bl, bh, c) |
|
|
void | bn_mul_normal (BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) |
|
void ASM_EXPORT | bn_mul_comba8 (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) |
|
void ASM_EXPORT | bn_mul_comba4 (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) |
|
void | bn_sqr_normal (BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) |
|
void ASM_EXPORT | bn_sqr_comba8 (BN_ULONG *r, const BN_ULONG *a) |
|
void ASM_EXPORT | bn_sqr_comba4 (BN_ULONG *r, const BN_ULONG *a) |
|
int | bn_cmp_words (const BN_ULONG *a, const BN_ULONG *b, int n) |
|
int | bn_cmp_part_words (const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) |
|
void | bn_mul_recursive (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, int dna, int dnb, BN_ULONG *t) |
|
void | bn_mul_part_recursive (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, int tna, int tnb, BN_ULONG *t) |
|
void | bn_sqr_recursive (BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t) |
|
void | bn_mul_low_normal (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) |
|
void | bn_mul_low_recursive (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, BN_ULONG *t) |
|
void | bn_mul_high (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2, BN_ULONG *t) |
|
BN_ULONG | bn_add_part_words (BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) |
|
BN_ULONG | bn_sub_part_words (BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) |
|
#define bn_clear_top2max |
( |
|
a | ) |
|
#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE (6) |
#define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ |
#define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ |
#define BN_MUL_RECURSIVE_SIZE_NORMAL (16) /* 32 less than */ |
#define BN_MULL_SIZE_NORMAL (16) /* 32 */ |
#define BN_SQR_RECURSIVE_SIZE_NORMAL (16) /* 32 */ |
#define BN_window_bits_for_ctime_exponent_size |
( |
|
b | ) |
|
Value:((b) > 937 ? 6 : \
(b) > 306 ? 5 : \
(b) > 89 ? 4 : \
(b) > 22 ? 3 : 1)
Definition at line 193 of file bn_lcl.h.
#define BN_window_bits_for_exponent_size |
( |
|
b | ) |
|
Value:((b) > 671 ? 6 : \
(b) > 239 ? 5 : \
(b) > 79 ? 4 : \
(b) > 23 ? 3 : 1)
Definition at line 154 of file bn_lcl.h.
#define LHBITS |
( |
|
a | ) |
(((a)>>BN_BITS2)&BN_MASKl) |
#define LL2HBITS |
( |
|
a | ) |
((BN_ULLONG)((a)&BN_MASKl)<<BN_BITS2) |
#define LLBITS |
( |
|
a | ) |
((a)&BN_MASKl) |
#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH ( 64 ) |
#define mul |
( |
|
r, |
|
|
|
a, |
|
|
|
bl, |
|
|
|
bh, |
|
|
|
c |
|
) |
| |
Value:{ \
BN_ULONG l,h; \
\
h= (a); \
mul64(l,h,(bl),(bh)); \
\
\
(c)=h&BN_MASK2; \
(r)=l&BN_MASK2; \
}
Definition at line 425 of file bn_lcl.h.
#define mul64 |
( |
|
l, |
|
|
|
h, |
|
|
|
bl, |
|
|
|
bh |
|
) |
| |
Value:{ \
\
lt=l; \
ht=h; \
m =(bh)*(lt); \
lt=(bl)*(lt); \
m1=(bl)*(ht); \
ht =(bh)*(ht); \
(l)=lt; \
(h)=ht; \
}
Definition at line 374 of file bn_lcl.h.
#define mul_add |
( |
|
r, |
|
|
|
a, |
|
|
|
bl, |
|
|
|
bh, |
|
|
|
c |
|
) |
| |
Value:{ \
BN_ULONG l,h; \
\
h= (a); \
mul64(l,h,(bl),(bh)); \
\
\
(c)=(r); \
(r)=l; \
}
Definition at line 409 of file bn_lcl.h.
#define sqr64 |
( |
|
lo, |
|
|
|
ho, |
|
|
|
in |
|
) |
| |
Value:{ \
BN_ULONG l,h,m; \
\
h=(in); \
m =(l)*(h); \
l*=l; \
h*=h; \
(lo)=l; \
(ho)=h; \
}
Definition at line 392 of file bn_lcl.h.