How can an "official" ROM be verified? I'd like to substitute the brand ROM on an huawei p10 with the official ROM one can find in the popular xda forum or alike. 

I'm a bit paranoid in this regard so, in order to be reasonably sure no one tempered the "official" ROM, how can I verify it's actually the one that comes with unbranded Huawei phones since, as far as I know, Huawei doesn't provide the ROM itself nor the md5?
Most of stock recoveries has an option for verification of system integrity.

It checks your ROM and reports deleted, modified and added files or any unauthorized change.

It is labeled as 'verify system integrity' or similar in my moto phone, it should be available in your ROM.