226 {
227 int num = sizeof(global::Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER) + curve.Prime.Length + curve.A.Length + curve.B.Length + curve.G.X.Length + curve.G.Y.Length + curve.Order.Length + curve.Cofactor.Length + ((curve.Seed != null) ? curve.Seed.Length : 0);
228 byte[]
array =
new byte[num];
229 fixed (
byte* ptr = &
array[0])
230 {
231 global::Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER* ptr2 = (global::Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER*)ptr;
232 ptr2->Version = 1;
233 ptr2->cbCofactor = curve.Cofactor.Length;
234 ptr2->cbFieldLength = curve.A.Length;
235 ptr2->cbSeed = ((curve.Seed != null) ? curve.Seed.Length : 0);
236 ptr2->cbSubgroupOrder = curve.Order.Length;
239 int offset =
sizeof(global::Interop.BCrypt.BCRYPT_ECC_PARAMETER_HEADER);
240 global::Interop.BCrypt.Emit(
array, ref
offset, curve.Prime);
241 global::Interop.BCrypt.Emit(
array, ref
offset, curve.A);
242 global::Interop.BCrypt.Emit(
array, ref
offset, curve.B);
243 global::Interop.BCrypt.Emit(
array, ref
offset, curve.G.X);
244 global::Interop.BCrypt.Emit(
array, ref
offset, curve.G.Y);
245 global::Interop.BCrypt.Emit(
array, ref
offset, curve.Order);
246 global::Interop.BCrypt.Emit(
array, ref
offset, curve.Cofactor);
247 if (curve.Seed != null)
248 {
249 global::Interop.BCrypt.Emit(
array, ref
offset, curve.Seed);
250 }
251 }
253 }
static global::Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM GetHashAlgorithmId(HashAlgorithmName? name)
static global::Interop.BCrypt.ECC_CURVE_TYPE_ENUM ConvertToCurveTypeEnum(ECCurve.ECCurveType value)