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

Function input_fe

common/codex32.c:115–131  ·  view source on GitHub ↗

Helper to input a single field element in the checksum engine. */

Source from the content-addressed store, hash-verified

113
114/* Helper to input a single field element in the checksum engine. */
115static void input_fe(const u8 *generator, u8 *residue, uint8_t e, size_t len)
116{
117 size_t res_len = len;
118 u8 xn = residue[0];
119
120 for(size_t i = 1; i < res_len; i++) {
121 residue[i - 1] = residue[i];
122 }
123
124 residue[res_len - 1] = e;
125
126 for(size_t i = 0; i < res_len; i++) {
127 u8 x = generator[i];
128 multiply_gf32(&x, xn);
129 addition_gf32(&residue[i], x);
130 }
131}
132
133/* Helper to input the HRP of codex32 string into the checksum engine */
134static void input_hrp(const u8 *generator, u8 *residue, const char *hrp, size_t len)

Callers 3

input_hrpFunction · 0.85
input_data_strFunction · 0.85
input_own_targetFunction · 0.85

Calls 2

multiply_gf32Function · 0.85
addition_gf32Function · 0.85

Tested by

no test coverage detected