SPB Git

Repository Public

QYV-AUD-006.json 4.4 KB 23 lines json

1{2  "id": "QYV-AUD-006",3  "title": "Ed25519 base-point multiplication: scalars whose windows are zero were measurably distinguishable by their duration (the neutral element was added)",4  "severity": "high",5  "cvss_vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N",6  "cvss_score": 4.7,7  "cwe": "CWE-208",8  "masvs": "MASVS-CRYPTO-1",9  "area": "crypto",10  "location": "Sources/QyvoraEd25519/Edwards25519.swift:169",11  "tool": "dudect-timing",12  "rule": "ed25519-basemul-one",13  "status": "fixed",14  "fix_commit": "2577679",15  "regression_test": "qytiming (internals build, --dit): ed25519-basemul-one, ed25519-basemul-zero, ed25519-basemul-highbit, run by the dudect-timing step of the audit; Tests/QyvoraEd25519Tests/Ed25519Tests.swift: GroupTests/basePointAndOrder (the base table holds 1B..16B, no neutral element, and the offset constant is [0x11..11]B) and GroupTests/scalarMultiplication; differential test ed25519-group-vs-integers (multiplyBase against Python integers and libsodium on edge scalars)",16  "description": "Found by the timing tests added for the multi-chain audit (qytiming built with the Ed25519 internals, data-independent-timing flag set as the production entry points set it; node M4M64a, Mac Studio M4 Max, Swift 6.3.3). The fixed-window multiplication used a table 0·B … 15·B: a window equal to zero added the neutral element (0, 1, 1, 0). The source has no secret-dependent branch or index and the machine code has none either (4 conditional branches, all on public values), yet the duration differed between degenerate scalars and random ones: scalar 1 against random scalars max |t| = 9.0 and 6.9 with 20 000 measurements per class, 33.1 and 32.0 with 200 000; scalar 0: 9.4, 5.9, 9.4, 27.9; scalar 2^252: 7.2, 6.5, 18.9, 28.1 (threshold 4.5; the raw means differ by a few nanoseconds in 34 microseconds, the difference shows in the lower half of the distribution). The controls of the same runs behave as required, a repeated random scalar against random scalars shows nothing (2.1, 0.8, 0.5, 1.8), the scalar 2^256−1 (every window 15) shows nothing (1.7, 2.3, 1.9, 0.9), and the field and scalar operations taken alone show nothing with operands 0, 1 or all-ones at one million measurements (all below 2.5): the effect belongs to the loop when it processes the neutral element, not to the arithmetic. Cause not established (a processor effect on constant, mostly-zero data is the hypothesis; it was not proven). Impact: the scalars measured are not reachable in use (the key scalar is clamped SHA-512 output, the nonce is SHA-512 output reduced modulo the order), so no key was recovered or is claimed recoverable; what the measurement shows is that the duration depended on how many windows of a secret scalar are zero, a few bits of information about the long-term scalar for an attacker able to time [a]B precisely and repeatedly on the device. Severity: recorded at the tool's default for a confirmed timing difference on an operation with a private key (high); the audit agent did not lower it.",17  "recommendation": "Fixed: the base-point multiplication, the only one made with secret scalars, uses a table shifted by one (window w adds (w + 1)·B) and removes the constant excess [0x11…11]B with one last addition, so that every window of every scalar adds a point that is not the neutral element and the accumulator leaves the neutral element at the first window. After the fix, same node, same sample counts: scalar 1: 1.9, 1.5, 1.6, 1.1; scalar 0: 0.6, 0.5, 2.0, 1.7; scalar 2^252: 0.7, 1.8, 3.7, 2.2; repeated scalar 1.5, 2.0, 2.4, 1.1; public interface (production build) public key 0.7, 1.3, 1.3, 1.2; signing, fixed seed 1.1, 2.1, 0.7, 0.7; signing, fixed nonce 0.9, 1.8, 1.4, 1.2; SLIP-0010 1.3, 2.0, 0.8, 1.5. The variable-base multiplication keeps the plain table: it serves verification only (public scalar, public point) and its targets are reported as informational. Residual: statistical evidence on one Mac and one build, not a proof; not measured on an iPhone; without the data-independent-timing flag the multiplication remains distinguishable for some scalars on this processor (informational targets info-nodit-*), which is why the production entry points set the flag; a processor without FEAT_DIT is not covered. Full data: security/audit/review/ed25519-timing-2026-12-05.json.",18  "evidence": "security/audit/review/ed25519-timing-2026-12-05.json",19  "fingerprint": "e52d603870d3",20  "reported": "2026-12-05",21  "owner": "audit-multichain"22}23
Files main
Menu

Theme