-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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.