From 5ac03256db0fe4ca7e3ad1117d096c3a76368b76 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 9 Jan 2015 09:46:07 +0100 Subject: backported CyaSSL/OpenSSL support for internal webserver instead of MatrixSSL --- .../router/cyassl/ctaocrypt/src/fp_mul_comba_3.i | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 release/src/router/cyassl/ctaocrypt/src/fp_mul_comba_3.i (limited to 'release/src/router/cyassl/ctaocrypt/src/fp_mul_comba_3.i') diff --git a/release/src/router/cyassl/ctaocrypt/src/fp_mul_comba_3.i b/release/src/router/cyassl/ctaocrypt/src/fp_mul_comba_3.i new file mode 100644 index 00000000..7b1675d6 --- /dev/null +++ b/release/src/router/cyassl/ctaocrypt/src/fp_mul_comba_3.i @@ -0,0 +1,36 @@ +#ifdef TFM_MUL3 +void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C) +{ + fp_digit c0, c1, c2, at[6]; + + memcpy(at, A->dp, 3 * sizeof(fp_digit)); + memcpy(at+3, B->dp, 3 * sizeof(fp_digit)); + COMBA_START; + + COMBA_CLEAR; + /* 0 */ + MULADD(at[0], at[3]); + COMBA_STORE(C->dp[0]); + /* 1 */ + COMBA_FORWARD; + MULADD(at[0], at[4]); MULADD(at[1], at[3]); + COMBA_STORE(C->dp[1]); + /* 2 */ + COMBA_FORWARD; + MULADD(at[0], at[5]); MULADD(at[1], at[4]); MULADD(at[2], at[3]); + COMBA_STORE(C->dp[2]); + /* 3 */ + COMBA_FORWARD; + MULADD(at[1], at[5]); MULADD(at[2], at[4]); + COMBA_STORE(C->dp[3]); + /* 4 */ + COMBA_FORWARD; + MULADD(at[2], at[5]); + COMBA_STORE(C->dp[4]); + COMBA_STORE2(C->dp[5]); + C->used = 6; + C->sign = A->sign ^ B->sign; + fp_clamp(C); + COMBA_FINI; +} +#endif -- cgit v1.2.3-54-g00ecf