Skip to content

Perf: KPA prefilter re-runs full RC4 KSA per silence index #7

Description

@felixx-sp

Confidence: medium · Effort: medium (1-3 d)

Problem

The KPA pre-filter macros KPA_PREFILTER_A/B (bruteforce.cu:213-246) call kpa_silence_check_dev once per d_const_silence_idx entry. Each check internally does a fresh rc4_ksa9_dev + full rc4_discard_dev(256) for every candidate key — even when multiple silence indices fall inside the same superframe and could share one KSA setup.

Files: src/bruteforce.cu:213-246 (macros), src/bruteforce.cu:865-880 (caller — ILP-2 kernel superframe loop)

Suggested fix

When d_const_n_silence > 1, group silence indices by their superframe (idx / 6) so a single KSA + discard serves all silence checks within the same superframe. Could be done by sorting silence_idx[] at upload time and amortizing inside kpa_silence_check_dev.

Why it matters

KPA pre-filter is on the hot path before any wrong-key rejection. Each saved KSA is ~256 S-box swaps × N silence indices × N keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions