Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ComputeQLength()

unsafe int System.Security.Cryptography.DSACng.ComputeQLength ( )
inlineprivate

Definition at line 450 of file DSACng.cs.

451 {
452 byte[] array;
453 using (GetDuplicatedKeyHandle())
454 {
455 array = ExportKeyBlob(includePrivateParameters: false);
456 }
457 if (array.Length < sizeof(global::Interop.BCrypt.BCRYPT_DSA_KEY_BLOB_V2))
458 {
459 return 20;
460 }
461 fixed (byte* ptr = array)
462 {
463 global::Interop.BCrypt.BCRYPT_DSA_KEY_BLOB_V2* ptr2 = (global::Interop.BCrypt.BCRYPT_DSA_KEY_BLOB_V2*)ptr;
464 if (ptr2->Magic != global::Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_DSA_PUBLIC_MAGIC_V2 && ptr2->Magic != global::Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_DSA_PRIVATE_MAGIC_V2)
465 {
466 return 20;
467 }
468 return ptr2->cbGroupSize;
469 }
470 }
SafeNCryptKeyHandle GetDuplicatedKeyHandle()
Definition DSACng.cs:96
byte[] ExportKeyBlob(bool includePrivateParameters)
Definition DSACng.cs:67

References System.array, System.Security.Cryptography.DSACng.ExportKeyBlob(), and System.Security.Cryptography.DSACng.GetDuplicatedKeyHandle().

Referenced by System.Security.Cryptography.DSACng.AdjustHashSizeIfNecessary().