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

◆ ExportNamedCurveParameters() [2/2]

static unsafe void System.Security.Cryptography.ECCng.ExportNamedCurveParameters ( ref ECParameters ecParams,
byte[] ecBlob,
bool includePrivateParameters )
inlinestaticpackage

Definition at line 162 of file ECCng.cs.

163 {
164 global::Interop.BCrypt.KeyBlobMagicNumber magic = (global::Interop.BCrypt.KeyBlobMagicNumber)BitConverter.ToInt32(ecBlob, 0);
165 CheckMagicValueOfKey(magic, includePrivateParameters);
166 if (ecBlob.Length < sizeof(global::Interop.BCrypt.BCRYPT_ECCKEY_BLOB))
167 {
168 throw global::Interop.NCrypt.ErrorCode.E_FAIL.ToCryptographicException();
169 }
170 fixed (byte* ptr = &ecBlob[0])
171 {
172 global::Interop.BCrypt.BCRYPT_ECCKEY_BLOB* ptr2 = (global::Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)ptr;
173 int offset = sizeof(global::Interop.BCrypt.BCRYPT_ECCKEY_BLOB);
174 ecParams.Q = new ECPoint
175 {
176 X = global::Interop.BCrypt.Consume(ecBlob, ref offset, ptr2->cbKey),
177 Y = global::Interop.BCrypt.Consume(ecBlob, ref offset, ptr2->cbKey)
178 };
179 if (includePrivateParameters)
180 {
181 ecParams.D = global::Interop.BCrypt.Consume(ecBlob, ref offset, ptr2->cbKey);
182 }
183 }
184 }
static void CheckMagicValueOfKey(global::Interop.BCrypt.KeyBlobMagicNumber magic, bool includePrivateParameters)
Definition ECCng.cs:224

References System.Security.Cryptography.ECCng.CheckMagicValueOfKey(), System.offset, System.BitConverter.ToInt32(), System.X, and System.Y.