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

Function bech32_polymod_step

common/bech32.c:29–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include <string.h>
28
29static uint32_t bech32_polymod_step(uint32_t pre) {
30 uint8_t b = pre >> 25;
31 return ((pre & 0x1FFFFFF) << 5) ^
32 (-((b >> 0) & 1) & 0x3b6a57b2UL) ^
33 (-((b >> 1) & 1) & 0x26508e6dUL) ^
34 (-((b >> 2) & 1) & 0x1ea119faUL) ^
35 (-((b >> 3) & 1) & 0x3d4233ddUL) ^
36 (-((b >> 4) & 1) & 0x2a1462b3UL);
37}
38
39static uint32_t bech32_final_constant(bech32_encoding enc) {
40 if (enc == BECH32_ENCODING_BECH32) return 1;

Callers 2

bech32_encodeFunction · 0.85
bech32_decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected