How to calculate fingerprint of Prime256v1 public key?

38 views Asked by At

A Prime256v1 public key consists of two points (x, y). These can be encoded in different formats. I don't mean e.g. DER, but compressed, uncompressed and hybrid format. At least I found those here: [1].

I want to create a SHA256 fingerprint of a public-key. I would convert them to uncompressed format (32 bytes), concat them and hash the result:

SHA256(x_uncompressed || y_uncompressed)

Is this correct? I have found very little information online. I think converting them to the same format is important, otherwise the same key could produce different results, but I am not sure to what format I should convert them.

Thank you very much.

[1] https://github.com/bcgit/pc-dart/blob/8213731f5d4c50afc76d79f84653788e8b579303/lib/ecc/ecc_base.dart#L198

0

There are 0 answers