change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
math/mul/fp_mul_comba_3.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_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 |