{"id":349,"date":"2018-02-05T15:30:04","date_gmt":"2018-02-05T06:30:04","guid":{"rendered":"http:\/\/tamatoyaku.com\/b\/?p=349"},"modified":"2018-02-05T15:30:04","modified_gmt":"2018-02-05T06:30:04","slug":"349","status":"publish","type":"post","link":"https:\/\/p-0.me\/b\/p\/349\/","title":{"rendered":"C\u8a00\u8a9e\u3067\u6955\u5186\u66f2\u7dda\u306e\u52c9\u5f37(4.\u52a0\u6cd5\u516c\u5f0f)"},"content":{"rendered":"<p>\u6709\u9650\u4f53Fp\u4e0a\u306e\u6955\u5186\u66f2\u7dda\u4e0a\u306e\u6709\u7406\u70b9\u306e\u52a0\u7b97\u3092\u8003\u3048\u308b\uff0e<br \/>\n\u3068\u306f\u8a00\u3063\u3066\u3082\uff0c\u300e<a href=\"https:\/\/researchmap.jp\/mulzrkzae-42427\/\">\u6955\u5186\u66f2\u7dda\u6697\u53f7\u5165\u9580<\/a>\u300f\u3092\u898b\u305f\u307b\u3046\u304c\u5206\u304b\u308a\u3084\u3059\u3044\uff0e<br \/>\n<!--more--><br \/>\n\u5b9a\u7fa91.20\u81ea\u4f53\u304c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3063\u307d\u304f\u66f8\u304b\u308c\u3066\u3044\u308b\u3051\u3069\uff0c\u305d\u308c\u3092C\u8a00\u8a9e\u3068\u3057\u3066\u66f8\u304d\u8d77\u3053\u3059\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\uff0e<br \/>\n\u305f\u3060\u3057\u4e00\u7b87\u6240\uff0cy_P=-y_Q\u3067\u306f\u306a\u304fx_P=x_Q\u304b\u3064y_P=-y_Q\u3068\u306a\u3063\u305f\u3068\u304d\u306bR\u3092\u7121\u9650\u9060\u70b9\u3068\u3057\u3066\u3044\u308b\uff0e<br \/>\n&nbsp;<\/p>\n<pre class=\"lang:c decode:true \" title=\"add\">void add(point *P,point *Q,point *R,int a,int p){\n\tint x,y,d;\n\tif(P-&gt;x==-1&amp;&amp;P-&gt;y==-1){\n\t\tR-&gt;x=Q-&gt;x;\n\t\tR-&gt;y=Q-&gt;y;\n\t}else if(Q-&gt;x==-1&amp;&amp;Q-&gt;y==-1){\n\t\tR-&gt;x=P-&gt;x;\n\t\tR-&gt;y=P-&gt;y;\n\t}else{\n\t\tif(P-&gt;x==Q-&gt;x&amp;&amp;P-&gt;y==mod(-Q-&gt;y,p)){\n\t\t\tR-&gt;x=-1;\n\t\t\tR-&gt;y=-1;\n\t\t}else{\n\t\t\tint lambda;\n\t\t\tint numerator,denominator;\n\t\t\tif(P-&gt;x!=Q-&gt;x){\n\t\t\t\tnumerator=P-&gt;y-Q-&gt;y;\n\t\t\t\tdenominator=P-&gt;x-Q-&gt;x;\n\t\t\t}else{\n\t\t\t\tnumerator=3*P-&gt;x*P-&gt;x+a;\n\t\t\t\tdenominator=2*P-&gt;y;\n\t\t\t}\n\t\t\tnumerator=mod(numerator,p);\n\t\t\tdenominator=mod(denominator,p);\n\t\t\textgcd(p,denominator,&amp;x,&amp;y,&amp;d);\n\t\t\tlambda=mod(numerator*y,p);\n\t\t\tR-&gt;x=mod(lambda*lambda-P-&gt;x-Q-&gt;x,p);\n\t\t\tR-&gt;y=mod(lambda*(P-&gt;x-R-&gt;x)-P-&gt;y,p);\n\t\t}\n\t}\n}<\/pre>\n<p>&nbsp;<br \/>\n<a href=\"https:\/\/github.com\/pome1618\/elliptic_curve_study\/blob\/master\/1\/4\/add.c\">Github\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u9650\u4f53Fp\u4e0a\u306e\u6955\u5186\u66f2\u7dda\u4e0a\u306e\u6709\u7406\u70b9\u306e\u52a0\u7b97\u3092\u8003\u3048\u308b\uff0e \u3068\u306f\u8a00\u3063\u3066\u3082\uff0c\u300e\u6955\u5186\u66f2\u7dda\u6697\u53f7\u5165\u9580\u300f\u3092\u898b\u305f\u307b\u3046\u304c\u5206\u304b\u308a\u3084\u3059\u3044\uff0e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-349","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":0,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"wp:attachment":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}