{"id":280142,"date":"2016-10-30T12:55:02","date_gmt":"2016-10-30T09:55:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280142"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280142","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u0430 \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb \u0441 \u0440\u0435\u0436\u0438\u043c\u043e\u043c CFB \u043d\u0430 \u0421++"},"content":{"rendered":"<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043d\u043e\u0432\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0413\u041e\u0421\u0422 \u0420 34.12 2015. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443. \u0412 \u043d\u0438\u0445 \u0441 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438\u0437\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0443\u0442\u0451\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0446\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/tc26.ru\/standard\/gost\/GOST_R_3412-2015.pdf\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439  <\/p>\n<ul>\n<li>\u043d\u0430\u0431\u043e\u0440 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u2014 mycrypto.cpp mycrypto.hpp<\/li>\n<li>\u0431\u043b\u043e\u0447\u043d\u044b\u0439 \u0448\u0438\u0444\u0440 \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb \u2014 Kuznyechik.cpp Kuznyechik.hpp<\/li>\n<li>\u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f Cipher Feed Back \u2014 modes.hpp<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h5>\n<p>  <\/p>\n<pre><code class=\"cpp\">#define BLOCK_LENGTH 16  typedef unsigned char BYTE; typedef unsigned short WORD; <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430<\/h4>\n<p>  <\/p>\n<h5>\u041a\u043b\u0430\u0441\u0441 ByteBlock<\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ByteBlock<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">class ByteBlock {     BYTE * pBlocks;     size_t amount_of_bytes; public:     \/\/ Construct block of bytes which contsists of     \/\/ size_ blocks each of them with init_value in it     ByteBlock(size_t size_ = 0, BYTE init_value = 0);      \/\/ Construct block with size_ first bytes of pBlocks_     \/\/ The value will be copied, source stays untouchable     ByteBlock(BYTE * pBlocks_, size_t size_);      \/\/ Move constructor     \/\/ Copy constructor thus implicitly deleted     \/\/ Object to move turn to null     ByteBlock(ByteBlock && rhs);      \/\/ Destructor, yeah     ~ByteBlock();      \/\/ Move assigment operator     \/\/ Object to move turn to null     void operator = (ByteBlock && rhs);      \/\/ This cast may be convenient to use the ByteBlock     \/\/ in functions which takes raw pointers as argument     BYTE * byte_ptr();     const BYTE * byte_ptr() const;      \/\/ Indexing operator with evident functionality     BYTE & operator [] (size_t index);     BYTE operator [] (size_t index) const;      bool operator == (const ByteBlock & lhs) const;     bool operator != (const ByteBlock & lhs) const;      \/\/ Replace body of the current block with pBlocks_     \/\/ Old value will be zerod, and then, deleted     \/\/ New value copied into the block,     \/\/ source stays untouchable     void reset(const BYTE * pBlocks_, size_t size_);      \/\/ Return amount of bytes in block     size_t size() const;      \/\/ It'll return deep copy of the block, which     \/\/ points to different place in memory     ByteBlock deep_copy() const;      \/\/ It'll return slice of current ByteBlock     ByteBlock operator () (size_t begin, size_t length) const;      \/\/ Changes values between two ByteBlock-s     friend void swap(ByteBlock & lhs, ByteBlock & rhs); }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0434\u0430\u043b\u0435\u0435 \u00ab\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00bb) \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/li>\n<li>\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u00ab\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00bb \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<li>\u041e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<li>\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/li>\n<li>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0431\u0430\u0439\u0442\u0430\u043c, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438<\/li>\n<\/ul>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b (\u043d\u0435\u044f\u0432\u043d\u043e), \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 ByteBlock \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043b\u0430\u0434\u0435\u044e\u0442 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442. \u0414\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043a\u043e\u043f\u0438\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0443\u043c\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0438\u0437 STL \u2014 std::unique_ptr.<br \/>  \u041e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 memset. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 memset, \u0437\u043d\u0430\u044f, \u0447\u0442\u043e \u0434\u0430\u043b\u0435\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430, \u0430 \u0432\u0441\u043a\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.<\/p>\n<h5>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 hex-\u0441\u0442\u0440\u043e\u043a \u0432 ByteBlock \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h5>\n<p>  <\/p>\n<pre><code class=\"cpp\">std::string hex_representation(const ByteBlock & bb); ByteBlock hex_to_bytes(std::string s); <\/code><\/pre>\n<p>  \u042d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0438\u0445 \u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb<\/h4>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Kuznyechik<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">class Kuznyechik {     std::vector&lt;ByteBlock&gt; keys;     static bool is_init; public:     static const int block_lenght { BLOCK_LENGTH };      Kuznyechik(const ByteBlock & key);     Kuznyechik(const Kuznyechik & rhs);     ~Kuznyechik();     void encrypt(const ByteBlock & src, ByteBlock & dst) const;     void decrypt(const ByteBlock & src, ByteBlock & dst) const; }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u043b\u0435 keys \u2014 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443. \u041f\u043e\u043b\u0435 is_init \u2014 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0438\u043f\u0430 Kuznyechik. \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d\u0438 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  \u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b ByteBlock, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 keys.<\/p>\n<h5>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">const vector&lt;BYTE&gt; nonlinear_transform_perm = { \t252, 238, 221, 17, 207, 110, 49, 22, 251, 196, \t250, 218, 35, 197, 4, 77, 233, 119, 240, 219, \t147, 46, 153, 186, 23, 54, 241, 187, 20, 205, \t95, 193, 249, 24, 101, 90, 226, 92, 239, 33, \t129, 28, 60, 66, 139, 1, 142, 79, 5, 132, 2, \t174, 227, 106, 143, 160, 6, 11, 237, 152, 127, \t212, 211, 31, 235, 52, 44, 81, 234, 200, 72, \t171, 242, 42, 104, 162, 253, 58, 206, 204, 181, \t112, 14, 86, 8, 12, 118, 18, 191, 114, 19, 71, \t156, 183, 93, 135, 21, 161, 150, 41, 16, 123, \t154, 199, 243, 145, 120, 111, 157, 158, 178, 177, \t50, 117, 25, 61, 255, 53, 138, 126, 109, 84, \t198, 128, 195, 189, 13, 87, 223, 245, 36, 169, \t62, 168, 67, 201, 215, 121, 214, 246, 124, 34, \t185, 3, 224, 15, 236, 222, 122, 148, 176, 188, \t220, 232, 40, 80, 78, 51, 10, 74, 167, 151, 96, \t115, 30, 0, 98, 68, 26, 184, 56, 130, 100, 159, \t38, 65, 173, 69, 70, 146, 39, 94, 85, 47, 140, \t163, 165, 125, 105, 213, 149, 59, 7, 88, 179, \t64, 134, 172, 29, 247, 48, 55, 107, 228, 136, \t217, 231, 137, 225, 27, 131, 73, 76, 63, 248, \t254, 141, 83, 170, 144, 202, 216, 133, 97, 32, \t113, 103, 164, 45, 43, 9, 91, 203, 155, 37, \t208, 190, 229, 108, 82, 89, 166, 116, 210, 230, \t244, 180, 192, 209, 102, 175, 194, 57, 75, 99, \t182 }; const map&lt;BYTE, BYTE&gt; direct_permutation, inverse_permutation;  const vector&lt;WORD&gt; linear_transform_coeff = { \t148, 32, 133, 16, 194, 192, 1, 251, 1, 192, \t194, 16, 133, 32, 148, 1 }; const WORD linear_transform_modulus = 0x1C3;  const vector&lt;ByteBlock&gt; iteration_constants; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e direct_permutation, inverse_permutation, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 iteration_constants, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void init_perms() {     map&lt;BYTE, BYTE&gt; *p_direct, *p_inverse;     p_direct = const_cast&lt; map&lt;BYTE, BYTE&gt; * &gt;(&direct_permutation);     p_inverse = const_cast&lt; map&lt;BYTE, BYTE&gt; * &gt;(&inverse_permutation);     for(int i = 0; i &lt; nonlinear_transform_perm.size(); i++) {         (*p_direct)[i] = nonlinear_transform_perm[i];         (*p_inverse)[nonlinear_transform_perm[i]] = i;     } }  void init_consts() {     vector&lt;ByteBlock&gt; * p = const_cast&lt; vector&lt;ByteBlock&gt; * &gt;(&iteration_constants);     ByteBlock v128;     for(BYTE i = 1; i &lt;= 32; i++) {         v128 = ByteBlock(BLOCK_LENGTH, 0); \tv128[BLOCK_LENGTH - 1] = i;         iteration_linear_transform_direct128(v128.byte_ptr()); \tp-&gt;push_back(std::move(v128));     } }  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439<\/h5>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438: \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 ByteBlock \u0432 BYTE * \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442, \u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0448\u0438\u0444\u0440\u0430, \u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043f\u0440\u044f\u043c\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void nonlinear_transform_direct128(BYTE * target) {     BYTE * p_end = target + BLOCK_LENGTH;     while(target != p_end) {         *target = direct_permutation.at(*target);         target++;     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0441\u0442\u044c \u043d\u0438 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043f\u0440\u044f\u043c\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void iteration_linear_transform_direct128(BYTE * target) {     for(int i = 0; i &lt; 16; i++)         linear_transform_direct128(target); }  void linear_transform_direct128(BYTE * target) {     BYTE buffer = linear_transform_core128(target);     for(int i = BLOCK_LENGTH - 1; i &gt; 0; i--)         target[i] = target[i-1];     *target = buffer; }  BYTE linear_transform_core128(const BYTE * target) {     WORD result = 0;     for(int i = 0; i &lt; BLOCK_LENGTH; i++)         result ^= multiply(target[i], linear_transform_coeff[i]);      return result; }  WORD multiply(WORD lhs, WORD rhs) {     WORD result = 0, modulus = linear_transform_modulus &lt;&lt; 7;     for(WORD detecter = 0x1; detecter != 0x100; detecter &lt;&lt;= 1, lhs &lt;&lt;= 1)         if(rhs & detecter) result ^= lhs;     for(WORD detecter = 0x8000; detecter != 0x80; detecter &gt;&gt;= 1, modulus &gt;&gt;= 1)         if(result & detecter) result ^= modulus;     return result; } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 multiply. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0435\u0451 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0432 \u0444\u0430\u043a\u0442\u043e\u0440-\u043a\u043e\u043b\u044c\u0446\u0435 GL(2)[x]\/p(x), \u0433\u0434\u0435 p(x) = x^8 + x^7 + x^6 + x + 1. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u0447\u043b\u0435\u043d\u043e\u0432, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u0437 GL(2). \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0436\u0435 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e p(x).<\/p>\n<h5>\u0420\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439<\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void keys_transform128(BYTE * k1, BYTE * k2, int iconst) {     BYTE buffer[BLOCK_LENGTH];     memcpy(buffer, k1, BLOCK_LENGTH);     xor128(k1, k1, iteration_constants[iconst].byte_ptr());     nonlinear_transform_direct128(k1);     iteration_linear_transform_direct128(k1);     xor128(k1, k2, k1);     memcpy(k2, buffer, BLOCK_LENGTH); }  void key_derivation128(BYTE * k1, BYTE * k2, BYTE * k3, BYTE * k4, int ipair) {     if(k1 != k3) memcpy(k3, k1, BLOCK_LENGTH);     if(k2 != k4) memcpy(k4, k2, BLOCK_LENGTH);     for(int i = 0; i &lt; 8; i++)         keys_transform128(k3, k4, ipair * 8 + i); } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">void encrypt128(BYTE * target, const vector&lt;ByteBlock&gt; & keys) {     xor128(target, target, keys[0].byte_ptr());     for(int i = 1; i &lt; 10; i++) {         nonlinear_transform_direct128(target);         iteration_linear_transform_direct128(target);         xor128(target, target, keys[i].byte_ptr());     } } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043b\u0438\u0448\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u00ab\u043f\u0440\u044f\u043c\u043e\u043c\u00bb \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<h4>\u0420\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f CFB<\/h4>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 CFB_Mode<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">template &lt;typename CipherType&gt; class CFB_Mode {     const CipherType algorithm;     const ByteBlock iv;      void decrypt_with_iv(const ByteBlock & src, ByteBlock & dst, const ByteBlock & iv_) const; public:     CFB_Mode(const CipherType & alg, const ByteBlock & init_vec);     void encrypt(const ByteBlock & src, ByteBlock & dst) const;     void decrypt(const ByteBlock & src, ByteBlock & dst) const;      void parallel_decrypt(const ByteBlock & src, ByteBlock & dst) const; }; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u044b\u0431\u043e\u0440 \u0440\u0435\u0436\u0438\u043c\u0430 \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b \u0441\u043b\u0443\u0447\u0430\u0435\u043d. \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u044b. \u0423 \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 CryptoPP \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u0434\u0435\u0436\u0430\u0432\u044e, \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u043e. \u0412\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u0430 \u0438 \u0440\u0435\u0436\u0438\u043c\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u0447\u043d\u044b\u0439 \u0448\u0438\u0444\u0440 \u0432 \u0442\u0430\u043d\u0434\u0435\u043c\u0435 \u0441 \u044d\u0442\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043a\u043b\u0430\u0441\u0441, \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439, \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\u041e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b encrypt \u0438 decrypt \u0441 \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u043c, \u0447\u0442\u043e \u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 CFB_Mode<\/li>\n<li>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u043f\u043e\u043b\u0435 block_length, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0430\u0439\u0442\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0434\u043b\u0438\u043d\u0435 \u0431\u043b\u043e\u043a\u0430 \u0448\u0438\u0444\u0440\u0430<\/li>\n<\/ul>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 Kuznyechik \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u044d\u0442\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n<h5>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h5>\n<p>  \u0412 \u044d\u0442\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0451 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438, \u043a\u0440\u0430\u0442\u043d\u044b\u0435 \u0434\u043b\u0438\u043d\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0431\u043b\u043e\u0447\u043d\u044b\u0439 \u0448\u0438\u0444\u0440, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u044b\u0439 xor.<\/p>\n<pre><code class=\"cpp\">std::vector&lt;ByteBlock&gt; split_blocks(const ByteBlock & src, size_t length); ByteBlock join_blocks(const std::vector&lt;ByteBlock&gt; & blocks); void xor_blocks(ByteBlock & to_assign, const ByteBlock & lhs, const ByteBlock & rhs); <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">template &lt;typename CipherType&gt; void CFB_Mode&lt;CipherType&gt;::encrypt(const ByteBlock & src, ByteBlock & dst) const {     auto blocks = split_blocks(src, CipherType::block_lenght);     ByteBlock tmp;      algorithm.encrypt(iv, tmp);     xor_blocks(tmp, tmp, blocks[0]);     blocks[0] = std::move(tmp);     for(int i = 1; i &lt; blocks.size(); i++) {         algorithm.encrypt(blocks[i-1], tmp);         xor_blocks(tmp, tmp, blocks[i]);         blocks[i] = std::move(tmp);     }     dst = join_blocks(blocks); } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">template &lt;typename CipherType&gt; void CFB_Mode&lt;CipherType&gt;::decrypt(const ByteBlock & src, ByteBlock & dst) const {     decrypt_with_iv(src, dst, iv); }  template &lt;typename CipherType&gt; void CFB_Mode&lt;CipherType&gt;::decrypt_with_iv(const ByteBlock & src, ByteBlock & dst, const ByteBlock & iv_) const {     auto blocks = split_blocks(src, CipherType::block_lenght);     ByteBlock tmp;      algorithm.encrypt(iv_, tmp);     xor_blocks(tmp, blocks[0], tmp);     swap(tmp, blocks[0]);     for(int i = 1; i &lt; blocks.size(); i++) {         algorithm.encrypt(tmp, tmp);         xor_blocks(tmp, blocks[i], tmp);         swap(tmp, blocks[i]);     }     dst = join_blocks(blocks); } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u043c. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0431\u044b \u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u043f\u043e \u0448\u0438\u0444\u0440\u043e\u0442\u0435\u043a\u0441\u0442\u0443 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432 std::threads \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C++11.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">template &lt;typename CipherType&gt; void CFB_Mode&lt;CipherType&gt;::parallel_decrypt(const ByteBlock & src, ByteBlock & dst) const {     \/\/ length in blocks of CipherType::block_lenght     unsigned long const length =         src.size() \/ CipherType::block_lenght + (src.size() % CipherType::block_lenght ? 1 : 0);      \/\/ amount of threads which can perform really simultaniously     unsigned long const hardware_threads = std::thread::hardware_concurrency();      \/\/ blocks of size CipherType::block_lenght to perform on by one thread     unsigned long const min_per_thread = 1;      \/\/ amount of threads to satisfy current condition     unsigned long const max_threads = (length + min_per_thread - 1) \/ min_per_thread;      \/\/ amount of threads to create     unsigned long const num_threads = std::min(         hardware_threads != 0 ? hardware_threads : 2,         max_threads     );      \/\/ if we aren't able to use multiple threads call common decryptor     if(num_threads &lt;= 1) {         decrypt(src, dst);         return;     }      std::cerr &lt;&lt; &quot;Running &quot; &lt;&lt; num_threads &lt;&lt; &quot; threads.&quot; &lt;&lt; endl;      unsigned long const block_size = (length \/ num_threads) * CipherType::block_lenght;     std::vector&lt;ByteBlock&gt; init_vectors(num_threads);     std::vector&lt;ByteBlock&gt; results(num_threads);     std::vector&lt;std::thread&gt; threads(num_threads - 1);      init_vectors[0] = iv.deep_copy();     for(int i = 1; i &lt; num_threads; i++)         init_vectors[i] = src(i * block_size - CipherType::block_lenght, CipherType::block_lenght);      unsigned long start_pos = 0;     for(unsigned long i = 0; i &lt; num_threads - 1; i++) {         threads[i] = std::thread(             &CFB_Mode&lt;CipherType&gt;::decrypt_with_iv,             this,             src(start_pos, block_size),             std::ref( results[i] ),             std::ref( init_vectors[i] )         );         start_pos += block_size;     }      decrypt_with_iv(         src(start_pos, src.size() - start_pos),         results[num_threads - 1],         init_vectors[num_threads - 1]     );      for(auto & t : threads) t.join();      dst = join_blocks(results); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0448\u0438\u0444\u0440\u0443\u044e\u0449\u0435\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &quot;mycrypto.hpp&quot; #include &quot;Kuznyechik.hpp&quot;  int main() {     ByteBlock key = hex_representation(         &quot;8899aabbccddeeff0011223344556677fedcba98765432100123456789abcdef&quot;     );     ByteBlock iv = hex_representation(&quot;abcdef12345600dacdef94756eeabefa&quot;);     ByteBlock msg = hex_representation(&quot;1122334455667700ffeeddccbbaa9988&quot;);     ByteBlock result;      CFB_Mode&lt;Kuznyechik&gt; encryptor(Kuznyechik(key), iv);     encryptor.encrypt(msg, result);      return 0; } <\/code><\/pre>\n<p>  \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/KoSeAn97\/Encryptor-With-Kuznyechik\">\u0442\u0443\u0442<\/a>.<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:\/\/habrahabr.ru\/post\/313932\/\"> https:\/\/habrahabr.ru\/post\/313932\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043d\u043e\u0432\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0413\u041e\u0421\u0422 \u0420 34.12 2015. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443. \u0412 \u043d\u0438\u0445 \u0441 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438\u0437\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0443\u0442\u0451\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0448\u0438\u0444\u0440\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0446\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/tc26.ru\/standard\/gost\/GOST_R_3412-2015.pdf\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439  <\/p>\n<ul>\n<li>\u043d\u0430\u0431\u043e\u0440 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u2014 mycrypto.cpp mycrypto.hpp<\/li>\n<li>\u0431\u043b\u043e\u0447\u043d\u044b\u0439 \u0448\u0438\u0444\u0440 \u00ab\u041a\u0443\u0437\u043d\u0435\u0447\u0438\u043a\u00bb \u2014 Kuznyechik.cpp Kuznyechik.hpp<\/li>\n<li>\u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f Cipher Feed Back \u2014 modes.hpp<\/li>\n<\/ul>\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-280142","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280142","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=280142"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280142\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}