A super trimmed down TLS stack, GPL licensed

Dependents:   MiniTLS-HTTPS-Example

MiniTLS - A super trimmed down TLS/SSL Library for embedded devices Author: Donatien Garnier Copyright (C) 2013-2014 AppNearMe Ltd

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Committer:
MiniTLS
Date:
Fri Jun 06 10:49:02 2014 +0000
Revision:
0:35aa5be3b78d
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MiniTLS 0:35aa5be3b78d 1 #define TFM_DEFINES
MiniTLS 0:35aa5be3b78d 2 #include "fp_mul_comba.c"
MiniTLS 0:35aa5be3b78d 3
MiniTLS 0:35aa5be3b78d 4 #ifdef TFM_MUL3
MiniTLS 0:35aa5be3b78d 5 void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C)
MiniTLS 0:35aa5be3b78d 6 {
MiniTLS 0:35aa5be3b78d 7 fp_digit c0, c1, c2, at[6];
MiniTLS 0:35aa5be3b78d 8
MiniTLS 0:35aa5be3b78d 9 memcpy(at, A->dp, 3 * sizeof(fp_digit));
MiniTLS 0:35aa5be3b78d 10 memcpy(at+3, B->dp, 3 * sizeof(fp_digit));
MiniTLS 0:35aa5be3b78d 11 COMBA_START;
MiniTLS 0:35aa5be3b78d 12
MiniTLS 0:35aa5be3b78d 13 COMBA_CLEAR;
MiniTLS 0:35aa5be3b78d 14 /* 0 */
MiniTLS 0:35aa5be3b78d 15 MULADD(at[0], at[3]);
MiniTLS 0:35aa5be3b78d 16 COMBA_STORE(C->dp[0]);
MiniTLS 0:35aa5be3b78d 17 /* 1 */
MiniTLS 0:35aa5be3b78d 18 COMBA_FORWARD;
MiniTLS 0:35aa5be3b78d 19 MULADD(at[0], at[4]); MULADD(at[1], at[3]);
MiniTLS 0:35aa5be3b78d 20 COMBA_STORE(C->dp[1]);
MiniTLS 0:35aa5be3b78d 21 /* 2 */
MiniTLS 0:35aa5be3b78d 22 COMBA_FORWARD;
MiniTLS 0:35aa5be3b78d 23 MULADD(at[0], at[5]); MULADD(at[1], at[4]); MULADD(at[2], at[3]);
MiniTLS 0:35aa5be3b78d 24 COMBA_STORE(C->dp[2]);
MiniTLS 0:35aa5be3b78d 25 /* 3 */
MiniTLS 0:35aa5be3b78d 26 COMBA_FORWARD;
MiniTLS 0:35aa5be3b78d 27 MULADD(at[1], at[5]); MULADD(at[2], at[4]);
MiniTLS 0:35aa5be3b78d 28 COMBA_STORE(C->dp[3]);
MiniTLS 0:35aa5be3b78d 29 /* 4 */
MiniTLS 0:35aa5be3b78d 30 COMBA_FORWARD;
MiniTLS 0:35aa5be3b78d 31 MULADD(at[2], at[5]);
MiniTLS 0:35aa5be3b78d 32 COMBA_STORE(C->dp[4]);
MiniTLS 0:35aa5be3b78d 33 COMBA_STORE2(C->dp[5]);
MiniTLS 0:35aa5be3b78d 34 C->used = 6;
MiniTLS 0:35aa5be3b78d 35 C->sign = A->sign ^ B->sign;
MiniTLS 0:35aa5be3b78d 36 fp_clamp(C);
MiniTLS 0:35aa5be3b78d 37 COMBA_FINI;
MiniTLS 0:35aa5be3b78d 38 }
MiniTLS 0:35aa5be3b78d 39 #endif