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

Function run_unit_tests

common/test/run-sphinx.c:103–213  ·  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

101/* Create an onionreply with the test vector parameters and check that
102 * we match the test vectors and that we can also unwrap it. */
103static void run_unit_tests(void)
104{
105 u8 *oreply;
106 struct onionreply *reply;
107 int origin_index;
108 u8 *raw = tal_hexdata(tmpctx, "2002", 4);
109
110 /* Shared secrets we already have from the forward path */
111 char *secrets[] = {
112 "53eb63ea8a3fec3b3cd433b85cd62a4b145e1dda09391b348c4e1cd36a03ea66",
113 "a6519e98832a0b179f62123b3567c106db99ee37bef036e783263602f3488fae",
114 "3a6b412548762f0dbccce5c7ae7bb8147d1caf9b5471c34120b30bc9c04891cc",
115 "21e13c2d7cfe7e18836df50872466117a295783ab8aab0e7ecc8c725503ad02d",
116 "b5756b9b542727dbafc6765a49488b023a725d631af688fc031217e90770c328",
117 };
118 struct secret ss[] = {
119 secret_from_hex(secrets[0]),
120 secret_from_hex(secrets[1]),
121 secret_from_hex(secrets[2]),
122 secret_from_hex(secrets[3]),
123 secret_from_hex(secrets[4])
124 };
125
126 int replylen = 292 * 2;
127
128 u8 *intermediates[] = {
129 tal_hexdata(tmpctx, "9c5add3963fc7f6ed7f148623c84134b5647e1306419db"
130 "e2174e523fa9e2fbed3a06a19f899145610741c83ad40b"
131 "7712aefaddec8c6baf7325d92ea4ca4d1df8bce517f7e5"
132 "4554608bf2bd8071a4f52a7a2f7ffbb1413edad81eeea5"
133 "785aa9d990f2865dc23b4bc3c301a94eec4eabebca66be"
134 "5cf638f693ec256aec514620cc28ee4a94bd9565bc4d49"
135 "62b9d3641d4278fb319ed2b84de5b665f307a2db0f7fbb"
136 "757366067d88c50f7e829138fde4f78d39b5b5802f1b92"
137 "a8a820865af5cc79f9f30bc3f461c66af95d13e5e1f038"
138 "1c184572a91dee1c849048a647a1158cf884064deddbf1"
139 "b0b88dfe2f791428d0ba0f6fb2f04e14081f69165ae66d"
140 "9297c118f0907705c9c4954a199bae0bb96fad763d690e"
141 "7daa6cfda59ba7f2c8d11448b604d12d",
142 replylen),
143 tal_hexdata(tmpctx, "aac3200c4968f56b21f53e5e374e3a2383ad2b1b6501bb"
144 "cc45abc31e59b26881b7dfadbb56ec8dae8857add94e67"
145 "02fb4c3a4de22e2e669e1ed926b04447fc73034bb730f4"
146 "932acd62727b75348a648a1128744657ca6a4e713b9b64"
147 "6c3ca66cac02cdab44dd3439890ef3aaf61708714f7375"
148 "349b8da541b2548d452d84de7084bb95b3ac2345201d62"
149 "4d31f4d52078aa0fa05a88b4e20202bd2b86ac5b52919e"
150 "a305a8949de95e935eed0319cf3cf19ebea61d76ba9253"
151 "2497fcdc9411d06bcd4275094d0a4a3c5d3a945e43305a"
152 "5a9256e333e1f64dbca5fcd4e03a39b9012d197506e06f"
153 "29339dfee3331995b21615337ae060233d39befea925cc"
154 "262873e0530408e6990f1cbd233a150ef7b004ff6166c7"
155 "0c68d9f8c853c1abca640b8660db2921",
156 replylen),
157 tal_hexdata(tmpctx, "a5d3e8634cfe78b2307d87c6d90be6fe7855b4f2cc9b1d"
158 "fb19e92e4b79103f61ff9ac25f412ddfb7466e74f81b3e"
159 "545563cdd8f5524dae873de61d7bdfccd496af2584930d"
160 "2b566b4f8d3881f8c043df92224f38cf094cfc09d92655"

Callers 1

mainFunction · 0.85

Calls 8

tal_hexdataFunction · 0.85
tal_hexFunction · 0.85
unwrap_onionreplyFunction · 0.85
memeqFunction · 0.85
tal_bytelenFunction · 0.85
secret_from_hexFunction · 0.70
create_onionreplyFunction · 0.50
wrap_onionreplyFunction · 0.50

Tested by

no test coverage detected