change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
math/sqr/fp_sqr_comba_4.c@0:35aa5be3b78d, 2014-06-06 (annotated)
- Committer:
- MiniTLS
- Date:
- Fri Jun 06 10:49:02 2014 +0000
- Revision:
- 0:35aa5be3b78d
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 0:35aa5be3b78d | 1 | #define TFM_DEFINES |
MiniTLS | 0:35aa5be3b78d | 2 | #include "fp_sqr_comba.c" |
MiniTLS | 0:35aa5be3b78d | 3 | |
MiniTLS | 0:35aa5be3b78d | 4 | #ifdef TFM_SQR4 |
MiniTLS | 0:35aa5be3b78d | 5 | void fp_sqr_comba4(fp_int *A, fp_int *B) |
MiniTLS | 0:35aa5be3b78d | 6 | { |
MiniTLS | 0:35aa5be3b78d | 7 | fp_digit *a, b[8], c0, c1, c2, sc0, sc1, sc2; |
MiniTLS | 0:35aa5be3b78d | 8 | #ifdef TFM_ISO |
MiniTLS | 0:35aa5be3b78d | 9 | fp_word tt; |
MiniTLS | 0:35aa5be3b78d | 10 | #endif |
MiniTLS | 0:35aa5be3b78d | 11 | |
MiniTLS | 0:35aa5be3b78d | 12 | a = A->dp; |
MiniTLS | 0:35aa5be3b78d | 13 | COMBA_START; |
MiniTLS | 0:35aa5be3b78d | 14 | |
MiniTLS | 0:35aa5be3b78d | 15 | /* clear carries */ |
MiniTLS | 0:35aa5be3b78d | 16 | CLEAR_CARRY; |
MiniTLS | 0:35aa5be3b78d | 17 | |
MiniTLS | 0:35aa5be3b78d | 18 | /* output 0 */ |
MiniTLS | 0:35aa5be3b78d | 19 | SQRADD(a[0],a[0]); |
MiniTLS | 0:35aa5be3b78d | 20 | COMBA_STORE(b[0]); |
MiniTLS | 0:35aa5be3b78d | 21 | |
MiniTLS | 0:35aa5be3b78d | 22 | /* output 1 */ |
MiniTLS | 0:35aa5be3b78d | 23 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 24 | SQRADD2(a[0], a[1]); |
MiniTLS | 0:35aa5be3b78d | 25 | COMBA_STORE(b[1]); |
MiniTLS | 0:35aa5be3b78d | 26 | |
MiniTLS | 0:35aa5be3b78d | 27 | /* output 2 */ |
MiniTLS | 0:35aa5be3b78d | 28 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 29 | SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); |
MiniTLS | 0:35aa5be3b78d | 30 | COMBA_STORE(b[2]); |
MiniTLS | 0:35aa5be3b78d | 31 | |
MiniTLS | 0:35aa5be3b78d | 32 | /* output 3 */ |
MiniTLS | 0:35aa5be3b78d | 33 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 34 | SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); |
MiniTLS | 0:35aa5be3b78d | 35 | COMBA_STORE(b[3]); |
MiniTLS | 0:35aa5be3b78d | 36 | |
MiniTLS | 0:35aa5be3b78d | 37 | /* output 4 */ |
MiniTLS | 0:35aa5be3b78d | 38 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 39 | SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); |
MiniTLS | 0:35aa5be3b78d | 40 | COMBA_STORE(b[4]); |
MiniTLS | 0:35aa5be3b78d | 41 | |
MiniTLS | 0:35aa5be3b78d | 42 | /* output 5 */ |
MiniTLS | 0:35aa5be3b78d | 43 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 44 | SQRADD2(a[2], a[3]); |
MiniTLS | 0:35aa5be3b78d | 45 | COMBA_STORE(b[5]); |
MiniTLS | 0:35aa5be3b78d | 46 | |
MiniTLS | 0:35aa5be3b78d | 47 | /* output 6 */ |
MiniTLS | 0:35aa5be3b78d | 48 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 49 | SQRADD(a[3], a[3]); |
MiniTLS | 0:35aa5be3b78d | 50 | COMBA_STORE(b[6]); |
MiniTLS | 0:35aa5be3b78d | 51 | COMBA_STORE2(b[7]); |
MiniTLS | 0:35aa5be3b78d | 52 | COMBA_FINI; |
MiniTLS | 0:35aa5be3b78d | 53 | |
MiniTLS | 0:35aa5be3b78d | 54 | B->used = 8; |
MiniTLS | 0:35aa5be3b78d | 55 | B->sign = FP_ZPOS; |
MiniTLS | 0:35aa5be3b78d | 56 | memcpy(B->dp, b, 8 * sizeof(fp_digit)); |
MiniTLS | 0:35aa5be3b78d | 57 | fp_clamp(B); |
MiniTLS | 0:35aa5be3b78d | 58 | } |
MiniTLS | 0:35aa5be3b78d | 59 | #endif |
MiniTLS | 0:35aa5be3b78d | 60 | |
MiniTLS | 0:35aa5be3b78d | 61 | |
MiniTLS | 0:35aa5be3b78d | 62 | /* $Source: /cvs/libtom/tomsfastmath/src/sqr/fp_sqr_comba_4.c,v $ */ |
MiniTLS | 0:35aa5be3b78d | 63 | /* $Revision: 1.2 $ */ |
MiniTLS | 0:35aa5be3b78d | 64 | /* $Date: 2007/02/17 03:39:01 $ */ |