Eneboo - Documentación para desarrolladores
|
#include "../bn_lcl.h"
'defines' | |
#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) |
Funciones | |
BN_ULONG | bn_mul_add_words (BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) |
BN_ULONG | bn_mul_words (BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) |
void | bn_sqr_words (BN_ULONG *r, const 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, const BN_ULONG *ap, const BN_ULONG *bp, int n) |
BN_ULONG | bn_sub_words (BN_ULONG *rp, const BN_ULONG *ap, const 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, const BN_ULONG *a) |
void | bn_sqr_comba4 (BN_ULONG *r, const BN_ULONG *a) |
#define BN_ULONG unsigned long |
#define mul | ( | r, | |
a, | |||
word, | |||
carry | |||
) |
#define mul_add | ( | r, | |
a, | |||
word, | |||
carry | |||
) |
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)
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)
#define sqr_add_c | ( | a, | |
i, | |||
c0, | |||
c1, | |||
c2 | |||
) |
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)
BN_ULONG bn_add_words | ( | BN_ULONG * | rp, |
const BN_ULONG * | ap, | ||
const BN_ULONG * | bp, | ||
int | n | ||
) |
BN_ULONG bn_div_words | ( | BN_ULONG | h, |
BN_ULONG | l, | ||
BN_ULONG | d | ||
) |
BN_ULONG bn_mul_add_words | ( | BN_ULONG * | rp, |
const BN_ULONG * | ap, | ||
int | num, | ||
BN_ULONG | w | ||
) |
void bn_mul_comba4 | ( | BN_ULONG * | r, |
BN_ULONG * | a, | ||
BN_ULONG * | b | ||
) |
void bn_mul_comba8 | ( | BN_ULONG * | r, |
BN_ULONG * | a, | ||
BN_ULONG * | b | ||
) |
BN_ULONG bn_mul_words | ( | BN_ULONG * | rp, |
const BN_ULONG * | ap, | ||
int | num, | ||
BN_ULONG | w | ||
) |
void bn_sqr_comba4 | ( | BN_ULONG * | r, |
const BN_ULONG * | a | ||
) |
void bn_sqr_comba8 | ( | BN_ULONG * | r, |
const BN_ULONG * | a | ||
) |
void bn_sqr_words | ( | BN_ULONG * | r, |
const BN_ULONG * | a, | ||
int | n | ||
) |
BN_ULONG bn_sub_words | ( | BN_ULONG * | rp, |
const BN_ULONG * | ap, | ||
const BN_ULONG * | bp, | ||
int | n | ||
) |