Skip to content

feat: consider switching signature format from ASN.1 to raw #28

@oreparaz

Description

@oreparaz

Today we are encoding ECDSA signatures in ASN.1 DER format. This is pretty much the standard. However, signature size in this format isn't constant. Although signature max size is 72 bytes for P-256, there are valid signatures that encode to shorter byte sequence.

The price we pay for convenience (using a standardized format) is complexity: PopSignature needs to do some minimal ASN.1 parsing. While this seems fine today in the current implementation, in other languages might get trickier. We might want to revisit this and move to a "raw" format: concatenate (r,s) and encode each integer as fixed-size, 0-padded, big-endian byte sequence.

There's also not a strong binding between signature scheme (ECDSA over P-256 w/SHA-256) and public keys; this binding is implicit via MachineType so any change to signature scheme / representation needs a bump in MachineType.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions