<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />

System.Security.Cryptography.ECDiffieHellmanKeyDerivationFunction

Specifies the key derivation function that the ECDiffieHellmanCng class will use to convert secret agreements into key material.
Hash = 0

A hash algorithm is used to generate key material. The HashAlgorithm property specifies the name of the algorithm to use. If the algorithm name is not specified, SHA256 is used as the default algorithm. You can also specify the SecretPrepend and SecretAppend properties, but they are not required. The amount of key material that is generated is equivalent to the size of the hash value for the specified algorithm.

Hmac = 1

A Hash-based Message Authentication Code (HMAC) algorithm is used to generate key material. The HmacKey property specifies the key to use. Either this property must be set or the UseSecretAgreementAsHmacKey property must be set to true; otherwise, a CryptographicException is thrown when you use Hmac. If both properties are set, the secret agreement is used as the HMAC key. You can also specify the SecretPrepend and SecretAppend properties, but they are not required. The amount of key material that is generated is equivalent to the size of the HMAC value.

Tls = 2

The Transport Layer Security (TLS) protocol is used to generate key material. The Seed and Label properties must be set; otherwise, a CryptographicException is thrown when you use Tls. This value generates 160 bits of key material.