OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
bn_lcl.h File Reference
#include <openssl/bn.h>

Go to the source code of this file.

Macros

#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)
 

Functions

void bn_mul_normal (BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
 
void bn_mul_comba8 (BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
 
void 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 bn_sqr_comba8 (BN_ULONG *r, const BN_ULONG *a)
 
void 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)
 
int bn_mul_mont (BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num)
 

Macro Definition Documentation

#define bn_clear_top2max (   a)

Definition at line 314 of file bn_lcl.h.

#define BN_MAX_WINDOW_BITS_FOR_CTIME_EXPONENT_SIZE   (6)

Definition at line 192 of file bn_lcl.h.

#define BN_MONT_CTX_SET_SIZE_WORD   (64) /* 32 */

Definition at line 211 of file bn_lcl.h.

#define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL   (32) /* 32 */

Definition at line 210 of file bn_lcl.h.

#define BN_MUL_RECURSIVE_SIZE_NORMAL   (16) /* 32 less than */

Definition at line 208 of file bn_lcl.h.

#define BN_MULL_SIZE_NORMAL   (16) /* 32 */

Definition at line 207 of file bn_lcl.h.

#define BN_SQR_RECURSIVE_SIZE_NORMAL   (16) /* 32 */

Definition at line 209 of file bn_lcl.h.

#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 187 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 148 of file bn_lcl.h.

#define HBITS (   a)    (((a)>>BN_BITS4)&BN_MASK2l)

Definition at line 402 of file bn_lcl.h.

#define Hw (   t)    (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2)

Definition at line 303 of file bn_lcl.h.

#define L2HBITS (   a)    (((a)<<BN_BITS4)&BN_MASK2)

Definition at line 403 of file bn_lcl.h.

#define LBITS (   a)    ((a)&BN_MASK2l)

Definition at line 401 of file bn_lcl.h.

#define LHBITS (   a)    (((a)>>BN_BITS2)&BN_MASKl)

Definition at line 406 of file bn_lcl.h.

#define LL2HBITS (   a)    ((BN_ULLONG)((a)&BN_MASKl)<<BN_BITS2)

Definition at line 407 of file bn_lcl.h.

#define LLBITS (   a)    ((a)&BN_MASKl)

Definition at line 405 of file bn_lcl.h.

#define Lw (   t)    (((BN_ULONG)(t))&BN_MASK2)

Definition at line 302 of file bn_lcl.h.

#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK   (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)

Definition at line 171 of file bn_lcl.h.

#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH   ( 64 )

Definition at line 170 of file bn_lcl.h.

#define mul (   r,
  a,
  bl,
  bh,
  c 
)
Value:
{ \
BN_ULONG l,h; \
\
h= (a); \
l=LBITS(h); \
h=HBITS(h); \
mul64(l,h,(bl),(bh)); \
\
/* non-multiply part */ \
l+=(c); if ((l&BN_MASK2) < (c)) h++; \
(c)=h&BN_MASK2; \
(r)=l&BN_MASK2; \
}

Definition at line 460 of file bn_lcl.h.

#define mul64 (   l,
  h,
  bl,
  bh 
)
Value:
{ \
BN_ULONG m,m1,lt,ht; \
\
lt=l; \
ht=h; \
m =(bh)*(lt); \
lt=(bl)*(lt); \
m1=(bl)*(ht); \
ht =(bh)*(ht); \
m=(m+m1)&BN_MASK2; if (m < m1) ht+=L2HBITS((BN_ULONG)1); \
ht+=HBITS(m); \
m1=L2HBITS(m); \
lt=(lt+m1)&BN_MASK2; if (lt < m1) ht++; \
(l)=lt; \
(h)=ht; \
}

Definition at line 409 of file bn_lcl.h.

#define mul_add (   r,
  a,
  bl,
  bh,
  c 
)
Value:
{ \
BN_ULONG l,h; \
\
h= (a); \
l=LBITS(h); \
h=HBITS(h); \
mul64(l,h,(bl),(bh)); \
\
/* non-multiply part */ \
l=(l+(c))&BN_MASK2; if (l < (c)) h++; \
(c)=(r); \
l=(l+(c))&BN_MASK2; if (l < (c)) h++; \
(c)=h&BN_MASK2; \
(r)=l; \
}

Definition at line 444 of file bn_lcl.h.

#define sqr64 (   lo,
  ho,
  in 
)
Value:
{ \
BN_ULONG l,h,m; \
\
h=(in); \
l=LBITS(h); \
h=HBITS(h); \
m =(l)*(h); \
l*=l; \
h*=h; \
h+=(m&BN_MASK2h1)>>(BN_BITS4-1); \
m =(m&BN_MASK2l)<<(BN_BITS4+1); \
l=(l+m)&BN_MASK2; if (l < m) h++; \
(lo)=l; \
(ho)=h; \
}

Definition at line 427 of file bn_lcl.h.

Function Documentation

BN_ULONG bn_add_part_words ( BN_ULONG *  r,
const BN_ULONG *  a,
const BN_ULONG *  b,
int  cl,
int  dl 
)

Definition at line 207 of file bn_mul.c.

int bn_cmp_part_words ( const BN_ULONG *  a,
const BN_ULONG *  b,
int  cl,
int  dl 
)

Definition at line 803 of file bn_lib.c.

int bn_cmp_words ( const BN_ULONG *  a,
const BN_ULONG *  b,
int  n 
)

Definition at line 779 of file bn_lib.c.

void bn_mul_comba4 ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b 
)

Definition at line 963 of file bn_asm.c.

void bn_mul_comba8 ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b 
)

Definition at line 971 of file bn_asm.c.

void bn_mul_high ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b,
BN_ULONG *  l,
int  n2,
BN_ULONG *  t 
)
void bn_mul_low_normal ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b,
int  n 
)

Definition at line 1146 of file bn_mul.c.

void bn_mul_low_recursive ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b,
int  n2,
BN_ULONG *  t 
)
int bn_mul_mont ( BN_ULONG *  rp,
const BN_ULONG *  ap,
const BN_ULONG *  bp,
const BN_ULONG *  np,
const BN_ULONG *  n0,
int  num 
)

Definition at line 17 of file sparcv9cap.c.

void bn_mul_normal ( BN_ULONG *  r,
BN_ULONG *  a,
int  na,
BN_ULONG *  b,
int  nb 
)

Definition at line 1104 of file bn_mul.c.

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_mul_recursive ( BN_ULONG *  r,
BN_ULONG *  a,
BN_ULONG *  b,
int  n2,
int  dna,
int  dnb,
BN_ULONG *  t 
)
void bn_sqr_comba4 ( BN_ULONG *  r,
const BN_ULONG *  a 
)

Definition at line 950 of file bn_asm.c.

void bn_sqr_comba8 ( BN_ULONG *  r,
const BN_ULONG *  a 
)

Definition at line 957 of file bn_asm.c.

void bn_sqr_normal ( BN_ULONG *  r,
const BN_ULONG *  a,
int  n,
BN_ULONG *  tmp 
)

Definition at line 158 of file bn_sqr.c.

void bn_sqr_recursive ( BN_ULONG *  r,
const BN_ULONG *  a,
int  n2,
BN_ULONG *  t 
)
BN_ULONG bn_sub_part_words ( BN_ULONG *  r,
const BN_ULONG *  a,
const BN_ULONG *  b,
int  cl,
int  dl 
)

Definition at line 80 of file bn_mul.c.