Deejuha / SecureHardwareExtension

A set of tools for Secure Hardware Extension
MIT License
6 stars 2 forks source link

Incorrect m2 plain generation #13

Open Henki92 opened 6 days ago

Henki92 commented 6 days ago

Thanks for the nice library. It looks like the m2 generation is incorrectly done (interpretation of the different documents used as base) FID creation. Now:
fid = (self.update_info.fid & 0b111111) << 95

Depending on if you use autosar or the vector definition you have 5 or 6 bits for fid flags this means you either need to left shift 94 times or 95 times. 6 bits = shift 94 times 5 bits = shift 95 times. (Now it is 6 bits and shifting 95 times).

Deejuha commented 6 days ago

Thanks, I will have a look - feel free to propose a PR if I would be too slow