Repository Public
1{2 "description": "Machine-code check of the functions that process secrets: number of conditional branch instructions (b.cond, cbz, cbnz, tbz, tbnz) in the release build, per function, read from the disassembly. 'max' is the count accepted after manual review of what each remaining branch tests (loop counters, public lengths, lazy initialisation of constants). A function above its maximum is a finding: the compiler introduced a branch that must be reviewed. The check cannot decide by itself whether a branch depends on a secret, and functions inlined into their callers are not visible as symbols: they are reported as 'not visible', never as passed.",3 "modules": ["QyvoraMath", "QyvoraSecp256k1", "QyvoraSymmetric", "QyvoraMLKEM", "QyvoraMLDSA", "QyvoraKeccak", "QyvoraEd25519"],4 "functions": [5 {"match": "static QyvoraSecp256k1.U256.adc(", "max": 0, "why": "add with carry: bit arithmetic only"},6 {"match": "static QyvoraSecp256k1.U256.sbb(", "max": 0, "why": "subtract with borrow: bit arithmetic only"},7 {"match": "static QyvoraSecp256k1.U256.add(", "max": 0, "why": "256-bit addition (was 8 branches on carries before the fix of QYV-AUD-002)"},8 {"match": "static QyvoraSecp256k1.U256.sub(", "max": 0, "why": "256-bit subtraction (was 8 branches on borrows before the fix)"},9 {"match": "static QyvoraSecp256k1.U256.select(", "max": 0, "why": "masked selection"},10 {"match": "QyvoraSecp256k1.Modulus.add(", "max": 0, "why": "modular addition"},11 {"match": "QyvoraSecp256k1.Modulus.sub(", "max": 0, "why": "modular subtraction"},12 {"match": "QyvoraSecp256k1.Modulus.neg(", "max": 0, "why": "modular negation"},13 {"match": "QyvoraSecp256k1.Modulus.reduce(", "max": 0, "why": "conditional subtraction by mask"},14 {"match": "static QyvoraSecp256k1.Modulus.addMod(", "max": 0, "why": "modular addition"},15 {"match": "QyvoraSecp256k1.Modulus.montMul(", "max": 4, "why": "Montgomery product (was 20 before the fix); the 4 remaining branches select the limb of the multiplier by the loop index 0..3, a public value"},16 {"match": "QyvoraSecp256k1.Modulus.montPow(", "max": 3, "why": "square-and-multiply on a PUBLIC exponent (p-2, n-2, (p+1)/4): loop counter and exponent bit"},17 {"match": "QyvoraSecp256k1.Modulus.inverse(", "max": 3, "why": "Fermat inversion with a public exponent"},18 {"match": "static QyvoraSecp256k1.Secp256k1.Point.select(", "max": 0, "why": "masked selection of a point"},19 {"match": "static QyvoraSecp256k1.Secp256k1.Point.add(", "max": 2, "why": "complete addition formulas; the 2 branches are the one-time initialisation checks of the constants (field, 3b)"},20 {"match": "static QyvoraSecp256k1.Secp256k1.Point.double(", "max": 2, "why": "complete doubling; same 2 initialisation checks"},21 {"match": "static QyvoraSecp256k1.Secp256k1.Point.multiply(", "max": 3, "why": "double-and-add-always: loop counter over 256 bits and the limb index of the scalar bit (public position)"},22 {"match": "static QyvoraMath.ConstantTime.isZeroMask(", "max": 0, "why": "mask from a byte"},23 {"match": "static QyvoraMath.ConstantTime.equal(", "max": 10, "why": "length check and vectorised loop control (lengths are public); the accumulator is never tested before the end"},24 {"match": "static QyvoraSymmetric.AES.subBytes(", "max": 0, "why": "bit-sliced S-box: no table, no branch"},25 {"match": "static QyvoraSymmetric.AES.invSubBytes(", "max": 0, "why": "bit-sliced inverse S-box"},26 {"match": "QyvoraSymmetric.AES.encrypt(", "max": 6, "why": "round loop (number of rounds depends on the key LENGTH, public)"},27 {"match": "QyvoraSymmetric.GHASH.update(Swift.UInt64, Swift.UInt64)", "max": 2, "why": "loop over the 64+64 bits of the block with masked table reads"},28 {"match": "QyvoraMLKEM.MLKEM.decapsCore(", "max": 16, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: length and bounds traps on the key and ciphertext sizes, and the control of the vectorised comparison loop (ciphertext length); the accumulated difference is never tested, the choice between K' and the rejection key is ConstantTime.select"},29 {"match": "QyvoraMLKEM.MLKEM.pkeDecrypt(", "max": 10, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: loop counters over k and 256 coefficients, buffer-overlap checks of the vectoriser, one-time initialisation of the zeta table, array uniqueness and bounds"},30 {"match": "QyvoraMLKEM.MLKEM.pkeEncrypt(", "max": 41, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: loop counters, bounds and overflow traps on public sizes, one-time initialisations, and the 3 branches of the rejection sampling of the matrix (SampleNTT, inlined) which test bytes derived from the PUBLIC seed rho; no branch on y, e1, e2, the message or the re-derived randomness"},31 {"match": "QyvoraMLKEM.MLKEM.NTT.forward(", "max": 7, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: layer, block and coefficient loop counters (vectorised and scalar tails), null check of the table pointer"},32 {"match": "QyvoraMLKEM.MLKEM.NTT.inverseToMontgomery(", "max": 9, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: loop counters only"},33 {"match": "QyvoraMLKEM.MLKEM.NTT.multiplyAccumulate(", "max": 7, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: the public `accumulate` flag, buffer-overlap checks, one-time initialisation, loop counters"},34 {"match": "QyvoraMLKEM.MLKEM.Sampling.samplePolyCBD(", "max": 10, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: the public parameter eta (2 or 3), buffer-overlap checks, loop counters; the PRF output bits are combined by masks and shifts only"},35 {"match": "QyvoraMLKEM.MLKEM.Coding.compressEncode(", "max": 10, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: count and bit-width traps, the bit-packing fill counter (a function of d and of the coefficient index, both public), array growth; the quotient by q is a multiplication and a shift"},36 {"match": "QyvoraMLKEM.MLKEM.Coding.decodeDecompress(", "max": 13, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: bit-width traps and the bit-unpacking fill counter (public); operates on the public ciphertext"},37 {"match": "QyvoraMLKEM.MLKEM.Coding.decode12(", "max": 3, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: count check, overflow trap, loop counter"},38 {"match": "QyvoraMLKEM.MLKEM.Coding.messageToPoly(", "max": 3, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: buffer-overlap check and loop counters; each message bit becomes a mask"},39 {"match": "static QyvoraMLKEM.MLKEM.Field.montgomeryReduce(", "max": 0, "why": "multiplication, subtraction, shift"},40 {"match": "static QyvoraMLKEM.MLKEM.Field.multiply(", "max": 0, "why": "Montgomery product"},41 {"match": "static QyvoraMLKEM.MLKEM.Field.barrettReduce(", "max": 0, "why": "Barrett reduction by multiplication and shift"},42 {"match": "static QyvoraMLKEM.MLKEM.Field.canonical(", "max": 0, "why": "sign mask (arithmetic shift), no comparison"},43 {"match": "static QyvoraMLKEM.MLKEM.Field.compress(", "max": 3, "why": "traps on the public bit width d only (out-of-line copy; the hot path is inlined in compressEncode)"},44 {"match": "static QyvoraMLKEM.MLKEM.Field.decompress(", "max": 5, "why": "traps on the public bit width d only"},45 {"match": "static QyvoraMath.ConstantTime.select(", "max": 12, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: length equality trap and loop control of the vectorised masked selection (lengths are public); the mask is never tested"},46 {"match": "in static QyvoraKeccak.KeccakF1600.permute(", "max": 1, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: the round counter"},47 {"match": "in QyvoraKeccak.KeccakSponge.absorb(", "max": 17, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: input length, position in the rate (public) and overflow traps"},48 {"match": "in QyvoraKeccak.KeccakSponge.squeeze(", "max": 11, "why": "ML-KEM decapsulation path, every branch read in the disassembly of Swift 6.3.3 and 6.4.2 (macOS) for QYV-AUD-005: output length, position in the rate, array uniqueness and overflow traps"},49 {"match": "static QyvoraEd25519.Fe.mul(", "max": 0, "why": "field multiplication modulo 2^255-19 (five 51-bit limbs, 128-bit accumulators with carries by bit arithmetic): no branch"},50 {"match": "static QyvoraEd25519.Fe.equalMask(", "max": 0, "why": "equality as a mask: no branch"},51 {"match": "QyvoraEd25519.Fe.isZeroMask", "max": 0, "why": "zero test as a mask on the canonical words: no branch"},52 {"match": "QyvoraEd25519.Fe.isNegative", "max": 0, "why": "parity of the canonical representative: no branch"},53 {"match": "QyvoraEd25519.Fe.toBytes(", "max": 0, "why": "canonical encoding (two carry passes and a masked subtraction of p): no branch"},54 {"match": "QyvoraEd25519.Fe.(pow250", "max": 3, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: the common part of inversion and square root, a fixed addition chain; the 3 branches are the loop counters of three runs of squarings whose lengths are public constants (the shorter runs are unrolled)"},55 {"match": "static QyvoraEd25519.Fe.invert(", "max": 3, "why": "Fermat inversion with the public exponent p-2 (inlined into its callers in the builds reviewed; when visible, only the loop counters of the squaring runs are allowed)"},56 {"match": "static QyvoraEd25519.EdPoint.add(", "max": 1, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: complete unified addition (RFC 8032); the single branch is the one-time initialisation check of the constant 2d"},57 {"match": "static QyvoraEd25519.EdPoint.double(", "max": 0, "why": "doubling: straight-line field operations"},58 {"match": "static QyvoraEd25519.EdPoint.multiply(scalar: [Swift.UInt8], table:", "max": 4, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: fixed-window scalar multiplication, shared by the base-point path (table 1B..16B, no neutral element, QYV-AUD-006) and the variable-base path of verification (64 windows of 4 bits, 4 doublings + 1 masked lookup + 1 addition each); the 4 branches are the two length preconditions (scalar is 32 bytes, table has 16 entries), the counter of the vectorised table scan (16 entries read under a mask: and/orr on NEON registers, no index derived from the scalar) and the window counter 63..0"},59 {"match": "QyvoraEd25519.EdPoint.encode(", "max": 2, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: encoding of a point (inversion of Z, canonical y, sign of x); the 2 branches are the uniqueness check of the output array and its bounds check (length 32)"},60 {"match": "static QyvoraEd25519.Sc.montMul(", "max": 3, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: Montgomery product modulo the group order; the 3 branches are the limb loop (4 iterations) and the choice of the next limb of the multiplier by the loop index 0..3, a public value; the final subtraction is a masked selection"},61 {"match": "static QyvoraEd25519.Sc.mulAdd(", "max": 1, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: S = r + k*a: two Montgomery products and a masked modular addition; the single branch is the one-time initialisation check of R^2 mod l"},62 {"match": "static QyvoraEd25519.Sc.reduceWide(", "max": 2, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: reduction of the 512-bit nonce: the length precondition (64 bytes) and the one-time initialisation check of R^2 mod l"},63 {"match": "static QyvoraEd25519.Sc.reduce(", "max": 1, "why": "reduction of a 256-bit value (inlined into its callers in the builds reviewed; when visible, only the one-time initialisation check is allowed)"},64 {"match": "QyvoraEd25519.Sc.bytes", "max": 0, "why": "serialisation of a scalar: no branch"},65 {"match": "static QyvoraEd25519.Ed25519.expand(seed:", "max": 7, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: SHA-512 of the seed and clamping; the 7 branches are bounds checks on the digest length (64, a public constant) for the two slices and the three clamped bytes, and the uniqueness check of the scalar array before it is modified"},66 {"match": "static QyvoraEd25519.Ed25519.publicKey(seed:", "max": 3, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: the seed-length check (public) and the one-time initialisation checks of the base-point table and of the offset constant of multiplyBase (inlined here; QYV-AUD-006)"},67 {"match": "static QyvoraEd25519.Ed25519.sign(message:", "max": 5, "why": "Ed25519 secret path, every branch read in the disassembly of Swift 6.3.3 (M4M64a) and 6.4 (M5M36), macOS release build, 2026-12-05: the seed-length check, the one-time initialisation checks of the base-point table and of the offset constant of multiplyBase (inlined here; QYV-AUD-006), the length precondition of the clamped scalar (32) and the test of the result of the verification of the signature just produced (a signature is released only when it verifies; in normal operation the branch is never taken)"},68 {"match": "QyvoraSymmetric.SHA512.(compress in", "max": 21, "why": "SHA-512 compression (expanded Ed25519 key, signing nonce, SLIP-0010 and BIP-32 HMAC), every branch read in the disassembly of Swift 6.3.3 and 6.4, 2026-12-05: loop counters of the message schedule (16 and 64 words) and of the 80 rounds, bounds checks on the length of the chaining-state array (8 words, public) and its uniqueness check; no branch on a word of the state or of the block"},69 {"match": "static QyvoraEd25519.EdPoint.multiplyBase(", "max": 2, "why": "base-point multiplication: the fixed-window loop on the shifted table plus one addition of a public constant (inlined into publicKey and sign in the builds reviewed; when visible, only the two one-time initialisation checks are allowed)"}70 ]71}72