You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestion: use fixed-size encoding for RSA signatures
SignedSSVMessage.Signatures is currently defined as:
Signatures [][]byte`ssz-max:"13,256"`
Since RSA-2048 signatures are always exactly 256 bytes (output is always the size of the modulus), the inner dimension could use fixed-size encoding instead of variable-length. The current ssz-max:"13,256" allows signatures shorter than 256 bytes at the wire level, which are never valid for RSA-2048.
Using fixed-size inner encoding would:
Enforce the invariant at the SSZ layer
Produce slightly more compact encoding (no offset pointers per signature)
Eliminate the need for runtime signature size validation
This came up during review of structural validation in Anchor — the VariableList<u8, U256> type (matching the Go spec) only guarantees <= 256, not == 256, so exact-size checks must be done at validation time rather than being enforced by the type system.
Activity
diegomrsantos commentedon Mar 4, 2026
Suggestion: use fixed-size encoding for RSA signatures
SignedSSVMessage.Signaturesis currently defined as:Since RSA-2048 signatures are always exactly 256 bytes (output is always the size of the modulus), the inner dimension could use fixed-size encoding instead of variable-length. The current
ssz-max:"13,256"allows signatures shorter than 256 bytes at the wire level, which are never valid for RSA-2048.Using fixed-size inner encoding would:
This came up during review of structural validation in Anchor — the
VariableList<u8, U256>type (matching the Go spec) only guarantees<= 256, not== 256, so exact-size checks must be done at validation time rather than being enforced by the type system.fix: validate SignedSSVMessage on SSZ-decoded network messages (#853)