Created
August 6, 2023 12:20
-
-
Save nishanc/e939b02b38afa4b89fcb97fadeb6e83c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hashing example | |
if (SHA3_256.IsSupported) | |
{ | |
byte[] hash = SHA3_256.HashData(dataToHash); | |
} | |
else | |
{ | |
// ... | |
} | |
// Signing example | |
if (SHA3_256.IsSupported) | |
{ | |
using ECDsa ec = ECDsa.Create(ECCurve.NamedCurves.nistP256); | |
byte[] signature = ec.SignData(dataToBeSigned, HashAlgorithmName.SHA3_256); | |
} | |
else | |
{ | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment