Skip to content

fix: JSON output drops pubkey from recovered key #23

Description

@oritwoen

RecoveredKey in attack/mod.rs:33-38 includes a pubkey field:

pub struct RecoveredKey {
    pub private_key: Scalar,
    pub private_key_decimal: String,
    pub private_key_hex: String,
    pub pubkey: Option<String>,  // ← present in domain type
}

But the serializable RecoveredKeyOutput in main.rs:188-192 drops it:

struct RecoveredKeyOutput {
    private_key_decimal: String,
    private_key_hex: String,
    // pubkey missing
}

When analyzing a dataset with signatures from multiple public keys, the JSON output shows recovered private keys but doesn't say which pubkey each one belongs to. The pubkey field IS present at the vulnerability level, but not on the recovered key itself — so if you're programmatically consuming the output, you have to correlate vulnerability-level pubkey with recovered key yourself.

Adding pubkey: Option<String> to RecoveredKeyOutput (and populating it from key.pubkey) would make the JSON output self-contained. The human-readable output already shows the pubkey at the vulnerability level, so this mainly matters for --json consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions