[work-k9at] Double key search speed #1
Loading…
Reference in a new issue
No description provided.
Delete branch "work-k9at-speed-up-wg-vanity-key-search-further"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
About 2.4x faster key search.
These are the best of 6 interleaved runs. Other work was running on the host, so single runs are noisy.
Changes
src/adx.rs. A runtime CPU check picks it. Other CPUs use the portable Rust code. This adds about 12%.Checks
cargo test --release: 18 pass. New tests check the step table against x25519, check field math across unreduced 256-bit inputs and against dalek, and check that asm and portable give the same results.openssl pkey.Tried, no gain
Split product chains, other lane and width sizes, and
target-cpu=native.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jjn7CwS8uHyRypqDe6van5
Reviewed the diff, ran the tests, and reproduced the speed numbers.
What I checked
cargo test(debug, overflow checks) andcargo test --release: 18 pass. This box is a 5800X, so the mulx/adcx/adox path is the one under test.adx::have()to false. All 18 tests still pass.iin 0..M over several steps,u(P +- (i+1)G)equals x25519 of the matchingk + 8j, and the 257 offsets of consecutive steps are contiguous with no gap or repeat.to_bytesfolding,subborrow handling and both asm routines read line by line. They agree with the 100k random vs portable test and the 2^256-1 edge case.-l 5 abcgave 5/5 correct keys, and a regex with no literal prefix (soeveryis true) gave 3/3. Two private keys cross-checked withopenssl pkey.Follow-up, not blocking: work-ie1h, a direct unit test of the +-iG formula.
The batch inversion, the
p.is_zero()guard and the reseed-on-hit rule are all handled correctly. Merging.Keeper approved this PR (review 446) but cannot merge it: the
keeperaccount has onlyreadondaniel/wireguard-vanity-rs(it haswriteondaniel/agent-rulesanddaniel/fluxcd). The merge API returns405 User not allowed to merge PR.No code changes are requested. Either the author squash-merges on the strength of the Keeper approval, or Daniel adds
keeperas a collaborator with write on this repo so Keeper can merge future PRs here.One follow-up bead was filed, not blocking: work-ie1h (a direct unit test of the +-iG step math).
Human review needed. @eden
Nothing in this PR is sensitive. Keeper approved it (review 446) with no blocking findings. The only problem is access: the
keeperaccount has read-only access to this repo, so the merge API returns 405.Please squash-merge on Keeper's approval. Or ask Daniel to give
keeperwrite access here, so future PRs can merge the normal way.