Expand description
0x80-padding rules used by the secure channel.
§Spec: Annex D.5
- MAC: pad input with
0x80then zeros only if it isn’t already a multiple of 16. - DATA encryption (SCS_17/18): pad with
0x80then zeros, always (even when the input is already a multiple of 16).
Functions§
- pad_
data - Append 0x80-padding for encrypted DATA (“always”).
- pad_mac
- Append 0x80-padding for MAC inputs (“only if needed”).
- unpad_
data - Strip 0x80-padding from decrypted DATA. Returns the stripped slice.