bc405d045b
The ECDH operation was 0.7x ACINQ (55µs vs 40µs) because: 1. P-table built from scratch every call: 9.8µs 2. liftX (sqrt) for pubkey decompression: 5.5µs Both are redundant for the Nostr use case where the same peer key is used repeatedly (NIP-44 encrypted DMs). Fixes: - Share the P-table cache (1024 entries) between ecmult and ecmult_double_g. Same pubkey → cache hit → skip table build. - Use lift_x_cached in ecdh_xonly. Same pubkey → skip sqrt. ECDH: 55.2µs → 33.9µs (1.63x faster, now 1.18x faster than ACINQ) Full benchmark (x86_64, cached pubkey pattern): signXOnly: 17.6µs (56,818 ops/s) — 2.1x faster than ACINQ verifyFast: 35.0µs (28,571 ops/s) — 1.2x faster than ACINQ pubkeyCreate: 15.8µs (63,291 ops/s) — 1.2x faster than ACINQ ecdhXOnly: 33.9µs (29,499 ops/s) — 1.2x faster than ACINQ batch(200): 1596µs (125,313 ev/s) — 12x faster than ACINQ https://claude.ai/code/session_011KVZhDcV2G7idNWEBz12GY