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_8.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_MUL8 |
MiniTLS | 0:35aa5be3b78d | 5 | void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C) |
MiniTLS | 0:35aa5be3b78d | 6 | { |
MiniTLS | 0:35aa5be3b78d | 7 | fp_digit c0, c1, c2, at[16]; |
MiniTLS | 0:35aa5be3b78d | 8 | |
MiniTLS | 0:35aa5be3b78d | 9 | memcpy(at, A->dp, 8 * sizeof(fp_digit)); |
MiniTLS | 0:35aa5be3b78d | 10 | memcpy(at+8, B->dp, 8 * 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[8]); |
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[9]); MULADD(at[1], at[8]); |
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[10]); MULADD(at[1], at[9]); MULADD(at[2], at[8]); |
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[0], at[11]); MULADD(at[1], at[10]); MULADD(at[2], at[9]); MULADD(at[3], at[8]); |
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[0], at[12]); MULADD(at[1], at[11]); MULADD(at[2], at[10]); MULADD(at[3], at[9]); MULADD(at[4], at[8]); |
MiniTLS | 0:35aa5be3b78d | 32 | COMBA_STORE(C->dp[4]); |
MiniTLS | 0:35aa5be3b78d | 33 | /* 5 */ |
MiniTLS | 0:35aa5be3b78d | 34 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 35 | MULADD(at[0], at[13]); MULADD(at[1], at[12]); MULADD(at[2], at[11]); MULADD(at[3], at[10]); MULADD(at[4], at[9]); MULADD(at[5], at[8]); |
MiniTLS | 0:35aa5be3b78d | 36 | COMBA_STORE(C->dp[5]); |
MiniTLS | 0:35aa5be3b78d | 37 | /* 6 */ |
MiniTLS | 0:35aa5be3b78d | 38 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 39 | MULADD(at[0], at[14]); MULADD(at[1], at[13]); MULADD(at[2], at[12]); MULADD(at[3], at[11]); MULADD(at[4], at[10]); MULADD(at[5], at[9]); MULADD(at[6], at[8]); |
MiniTLS | 0:35aa5be3b78d | 40 | COMBA_STORE(C->dp[6]); |
MiniTLS | 0:35aa5be3b78d | 41 | /* 7 */ |
MiniTLS | 0:35aa5be3b78d | 42 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 43 | MULADD(at[0], at[15]); MULADD(at[1], at[14]); MULADD(at[2], at[13]); MULADD(at[3], at[12]); MULADD(at[4], at[11]); MULADD(at[5], at[10]); MULADD(at[6], at[9]); MULADD(at[7], at[8]); |
MiniTLS | 0:35aa5be3b78d | 44 | COMBA_STORE(C->dp[7]); |
MiniTLS | 0:35aa5be3b78d | 45 | /* 8 */ |
MiniTLS | 0:35aa5be3b78d | 46 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 47 | MULADD(at[1], at[15]); MULADD(at[2], at[14]); MULADD(at[3], at[13]); MULADD(at[4], at[12]); MULADD(at[5], at[11]); MULADD(at[6], at[10]); MULADD(at[7], at[9]); |
MiniTLS | 0:35aa5be3b78d | 48 | COMBA_STORE(C->dp[8]); |
MiniTLS | 0:35aa5be3b78d | 49 | /* 9 */ |
MiniTLS | 0:35aa5be3b78d | 50 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 51 | MULADD(at[2], at[15]); MULADD(at[3], at[14]); MULADD(at[4], at[13]); MULADD(at[5], at[12]); MULADD(at[6], at[11]); MULADD(at[7], at[10]); |
MiniTLS | 0:35aa5be3b78d | 52 | COMBA_STORE(C->dp[9]); |
MiniTLS | 0:35aa5be3b78d | 53 | /* 10 */ |
MiniTLS | 0:35aa5be3b78d | 54 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 55 | MULADD(at[3], at[15]); MULADD(at[4], at[14]); MULADD(at[5], at[13]); MULADD(at[6], at[12]); MULADD(at[7], at[11]); |
MiniTLS | 0:35aa5be3b78d | 56 | COMBA_STORE(C->dp[10]); |
MiniTLS | 0:35aa5be3b78d | 57 | /* 11 */ |
MiniTLS | 0:35aa5be3b78d | 58 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 59 | MULADD(at[4], at[15]); MULADD(at[5], at[14]); MULADD(at[6], at[13]); MULADD(at[7], at[12]); |
MiniTLS | 0:35aa5be3b78d | 60 | COMBA_STORE(C->dp[11]); |
MiniTLS | 0:35aa5be3b78d | 61 | /* 12 */ |
MiniTLS | 0:35aa5be3b78d | 62 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 63 | MULADD(at[5], at[15]); MULADD(at[6], at[14]); MULADD(at[7], at[13]); |
MiniTLS | 0:35aa5be3b78d | 64 | COMBA_STORE(C->dp[12]); |
MiniTLS | 0:35aa5be3b78d | 65 | /* 13 */ |
MiniTLS | 0:35aa5be3b78d | 66 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 67 | MULADD(at[6], at[15]); MULADD(at[7], at[14]); |
MiniTLS | 0:35aa5be3b78d | 68 | COMBA_STORE(C->dp[13]); |
MiniTLS | 0:35aa5be3b78d | 69 | /* 14 */ |
MiniTLS | 0:35aa5be3b78d | 70 | COMBA_FORWARD; |
MiniTLS | 0:35aa5be3b78d | 71 | MULADD(at[7], at[15]); |
MiniTLS | 0:35aa5be3b78d | 72 | COMBA_STORE(C->dp[14]); |
MiniTLS | 0:35aa5be3b78d | 73 | COMBA_STORE2(C->dp[15]); |
MiniTLS | 0:35aa5be3b78d | 74 | C->used = 16; |
MiniTLS | 0:35aa5be3b78d | 75 | C->sign = A->sign ^ B->sign; |
MiniTLS | 0:35aa5be3b78d | 76 | fp_clamp(C); |
MiniTLS | 0:35aa5be3b78d | 77 | COMBA_FINI; |
MiniTLS | 0:35aa5be3b78d | 78 | } |
MiniTLS | 0:35aa5be3b78d | 79 | #endif |