101 {
102 if (specifiedParameters.
Version < 1 || specifiedParameters.
Version > 3)
103 {
105 }
106 if (specifiedParameters.
Version > 1 && !specifiedParameters.
Curve.
Seed.HasValue)
107 {
109 }
111 bool flag;
113 if (!(fieldType == "1.2.840.10045.1.1"))
114 {
115 if (!(fieldType == "1.2.840.10045.1.2"))
116 {
118 }
119 flag = false;
124 {
126 }
127 int value2 = -1;
128 int value3 = -1;
130 int value4;
131 if (!(
text ==
"1.2.840.10045.1.2.3.2"))
132 {
133 if (!(
text ==
"1.2.840.10045.1.2.3.3"))
134 {
136 }
139 {
141 }
143 }
145 {
147 }
153 if (value2 > 0)
154 {
157 }
161 }
162 else
163 {
164 flag = true;
168 if (readOnlySpan[0] == 0)
169 {
170 readOnlySpan = readOnlySpan.Slice(1);
171 }
172 if (readOnlySpan.Length > 82)
173 {
175 }
176 array = readOnlySpan.ToArray();
177 }
178 ECCurve result;
179 if (flag)
180 {
181 ECCurve eCCurve = default(ECCurve);
182 eCCurve.CurveType = ECCurve.ECCurveType.PrimeShortWeierstrass;
183 eCCurve.Prime =
array;
184 result = eCCurve;
185 }
186 else
187 {
188 ECCurve eCCurve = default(ECCurve);
189 eCCurve.CurveType = ECCurve.ECCurveType.Characteristic2;
190 eCCurve.Polynomial =
array;
191 result = eCCurve;
192 }
193 result.A = specifiedParameters.
Curve.
A.ToUnsignedIntegerBytes(
array.Length);
194 result.B = specifiedParameters.
Curve.
B.ToUnsignedIntegerBytes(
array.Length);
195 result.Order = specifiedParameters.
Order.ToUnsignedIntegerBytes(
array.Length);
196 ReadOnlySpan<byte> span = specifiedParameters.
Base.
Span;
197 if (span[0] != 4 || span.Length != 2 *
array.Length + 1)
198 {
200 }
201 result.G.X = span.Slice(1,
array.Length).ToArray();
202 result.G.Y = span.Slice(1 +
array.Length).ToArray();
203 if (specifiedParameters.
Cofactor.HasValue)
204 {
205 result.Cofactor = specifiedParameters.
Cofactor.Value.ToUnsignedIntegerBytes();
206 }
207 return result;
208 }
void Set(int index, bool value)
unsafe void CopyTo(Array array, int index)
static string Cryptography_Der_Invalid_Encoding
unsafe ReadOnlySpan< T > Span
ReadOnlyMemory< byte >? Seed
ReadOnlyMemory< byte > Parameters
ReadOnlyMemory< byte > Order
ReadOnlyMemory< byte >? Cofactor
ReadOnlyMemory< byte > Base