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

Function run_unit_tests

common/test/run-sphinx.c:127–237  ·  view source on GitHub ↗

Create an onionreply with the test vector parameters and check that * we match the test vectors and that we can also unwrap it. */

Source from the content-addressed store, hash-verified

125/* Create an onionreply with the test vector parameters and check that
126 * we match the test vectors and that we can also unwrap it. */
127static void run_unit_tests(void)
128{
129 u8 *oreply;
130 struct onionreply *reply;
131 int origin_index;
132 u8 *raw = tal_hexdata(tmpctx, "2002", 4);
133
134 /* Shared secrets we already have from the forward path */
135 char *secrets[] = {
136 "53eb63ea8a3fec3b3cd433b85cd62a4b145e1dda09391b348c4e1cd36a03ea66",
137 "a6519e98832a0b179f62123b3567c106db99ee37bef036e783263602f3488fae",
138 "3a6b412548762f0dbccce5c7ae7bb8147d1caf9b5471c34120b30bc9c04891cc",
139 "21e13c2d7cfe7e18836df50872466117a295783ab8aab0e7ecc8c725503ad02d",
140 "b5756b9b542727dbafc6765a49488b023a725d631af688fc031217e90770c328",
141 };
142 struct secret ss[] = {
143 secret_from_hex(secrets[0]),
144 secret_from_hex(secrets[1]),
145 secret_from_hex(secrets[2]),
146 secret_from_hex(secrets[3]),
147 secret_from_hex(secrets[4])
148 };
149
150 int replylen = 292 * 2;
151
152 u8 *intermediates[] = {
153 tal_hexdata(tmpctx, "9c5add3963fc7f6ed7f148623c84134b5647e1306419db"
154 "e2174e523fa9e2fbed3a06a19f899145610741c83ad40b"
155 "7712aefaddec8c6baf7325d92ea4ca4d1df8bce517f7e5"
156 "4554608bf2bd8071a4f52a7a2f7ffbb1413edad81eeea5"
157 "785aa9d990f2865dc23b4bc3c301a94eec4eabebca66be"
158 "5cf638f693ec256aec514620cc28ee4a94bd9565bc4d49"
159 "62b9d3641d4278fb319ed2b84de5b665f307a2db0f7fbb"
160 "757366067d88c50f7e829138fde4f78d39b5b5802f1b92"
161 "a8a820865af5cc79f9f30bc3f461c66af95d13e5e1f038"
162 "1c184572a91dee1c849048a647a1158cf884064deddbf1"
163 "b0b88dfe2f791428d0ba0f6fb2f04e14081f69165ae66d"
164 "9297c118f0907705c9c4954a199bae0bb96fad763d690e"
165 "7daa6cfda59ba7f2c8d11448b604d12d",
166 replylen),
167 tal_hexdata(tmpctx, "aac3200c4968f56b21f53e5e374e3a2383ad2b1b6501bb"
168 "cc45abc31e59b26881b7dfadbb56ec8dae8857add94e67"
169 "02fb4c3a4de22e2e669e1ed926b04447fc73034bb730f4"
170 "932acd62727b75348a648a1128744657ca6a4e713b9b64"
171 "6c3ca66cac02cdab44dd3439890ef3aaf61708714f7375"
172 "349b8da541b2548d452d84de7084bb95b3ac2345201d62"
173 "4d31f4d52078aa0fa05a88b4e20202bd2b86ac5b52919e"
174 "a305a8949de95e935eed0319cf3cf19ebea61d76ba9253"
175 "2497fcdc9411d06bcd4275094d0a4a3c5d3a945e43305a"
176 "5a9256e333e1f64dbca5fcd4e03a39b9012d197506e06f"
177 "29339dfee3331995b21615337ae060233d39befea925cc"
178 "262873e0530408e6990f1cbd233a150ef7b004ff6166c7"
179 "0c68d9f8c853c1abca640b8660db2921",
180 replylen),
181 tal_hexdata(tmpctx, "a5d3e8634cfe78b2307d87c6d90be6fe7855b4f2cc9b1d"
182 "fb19e92e4b79103f61ff9ac25f412ddfb7466e74f81b3e"
183 "545563cdd8f5524dae873de61d7bdfccd496af2584930d"
184 "2b566b4f8d3881f8c043df92224f38cf094cfc09d92655"

Callers 1

mainFunction · 0.85

Calls 6

tal_hexdataFunction · 0.85
create_onionreplyFunction · 0.85
tal_hexFunction · 0.85
wrap_onionreplyFunction · 0.85
unwrap_onionreplyFunction · 0.85
secret_from_hexFunction · 0.70

Tested by

no test coverage detected