MCPcopy Create free account
hub / github.com/F-Stack/f-stack / gf128_mulalpha

Function gf128_mulalpha

freebsd/opencrypto/gfmult.c:44–55  ·  view source on GitHub ↗

calculate v * 2 */

Source from the content-addressed store, hash-verified

42
43/* calculate v * 2 */
44static inline struct gf128
45gf128_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

Callers 1

gf128_genmultableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected