Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MiniTLS-HTTPS-Example
fp_sqr_comba_7.c
00001 #define TFM_DEFINES 00002 #include "fp_sqr_comba.c" 00003 00004 #ifdef TFM_SQR7 00005 void fp_sqr_comba7(fp_int *A, fp_int *B) 00006 { 00007 fp_digit *a, b[14], c0, c1, c2, sc0, sc1, sc2; 00008 #ifdef TFM_ISO 00009 fp_word tt; 00010 #endif 00011 00012 a = A->dp; 00013 COMBA_START; 00014 00015 /* clear carries */ 00016 CLEAR_CARRY; 00017 00018 /* output 0 */ 00019 SQRADD(a[0],a[0]); 00020 COMBA_STORE(b[0]); 00021 00022 /* output 1 */ 00023 CARRY_FORWARD; 00024 SQRADD2(a[0], a[1]); 00025 COMBA_STORE(b[1]); 00026 00027 /* output 2 */ 00028 CARRY_FORWARD; 00029 SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 00030 COMBA_STORE(b[2]); 00031 00032 /* output 3 */ 00033 CARRY_FORWARD; 00034 SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 00035 COMBA_STORE(b[3]); 00036 00037 /* output 4 */ 00038 CARRY_FORWARD; 00039 SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 00040 COMBA_STORE(b[4]); 00041 00042 /* output 5 */ 00043 CARRY_FORWARD; 00044 SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 00045 COMBA_STORE(b[5]); 00046 00047 /* output 6 */ 00048 CARRY_FORWARD; 00049 SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 00050 COMBA_STORE(b[6]); 00051 00052 /* output 7 */ 00053 CARRY_FORWARD; 00054 SQRADDSC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 00055 COMBA_STORE(b[7]); 00056 00057 /* output 8 */ 00058 CARRY_FORWARD; 00059 SQRADD2(a[2], a[6]); SQRADD2(a[3], a[5]); SQRADD(a[4], a[4]); 00060 COMBA_STORE(b[8]); 00061 00062 /* output 9 */ 00063 CARRY_FORWARD; 00064 SQRADD2(a[3], a[6]); SQRADD2(a[4], a[5]); 00065 COMBA_STORE(b[9]); 00066 00067 /* output 10 */ 00068 CARRY_FORWARD; 00069 SQRADD2(a[4], a[6]); SQRADD(a[5], a[5]); 00070 COMBA_STORE(b[10]); 00071 00072 /* output 11 */ 00073 CARRY_FORWARD; 00074 SQRADD2(a[5], a[6]); 00075 COMBA_STORE(b[11]); 00076 00077 /* output 12 */ 00078 CARRY_FORWARD; 00079 SQRADD(a[6], a[6]); 00080 COMBA_STORE(b[12]); 00081 COMBA_STORE2(b[13]); 00082 COMBA_FINI; 00083 00084 B->used = 14; 00085 B->sign = FP_ZPOS; 00086 memcpy(B->dp, b, 14 * sizeof(fp_digit)); 00087 fp_clamp(B); 00088 } 00089 #endif 00090 00091 00092 /* $Source: /cvs/libtom/tomsfastmath/src/sqr/fp_sqr_comba_7.c,v $ */ 00093 /* $Revision: 1.2 $ */ 00094 /* $Date: 2007/02/17 03:39:01 $ */
Generated on Wed Jul 13 2022 00:22:54 by
1.7.2