MCPcopy Create free account
hub / github.com/ElementsProject/lightning / polymod

Function polymod

common/descriptor_checksum.c:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22static u64 polymod(u64 c, int val)
23{
24 u8 c0 = c >> 35;
25 c = ((c & 0x7ffffffff) << 5) ^ val;
26 if (c0 & 1) c ^= 0xf5dee51989;
27 if (c0 & 2) c ^= 0xa9fdca3312;
28 if (c0 & 4) c ^= 0x1bab10e32d;
29 if (c0 & 8) c ^= 0x3706b1677a;
30 if (c0 & 16) c ^= 0x644d626ffd;
31 return c;
32}
33
34
35bool descriptor_checksum(const char *descriptor, int desc_size,

Callers 1

descriptor_checksumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected