00-single-file-compile.patch (6964B)
1 diff --git a/src/sc.c b/src/sc.c 2 index ca5bad2..3d2ab56 100644 3 --- a/src/sc.c 4 +++ b/src/sc.c 5 @@ -1,7 +1,7 @@ 6 #include "fixedint.h" 7 #include "sc.h" 8 9 -static uint64_t load_3(const unsigned char *in) { 10 +static uint64_t sc_load_3(const unsigned char *in) { 11 uint64_t result; 12 13 result = (uint64_t) in[0]; 14 @@ -11,7 +11,7 @@ static uint64_t load_3(const unsigned char *in) { 15 return result; 16 } 17 18 -static uint64_t load_4(const unsigned char *in) { 19 +static uint64_t sc_load_4(const unsigned char *in) { 20 uint64_t result; 21 22 result = (uint64_t) in[0]; 23 @@ -33,30 +33,30 @@ Output: 24 */ 25 26 void sc_reduce(unsigned char *s) { 27 - int64_t s0 = 2097151 & load_3(s); 28 - int64_t s1 = 2097151 & (load_4(s + 2) >> 5); 29 - int64_t s2 = 2097151 & (load_3(s + 5) >> 2); 30 - int64_t s3 = 2097151 & (load_4(s + 7) >> 7); 31 - int64_t s4 = 2097151 & (load_4(s + 10) >> 4); 32 - int64_t s5 = 2097151 & (load_3(s + 13) >> 1); 33 - int64_t s6 = 2097151 & (load_4(s + 15) >> 6); 34 - int64_t s7 = 2097151 & (load_3(s + 18) >> 3); 35 - int64_t s8 = 2097151 & load_3(s + 21); 36 - int64_t s9 = 2097151 & (load_4(s + 23) >> 5); 37 - int64_t s10 = 2097151 & (load_3(s + 26) >> 2); 38 - int64_t s11 = 2097151 & (load_4(s + 28) >> 7); 39 - int64_t s12 = 2097151 & (load_4(s + 31) >> 4); 40 - int64_t s13 = 2097151 & (load_3(s + 34) >> 1); 41 - int64_t s14 = 2097151 & (load_4(s + 36) >> 6); 42 - int64_t s15 = 2097151 & (load_3(s + 39) >> 3); 43 - int64_t s16 = 2097151 & load_3(s + 42); 44 - int64_t s17 = 2097151 & (load_4(s + 44) >> 5); 45 - int64_t s18 = 2097151 & (load_3(s + 47) >> 2); 46 - int64_t s19 = 2097151 & (load_4(s + 49) >> 7); 47 - int64_t s20 = 2097151 & (load_4(s + 52) >> 4); 48 - int64_t s21 = 2097151 & (load_3(s + 55) >> 1); 49 - int64_t s22 = 2097151 & (load_4(s + 57) >> 6); 50 - int64_t s23 = (load_4(s + 60) >> 3); 51 + int64_t s0 = 2097151 & sc_load_3(s); 52 + int64_t s1 = 2097151 & (sc_load_4(s + 2) >> 5); 53 + int64_t s2 = 2097151 & (sc_load_3(s + 5) >> 2); 54 + int64_t s3 = 2097151 & (sc_load_4(s + 7) >> 7); 55 + int64_t s4 = 2097151 & (sc_load_4(s + 10) >> 4); 56 + int64_t s5 = 2097151 & (sc_load_3(s + 13) >> 1); 57 + int64_t s6 = 2097151 & (sc_load_4(s + 15) >> 6); 58 + int64_t s7 = 2097151 & (sc_load_3(s + 18) >> 3); 59 + int64_t s8 = 2097151 & sc_load_3(s + 21); 60 + int64_t s9 = 2097151 & (sc_load_4(s + 23) >> 5); 61 + int64_t s10 = 2097151 & (sc_load_3(s + 26) >> 2); 62 + int64_t s11 = 2097151 & (sc_load_4(s + 28) >> 7); 63 + int64_t s12 = 2097151 & (sc_load_4(s + 31) >> 4); 64 + int64_t s13 = 2097151 & (sc_load_3(s + 34) >> 1); 65 + int64_t s14 = 2097151 & (sc_load_4(s + 36) >> 6); 66 + int64_t s15 = 2097151 & (sc_load_3(s + 39) >> 3); 67 + int64_t s16 = 2097151 & sc_load_3(s + 42); 68 + int64_t s17 = 2097151 & (sc_load_4(s + 44) >> 5); 69 + int64_t s18 = 2097151 & (sc_load_3(s + 47) >> 2); 70 + int64_t s19 = 2097151 & (sc_load_4(s + 49) >> 7); 71 + int64_t s20 = 2097151 & (sc_load_4(s + 52) >> 4); 72 + int64_t s21 = 2097151 & (sc_load_3(s + 55) >> 1); 73 + int64_t s22 = 2097151 & (sc_load_4(s + 57) >> 6); 74 + int64_t s23 = (sc_load_4(s + 60) >> 3); 75 int64_t carry0; 76 int64_t carry1; 77 int64_t carry2; 78 @@ -360,42 +360,42 @@ Output: 79 */ 80 81 void sc_muladd(unsigned char *s, const unsigned char *a, const unsigned char *b, const unsigned char *c) { 82 - int64_t a0 = 2097151 & load_3(a); 83 - int64_t a1 = 2097151 & (load_4(a + 2) >> 5); 84 - int64_t a2 = 2097151 & (load_3(a + 5) >> 2); 85 - int64_t a3 = 2097151 & (load_4(a + 7) >> 7); 86 - int64_t a4 = 2097151 & (load_4(a + 10) >> 4); 87 - int64_t a5 = 2097151 & (load_3(a + 13) >> 1); 88 - int64_t a6 = 2097151 & (load_4(a + 15) >> 6); 89 - int64_t a7 = 2097151 & (load_3(a + 18) >> 3); 90 - int64_t a8 = 2097151 & load_3(a + 21); 91 - int64_t a9 = 2097151 & (load_4(a + 23) >> 5); 92 - int64_t a10 = 2097151 & (load_3(a + 26) >> 2); 93 - int64_t a11 = (load_4(a + 28) >> 7); 94 - int64_t b0 = 2097151 & load_3(b); 95 - int64_t b1 = 2097151 & (load_4(b + 2) >> 5); 96 - int64_t b2 = 2097151 & (load_3(b + 5) >> 2); 97 - int64_t b3 = 2097151 & (load_4(b + 7) >> 7); 98 - int64_t b4 = 2097151 & (load_4(b + 10) >> 4); 99 - int64_t b5 = 2097151 & (load_3(b + 13) >> 1); 100 - int64_t b6 = 2097151 & (load_4(b + 15) >> 6); 101 - int64_t b7 = 2097151 & (load_3(b + 18) >> 3); 102 - int64_t b8 = 2097151 & load_3(b + 21); 103 - int64_t b9 = 2097151 & (load_4(b + 23) >> 5); 104 - int64_t b10 = 2097151 & (load_3(b + 26) >> 2); 105 - int64_t b11 = (load_4(b + 28) >> 7); 106 - int64_t c0 = 2097151 & load_3(c); 107 - int64_t c1 = 2097151 & (load_4(c + 2) >> 5); 108 - int64_t c2 = 2097151 & (load_3(c + 5) >> 2); 109 - int64_t c3 = 2097151 & (load_4(c + 7) >> 7); 110 - int64_t c4 = 2097151 & (load_4(c + 10) >> 4); 111 - int64_t c5 = 2097151 & (load_3(c + 13) >> 1); 112 - int64_t c6 = 2097151 & (load_4(c + 15) >> 6); 113 - int64_t c7 = 2097151 & (load_3(c + 18) >> 3); 114 - int64_t c8 = 2097151 & load_3(c + 21); 115 - int64_t c9 = 2097151 & (load_4(c + 23) >> 5); 116 - int64_t c10 = 2097151 & (load_3(c + 26) >> 2); 117 - int64_t c11 = (load_4(c + 28) >> 7); 118 + int64_t a0 = 2097151 & sc_load_3(a); 119 + int64_t a1 = 2097151 & (sc_load_4(a + 2) >> 5); 120 + int64_t a2 = 2097151 & (sc_load_3(a + 5) >> 2); 121 + int64_t a3 = 2097151 & (sc_load_4(a + 7) >> 7); 122 + int64_t a4 = 2097151 & (sc_load_4(a + 10) >> 4); 123 + int64_t a5 = 2097151 & (sc_load_3(a + 13) >> 1); 124 + int64_t a6 = 2097151 & (sc_load_4(a + 15) >> 6); 125 + int64_t a7 = 2097151 & (sc_load_3(a + 18) >> 3); 126 + int64_t a8 = 2097151 & sc_load_3(a + 21); 127 + int64_t a9 = 2097151 & (sc_load_4(a + 23) >> 5); 128 + int64_t a10 = 2097151 & (sc_load_3(a + 26) >> 2); 129 + int64_t a11 = (sc_load_4(a + 28) >> 7); 130 + int64_t b0 = 2097151 & sc_load_3(b); 131 + int64_t b1 = 2097151 & (sc_load_4(b + 2) >> 5); 132 + int64_t b2 = 2097151 & (sc_load_3(b + 5) >> 2); 133 + int64_t b3 = 2097151 & (sc_load_4(b + 7) >> 7); 134 + int64_t b4 = 2097151 & (sc_load_4(b + 10) >> 4); 135 + int64_t b5 = 2097151 & (sc_load_3(b + 13) >> 1); 136 + int64_t b6 = 2097151 & (sc_load_4(b + 15) >> 6); 137 + int64_t b7 = 2097151 & (sc_load_3(b + 18) >> 3); 138 + int64_t b8 = 2097151 & sc_load_3(b + 21); 139 + int64_t b9 = 2097151 & (sc_load_4(b + 23) >> 5); 140 + int64_t b10 = 2097151 & (sc_load_3(b + 26) >> 2); 141 + int64_t b11 = (sc_load_4(b + 28) >> 7); 142 + int64_t c0 = 2097151 & sc_load_3(c); 143 + int64_t c1 = 2097151 & (sc_load_4(c + 2) >> 5); 144 + int64_t c2 = 2097151 & (sc_load_3(c + 5) >> 2); 145 + int64_t c3 = 2097151 & (sc_load_4(c + 7) >> 7); 146 + int64_t c4 = 2097151 & (sc_load_4(c + 10) >> 4); 147 + int64_t c5 = 2097151 & (sc_load_3(c + 13) >> 1); 148 + int64_t c6 = 2097151 & (sc_load_4(c + 15) >> 6); 149 + int64_t c7 = 2097151 & (sc_load_3(c + 18) >> 3); 150 + int64_t c8 = 2097151 & sc_load_3(c + 21); 151 + int64_t c9 = 2097151 & (sc_load_4(c + 23) >> 5); 152 + int64_t c10 = 2097151 & (sc_load_3(c + 26) >> 2); 153 + int64_t c11 = (sc_load_4(c + 28) >> 7); 154 int64_t s0; 155 int64_t s1; 156 int64_t s2;