Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Trail of Bits 6 min read Deep dive hardMaster

How we avoided side-channels in our new post-quantum Go cryptography libraries

Trail of Bits released pure-Go, open-source implementations of the NIST post-quantum signature schemes ML-DSA (FIPS-204) and SLH-DSA (FIPS-205), engineered to run in constant time. SLH-DSA is hash-based and straightforward, but ML-DSA's Decompose step divides by 2γ2, and secret-dependent division and branching are what enabled the KyberSlash timing attack. The fix replaces branches with mask-based constant-time conditional swaps and replaces division with a bit-by-bit constant-time long division, then speeds that up with Barrett reduction using precomputed reciprocals for the two fixed γ2 values plus two branchless correction steps.

Assumes: timing side-channel attackstwo's complement bit manipulationmodular arithmeticpost-quantum signature schemes

Related posts

  • Go Turns 17

    The Go Blog easyNovice

    Go's 17th anniversary recap covers Go 1.26 and 1.27. On the language side, it adds generic methods, self-referential constraints, `new` with an initial value, and nested struct literal keys. In the standard library, `encoding/json/v2` reached GA with up to 10× faster unmarshaling and now backs v1, and a GC-based goroutine leak profiler shipped. Performance work includes the Green Tea GC as default (10–40% less GC overhead), experimental SIMD packages, stack-allocated append backing stores and size-specialized allocation. The release also brings post-quantum TLS/HPKE/ML-DSA, a 7.5-hour urgent response to the eMudhra weak-key incident, and tooling built for humans and AI agents: `go fix` modernizers, `//go:fix inline`, gopls MCP and the pkg.go.dev API.

  • Safeguarding cryptocurrency by disclosing quantum vulnerabilities responsibly

    Google Research hardMaster

    New resource estimates show Shor's algorithm can break 256-bit elliptic curve cryptography (ECDLP-256) using two compiled circuits. One needs under 1,200 logical qubits and 90 million Toffoli gates, the other under 1,450 logical qubits and 70 million Toffoli gates. That translates to fewer than 500,000 physical superconducting qubits running for a few minutes, roughly a 20-fold reduction from earlier estimates. Because most blockchains rely on ECDLP-256, Google recommends migrating cryptocurrencies to post-quantum cryptography, avoiding exposed or reused wallet addresses, and considering policy for abandoned coins. To disclose responsibly, the circuits are withheld and a zero-knowledge proof lets third parties verify the claims without handing attackers a roadmap.

  • From hand-tuned Go to self-optimizing code: Building BitsEvolve

    Datadog Engineering mediumAdept

    Datadog cut CPU in Go hot paths by removing compiler bounds checks in NormalizeTag (25% faster, 0.75% service CPU) and adding an ASCII fast path to NormalizeTagArbTagValue (90% faster, hundreds of thousands of dollars in projected annual savings), guided by production data showing nearly all inputs were ASCII. These manual techniques became the heuristics for BitsEvolve, an AlphaEvolve-inspired agent that uses an island-model evolutionary algorithm, benchmark fitness functions and Temporal orchestration to mutate code. BitsEvolve rediscovered the hand-tuned versions and improved Murmur3 and CRC32 by about 20%. The key lesson is that realistic benchmarks matter, so production data captured with Live Debugger is used to build trustworthy fitness functions, and the work then extends toward SIMD kernels for Go.

  • Signal Protocol and Post-Quantum Ratchets

    Signal hardMaster

    Signal adds the Sparse Post Quantum Ratchet (SPQR), a continuously advancing ML-KEM-based ratchet whose output is mixed with the existing Double Ratchet to form a "Triple Ratchet". It extends quantum resistance beyond PQXDH's session handshake to forward secrecy and post-compromise security. KEM key exchange needs ordered, asymmetric messages, and ML-KEM 768 keys and ciphertexts each exceed 1000 bytes versus 32 for ECDH. SPQR handles this with a state machine that coordinates encapsulation-key and ciphertext exchange, and with erasure-coded chunks spread across messages. The chunking keeps message sizes small and uniform and tolerates loss, reordering and offline peers. It also forces an attacker who wants to block key agreement into an obvious denial of service. Rollout requires no user action.

  • Post-quantum security for SSH access on GitHub

    GitHub Engineering mediumAdept

    GitHub is adding the hybrid post-quantum SSH key exchange sntrup761x25519-sha512 (Streamlined NTRU Prime combined with X25519 ECDH) to its Git SSH endpoints on September 17, 2025. The goal is to defend against "store now, decrypt later" attacks. Because the scheme is hybrid, security is never weaker than classical X25519. The change covers github.com, non-US GitHub Enterprise Cloud regions and GHES 3.19, but not the FIPS-only US region. Clients running OpenSSH 9.0+ negotiate it automatically, older clients fall back, and `ssh -Q kex` or `ssh -v` shows support and the negotiated algorithm.

The quest for software engineering knowledge.

Look:
Layout: