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_9.c@5:95f70ebfe61f, 2015-02-06 (annotated)
- Committer:
- shiyilei
- Date:
- Fri Feb 06 06:17:33 2015 +0000
- Revision:
- 5:95f70ebfe61f
- Parent:
- 0:35aa5be3b78d
change some parameters in the library to meet the needs of httpbin.org
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_SQR9 |
MiniTLS | 0:35aa5be3b78d | 5 | void fp_sqr_comba9(fp_int *A, fp_int *B) |
MiniTLS | 0:35aa5be3b78d | 6 | { |
MiniTLS | 0:35aa5be3b78d | 7 | fp_digit *a, b[18], 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[0], a[4]); 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 | SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; |
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 | SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); |
MiniTLS | 0:35aa5be3b78d | 50 | COMBA_STORE(b[6]); |
MiniTLS | 0:35aa5be3b78d | 51 | |
MiniTLS | 0:35aa5be3b78d | 52 | /* output 7 */ |
MiniTLS | 0:35aa5be3b78d | 53 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 54 | SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; |
MiniTLS | 0:35aa5be3b78d | 55 | COMBA_STORE(b[7]); |
MiniTLS | 0:35aa5be3b78d | 56 | |
MiniTLS | 0:35aa5be3b78d | 57 | /* output 8 */ |
MiniTLS | 0:35aa5be3b78d | 58 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 59 | SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); |
MiniTLS | 0:35aa5be3b78d | 60 | COMBA_STORE(b[8]); |
MiniTLS | 0:35aa5be3b78d | 61 | |
MiniTLS | 0:35aa5be3b78d | 62 | /* output 9 */ |
MiniTLS | 0:35aa5be3b78d | 63 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 64 | SQRADDSC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; |
MiniTLS | 0:35aa5be3b78d | 65 | COMBA_STORE(b[9]); |
MiniTLS | 0:35aa5be3b78d | 66 | |
MiniTLS | 0:35aa5be3b78d | 67 | /* output 10 */ |
MiniTLS | 0:35aa5be3b78d | 68 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 69 | SQRADDSC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); |
MiniTLS | 0:35aa5be3b78d | 70 | COMBA_STORE(b[10]); |
MiniTLS | 0:35aa5be3b78d | 71 | |
MiniTLS | 0:35aa5be3b78d | 72 | /* output 11 */ |
MiniTLS | 0:35aa5be3b78d | 73 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 74 | SQRADDSC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; |
MiniTLS | 0:35aa5be3b78d | 75 | COMBA_STORE(b[11]); |
MiniTLS | 0:35aa5be3b78d | 76 | |
MiniTLS | 0:35aa5be3b78d | 77 | /* output 12 */ |
MiniTLS | 0:35aa5be3b78d | 78 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 79 | SQRADD2(a[4], a[8]); SQRADD2(a[5], a[7]); SQRADD(a[6], a[6]); |
MiniTLS | 0:35aa5be3b78d | 80 | COMBA_STORE(b[12]); |
MiniTLS | 0:35aa5be3b78d | 81 | |
MiniTLS | 0:35aa5be3b78d | 82 | /* output 13 */ |
MiniTLS | 0:35aa5be3b78d | 83 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 84 | SQRADD2(a[5], a[8]); SQRADD2(a[6], a[7]); |
MiniTLS | 0:35aa5be3b78d | 85 | COMBA_STORE(b[13]); |
MiniTLS | 0:35aa5be3b78d | 86 | |
MiniTLS | 0:35aa5be3b78d | 87 | /* output 14 */ |
MiniTLS | 0:35aa5be3b78d | 88 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 89 | SQRADD2(a[6], a[8]); SQRADD(a[7], a[7]); |
MiniTLS | 0:35aa5be3b78d | 90 | COMBA_STORE(b[14]); |
MiniTLS | 0:35aa5be3b78d | 91 | |
MiniTLS | 0:35aa5be3b78d | 92 | /* output 15 */ |
MiniTLS | 0:35aa5be3b78d | 93 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 94 | SQRADD2(a[7], a[8]); |
MiniTLS | 0:35aa5be3b78d | 95 | COMBA_STORE(b[15]); |
MiniTLS | 0:35aa5be3b78d | 96 | |
MiniTLS | 0:35aa5be3b78d | 97 | /* output 16 */ |
MiniTLS | 0:35aa5be3b78d | 98 | CARRY_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 99 | SQRADD(a[8], a[8]); |
MiniTLS | 0:35aa5be3b78d | 100 | COMBA_STORE(b[16]); |
MiniTLS | 0:35aa5be3b78d | 101 | COMBA_STORE2(b[17]); |
MiniTLS | 0:35aa5be3b78d | 102 | COMBA_FINI; |
MiniTLS | 0:35aa5be3b78d | 103 | |
MiniTLS | 0:35aa5be3b78d | 104 | B->used = 18; |
MiniTLS | 0:35aa5be3b78d | 105 | B->sign = FP_ZPOS; |
MiniTLS | 0:35aa5be3b78d | 106 | memcpy(B->dp, b, 18 * sizeof(fp_digit)); |
MiniTLS | 0:35aa5be3b78d | 107 | fp_clamp(B); |
MiniTLS | 0:35aa5be3b78d | 108 | } |
MiniTLS | 0:35aa5be3b78d | 109 | #endif |
MiniTLS | 0:35aa5be3b78d | 110 | |
MiniTLS | 0:35aa5be3b78d | 111 | |
MiniTLS | 0:35aa5be3b78d | 112 | /* $Source: /cvs/libtom/tomsfastmath/src/sqr/fp_sqr_comba_9.c,v $ */ |
MiniTLS | 0:35aa5be3b78d | 113 | /* $Revision: 1.2 $ */ |
MiniTLS | 0:35aa5be3b78d | 114 | /* $Date: 2007/02/17 03:39:01 $ */ |