I'm writing code to parse container file. And found that there are 3 similar struct headers used to indicate data block's TAG, SIZE and VERSION:
A: { VERSION, LENGTH_L, LENGHT_H, TAG}
Used in Container, SignatureBlock, Signature, Certificate, Block(DEK)'s header.
B: {TAG, LENGTH_L/H, LENGHT_H/L, VERSION}
Used in SRK Table's header.
C: {Tag, LENGTH_L/H, LENGHT_H/L}
Used in SRK Record's header
P.S. I use `L/H` because there are labled as `Variable` in a fixed length of 2 bytes in i.MX8 RM Rev.0
This two make me confused:
- Why not use same structures?
- Why not place TAG to the first byte of a structure?