Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ TrySignHashCore()

unsafe override bool System.Security.Cryptography.ECDsaImplementation.ECDsaCng.TrySignHashCore ( ReadOnlySpan< byte > hash,
Span< byte > destination,
DSASignatureFormat signatureFormat,
out int bytesWritten )
inlineprotectedvirtual

Reimplemented from System.Security.Cryptography.ECDsa.

Definition at line 339 of file ECDsaImplementation.cs.

340 {
341 using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
342 {
343 if (!keyHandle.TrySignHash(hash, destination, global::Interop.NCrypt.AsymmetricPaddingMode.None, null, out bytesWritten))
344 {
345 bytesWritten = 0;
346 return false;
347 }
348 }
349 return signatureFormat switch
350 {
351 DSASignatureFormat.IeeeP1363FixedFieldConcatenation => true,
352 DSASignatureFormat.Rfc3279DerSequence => AsymmetricAlgorithmHelpers.TryConvertIeee1363ToDer(destination.Slice(0, bytesWritten), destination, out bytesWritten),
353 _ => throw new CryptographicException(System.SR.Cryptography_UnknownSignatureFormat, signatureFormat.ToString()),
354 };
355 }
static bool TryConvertIeee1363ToDer(ReadOnlySpan< byte > input, Span< byte > destination, out int bytesWritten)
static string Cryptography_UnknownSignatureFormat
Definition SR.cs:156
Definition SR.cs:7

References System.SR.Cryptography_UnknownSignatureFormat, System.destination, System.Security.Cryptography.ECDsaImplementation.ECDsaCng.GetDuplicatedKeyHandle(), and Internal.Cryptography.AsymmetricAlgorithmHelpers.TryConvertIeee1363ToDer().

Referenced by System.Security.Cryptography.ECDsaImplementation.ECDsaCng.TrySignHash().