Commit 362495b
committed
test: remove a ton of rand feature-gating
Sometihng like half the tests in this crate are gated on "rand", most of
which are for dumb reasons (we are generating random keys from the
thread rng). By adding a non-feature=rand "random key generator" we can
enable these tests even without the rand feature.
We typically also have a gate on "std", which is needed to get the
thread rng, but in some cases this is the *only* reason to have a std
gate. So by eliminating the rand requirement we can make tests work in
nostd. We do this by implementing a parallel LCG which is obviously not
cryptographic but is fine for testing.
In the LLM-generated tests in musig2.rs we have some rand feature gates
for literally no reason at all :/. My bad.
In addition to dramatically increasing nostd test coverage, the new
"generate random keys" function also gives us an opportunity to use the
new global context API including rerandomization.1 parent 5fa32b3 commit 362495b
File tree
7 files changed
+176
-131
lines changed- src
- ecdsa
7 files changed
+176
-131
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | 195 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 196 | + | |
| 197 | + | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
| 288 | + | |
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
| |||
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | | - | |
| 309 | + | |
311 | 310 | | |
312 | 311 | | |
313 | | - | |
314 | | - | |
| 312 | + | |
315 | 313 | | |
316 | 314 | | |
317 | 315 | | |
| |||
332 | 330 | | |
333 | 331 | | |
334 | 332 | | |
335 | | - | |
| 333 | + | |
336 | 334 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 335 | + | |
342 | 336 | | |
343 | | - | |
| 337 | + | |
| 338 | + | |
344 | 339 | | |
345 | 340 | | |
346 | 341 | | |
347 | 342 | | |
348 | | - | |
349 | | - | |
| 343 | + | |
350 | 344 | | |
351 | 345 | | |
352 | 346 | | |
353 | 347 | | |
354 | 348 | | |
355 | 349 | | |
356 | 350 | | |
357 | | - | |
| 351 | + | |
358 | 352 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 353 | + | |
364 | 354 | | |
365 | | - | |
| 355 | + | |
| 356 | + | |
366 | 357 | | |
367 | 358 | | |
368 | 359 | | |
369 | 360 | | |
370 | 361 | | |
371 | 362 | | |
372 | 363 | | |
373 | | - | |
| 364 | + | |
374 | 365 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 366 | + | |
380 | 367 | | |
381 | | - | |
| 368 | + | |
| 369 | + | |
382 | 370 | | |
383 | | - | |
| 371 | + | |
384 | 372 | | |
385 | 373 | | |
386 | 374 | | |
387 | 375 | | |
388 | 376 | | |
389 | 377 | | |
390 | 378 | | |
391 | | - | |
| 379 | + | |
392 | 380 | | |
393 | | - | |
394 | | - | |
| 381 | + | |
395 | 382 | | |
396 | | - | |
| 383 | + | |
397 | 384 | | |
398 | 385 | | |
399 | 386 | | |
| |||
454 | 441 | | |
455 | 442 | | |
456 | 443 | | |
457 | | - | |
| 444 | + | |
458 | 445 | | |
459 | 446 | | |
460 | 447 | | |
461 | | - | |
| 448 | + | |
462 | 449 | | |
463 | 450 | | |
464 | 451 | | |
465 | 452 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
470 | 456 | | |
471 | 457 | | |
472 | | - | |
| 458 | + | |
473 | 459 | | |
474 | 460 | | |
475 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
370 | 386 | | |
371 | 387 | | |
372 | 388 | | |
| |||
1036 | 1052 | | |
1037 | 1053 | | |
1038 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1039 | 1065 | | |
1040 | 1066 | | |
1041 | 1067 | | |
| |||
1733 | 1759 | | |
1734 | 1760 | | |
1735 | 1761 | | |
1736 | | - | |
1737 | 1762 | | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
| 1763 | + | |
1741 | 1764 | | |
1742 | 1765 | | |
1743 | 1766 | | |
| |||
2010 | 2033 | | |
2011 | 2034 | | |
2012 | 2035 | | |
2013 | | - | |
| 2036 | + | |
2014 | 2037 | | |
2015 | 2038 | | |
2016 | 2039 | | |
2017 | | - | |
| 2040 | + | |
2018 | 2041 | | |
2019 | 2042 | | |
2020 | 2043 | | |
2021 | | - | |
| 2044 | + | |
2022 | 2045 | | |
2023 | 2046 | | |
2024 | 2047 | | |
| |||
2029 | 2052 | | |
2030 | 2053 | | |
2031 | 2054 | | |
2032 | | - | |
| 2055 | + | |
2033 | 2056 | | |
2034 | 2057 | | |
2035 | 2058 | | |
2036 | | - | |
| 2059 | + | |
2037 | 2060 | | |
2038 | 2061 | | |
2039 | 2062 | | |
| |||
2044 | 2067 | | |
2045 | 2068 | | |
2046 | 2069 | | |
2047 | | - | |
| 2070 | + | |
2048 | 2071 | | |
2049 | 2072 | | |
2050 | 2073 | | |
2051 | | - | |
| 2074 | + | |
2052 | 2075 | | |
2053 | 2076 | | |
2054 | | - | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
2059 | | - | |
2060 | | - | |
| 2077 | + | |
| 2078 | + | |
2061 | 2079 | | |
2062 | | - | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
2063 | 2086 | | |
2064 | 2087 | | |
2065 | 2088 | | |
2066 | | - | |
2067 | 2089 | | |
2068 | | - | |
2069 | | - | |
| 2090 | + | |
2070 | 2091 | | |
2071 | 2092 | | |
2072 | 2093 | | |
2073 | 2094 | | |
2074 | 2095 | | |
2075 | 2096 | | |
2076 | | - | |
| 2097 | + | |
2077 | 2098 | | |
2078 | 2099 | | |
2079 | 2100 | | |
2080 | | - | |
| 2101 | + | |
2081 | 2102 | | |
2082 | 2103 | | |
2083 | 2104 | | |
| |||
2095 | 2116 | | |
2096 | 2117 | | |
2097 | 2118 | | |
2098 | | - | |
| 2119 | + | |
2099 | 2120 | | |
2100 | 2121 | | |
2101 | 2122 | | |
| |||
2107 | 2128 | | |
2108 | 2129 | | |
2109 | 2130 | | |
2110 | | - | |
2111 | 2131 | | |
2112 | 2132 | | |
2113 | 2133 | | |
2114 | | - | |
| 2134 | + | |
2115 | 2135 | | |
2116 | 2136 | | |
2117 | 2137 | | |
| |||
2178 | 2198 | | |
2179 | 2199 | | |
2180 | 2200 | | |
2181 | | - | |
| 2201 | + | |
2182 | 2202 | | |
2183 | 2203 | | |
2184 | 2204 | | |
2185 | | - | |
2186 | | - | |
| 2205 | + | |
| 2206 | + | |
2187 | 2207 | | |
2188 | 2208 | | |
2189 | 2209 | | |
| |||
2288 | 2308 | | |
2289 | 2309 | | |
2290 | 2310 | | |
2291 | | - | |
| 2311 | + | |
2292 | 2312 | | |
2293 | 2313 | | |
2294 | 2314 | | |
2295 | | - | |
2296 | 2315 | | |
2297 | | - | |
| 2316 | + | |
2298 | 2317 | | |
2299 | | - | |
| 2318 | + | |
2300 | 2319 | | |
2301 | 2320 | | |
2302 | 2321 | | |
| |||
2548 | 2567 | | |
2549 | 2568 | | |
2550 | 2569 | | |
2551 | | - | |
2552 | 2570 | | |
2553 | | - | |
2554 | | - | |
| 2571 | + | |
2555 | 2572 | | |
2556 | 2573 | | |
2557 | 2574 | | |
| |||
0 commit comments