🤖 AI Summary
Filippo Valsorda reports that Anthropic’s Claude Code (v2.0.28 with Opus 4.1) rapidly diagnosed and helped fix multiple low-level bugs in his fresh Go implementation of ML‑DSA, a NIST-specified post‑quantum signature algorithm. After Verify repeatedly rejected known-good test vectors, Claude loaded the repo, reproduced failing tests, and pinpointed a subtle mistake: a merged HighBits/w1Encode function caused Verify to take the high bits of w1 twice. Claude produced a test to confirm the hypothesis and suggested a fix; Filippo later refactored w1Encode to accept high bits explicitly, which also eliminated an extra Montgomery-domain conversion. In a second run over earlier broken signing code Claude discovered (1) incorrectly computed Montgomery constants (1 and −1) that created an infinite retry loop, and (2) a sizing bug where an encoded value was too short (allocation length vs. capacity), both of which it helped locate and remediate.
This case is significant because it shows an LLM can reason about complex, bit‑level cryptographic code, run focused test-driven debugging, and suggest correct low-level fixes — not just high-level guidance. The outcome underscores practical uses for LLMs in developer workflows (kick off agents on test failures, triage and localize faults) while noting human review remains essential. For cryptographers and maintainers, this demonstrates that well-scoped failing tests plus code context make excellent prompts for AI-assisted debugging, potentially saving hours on intricate implementation bugs.
Loading comments...
login to comment
loading comments...
no comments yet