cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
Macros | Functions
x86_64-gcc.c File Reference

Go to the source code of this file.

Macros

#define BN_ULONG   unsigned long
 
#define mul_add(r, a, word, carry)
 
#define mul(r, a, word, carry)
 
#define sqr(r0, r1, a)
 
#define mul_add_c(a, b, c0, c1, c2)
 
#define sqr_add_c(a, i, c0, c1, c2)
 
#define mul_add_c2(a, b, c0, c1, c2)
 
#define sqr_add_c2(a, i, j, c0, c1, c2)   mul_add_c2((a)[i],(a)[j],c0,c1,c2)
 

Functions

BN_ULONG bn_mul_add_words (BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
 
BN_ULONG bn_mul_words (BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
 
void bn_sqr_words (BN_ULONG *r, BN_ULONG *a, int n)
 
BN_ULONG bn_div_words (BN_ULONG h, BN_ULONG l, BN_ULONG d)
 
BN_ULONG bn_add_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp, int n)
 
BN_ULONG bn_sub_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp, int n)
 
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_comba8 (BN_ULONG *r, BN_ULONG *a)
 
void bn_sqr_comba4 (BN_ULONG *r, BN_ULONG *a)
 

Macro Definition Documentation

#define BN_ULONG   unsigned long

Definition at line 54 of file x86_64-gcc.c.

#define mul (   r,
  a,
  word,
  carry 
)
Value:
do { \
register BN_ULONG high,low; \
asm ("mulq %3" \
: "=a"(low),"=d"(high) \
: "a"(word),"g"(a) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(carry),"+d"(high)\
: "a"(low),"g"(0) \
: "cc"); \
(r)=carry, carry=high; \
} while (0)

Definition at line 78 of file x86_64-gcc.c.

#define mul_add (   r,
  a,
  word,
  carry 
)
Value:
do { \
register BN_ULONG high,low; \
asm ("mulq %3" \
: "=a"(low),"=d"(high) \
: "a"(word),"m"(a) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(carry),"+d"(high)\
: "a"(low),"g"(0) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+m"(r),"+d"(high) \
: "r"(carry),"g"(0) \
: "cc"); \
carry=high; \
} while (0)

Definition at line 61 of file x86_64-gcc.c.

#define mul_add_c (   a,
  b,
  c0,
  c1,
  c2 
)
Value:
do { \
asm ("mulq %3" \
: "=a"(t1),"=d"(t2) \
: "a"(a),"m"(b) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c0),"+d"(t2) \
: "a"(t1),"g"(0) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c1),"+r"(c2) \
: "d"(t2),"g"(0) \
: "cc"); \
} while (0)

Definition at line 284 of file x86_64-gcc.c.

#define mul_add_c2 (   a,
  b,
  c0,
  c1,
  c2 
)
Value:
do { \
asm ("mulq %3" \
: "=a"(t1),"=d"(t2) \
: "a"(a),"m"(b) \
: "cc"); \
asm ("addq %0,%0; adcq %2,%1" \
: "+d"(t2),"+r"(c2) \
: "g"(0) \
: "cc"); \
asm ("addq %0,%0; adcq %2,%1" \
: "+a"(t1),"+d"(t2) \
: "g"(0) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c0),"+d"(t2) \
: "a"(t1),"g"(0) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c1),"+r"(c2) \
: "d"(t2),"g"(0) \
: "cc"); \
} while (0)

Definition at line 314 of file x86_64-gcc.c.

#define sqr (   r0,
  r1,
 
)
Value:
asm ("mulq %2" \
: "=a"(r0),"=d"(r1) \
: "a"(a) \
: "cc");

Definition at line 91 of file x86_64-gcc.c.

#define sqr_add_c (   a,
  i,
  c0,
  c1,
  c2 
)
Value:
do { \
asm ("mulq %2" \
: "=a"(t1),"=d"(t2) \
: "a"(a[i]) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c0),"+d"(t2) \
: "a"(t1),"g"(0) \
: "cc"); \
asm ("addq %2,%0; adcq %3,%1" \
: "+r"(c1),"+r"(c2) \
: "d"(t2),"g"(0) \
: "cc"); \
} while (0)

Definition at line 299 of file x86_64-gcc.c.

#define sqr_add_c2 (   a,
  i,
  j,
  c0,
  c1,
  c2 
)    mul_add_c2((a)[i],(a)[j],c0,c1,c2)

Definition at line 338 of file x86_64-gcc.c.

Function Documentation

BN_ULONG bn_add_words ( BN_ULONG rp,
BN_ULONG ap,
BN_ULONG bp,
int  n 
)

Definition at line 175 of file x86_64-gcc.c.

BN_ULONG bn_div_words ( BN_ULONG  h,
BN_ULONG  l,
BN_ULONG  d 
)

Definition at line 164 of file x86_64-gcc.c.

BN_ULONG bn_mul_add_words ( BN_ULONG rp,
BN_ULONG ap,
int  num,
BN_ULONG  w 
)

Definition at line 97 of file x86_64-gcc.c.

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

Definition at line 445 of file x86_64-gcc.c.

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

Definition at line 341 of file x86_64-gcc.c.

BN_ULONG bn_mul_words ( BN_ULONG rp,
BN_ULONG ap,
int  num,
BN_ULONG  w 
)

Definition at line 121 of file x86_64-gcc.c.

void bn_sqr_comba4 ( BN_ULONG r,
BN_ULONG a 
)

Definition at line 561 of file x86_64-gcc.c.

void bn_sqr_comba8 ( BN_ULONG r,
BN_ULONG a 
)

Definition at line 485 of file x86_64-gcc.c.

void bn_sqr_words ( BN_ULONG r,
BN_ULONG a,
int  n 
)

Definition at line 144 of file x86_64-gcc.c.

BN_ULONG bn_sub_words ( BN_ULONG rp,
BN_ULONG ap,
BN_ULONG bp,
int  n 
)

Definition at line 198 of file x86_64-gcc.c.