Repository Public
1{2 "schema": "qyvora-review/1",3 "title": "Wallet-audit items of the Ed25519 review (merged into security/policies/wallet-audit.json)",4 "wallet_audit_items": [5 {6 "id": "WA-ED-01",7 "title": "Ed25519 (Solana signatures): conformance and agreement with independent implementations",8 "group": "key-storage",9 "verdict": "pass",10 "scope": "engine",11 "rationale": "The from-scratch Ed25519 that signs Solana transactions is replayed against RFC 8032 section 7.1, the SLIP-0010 vectors, Wycheproof and the ed25519-speccheck edge cases, and compared with libsodium, OpenSSL, ed25519-dalek (verify_strict, the rule of Solana validators), CryptoKit and an integer transcription of RFC 8032: public keys and signatures byte-identical, verification verdicts identical to dalek and libsodium on adversarial inputs, field, scalar and group arithmetic equal to Python integers. Signing is deterministic, recomputes the public key from the seed and verifies each signature before returning it. Internal tests, not an independent review.",12 "residual_risk": "Unaudited from-scratch implementation on a signing path: no second line of defence for a Solana signature (docs/THREAT_MODEL.md 5.5).",13 "evidence": [14 {15 "ref": "Sources/QyvoraEd25519/Ed25519.swift:119",16 "contains": "public static func sign(message: Bytes, seed: Bytes) throws -> Bytes {"17 },18 {19 "ref": "Sources/QyvoraEd25519/Ed25519.swift:143",20 "contains": "guard verify(signature: signature, message: message, publicKey: publicKey) else { throw Error.signingFailed }"21 },22 {23 "ref": "security/tests/Tests/DifferentialAuditTests/Ed25519DiffTests.swift:237",24 "contains": "@Test func verificationAgreementOnAdversarialInputs() throws {"25 },26 {27 "ref": "security/tests/Tests/ConformanceAuditTests/Ed25519Vectors.swift:107",28 "contains": "@Test func speccheckEdgeCases() throws {"29 },30 "runner:swift-audit"31 ]32 },33 {34 "id": "WA-ED-02",35 "title": "Ed25519 secret path: constant-time construction, processor flag, machine-code and timing checks",36 "group": "key-storage",37 "verdict": "partial",38 "scope": "engine",39 "rationale": "No secret-dependent branch or memory index at source level; the table of the scalar multiplication is read entirely under a mask; every conditional branch of the compiled secret-path functions was read (two compiler versions) and is re-counted at each audit; public-key derivation and signing set the data-independent-timing flag. The timing tests found one defect (QYV-AUD-006: zero windows added the neutral element and were measurably distinguishable), fixed by a shifted base table. The hash state that held the expanded key and the nonce after use is now erased (QYV-CRY-005).",40 "gap": "Statistical evidence on Macs only: nothing was timed on an iPhone; a processor without FEAT_DIT cannot be covered by the flag; scalars and points held in structs on the stack cannot be erased from Swift (QYV-CRY-003).",41 "finding": "QYV-AUD-006, QYV-CRY-005, QYV-CRY-003",42 "severity": "medium",43 "residual_risk": "A local attacker with precise timing or memory access is not excluded; independent review required before any recommendation to use real funds.",44 "evidence": [45 {46 "ref": "Sources/QyvoraEd25519/Edwards25519.swift:123",47 "contains": "static func lookup(_ table: UnsafePointer<EdPoint>, _ index: UInt64) -> EdPoint {"48 },49 {50 "ref": "Sources/QyvoraEd25519/Edwards25519.swift:170",51 "contains": "add(multiply(scalar: scalar, table: baseTable), baseOffset)"52 },53 {54 "ref": "Sources/QyvoraSymmetric/SHA2.swift:227",55 "contains": "this one must not outlive it (QYV-CRY-005). `finalize` ends the computation: the instance is not reusable."56 },57 "runner:ct-machine-code",58 "runner:dudect-timing"59 ],60 "checks": [61 {62 "id": "ed25519-dit",63 "type": "grep",64 "description": "Ed25519 public-key derivation and signing set the data-independent-timing flag",65 "globs": [66 "Sources/QyvoraEd25519/Ed25519.swift"67 ],68 "pattern": "DataIndependentTiming\\.enable\\(\\)",69 "expect": "present",70 "severity": "high",71 "area": "crypto",72 "cwe": "CWE-208",73 "recommendation": "Set the flag for the whole body of every function that handles the seed, the expanded key or the nonce."74 }75 ]76 }77 ]78}79