calculate v * 2 */
| 42 | |
| 43 | /* calculate v * 2 */ |
| 44 | static inline struct gf128 |
| 45 | gf128_mulalpha(struct gf128 v) |
| 46 | { |
| 47 | uint64_t mask; |
| 48 | |
| 49 | mask = !!(v.v[1] & 1); |
| 50 | mask = ~(mask - 1); |
| 51 | v.v[1] = (v.v[1] >> 1) | ((v.v[0] & 1) << 63); |
| 52 | v.v[0] = (v.v[0] >> 1) ^ ((mask & REV_POLY_REDUCT) << 56); |
| 53 | |
| 54 | return v; |
| 55 | } |
| 56 | |
| 57 | /* |
| 58 | * Generate a table for 0-16 * h. Store the results in the table w/ indexes |