{"id":287330,"date":"2018-08-16T14:06:53","date_gmt":"2018-08-16T10:06:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287330"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287330","title":{"rendered":"\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 Bitcoin"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420131\/\" class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oi\/lh\/dt\/oilhdtkhhgrgz2gpjy00mjrxhaq.jpeg\"><\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u0440\u0435\u0434\u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043d\u0438\u043a \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043d\u0435\u0434\u0435\u043b\u0435. \u0423 \u043c\u0435\u043d\u044f \u0445\u043e\u0431\u0431\u0438, \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435 \u044f \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u0437\u043b\u043e\u043c\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 bitcoin, \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0443\u043f\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u043d\u043e\u043d\u0441\u0435 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0445\u044d\u0448\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u043c \u044d\u043d\u0435\u0440\u0433\u0438\u0438. \u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0438\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043f\u0438\u0441\u044c\u043c\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u0434\u0435\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0433\u043e\u043b\u043e\u0432\u0435? \u041a\u0443\u0434\u0430-\u0442\u043e \u0436\u0435 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0432\u0430\u0442\u044c\u2026<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0431\u0440\u0435\u0434\u043e\u0432\u043e\u0441\u0442\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0438\u0434\u0435\u0439 \u044f \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u0438\u0437\u0443\u0447\u0430\u0435\u0442<\/p>\n<ol>\n<li>\u044f\u0437\u044b\u043a C++ \u0438 \u0435\u0433\u043e \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b<\/li>\n<li>\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0438<\/li>\n<li>\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438<\/li>\n<li>\u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f bitcoin<\/li>\n<\/ol>\n<p><a name=\"habracut\"><\/a><br \/>  \u0421 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u043d\u0435\u043c? <\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u043a\u0443\u0447\u043d\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430? \u041f\u043e\u0442\u0435\u0440\u043f\u0438\u0442\u0435, \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0435\u043b\u0435\u0435.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0445\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 bitcoin. \u041e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u044f F(x)=sha256(sha256(x)), \u0433\u0434\u0435 x \u2014 \u044d\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 80 \u0431\u0430\u0439\u0442, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0431\u043b\u043e\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u043b\u043e\u043a\u0430, prev block hash, merkle root, timestamp, bits \u0438 nonce. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0432\u0435\u0436\u0438\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0431\u043b\u043e\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0445\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">\t\/\/blk=533522 \t0x00,0x00,0x00,0x20, \t0x6d,0xa5,0xdd,0xb5,0x78,0x04,0x08,0x80,0xae,0x3d,0xed,0xc5,0x8e,0xe9,0x74,0x93,0x93,0x6d,0x6a,0xf4,0x0e,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t0xdf,0x3e,0xb0,0xf4,0x92,0xbf,0xe9,0xb8,0xc8,0x12,0x1f,0x84,0xdd,0x35,0xe1,0x38,0x09,0xcc,0x28,0xc2,0x33,0x53,0x90,0x4e,0x15,0x49,0x5e,0xc7,0xb0,0x78,0x35,0x91, \t0x82,0xDB,0x57,0x5B, \t0x17,0x5A,0x36,0x17, \t0xAA,0x02,0x44,0x22,  \t\/\/blk=533523 \t0x00,0x00,0x00,0x20, \t0x6a,0x27,0x37,0xc3,0x1f,0x68,0xf8,0xe3,0x03,0xa3,0x5d,0xff,0x2d,0x97,0x39,0xaf,0x81,0xa2,0xf5,0xf0,0x7c,0xdb,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t0xa1,0xb8,0x4f,0x75,0x66,0xf3,0xf3,0x8e,0x78,0xf7,0xa2,0xa2,0xa2,0x19,0xa1,0x18,0x45,0xfa,0x58,0x53,0xe4,0x05,0x50,0x12,0x57,0xa1,0xab,0x2c,0x39,0xe6,0x1f,0x63, \t0xA0,0xDB,0x57,0x5B, \t0x17,0x5A,0x36,0x17, \t0x84,0x7B,0x86,0xE7,  \t\/\/blk=533524 \t0x00,0x00,0x00,0x20, \t0xb3,0xc7,0xaa,0x07,0x26,0xdb,0xe8,0x58,0x19,0xa8,0xb9,0x53,0x08,0x62,0x8b,0xca,0x58,0x00,0x69,0x64,0x58,0x69,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t0x4e,0xfc,0xf4,0x5c,0xad,0x31,0x44,0x5b,0xb1,0x13,0x80,0x03,0xe0,0xfd,0x04,0x24,0x86,0xcc,0x7a,0x8c,0xa7,0x7c,0x30,0x60,0x05,0x6f,0x43,0xcf,0x25,0x45,0x8f,0xd8, \t0x80,0xDE,0x57,0x5B, \t0x17,0x5A,0x36,0x17, \t0xF7,0x2B,0x3B,0x42, <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0446\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c \u043c\u0430\u0439\u043d\u0435\u0440\u043e\u0432 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0439\u0442\u044b \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u043e\u0442 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u0431\u0430\u0439\u0442 (endians).<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0431\u043b\u043e\u043a\u0430, 80 \u0431\u0430\u0439\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0445\u044d\u0448 sha256 \u0438 \u043f\u043e\u0442\u043e\u043c \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0435\u0449\u0435 sha256.<br \/>  \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c sha256, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<ol>\n<li>void sha256_init(SHA256_CTX *ctx);<\/li>\n<li>void sha256_transform(SHA256_CTX *ctx, const BYTE data[]);<\/li>\n<li>void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len);<\/li>\n<li>void sha256_final(SHA256_CTX *ctx, BYTE hash[]);<\/li>\n<\/ol>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0445\u044d\u0448\u0430 \u2014 \u044d\u0442\u043e sha256_init(), \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 SHA256_CTX. \u0422\u0430\u043c \u0442\u0430\u043a \u0442\u043e \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u043c\u0435 \u0432\u043e\u0441\u044c\u043c\u0438 32\u0445 \u0431\u0438\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432\u0430 state, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">void sha256_init(SHA256_CTX *ctx) { \tctx-&gt;datalen = 0; \tctx-&gt;bitlen = 0; \tctx-&gt;state[0] = 0x6a09e667; \tctx-&gt;state[1] = 0xbb67ae85; \tctx-&gt;state[2] = 0x3c6ef372; \tctx-&gt;state[3] = 0xa54ff53a; \tctx-&gt;state[4] = 0x510e527f; \tctx-&gt;state[5] = 0x9b05688c; \tctx-&gt;state[6] = 0x1f83d9ab; \tctx-&gt;state[7] = 0x5be0cd19; } <\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b, \u0445\u044d\u0448 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c. \u0427\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e sha256_update() \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0430 \u0438 \u0434\u043b\u0438\u043d\u0443 \u0431\u043b\u043e\u043a\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0435\u0442 \u0445\u044d\u0448 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 SHA256_CTX \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 state:<\/p>\n<pre><code class=\"cpp\">void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len) { \tuint32_t i;  \tfor (i = 0; i &lt; len; ++i) { \t\tctx-&gt;data[ctx-&gt;datalen] = data[i]; \t\tctx-&gt;datalen++; \t\tif (ctx-&gt;datalen == 64) { \t\t\tsha256_transform(ctx, ctx-&gt;data); \t\t\tctx-&gt;bitlen += 512; \t\t\tctx-&gt;datalen = 0; \t\t} \t} } <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 sha256_update() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043b\u043e\u0448\u0430\u0434\u043a\u0443 sha256_transform(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0443\u0436\u0435 \u0431\u043b\u043e\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u043f\u043e 64 \u0431\u0430\u0439\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">\/****************************** MACROS ******************************\/ #define ROTLEFT(a,b) (((a) &lt;&lt; (b)) | ((a) &gt;&gt; (32-(b)))) #define ROTRIGHT(a,b) (((a) &gt;&gt; (b)) | ((a) &lt;&lt; (32-(b))))  #define CH(x,y,z) (((x) &amp; (y)) ^ (~(x) &amp; (z))) #define MAJ(x,y,z) (((x) &amp; (y)) ^ ((x) &amp; (z)) ^ ((y) &amp; (z))) #define EP0(x) (ROTRIGHT(x,2) ^ ROTRIGHT(x,13) ^ ROTRIGHT(x,22)) #define EP1(x) (ROTRIGHT(x,6) ^ ROTRIGHT(x,11) ^ ROTRIGHT(x,25)) #define SIG0(x) (ROTRIGHT(x,7) ^ ROTRIGHT(x,18) ^ ((x) &gt;&gt; 3)) #define SIG1(x) (ROTRIGHT(x,17) ^ ROTRIGHT(x,19) ^ ((x) &gt;&gt; 10))  \/**************************** VARIABLES *****************************\/ static const uint32_t k[64] = { \t0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5, \t0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174, \t0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da, \t0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967, \t0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85, \t0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070, \t0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3, \t0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 };  \/*********************** FUNCTION DEFINITIONS ***********************\/ void sha256_transform(SHA256_CTX *ctx, const BYTE data[]) { \tuint32_t a, b, c, d, e, f, g, h, i, j, t1, t2, m[64];  \tfor (i = 0, j = 0; i &lt; 16; ++i, j += 4) \t\tm[i] = (data[j] &lt;&lt; 24) | (data[j + 1] &lt;&lt; 16) | (data[j + 2] &lt;&lt; 8) | (data[j + 3]); \tfor (; i &lt; 64; ++i) \t\tm[i] = SIG1(m[i - 2]) + m[i - 7] + SIG0(m[i - 15]) + m[i - 16];  \ta = ctx-&gt;state[0]; \tb = ctx-&gt;state[1]; \tc = ctx-&gt;state[2]; \td = ctx-&gt;state[3]; \te = ctx-&gt;state[4]; \tf = ctx-&gt;state[5]; \tg = ctx-&gt;state[6]; \th = ctx-&gt;state[7];  \tfor (i = 0; i &lt; 64; ++i) { \t\tt1 = h + EP1(e) + CH(e, f, g) + k[i] + m[i]; \t\tt2 = EP0(a) + MAJ(a, b, c); \t\th = g; \t\tg = f; \t\tf = e; \t\te = d + t1; \t\td = c; \t\tc = b; \t\tb = a; \t\ta = t1 + t2; \t}  \tctx-&gt;state[0] += a; \tctx-&gt;state[1] += b; \tctx-&gt;state[2] += c; \tctx-&gt;state[3] += d; \tctx-&gt;state[4] += e; \tctx-&gt;state[5] += f; \tctx-&gt;state[6] += g; \tctx-&gt;state[7] += h; } <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0445\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0432\u0435\u0441\u044c \u0441\u0447\u0438\u0442\u0430\u043d \u0438 \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e sha256_update() \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e sha256_final(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0431\u044b\u043b \u043d\u0435 \u043a\u0440\u0430\u0442\u0435\u043d 64 \u0431\u0430\u0439\u0442\u0430\u043c, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 padding \u0431\u0430\u0439\u0442\u044b, \u0432\u043f\u0438\u0448\u0435\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0449\u0443\u044e \u0434\u043b\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0438\u0442\u0430\u0445 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 sha256_transform().<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 state.<\/p>\n<p>  \u042d\u0442\u043e \u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u00ab\u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\u00bb.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043c\u0430\u0439\u043d\u0435\u0440\u0443 \u0431\u0438\u0442\u043a\u043e\u0438\u043d\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0443\u043c\u0430\u044e\u0442 \u043a\u0430\u043a \u0431\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430 \u043f\u043e\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0439.<\/p>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e: \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u043e 80 \u0431\u0430\u0439\u0442, \u0447\u0442\u043e \u043d\u0435 \u043a\u0440\u0430\u0442\u043d\u043e 64 \u0431\u0430\u0439\u0442\u0430\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e sha256 \u0443\u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0432\u0430 sha256_transform(). \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043c\u0430\u0439\u043d\u0435\u0440\u043e\u0432, nonce \u0431\u043b\u043e\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 sha256_transform() \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 midstate. \u0414\u0430\u043b\u0435\u0435 \u043c\u0430\u0439\u043d\u0435\u0440 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043d\u043e\u043d\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 4 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430, 2^32 \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e sha256_transform(). \u042d\u0442\u043e\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e sha256. \u0415\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u044d\u0442\u043e \u0432\u043e\u0441\u0435\u043c\u044c 32\u0445 \u0431\u0438\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c 32 \u0431\u0430\u0439\u0442\u0430. \u041e\u0442 \u043d\u0438\u0445 \u043d\u0430\u0439\u0442\u0438 sha256 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439 sha256_transform() \u0438 \u0432\u0441\u0435 \u2014 \u0433\u043e\u0442\u043e\u0432\u043e. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 32 \u0431\u0430\u0439\u0442\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443, \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f sha256_transform() 64 \u0431\u0430\u0439\u0442\u0430. \u0417\u043d\u0430\u0447\u0438\u0442 \u043e\u043f\u044f\u0442\u044c \u0431\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0443\u043b\u044f\u043c\u0438 \u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0431\u0443\u0434\u0435\u0442 \u0432\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u0438\u043d\u0430 \u0431\u043b\u043e\u043a\u0430.<\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 sha256_transform() \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f midstate.<\/p>\n<p>  \u042f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0445\u044d\u0448\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0431\u043b\u043e\u043a\u0430 \u0431\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u0431\u0438\u0442\u043a\u043e\u0438\u043d\u0430 \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<pre><code class=\"cpp\">\/\/get bitcoin header via ptr to 80 bytes and calc hash template &lt;typename T&gt; void full_btc_hash(const uint8_t* ptr80, T nonce, T* presult) { \t\/\/-1------------------------------------------ \t\/\/init sha256 state s[7:0] \tT s[16]; \tfor (int i = 0; i &lt; 8; i++) { \t\ts[i] = sha256_init_state[i]; \t\tpresult[i] = sha256_init_state[i]; \t}  \tuint8_t tail2[] = { \t\t0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t\t0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, \t};  \tuint32_t* p = (uint32_t*)tail2; \tfor (int i = 0; i &lt; 8; i++) { \t\ts[i + 8] = ntohl(p[i]); \t}  \t\/\/get first block for sha256 \tuint8_t tail[] = { \/* 2nd sha256 block padding *\/ \t\t0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t\t0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t\t0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80 \t}; \tT blk1[32]; \tp = (uint32_t*)ptr80; \tfor (int i = 0; i &lt; 19; i++) { \t\tblk1[i] = ntohl(p[i]); \t}  \t\/\/put nonce here \tblk1[19] = nonce;  \tp = (uint32_t*)tail; \tfor (int i = 0; i &lt; 12; i++) { \t\tblk1[i + 20] = ntohl(p[i]); \t}  \tsha256_transform(s, &amp;blk1[0]); \/\/warning! this can be called only once and produce MIDSTATE \tsha256_transform(s, &amp;blk1[16]); \tsha256_transform(presult, s); } <\/code><\/pre>\n<p>  \u042f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a c++ template, \u043e\u043d\u0430 \u0443 \u043c\u0435\u043d\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e 32\u0445 \u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0441\u043a\u0430\u0436\u0435\u043c uint32_t, \u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0438\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u00abT\u00bb. \u0423 \u043c\u0435\u043d\u044f \u0437\u0434\u0435\u0441\u044c \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 sha256 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0442\u0438\u043f\u0430 \u00abT\u00bb \u0438 sha256_transform() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430 \u00abT\u00bb \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0436\u0435. \u0422\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 c++ template:<\/p>\n<pre><code class=\"cpp\">template &lt;typename T&gt; T ror32(T word, unsigned int shift) { \treturn (word &gt;&gt; shift) | (word &lt;&lt; (32 - shift)); }  template &lt;typename T&gt; T Ch(T x, T y, T z) { \treturn z ^ (x &amp; (y ^ z)); }  template&lt;typename T&gt; T Maj(T x, T y, T z) { \treturn (x &amp; y) | (z &amp; (x | y)); }  #define e0(x)       (ror32(x, 2) ^ ror32(x,13) ^ ror32(x,22)) #define e1(x)       (ror32(x, 6) ^ ror32(x,11) ^ ror32(x,25)) #define s0(x)       (ror32(x, 7) ^ ror32(x,18) ^ (x &gt;&gt; 3)) #define s1(x)       (ror32(x,17) ^ ror32(x,19) ^ (x &gt;&gt; 10))  unsigned int ntohl(unsigned int in) { \treturn ((in &amp; 0xff) &lt;&lt; 24) | ((in &amp; 0xff00) &lt;&lt; 8) | ((in &amp; 0xff0000) &gt;&gt; 8) | ((in &amp; 0xff000000) &gt;&gt; 24); }  template &lt;typename T&gt; void LOAD_OP(int I, T *W, const u8 *input) { \t\/\/W[I] = \/*ntohl*\/ (((u32*)(input))[I]); \tW[I] = ntohl(((u32*)(input))[I]); \t\/\/W[I] = (input[3] &lt;&lt; 24) | (input[2] &lt;&lt; 16) | (input[1] &lt;&lt; 8) | (input[0]); }  template &lt;typename T&gt; void BLEND_OP(int I, T *W) { \tW[I] = s1(W[I - 2]) + W[I - 7] + s0(W[I - 15]) + W[I - 16]; }  template &lt;typename T&gt; void sha256_transform(T *state, const T *input) { \tT a, b, c, d, e, f, g, h, t1, t2; \tT W[64]; \tint i;  \t\/* load the input *\/ \tfor (i = 0; i &lt; 16; i++)\t\t\/\/ MJ input is cast to u32* so this processes 16 DWORDS = 64 bytes \t\tW[i] = input[i];  \t\/* now blend *\/ \tfor (i = 16; i &lt; 64; i++) \t\tBLEND_OP(i, W);  \t\/* load the state into our registers *\/ \ta = state[0];  b = state[1];  c = state[2];  d = state[3]; \te = state[4];  f = state[5];  g = state[6];  h = state[7];  \t\/\/ \tt1 = h + e1(e) + Ch(e, f, g) + 0x428a2f98 + W[0]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0x71374491 + W[1]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0xb5c0fbcf + W[2]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0xe9b5dba5 + W[3]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x3956c25b + W[4]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0x59f111f1 + W[5]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x923f82a4 + W[6]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0xab1c5ed5 + W[7]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0xd807aa98 + W[8]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0x12835b01 + W[9]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0x243185be + W[10]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0x550c7dc3 + W[11]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x72be5d74 + W[12]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0x80deb1fe + W[13]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x9bdc06a7 + W[14]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0xc19bf174 + W[15]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0xe49b69c1 + W[16]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0xefbe4786 + W[17]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0x0fc19dc6 + W[18]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0x240ca1cc + W[19]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x2de92c6f + W[20]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0x4a7484aa + W[21]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x5cb0a9dc + W[22]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0x76f988da + W[23]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0x983e5152 + W[24]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0xa831c66d + W[25]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0xb00327c8 + W[26]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0xbf597fc7 + W[27]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0xc6e00bf3 + W[28]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0xd5a79147 + W[29]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x06ca6351 + W[30]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0x14292967 + W[31]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0x27b70a85 + W[32]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0x2e1b2138 + W[33]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0x4d2c6dfc + W[34]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0x53380d13 + W[35]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x650a7354 + W[36]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0x766a0abb + W[37]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x81c2c92e + W[38]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0x92722c85 + W[39]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0xa2bfe8a1 + W[40]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0xa81a664b + W[41]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0xc24b8b70 + W[42]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0xc76c51a3 + W[43]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0xd192e819 + W[44]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0xd6990624 + W[45]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0xf40e3585 + W[46]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0x106aa070 + W[47]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0x19a4c116 + W[48]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0x1e376c08 + W[49]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0x2748774c + W[50]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0x34b0bcb5 + W[51]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x391c0cb3 + W[52]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0x4ed8aa4a + W[53]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0x5b9cca4f + W[54]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0x682e6ff3 + W[55]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tt1 = h + e1(e) + Ch(e, f, g) + 0x748f82ee + W[56]; \tt2 = e0(a) + Maj(a, b, c);    d += t1;    h = t1 + t2; \tt1 = g + e1(d) + Ch(d, e, f) + 0x78a5636f + W[57]; \tt2 = e0(h) + Maj(h, a, b);    c += t1;    g = t1 + t2; \tt1 = f + e1(c) + Ch(c, d, e) + 0x84c87814 + W[58]; \tt2 = e0(g) + Maj(g, h, a);    b += t1;    f = t1 + t2; \tt1 = e + e1(b) + Ch(b, c, d) + 0x8cc70208 + W[59]; \tt2 = e0(f) + Maj(f, g, h);    a += t1;    e = t1 + t2; \tt1 = d + e1(a) + Ch(a, b, c) + 0x90befffa + W[60]; \tt2 = e0(e) + Maj(e, f, g);    h += t1;    d = t1 + t2; \tt1 = c + e1(h) + Ch(h, a, b) + 0xa4506ceb + W[61]; \tt2 = e0(d) + Maj(d, e, f);    g += t1;    c = t1 + t2; \tt1 = b + e1(g) + Ch(g, h, a) + 0xbef9a3f7 + W[62]; \tt2 = e0(c) + Maj(c, d, e);    f += t1;    b = t1 + t2; \tt1 = a + e1(f) + Ch(f, g, h) + 0xc67178f2 + W[63]; \tt2 = e0(b) + Maj(b, c, d);    e += t1;    a = t1 + t2;  \tstate[0] += a; state[1] += b; state[2] += c; state[3] += d; \tstate[4] += e; state[5] += f; state[6] += g; state[7] += h; }  <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 C++ template \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0443\u0434\u043e\u0431\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043d\u0435 \u0445\u044d\u0448 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"cpp\">\tconst uint8_t header[] = { \t\t0x02,0x00,0x00,0x00, \t\t0x17,0x97,0x5b,0x97,0xc1,0x8e,0xd1,0xf7, \t\t0xe2,0x55,0xad,0xf2,0x97,0x59,0x9b,0x55, \t\t0x33,0x0e,0xda,0xb8,0x78,0x03,0xc8,0x17, \t\t0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t\t0x8a,0x97,0x29,0x5a,0x27,0x47,0xb4,0xf1, \t\t0xa0,0xb3,0x94,0x8d,0xf3,0x99,0x03,0x44, \t\t0xc0,0xe1,0x9f,0xa6,0xb2,0xb9,0x2b,0x3a, \t\t0x19,0xc8,0xe6,0xba, \t\t0xdc,0x14,0x17,0x87, \t\t0x35,0x8b,0x05,0x53, \t\t0x53,0x5f,0x01,0x19, \t\t0x48,0x75,0x08,0x33 \t}; \t \tuint32_t test_nonce = 0x48750833; \tuint32_t result[8]; \tfull_btc_hash(header, test_nonce, result); \tuint8_t* presult = (uint8_t * )result; \tfor (int i = 0; i &lt; 32; i++) \t\tprintf(\"%02X \", presult[i]); <\/code><\/pre>\n<p>   \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>  92 98 2A 50 91 FA BD 42 97 8A A5 2D CD C9 36 28 02 4A DD FE E0 67 A4 78 00 00 00 00 00 00 00 00<\/p>\n<p>   \u0412 \u043a\u043e\u043d\u0446\u0435 \u0445\u044d\u0448\u0430 \u043c\u043d\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0439, \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0445\u044d\u0448, \u0431\u0438\u043d\u0433\u043e \u0438 \u0442.\u0434.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u044f \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u044d\u0442\u0443 \u0445\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 uint32_t \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043c\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 C++ \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0432\u0441\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443.<\/p>\n<p>  \u0414\u0430-\u0434\u0430. \u042f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u00ab\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e\u00bb \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443.<br \/>  \u0421\u0430\u043c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0441\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b, \u0441\u0430\u043c \u0438\u0441\u043f\u044b\u0442\u0430\u043b. \u041f\u043e\u0445\u043e\u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0428\u0443\u0442\u043a\u0430. \u0414\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0430\u043a\u043e\u0435 \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443.<br \/>  \u0412\u0441\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0431\u0438\u0442\u0430\u043c\u0438, \u0438 \u043e\u043d\u0430 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0418, \u0418\u041b\u0418, \u041d\u0415, \u0418\u0421\u041a\u041b\u042e\u0427\u0410\u042e\u0429\u0415\u0415 \u0418\u041b\u0418. \u041d\u0443 \u043c\u044b \u0432\u0441\u0435 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u0431\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u0435.<\/p>\n<p>  \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u043c\u0438.<br \/>  \u041f\u0443\u0441\u0442\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u0432 \u0441\u043b\u043e\u0432\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u041d\u041e\u041b\u042c \u0438 \u0415\u0414\u0418\u041d\u0418\u0426\u0410, \u043d\u043e \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435! \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u0430, \u043a\u0430\u043a \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u044b\u043c \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0442\u043e \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u00aba\u00bb \u0438 \u00abb\u00bb, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442 \u043d\u0443\u043b\u044f \u0434\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e Pa \u0438 Pb. \u041a\u0430\u043a\u043e\u0432\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e? \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u0431\u0435\u0437 \u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u0439 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 P = Pa * Pb \u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442!<\/p>\n<p>  3D \u0433\u0440\u0430\u0444\u0438\u043a \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a (\u0441 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0437\u0440\u0435\u043d\u0438\u044f):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-e\/ll\/pw\/-ellpwuzq9bxl8fi_b3l1drhutc.png\"><\/p>\n<p>  \u0410 \u043a\u0430\u043a\u043e\u0432\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Pa \u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Pb?<br \/>  \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c P = Pa+Pb-Pa*Pb. \u0413\u0440\u0430\u0444\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vs\/sd\/wk\/vssdwknevb1dijfbqcy3lsnib0w.png\"><\/p>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f Pa, \u0442\u043e \u043a\u0430\u043a\u043e\u0432\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442?<br \/>  P = 1 \u2014 Pa.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u0435. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0437\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tn\/qk\/-v\/tnqk-v5-dce15dkr0-zsb1wmiww.gif\"><\/p>\n<p>  \u0418\u043c\u0435\u044f \u0442\u0430\u043a\u0438\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435 \u0438\u043b\u0438, XOR:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l0\/e8\/ju\/l0e8judlmw-uh6plwsuj5sjnutq.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u0441\u0445\u0435\u043c\u0443 \u044d\u0442\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 XOR, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u043e\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0433\u043e XOR:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oj\/xy\/re\/ojxyrexx8xkmcrmoyfohfl6bqyw.png\"><\/p>\n<p>  \u041d\u043e \u0438 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435. \u041c\u044b \u0437\u043d\u0430\u0435\u043c \u0442\u0438\u043f\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u0443\u043c\u043c\u0430\u0442\u043e\u0440\u0430 \u0438 \u0438\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0438\u0437 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u0443\u043c\u043c\u0430\u0442\u043e\u0440\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u0439 \u0441\u0443\u043c\u043c\u0430\u0442\u043e\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_s\/fh\/qs\/_sfhqsmrhygqasjfv6inengna38.png\"><\/p>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0435\u0433\u043e \u0441\u0445\u0435\u043c\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0435\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0435, \u043f\u0440\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043c\u043e\u0433\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 c++ \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u00ab32\u0445 \u0431\u0438\u0442\u043d\u044b\u0439\u00bb \u043a\u043b\u0430\u0441\u0441 (\u043d\u0430\u0437\u043e\u0432\u0443 \u0435\u0433\u043e x32) c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e\u0439, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0443 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f sha256 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 AND, OR, XOR, ADD \u0438 \u0441\u0434\u0432\u0438\u0433\u043e\u0432. \u041a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 32 \u0431\u0438\u0442\u0430, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0438\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041a\u0430\u0436\u0434\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043b\u0438 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434 \u0442\u0430\u043a\u0438\u043c 32\u0445 \u0431\u0438\u0442\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u043f\u0440\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0438\u043b\u0438 \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043b\u0438 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443:<\/p>\n<pre><code class=\"cpp\">typedef std::numeric_limits&lt; double &gt; dbl;  int main(int argc, char *argv[]) { \tcout.precision(dbl::max_digits10); \tx32 a = 0xaabbccdd; \tx32 b = 0x12345678; \t&lt;b&gt;\/\/b.setBit( 4, 0.75 );&lt;\/b&gt; \tx32 c = a + b; \tcout &lt;&lt; std::hex &lt;&lt; \"result = 0x\" &lt;&lt; c.get32() &lt;&lt; \"\\n\" &lt;&lt; std::dec;  \tfor (int i = 0; i &lt; 32; i++) \t\tcout &lt;&lt; \"bit\" &lt;&lt; i &lt;&lt; \" = \" &lt;&lt; c.get_bvi(i) &lt;&lt; \"\\n\";  \tcout &lt;&lt; \"ok\\n\"; } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 32\u0445 \u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430.<br \/>  \u041f\u043e\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 b.setBit( 4, 0.75 ); \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c \u0438 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u0432\u0435\u0434\u044c \u0432\u0441\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435:<\/p>\n<pre><code>result = 0xbcf02355 bit0 = 1 bit1 = 0 bit2 = 1 bit3 = 0 bit4 = 1 bit5 = 0 bit6 = 1 bit7 = 0 bit8 = 1 bit9 = 1 bit10 = 0 bit11 = 0 bit12 = 0 bit13 = 1 bit14 = 0 bit15 = 0 bit16 = 0 bit17 = 0 bit18 = 0 bit19 = 0 bit20 = 1 bit21 = 1 bit22 = 1 bit23 = 1 bit24 = 0 bit25 = 0 bit26 = 1 bit27 = 1 bit28 = 1 bit29 = 1 bit30 = 0 bit31 = 1 <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 b.setBit( 4, 0.75 );, \u0442\u043e \u044d\u0442\u0438\u043c \u0441\u0430\u043c\u044b\u043c \u044f \u043a\u0430\u043a \u0431\u044b \u0433\u043e\u0432\u043e\u0440\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435: \u00ab\u0441\u043b\u043e\u0436\u0438 \u043c\u043d\u0435 \u044d\u0442\u0438 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u0430 4 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0434\u0443\u043c\u0430\u044e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e 0.75 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u00bb.<\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u0430\u043a \u0435\u043c\u0443 \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e, \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0438\u0442\u043e\u0432:<\/p>\n<pre><code>bit not stable bit not stable bit not stable result = 0xbcf02305 bit0 = 1 bit1 = 0 bit2 = 1 bit3 = 0 bit4 = 0.75 bit5 = 0.1875 bit6 = 0.8125 bit7 = 0 bit8 = 1 bit9 = 1 bit10 = 0 bit11 = 0 bit12 = 0 bit13 = 1 bit14 = 0 bit15 = 0 bit16 = 0 bit17 = 0 bit18 = 0 bit19 = 0 bit20 = 1 bit21 = 1 bit22 = 1 bit23 = 1 bit24 = 0 bit25 = 0 bit26 = 1 bit27 = 1 bit28 = 1 bit29 = 1 bit30 = 0 bit31 = 1 <\/code><\/pre>\n<p>  \u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e. \u0427\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 32\u0445 \u0431\u0438\u0442\u043d\u044b\u0439 c++ \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u0435\u0447\u0435\u0442\u043a\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438, \u044f \u0441\u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 template \u0444\u0443\u043d\u043a\u0446\u0438\u044e full_btc_hash() \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 x32 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0439 \u043e\u0446\u0435\u043d\u043e\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0445\u044d\u0448\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0435 \u0447\u0442\u043e \u0438\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 x32 \u0432\u043e\u0442:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#pragma once  #include &lt;string&gt; #include &lt;list&gt; #include &lt;iostream&gt; #include &lt;utility&gt; #include &lt;stdint.h&gt; #include &lt;vector&gt; #include &lt;limits&gt; using namespace std;  #include &lt;boost\/math\/constants\/constants.hpp&gt; #include &lt;boost\/multiprecision\/cpp_dec_float.hpp&gt; using boost::multiprecision::cpp_dec_float_50;  \/\/typedef double MY_FP; typedef cpp_dec_float_50 MY_FP;  class x32 { public: \tx32(); \tx32(uint32_t n); \tvoid init(MY_FP val); \tvoid init(double* pval); \tvoid setBit(int i, MY_FP val) { bvi[i] = val;  }; \t~x32() {}; \tx32 operator|(const x32&amp; right); \tx32 operator&amp;(const x32&amp; right); \tx32 operator^(const x32&amp; right); \tx32 operator+(const x32&amp; right); \tx32&amp; x32::operator+=(const x32&amp; right); \tx32 operator~(); \tx32 operator&lt;&lt;(const unsigned int&amp; right); \tx32 operator&gt;&gt;(const unsigned int&amp; right); \tvoid print(); \tuint32_t get32(); \tMY_FP get_bvi(uint32_t idx) { return bvi[idx]; }; private: \tMY_FP not(MY_FP a); \tMY_FP and(MY_FP a, MY_FP b); \tMY_FP or (MY_FP a, MY_FP b); \tMY_FP xor(MY_FP a, MY_FP b); \tMY_FP bvi[32]; \/\/bit values };  #include \"stdafx.h\"  #include \"x32.h\"  x32::x32() { \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tbvi[i] = 0.0; \t} }  x32::x32(uint32_t n) { \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tbvi[i] = (n&amp;(1 &lt;&lt; i)) ? 1.0 : 0.0; \t} }  void x32::init(MY_FP val) { \tfor (int i = 0; i &lt; 32; i++) { \t\tbvi[i] = val; \t} }  void x32::init(double* pval) { \tfor (int i = 0; i &lt; 32; i++) { \t\tbvi[i] = pval[i]; \t} }  x32 x32::operator&lt;&lt;(const unsigned int&amp; right) { \tx32 t; \tfor (int i = 31; i &gt;= 0; i--) \t{ \t\tif (i &lt; right) \t\t{ \t\t\tt.bvi[i] = 0.0; \t\t} \t\telse \t\t{ \t\t\tt.bvi[i] = bvi[i - right]; \t\t} \t} \treturn t; }  x32 x32::operator&gt;&gt;(const unsigned int&amp; right) { \tx32 t; \tfor (unsigned int i = 0; i &lt; 32; i++) \t{ \t\tif (i &gt;= (32 - right)) \t\t{ \t\t\tt.bvi[i] = 0; \t\t} \t\telse \t\t{ \t\t\tt.bvi[i] = bvi[i + right]; \t\t} \t} \treturn t; }  MY_FP x32::not(MY_FP a) { \treturn 1.0 - a; }  MY_FP x32::and(MY_FP a, MY_FP b) { \treturn a * b; }  MY_FP x32::or(MY_FP a, MY_FP b) { \treturn a + b - a * b; }  MY_FP x32::xor (MY_FP a, MY_FP b) { \t\/\/(~(A &amp; B)) &amp; (A | B) \treturn and( not( and(a,b) ) , or(a,b) ); }  x32 x32::operator|(const x32&amp; right) { \tx32 t; \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tt.bvi[i] = or ( bvi[i], right.bvi[i] ); \t} \treturn t; }  x32 x32::operator&amp;(const x32&amp; right) { \tx32 t; \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tt.bvi[i] = and (bvi[i], right.bvi[i]); \t} \treturn t; }  x32 x32::operator~() { \tx32 t; \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tt.bvi[i] = not(bvi[i]); \t} \treturn t; }  x32 x32::operator^(const x32&amp; right) { \tx32 t; \tfor (int i = 0; i &lt; 32; i++) { \t\tt.bvi[i] = xor (bvi[i], right.bvi[i]); \t} \treturn t; }  x32 x32::operator+(const x32&amp; right) { \tx32 r; \tr.bvi[0]   = xor (bvi[0], right.bvi[0]); \tMY_FP cout = and (bvi[0], right.bvi[0]); \tfor (unsigned int i = 1; i &lt; 32; i++) \t{ \t\tMY_FP xor_a_b = xor (bvi[i], right.bvi[i]); \t\tr.bvi[i] = xor( xor_a_b, cout ); \t\tMY_FP and1 = and (bvi[i], right.bvi[i]); \t\tMY_FP and2 = and (xor_a_b, cout); \t\tcout = or (and1,and2); \t} \treturn r; }  x32&amp; x32::operator+=(const x32&amp; right) { \tMY_FP cout = and (bvi[0], right.bvi[0]); \tbvi[0] = xor (bvi[0], right.bvi[0]); \tfor (unsigned int i = 1; i &lt; 32; i++) \t{ \t\tMY_FP xor_a_b = xor (bvi[i], right.bvi[i]); \t\tMY_FP and1 = and (bvi[i], right.bvi[i]); \t\tMY_FP and2 = and (xor_a_b, cout); \t\tbvi[i] = xor (xor_a_b, cout); \t\tcout = or (and1, and2); \t} \treturn *this; }  void x32::print() { \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tcout &lt;&lt; bvi[i] &lt;&lt; \"\\n\"; \t} }  uint32_t x32::get32() { \tuint32_t r = 0; \tfor (int i = 0; i &lt; 32; i++) \t{ \t\tif (bvi[i] == 1.0) \t\t\tr = r | (1 &lt;&lt; i); \t\telse \t\t\tif (bvi[i] == 0.0) \t\t\t{ \t\t\t\t\/\/ok \t\t\t} \t\t\telse \t\t\t{ \t\t\t\t\/\/oops.. \t\t\t\tcout &lt;&lt; \"bit not stable\\n\"; \t\t\t} \t} \treturn r; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/p>\n<p>  \u041c\u0430\u0439\u043d\u0435\u0440 \u0431\u0438\u0442\u043a\u043e\u0438\u043d \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 32\u0445 \u0431\u0438\u0442\u043d\u043e\u0433\u043e nonce. \u041c\u0430\u0439\u043d\u0435\u0440 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 4 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0445\u044d\u0448, \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u00ab\u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c\u00bb, \u043f\u043e\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0445\u044d\u0448\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 target.<\/p>\n<p>  \u041d\u0435\u0447\u0435\u0442\u043a\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430.<\/p>\n<p>  \u0414\u0430, \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u043d\u043e\u043d\u0441\u0435. \u0415\u0441\u043b\u0438 \u044f \u0438\u0445 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0438-\u0442\u043e \u043d\u0438-\u0441\u0451 \u2014 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u043e\u043d\u0441\u0435 \u0431\u0438\u0442\u043e\u0432 0.5. \u0414\u0430\u0436\u0435 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0435 \u044f \u043c\u043e\u0433\u0443 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0445\u044d\u0448\u0430. \u0413\u0434\u0435-\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 \u043e\u043a\u043e\u043b\u043e 0.5 \u043f\u043b\u044e\u0441-\u043c\u0438\u043d\u0443\u0441 \u043f\u043e\u043b \u043a\u043e\u043f\u0435\u0439\u043a\u0438.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u043c\u043e\u0433\u0443 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u043d\u043e\u043d\u0441\u0435 \u0441 0.5 \u0434\u043e 0.9 \u0438\u043b\u0438 \u0434\u043e 0.1 \u0438\u043b\u0438 \u0434\u043e 1.0 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0446\u0435\u043d\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u042f \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0442 \u043d\u043e\u043d\u0441\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0431\u0438\u0442\u0430\u0445 \u043d\u043e\u043d\u0441\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0431\u0438\u0442 \u0440\u0430\u0432\u043d\u0430 0.5 \u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u0430 nonce[0] = 0.9:<\/p>\n<pre><code class=\"cpp\">typedef std::numeric_limits&lt; double &gt; dbl;  int main(int argc, char *argv[]) { \tcout.precision(dbl::max_digits10); \t\/\/--------------------------------- \t\/\/hash: 502A989242BDFA912DA58A972836C9CDFEDD4A0278A467E00000000000000000 \tconst u8 strxx[] = { \t\t0x02,0x00,0x00,0x00, \t\t0x17,0x97,0x5b,0x97,0xc1,0x8e,0xd1,0xf7, \t\t0xe2,0x55,0xad,0xf2,0x97,0x59,0x9b,0x55, \t\t0x33,0x0e,0xda,0xb8,0x78,0x03,0xc8,0x17, \t\t0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, \t\t0x8a,0x97,0x29,0x5a,0x27,0x47,0xb4,0xf1, \t\t0xa0,0xb3,0x94,0x8d,0xf3,0x99,0x03,0x44, \t\t0xc0,0xe1,0x9f,0xa6,0xb2,0xb9,0x2b,0x3a, \t\t0x19,0xc8,0xe6,0xba, \t\t0xdc,0x14,0x17,0x87, \t\t0x35,0x8b,0x05,0x53, \t\t0x53,0x5f,0x01,0x19, \t\t0x48,0x75,0x08,0x33 \t}; \t \tdouble nonce_bits[32]; \tfor (int i = 0; i &lt; 32; i++) \t\tnonce_bits[i] = 0.5; \tx32 nonce_x32_a; \tx32 nonce_x32_b; \tnonce_x32_a.init(nonce_bits); \tnonce_bits[0] = 0.9; \tnonce_x32_b.init(nonce_bits); \tx32 result_x32_a[8]; \tx32 result_x32_b[8]; \tfull_btc_hash(strxx, nonce_x32_a, result_x32_a); \tfull_btc_hash(strxx, nonce_x32_b, result_x32_b); \tfor (int i = 0; i &lt; 32; i++) \t\tcout &lt;&lt; result_x32_a[7].get_bvi(i) &lt;&lt; \" \" &lt;&lt; result_x32_b[7].get_bvi(i) &lt;&lt; \"\\n\"; <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 x32::get_bvi() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<br \/>  \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u0430 nonce[0] \u0441 0.5 \u0434\u043e 0.9, \u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0442\u044b \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0445\u044d\u0448\u0430 \u0435\u043b\u0435 \u043a\u0430\u0447\u043d\u0443\u043b\u0438\u0441\u044c \u0432\u0432\u0435\u0440\u0445, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u043b\u0435 \u043a\u0430\u0447\u043d\u0443\u043b\u0438\u0441\u044c \u0432\u043d\u0438\u0437:<\/p>\n<pre><code>0.44525679540883948 0.44525679540840074 0.55268174813167364 0.5526817481315932 0.57758654725359399 0.57758654725360606 0.49595026978928474 0.49595026978930477 0.57118578561406703 0.57118578561407746 0.53237003739057907 0.5323700373905661 0.57269859374138096 0.57269859374138162 0.57631236396381141 0.5763123639638157 0.47943176373960149 0.47943176373960219 0.54955992675177704 0.5495599267517755 0.53321116270879686 0.53321116270879733 0.57294025883744952 0.57294025883744984 0.53131857821387693 0.53131857821387655 0.57253530821899101 0.57253530821899102 0.50661432403287194 0.50661432403287198 0.57149419848354913 0.57149419848354916 0.53220327148366491 0.53220327148366487 0.57268927270412251 0.57268927270412251 0.57632130426913003 0.57632130426913005 0.57233970084776142 0.57233970084776143 0.56824728628552812 0.56824728628552813 0.45247155441889921 0.45247155441889922 0.56875940568326509 0.56875940568326509 0.57524323439326321 0.57524323439326321 0.57587726902392535 0.57587726902392535 0.57597043124557292 0.57597043124557292 0.52847748894672118 0.52847748894672118 0.54512141953055808 0.54512141953055808 0.57362254577539695 0.57362254577539695 0.53082194129771177 0.53082194129771177 0.54404489702929382 0.54404489702929382 0.54065386336136847 0.54065386336136847 <\/code><\/pre>\n<p>  \u042d\u0434\u0430\u043a\u043e\u0435 \u0434\u044b\u0445\u0430\u043d\u0438\u0435 \u0432\u0435\u0442\u0435\u0440\u043a\u0430, \u0435\u043b\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0432 10\u043c \u0437\u043d\u0430\u043a\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041d\u0443 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435\u2026 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u0440\u0430\u0441\u0438\u0432\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0431\u0438\u0442\u044b \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043d\u043e\u043d\u0441\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438, \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u0442\u0438\u043f\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">double nonce_bits[32]; \t for (int i = 0; i &lt; 32; i++) \tnonce_bits[i] = (real_nonce32&amp;(1 &lt;&lt; i)) ? 1.0 : 0.0;  x32 nonce_x32; nonce_x32.init(nonce_bits); full_btc_hash(strxx, nonce_x32, result_x32); <\/code><\/pre>\n<p>  \u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0439 \u0445\u044d\u0448 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u00ab\u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439\u00bb \u0445\u044d\u0448 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u0431\u0438\u043d\u0433\u043e.<\/p>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439 \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u044b\u0445\u0430\u043d\u0438\u0435 \u0432\u0435\u0442\u0435\u0440\u043a\u0430\u2026 \u0438 \u0445\u044d\u0448 \u0441\u043b\u043e\u043c\u0430\u043d.<br \/>  \u0417\u0432\u0443\u0447\u0438\u0442, \u043a\u0430\u043a \u0431\u0440\u0435\u0434, \u043d\u043e \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0431\u0440\u0435\u0434 \u2014 \u0430 \u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u043b.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b:<\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/post\/258181\/\">\u041c\u0430\u0439\u043d\u0438\u043c Bitcoin \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0443\u043c\u0430\u0433\u0438 \u0438 \u0440\u0443\u0447\u043a\u0438.<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/318174\/\">\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0431\u0438\u0442\u043a\u043e\u0438\u043d\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043f\u0440\u043e\u0449\u0435 \u0438\u043b\u0438 \u043b\u0435\u0433\u0447\u0435?<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/post\/351118\/\">\u041a\u0430\u043a \u044f blakecoin \u043c\u0430\u0439\u043d\u0435\u0440 \u0434\u0435\u043b\u0430\u043b<\/a><\/li>\n<li><a href=\"https:\/\/marsohod.org\/projects\/proekty-dlya-platy-marsokhod3\/340-miner-bitcoin\">FPGA \u041c\u0430\u0439\u043d\u0435\u0440 Bitcoin \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u041c\u0430\u0440\u0441\u043e\u0445\u043e\u04343<\/a><\/li>\n<li><a href=\"https:\/\/marsohod.org\/projects\/proekty-dlya-platy-marsokhod3\/363-blake\">FPGA \u041c\u0430\u0439\u043d\u0435\u0440 \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c Blake<\/a><\/li>\n<\/ol>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/420131\/\"> https:\/\/habr.com\/post\/420131\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/post\/420131\/\" class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oi\/lh\/dt\/oilhdtkhhgrgz2gpjy00mjrxhaq.jpeg\"><\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u0440\u0435\u0434\u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043d\u0438\u043a \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0440\u0435\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043d\u0435\u0434\u0435\u043b\u0435. \u0423 \u043c\u0435\u043d\u044f \u0445\u043e\u0431\u0431\u0438, \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435 \u044f \u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0432\u0437\u043b\u043e\u043c\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u0430\u0439\u043d\u0438\u043d\u0433\u0430 bitcoin, \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0443\u043f\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u043d\u043e\u043d\u0441\u0435 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0445\u044d\u0448\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u043c \u044d\u043d\u0435\u0440\u0433\u0438\u0438. \u0421\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0438\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043f\u0438\u0441\u044c\u043c\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u0434\u0435\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0433\u043e\u043b\u043e\u0432\u0435? \u041a\u0443\u0434\u0430-\u0442\u043e \u0436\u0435 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0432\u0430\u0442\u044c\u2026<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0431\u0440\u0435\u0434\u043e\u0432\u043e\u0441\u0442\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0438\u0434\u0435\u0439 \u044f \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u0438\u0437\u0443\u0447\u0430\u0435\u0442<\/p>\n<ol>\n<li>\u044f\u0437\u044b\u043a C++ \u0438 \u0435\u0433\u043e \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b<\/li>\n<li>\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0438<\/li>\n<li>\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438<\/li>\n<li>\u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f bitcoin<\/li>\n<\/ol>\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-287330","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287330","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=287330"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287330\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}