{"id":271543,"date":"2016-01-03T17:33:02","date_gmt":"2016-01-03T14:33:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271543"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271543","title":{"rendered":"\u0420\u0438\u0441\u0443\u0435\u043c \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u0440\u0438\u0432\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SQL"},"content":{"rendered":"<p>       \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u0440\u0438\u0432\u044b\u0445 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 RSA, \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430 \u0438 \u0432 DSS, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043f\u0440\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u0435 \u043a\u043b\u044e\u0447\u0430.<\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0415 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<p>   \u2014 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 <\/p>\n<p>  \u0438\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n:<\/p>\n<p>   \u2014 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 mod N<\/p>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0443 <b>\u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b> \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439.<\/p>\n<h2>\u042d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R, \u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0438 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0448\u043a\u043e\u043b\u044b<\/p>\n<p>  \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b N a1 a2 a3 a4 a6 xmin xmax  <\/p>\n<ol>\n<li>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d [xmin \u2014 xmax] \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 x <\/li>\n<li>\u041e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 x \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 x1,&#8230;,xN<\/li>\n<li>\u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 x1,&#8230;,xN \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u0440\u043d\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a <\/li>\n<li>\u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435 \u00ab\u0432\u0435\u0440\u0445\u043d\u0438\u0435\u00bb \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438 \u0432\u0441\u0435 \u00ab\u043d\u0438\u0436\u043d\u0438\u0435\u00bb \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435<\/li>\n<\/ol>\n<p>  <a name=\"habracut\"><\/a><br \/>   \u2014 a=a(x)=1<br \/>   \u2014 b=b(x)=a1*x+a3<br \/>   \u2014 c=c(x)=-(x^3+a2*x^2+a4*x+a6)<\/p>\n<p>   \u2014 ayy+by+c=0<br \/>   \u2014 D=bb-4ac<br \/>   \u2014 y1=(-b-sqrt(D))\/(2a)<br \/>   \u2014 y2=(-b+sqrt(D))\/(2a)<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<pre><code class=\"cs\">        private void button1_Click(object sender, EventArgs e)         {             LockForm();              \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439             double a1 = GetA1();             double a2 = GetA2();             double a3 = GetA3();             double a4 = GetA4();             double a6 = GetA6();              \/\/ \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432             double xmin = GetXmin();             double xmax = GetXmax();             ulong n = GetN();              \/\/ http:\/\/stackoverflow.com\/questions\/10622674\/chart-creating-dynamically-in-net-c-sharp             var series1 = new Series             {                 Name = &quot;Series1&quot;,                 Color = Color.Black,                 IsVisibleInLegend = false,                 IsXValueIndexed = true,                 ChartType = SeriesChartType.Line             };              var series2 = new Series             {                 Name = &quot;Series2&quot;,                 Color = Color.Black,                 IsVisibleInLegend = false,                 IsXValueIndexed = true,                 ChartType = SeriesChartType.Line             };              var sb = new StringBuilder();             var sb1 = new StringBuilder();             sb.AppendLine(&quot;y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6&quot;);             sb.AppendLine(&quot;a1=&quot; + a1);             sb.AppendLine(&quot;a2=&quot; + a2);             sb.AppendLine(&quot;a3=&quot; + a3);             sb.AppendLine(&quot;a4=&quot; + a4);             sb.AppendLine(&quot;a6=&quot; + a6);             sb.AppendLine();             sb.AppendLine(&quot;# X Y1 Y2&quot;);             sb1.AppendLine(&quot;# X Y1 Y2&quot;);             for (ulong i = 0; i &lt;= n; i++)             {                 double x = (xmin*(n - i) + xmax*i)\/n;                  \/\/ \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e X                 const double a = 1;                 double b = a1*x + a3;                 double c = -(x*x*x + a2*x*x + a4*x + a6);                  \/\/ \u041f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u0437\u0430 \u0448\u0435\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0448\u043a\u043e\u043b\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f                 double d = b*b - 4*a*c;                 if (d &lt; 0) continue;                  double y1 = (-b - Math.Sqrt(d))\/(2*a);                 double y2 = (-b + Math.Sqrt(d))\/(2*a);                  series1.Points.AddXY(x, y1);                 series2.Points.AddXY(x, y2);                  sb.AppendLine(x + &quot; &quot; + y1 + &quot; &quot; + y2);                 sb1.AppendLine(x + &quot; &quot; + y1 + &quot; &quot; + y2);             }              \/\/ \u0412\u044b\u0434\u0430\u0451\u043c \u043e\u0442\u0447\u0451\u0442 \u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435             SetChart(series1, series2);             SetReport(sb.ToString());             SetReport1(sb1.ToString());              UnlockForm();             ActivatePage(2);         } <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/dprotopopov\/mssove3\/master\/EllipticR.jpg\" alt=\"\u042d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R\"\/><\/p>\n<h2>\u042d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0432 \u043a\u043e\u043b\u044c\u0446\u0435 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n, \u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c rendezvous \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0415:<\/p>\n<p>   \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b N a1 a2 a3 a4 a6<\/p>\n<ol>\n<li>\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f<\/li>\n<li>\u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0434\u043b\u044f \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446<\/li>\n<li>\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043b\u0435\u0432\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0415, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DBMS, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u044d\u0442\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<p>  t1<br \/>  x key1 = x^3+a2*x^2+a4*x+a6 mod N<br \/>  1\u2026<br \/>  2\u2026<br \/>  3\u2026<br \/>  \u2026<br \/>  N rN<\/p>\n<p>  t2<br \/>  y key2 = y^2+a3*y mod N<br \/>  1\u2026<br \/>  2\u2026<br \/>  3\u2026<br \/>  \u2026<br \/>  N lN<\/p>\n<p>  t3<br \/>  x y key3=a1*x*y mod N<br \/>  1 1\u2026<br \/>  1 2\u2026<br \/>  \u2026<br \/>  N N\u2026<\/p>\n<p>  if(a1!=0 mod N) select t1.x,t2.y from t1, t2, t3 where (key1=key2+key3 or key1+N=key2+key3) and t1.x=t3.x and t2.y=t3.y<br \/>  if(a1==0 mod N) select t1.x,t2.y from t1, t2 where key1=key2<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>   \u2014 DBMS \u2014 SQLite  <\/p>\n<pre><code class=\"cs\">        private void button1_Click(object sender, EventArgs e)         {             LockForm();              \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043b\u044c\u0446\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n             var n = GetN();              \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439             var a1 = GetA1();             var a2 = GetA2();             var a3 = GetA3();             var a4 = GetA4();             var a6 = GetA6();              \/\/ http:\/\/stackoverflow.com\/questions\/9173485\/how-can-i-create-an-in-memory-sqlite-database             var connection = new SQLiteConnection(&quot;Data Source=:memory:&quot;);             connection.Open();              \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b             string[] sqls1 =             {                 &quot;CREATE TABLE t1 (x INTEGER , key1 INTEGER )&quot;,                 &quot;CREATE TABLE t2 (y INTEGER , key2 INTEGER )&quot;,                 &quot;CREATE TABLE t3 (x INTEGER , y INTEGER , key3 INTEGER )&quot;             };              foreach (var sql in sqls1)                 new SQLiteCommand(sql, connection).ExecuteNonQuery();              \/\/ \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438             for (ulong x = 0; x &lt; n; x++)             {                 var x2 = (x*x)%n;                 var x3 = (x2*x)%n;                 var a2X2 = (a2*x2)%n;                 var a4X = (a4*x)%n;                 var key1 = (x3 + a2X2 + a4X + a6)%n;                 var sql = string.Format(&quot;INSERT INTO t1 (x, key1) VALUES ({0},{1})&quot;, x, key1);                 new SQLiteCommand(sql, connection).ExecuteNonQuery();             }              for (ulong y = 0; y &lt; n; y++)             {                 var y2 = y*y%n;                 var a3Y = (a3*y)%n;                 var key2 = (y2 + a3Y)%n;                 var sql = string.Format(&quot;INSERT INTO t2 (y, key2) VALUES ({0},{1})&quot;, y, key2);                 new SQLiteCommand(sql, connection).ExecuteNonQuery();             }              if ((a1%n) != 0)                 for (ulong x = 0; x &lt; n; x++)                 {                     var a1X = (a1*x)%n;                     for (ulong y = 0; y &lt; n; y++)                     {                         var key3 = (a1X*y)%n;                         var sql = string.Format(&quot;INSERT INTO t3 (x, y, key3) VALUES ({0},{1},{2})&quot;, x, y, key3);                         new SQLiteCommand(sql, connection).ExecuteNonQuery();                     }                 }              \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446             string[] sqls2 =             {                 &quot;CREATE INDEX t1key1 ON t1 (key1)&quot;,                 &quot;CREATE INDEX t2key2 ON t2 (key2)&quot;,                 &quot;CREATE INDEX t3key3 ON t3 (key3)&quot;,                 &quot;CREATE UNIQUE INDEX t1x ON t1 (x)&quot;,                 &quot;CREATE UNIQUE INDEX t2y ON t2 (y)&quot;,                 &quot;CREATE INDEX t3x ON t3 (x)&quot;,                 &quot;CREATE INDEX t3y ON t3 (y)&quot;             };              foreach (var sql in sqls2)                 new SQLiteCommand(sql, connection).ExecuteNonQuery();              \/\/ http:\/\/stackoverflow.com\/questions\/10622674\/chart-creating-dynamically-in-net-c-sharp             var series1 = new Series             {                 Name = &quot;Series1&quot;,                 Color = Color.Black,                 IsVisibleInLegend = false,                 IsXValueIndexed = true,                 ChartType = SeriesChartType.Point             };              \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c JOIN \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b             \/\/ \u0427\u0435\u043c \u0434\u043e\u0440\u043e\u0436\u0435 DBMS \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432             var select = ((a1%n) == 0)                 ? &quot;SELECT t1.x,t2.y FROM t1, t2 WHERE key1=key2&quot;                 : &quot;SELECT t1.x,t2.y FROM t1, t2, t3 WHERE (key1=key2+key3 or key1+&quot; + n +                   &quot;=key2+key3) AND t1.x=t3.x AND t2.y=t3.y&quot;;             var reader = new SQLiteCommand(select, connection).ExecuteReader();             var sb = new StringBuilder();             var sb1 = new StringBuilder();             sb.AppendLine(&quot;y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 mod n&quot;);             sb.AppendLine(&quot;n=&quot; + n);             sb.AppendLine(&quot;a1=&quot; + a1);             sb.AppendLine(&quot;a2=&quot; + a2);             sb.AppendLine(&quot;a3=&quot; + a3);             sb.AppendLine(&quot;a4=&quot; + a4);             sb.AppendLine(&quot;a6=&quot; + a6);             sb.AppendLine();             sb.AppendLine(&quot;# X Y&quot;);             sb1.AppendLine(&quot;# X Y&quot;);             while (reader.Read())             {                 var x = Convert.ToInt32(reader[0]);                 var y = Convert.ToInt32(reader[1]);                 series1.Points.AddXY(x, y);                 sb.AppendLine(x + &quot; &quot; + y);                 sb1.AppendLine(x + &quot; &quot; + y);             }              \/\/ \u0412\u044b\u0434\u0430\u0451\u043c \u043e\u0442\u0447\u0451\u0442 \u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435             SetChart(series1);             SetReport(sb.ToString());             SetReport1(sb1.ToString());             connection.Close();              UnlockForm();             ActivatePage(2);         } <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/dprotopopov\/mssove3\/master\/EllipticZn.jpg\" alt=\"\u042d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0432 \u043a\u043e\u043b\u044c\u0446\u0435 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n\"\/><\/p>\n<p>  <b>\u0427\u0442\u043e \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c<\/b><\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"https:\/\/github.com\/dprotopopov\/mssove3\">https:\/\/github.com\/dprotopopov\/mssove3<\/a>               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274473\/\"> http:\/\/habrahabr.ru\/post\/274473\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u0440\u0438\u0432\u044b\u0445 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 RSA, \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430 \u0438 \u0432 DSS, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430\u044f \u0437\u0430\u0449\u0438\u0442\u0430 \u043f\u0440\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u0435 \u043a\u043b\u044e\u0447\u0430.<\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0415 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<p>   \u2014 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 <\/p>\n<p>  \u0438\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430 \u0432\u044b\u0447\u0435\u0442\u043e\u0432 Z|n:<\/p>\n<p>   \u2014 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 mod N<\/p>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0443 <b>\u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b> \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439.<\/p>\n<h2>\u042d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0415 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b R, \u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u043d\u0438\u044f \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0438 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0448\u043a\u043e\u043b\u044b<\/p>\n<p>  \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b N a1 a2 a3 a4 a6 xmin xmax  <\/p>\n<ol>\n<li>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d [xmin \u2014 xmax] \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 x <\/li>\n<li>\u041e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 x \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 x1,&#8230;,xN<\/li>\n<li>\u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 x1,&#8230;,xN \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 y^2+a1*x*y+a3*y = x^3+a2*x^2+a4*x+a6 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u0440\u043d\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 y \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a <\/li>\n<li>\u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435 \u00ab\u0432\u0435\u0440\u0445\u043d\u0438\u0435\u00bb \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438 \u0432\u0441\u0435 \u00ab\u043d\u0438\u0436\u043d\u0438\u0435\u00bb \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435<\/li>\n<\/ol>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271543","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271543"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271543\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}