Nitrokey HSM P-384 ECDSA hash function

Hi there,

What hash function/size does the Nitrokey HSM use when performing ECDSA with P-384? The YubiHSM uses SHA2-256 for P-256 and SHA2-384 for P-384, so I wanted to confirm that the Nitrokey HSM does the same.

You can actually select what hash algorithm is used. You can hash externally and just provide the hash result as input to the ECDSA operation, or you can chose a combination of hash-algorithm with ECDSA. The key size does not really matter, as the hash output is either truncated or extended to the actual field size. It is perfectly valid to use SHA-1 with a P-521 curve.

Thanks. I’m aware that it’s valid to use any hash function with any curve, but was curious whether there was a default parameter selection in place for each curve + ECDSA. If now, manual selection is fine.