Skip to main content
Associate II
October 11, 2024
Solved

PKHTH calculation from public key hashes

  • October 11, 2024
  • 1 reply
  • 1197 views

Hello,

I have 8 pairs of public and private keys with the hashes of each public key and I would like to calculate the associated PKHTH value without necessarily using the STM32MP_KeyGen_CLI tool (for integration with our manufacturing tool).

I tried to calculate the sha256 of all the concatenated hashes of the public keys but this value does not correspond to the one calculated by STM32MP_KeyGen_CLI. Is there anything else I should include in my PKHTH calculation?

Thank you

Best answer by zakariazh

I've found how to do it, just get the ESCDA public key without the asn1 tag (“04”) then add the ECDSA algorithm field at the beginning and calculate the sha256 of the whole. This will give the hash of this key.

Finally, calculate the sha256 of all these hashes to get the PKHTH.

 

Thank you

1 reply

zakariazhAuthorBest answer
Associate II
October 12, 2024

I've found how to do it, just get the ESCDA public key without the asn1 tag (“04”) then add the ECDSA algorithm field at the beginning and calculate the sha256 of the whole. This will give the hash of this key.

Finally, calculate the sha256 of all these hashes to get the PKHTH.

 

Thank you