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_4.c
00001 #define TFM_DEFINES 00002 #include "fp_sqr_comba.c" 00003 00004 #ifdef TFM_SQR4 00005 void fp_sqr_comba4(fp_int *A, fp_int *B) 00006 { 00007 fp_digit *a, b[8], 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[1], a[3]); SQRADD(a[2], a[2]); 00040 COMBA_STORE(b[4]); 00041 00042 /* output 5 */ 00043 CARRY_FORWARD; 00044 SQRADD2(a[2], a[3]); 00045 COMBA_STORE(b[5]); 00046 00047 /* output 6 */ 00048 CARRY_FORWARD; 00049 SQRADD(a[3], a[3]); 00050 COMBA_STORE(b[6]); 00051 COMBA_STORE2(b[7]); 00052 COMBA_FINI; 00053 00054 B->used = 8; 00055 B->sign = FP_ZPOS; 00056 memcpy(B->dp, b, 8 * sizeof(fp_digit)); 00057 fp_clamp(B); 00058 } 00059 #endif 00060 00061 00062 /* $Source: /cvs/libtom/tomsfastmath/src/sqr/fp_sqr_comba_4.c,v $ */ 00063 /* $Revision: 1.2 $ */ 00064 /* $Date: 2007/02/17 03:39:01 $ */
Generated on Wed Jul 13 2022 00:22:54 by
1.7.2