{"id":394,"date":"2018-05-16T01:58:02","date_gmt":"2018-05-15T16:58:02","guid":{"rendered":"http:\/\/tamatoyaku.com\/b\/?p=394"},"modified":"2018-05-16T01:58:02","modified_gmt":"2018-05-15T16:58:02","slug":"394","status":"publish","type":"post","link":"https:\/\/p-0.me\/b\/p\/394\/","title":{"rendered":"SystemVerilog\u3067Montgomery curves\u306e2\u500d\u7b97\u306e\u5b9f\u88c5"},"content":{"rendered":"<p>[mathjax]\u57fa\u672c\u7684\u306b\u306f\u524d\u56de\u306e<a href=\"http:\/\/tamatoyaku.com\/b\/p\/378\">\u52a0\u7b97\u516c\u5f0f<\/a>\u306e\u8a71\u3068\u540c\u3058\uff0e<br \/>\n\u5909\u66f4\u70b9\u306e\u307f\u3092\u66f8\u304f\uff0e\u6b63\u76f4\u52a0\u7b97\u516c\u5f0f\u3068\u307b\u307c\u540c\u3058\u3060\u3057\u7720\u3044\u3057\u65e9\u304fMontgomery ladder\u7d44\u307f\u305f\u3044\u306e\u3067\u6642\u9593\u306f\u304b\u3051\u306a\u3044\uff0e<br \/>\n<!--more--><br \/>\n&nbsp;<br \/>\n<strong>1.\u524d\u56de\u306e\u8a71<\/strong><br \/>\n\u52a0\u7b97\u516c\u5f0f\u306e\u56de\u8def\u3092\u7d44\u3093\u3060\u3082\u306e\u306e\uff0c\u4e57\u7b97\u3068\\(mod\\ p\\)\u306e\u9ad8\u901f\u5316\u3092\u3059\u308b\u3079\u304d\u3068\u3044\u3046\u6307\u6458\u3092\u53d7\u3051\uff0c\u4e00\u5ea6\u306f\u305d\u306e\u65b9\u91dd\u3067\u9032\u3081\u3088\u3046\u3068\u3057\u305f\uff0e<br \/>\n\u3057\u304b\u3057\u6700\u521d\u306b\u52d5\u304f\u3082\u306e\u3092\u3064\u304f\u308a\uff0c\u3042\u3068\u304b\u3089\u9ad8\u901f\u5316\u624b\u6cd5\u3092\u53d6\u308a\u5165\u308c\u6bd4\u8f03\u3059\u308b\u3053\u3068\u3067\uff0c\u52b9\u679c\u3092\u78ba\u8a8d\u3057\u3064\u3064\u898b\u6804\u3048\u3092\u826f\u304f\u3059\u308b\u3068\u3044\u3046\u5c0f\u72e1\u3044\u624b\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u305f\u306e\u3067\u3042\u3063\u305f&#8230;<br \/>\n&nbsp;<br \/>\n<strong>2.\u69cb\u6210<\/strong><br \/>\n\u52a0\u7b97\u516c\u5f0f\u3068\u307b\u307c\u540c\u3058\u3060\u304c\uff0c\u3044\u304f\u3064\u304b\u306e\u5909\u66f4\u70b9\u304c\u3042\u308b\uff0e\u8a08\u7b97\u304c\u5909\u308f\u3063\u305f\u305f\u3081\u30b9\u30c6\u30c3\u30d7\u6570\u304c\u5909\u66f4\u3055\u308c\u3066\u304a\u308a\uff0cin_sel,out_sel\u306e\u30d3\u30c3\u30c8\u5e45\u3082\u5909\u308f\u3063\u3066\u3044\u308b\uff0e\u30e1\u30e2\u30ea\u3078\u306e\u521d\u671f\u5024\u3082\\(\\alpha,X_n,Z_n\\)\u3068\u3057\u305f\uff0e\u306a\u304a\uff0c\\(\\alpha=(A+2)\/4\\)\u3067\u3042\u308a\uff0c\\(A\\)\u306fMontgomery curves\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3042\u308b\uff0e<br \/>\nin_sel\uff0cout_sel\uff0c\u30e1\u30e2\u30ea\uff0c\u5404\u4fe1\u53f7\u306e\u8aac\u660e\u306f<a href=\"http:\/\/tamatoyaku.com\/b\/p\/378\">\u52a0\u7b97\u516c\u5f0f<\/a>\u306e\u3082\u306e\u3092\u53c2\u7167\uff0e<br \/>\n&nbsp;<br \/>\n<strong>3.\u5236\u5fa1\u4fe1\u53f7\u306e\u8a2d\u8a08<\/strong><br \/>\n$$4X_nZ_n=(X_n+Z_n)^2-(X_n-Z_n)^2$$<br \/>\n$$X_{2n}=(X_n+Z_n)^2(X_n-Z_n)^2$$<br \/>\n$$Z_{2n}=4X_nZ_n((X_n-Z_n)^2+((A+2)\/4)(4X_nZ_n))$$<br \/>\n\u306e\u5f0f\u306b\u5f93\u3044\u9010\u6b21\u5b9f\u884c\u7684\u306b\u66f8\u304d\u4e0b\u3057\u3066\u307f\u308b\uff0e<br \/>\n\u306a\u304a\uff0c\u30e1\u30e2\u30ea\u306b\u306f\u521d\u671f\u5024\u3068\u3057\u3066M[0]=\\(\\alpha\\),M[1]=\\(X_n\\),M[2]=\\(Z_n\\)\u304c\u5165\u3063\u3066\u308b\u3082\u306e\u3068\u3059\u308b\uff0e<br \/>\nstep1<\/p>\n<p style=\"padding-left: 30px;\">M[1]=M[1]+M[2]<\/p>\n<p style=\"padding-left: 30px;\">M[2]=M[1]-M[2]<\/p>\n<p>step2<\/p>\n<p style=\"padding-left: 30px;\">M[3]=M[1]*M[1]<\/p>\n<p>step3<\/p>\n<p style=\"padding-left: 30px;\">M[4]=M[2]*M[2]<\/p>\n<p>step4<\/p>\n<p style=\"padding-left: 30px;\">M[2]=M[3]-M[4]<\/p>\n<p style=\"padding-left: 30px;\">M[3]=M[3]*M[4]<\/p>\n<p>step5<\/p>\n<p style=\"padding-left: 30px;\">M[1]=M[0]*M[2]<\/p>\n<p>step6<\/p>\n<p style=\"padding-left: 30px;\">M[1]=M[4]+M[1]<\/p>\n<p>step7<\/p>\n<p style=\"padding-left: 30px;\">M[4]=M[2]*M[1]<\/p>\n<p>&nbsp;<br \/>\n\u5b9f\u969b\u306e\u5236\u5fa1\u4fe1\u53f7\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\uff0e<br \/>\n&nbsp;<br \/>\nstep1<br \/>\nin : 101 010 001<br \/>\nout: 000 000 010 001 010 001<br \/>\nstep2<br \/>\nin : 011 101 101<br \/>\nout: 001 001 000 000 000 000<br \/>\nstep3<br \/>\nin : 100 101 101<br \/>\nout: 010 010 000 000 000 000<br \/>\nstep4<br \/>\nin : 011 010 101<br \/>\nout: 100 011 100 011 000 000<br \/>\nstep5<br \/>\nin : 001 101 101<br \/>\nout: 010 000 000 000 000 000<br \/>\nstep6<br \/>\nin : 101 101 001<br \/>\nout: 000 000 000 000 001 100<br \/>\nstep7<br \/>\nin : 100 101 101<br \/>\nout: 001 010 000 000 000 000<br \/>\n&nbsp;<br \/>\n<strong>4.SystemVerilog\u306b\u3088\u308b\u5b9f\u88c5<\/strong><br \/>\n<strong>4.1.memory<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/6abc577a302d3027b479f744e4491d5b.js\"><\/script><br \/>\n<strong>4.2.control unit<\/strong><br \/>\n<script src=\"https:\/\/gist.github.com\/pome1618\/a630e42e1b43b2761033a0bada93f220.js\"><\/script><br \/>\n&nbsp;<br \/>\n<strong>5.\u52d5\u4f5c\u78ba\u8a8d<\/strong><br \/>\n\u4f7f\u7528\u3059\u308b\u66f2\u7dda\u306f\\(y^2=x^3+84x^2+x\\)\u3067\uff0c\\(p=65521\\)\u3068\u3059\u308b\uff0e\\(\\alpha=(A+2)\/4=32782\\)\u3068\u306a\u308a\uff0c\u70b9\u306b\u3064\u3044\u3066\u306f\\(P_n=(19336,65265)\\) \uff0c\\(2P_n=(16050,30992)\\)\u3068\u3059\u308b\uff0e<br \/>\n<a href=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-396\" src=\"https:\/\/tamatoyaku.com\/b\/wp-content\/uploads\/2018\/05\/1-1024x259.png\" alt=\"\" width=\"1024\" height=\"259\" \/><\/a><br \/>\n\u4e0a\u8a18\u306e\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u7d50\u679c\u304b\u3089\uff0c\u7d50\u679c\u304c\u6b63\u3057\u3044\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308b\uff0e<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n\u305d\u308c\u306f\u3068\u3082\u304b\u304f\uff0c\u4eca\u306f\u5348\u524d2\u6642\u3067\u3042\u308a\uff0c\u79c1\u306f\u3068\u3066\u3082\u7720\u3044\uff0e\u4eca\u65e5\u306f\u3053\u3053\u307e\u3067\u3068\u3057\u3066\u3082\u3046\u5bdd\u3088\u3046\u3068\u601d\u3046\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[mathjax]\u57fa\u672c\u7684\u306b\u306f\u524d\u56de\u306e\u52a0\u7b97\u516c\u5f0f\u306e\u8a71\u3068\u540c\u3058\uff0e \u5909\u66f4\u70b9\u306e\u307f\u3092\u66f8\u304f\uff0e\u6b63\u76f4\u52a0\u7b97\u516c\u5f0f\u3068\u307b\u307c\u540c\u3058\u3060\u3057\u7720\u3044\u3057\u65e9\u304fMontgomery ladder\u7d44\u307f\u305f\u3044\u306e\u3067\u6642\u9593\u306f\u304b\u3051\u306a\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-394","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/394","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=394"}],"version-history":[{"count":0,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"wp:attachment":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}