* Calculate: * (x*2^4 + word[3,0]*h) * * 2^4 + word[7,4]*h) * * ... * 2^4 + word[63,60]*h */
| 135 | * 2^4 + word[63,60]*h |
| 136 | */ |
| 137 | static struct gf128 |
| 138 | gfmultword(uint64_t word, struct gf128 x, struct gf128table *tbl) |
| 139 | { |
| 140 | struct gf128 row; |
| 141 | unsigned bits; |
| 142 | unsigned redbits; |
| 143 | int i; |
| 144 | |
| 145 | for (i = 0; i < 64; i += 4) { |
| 146 | bits = word % 16; |
| 147 | |
| 148 | /* fetch row */ |
| 149 | row = readrow(tbl, bits); |
| 150 | |
| 151 | /* x * 2^4 */ |
| 152 | redbits = x.v[1] % 16; |
| 153 | x.v[1] = (x.v[1] >> 4) | (x.v[0] % 16) << 60; |
| 154 | x.v[0] >>= 4; |
| 155 | x.v[0] ^= (uint64_t)reduction[redbits] << (64 - 16); |
| 156 | |
| 157 | word >>= 4; |
| 158 | |
| 159 | x = gf128_add(x, row); |
| 160 | } |
| 161 | |
| 162 | return x; |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | * Calculate |