X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gost89.c;h=ccf338e29d8a3acf5e363dde47206f8a2da87ff5;hb=25729ddc501fecd873943450dec45e15d885c20f;hp=4ff4ddd7a56531bf65d24dd5d3df607461391906;hpb=c98ba9d03213d0c63d6874539d59f7b55fbc3fae;p=openssl-gost%2Fengine.git diff --git a/gost89.c b/gost89.c index 4ff4ddd..ccf338e 100644 --- a/gost89.c +++ b/gost89.c @@ -208,6 +208,33 @@ gost_subst_block Gost28147_CryptoProParamSetD = { 0x8, 0x3} }; +/* 1.2.643.7.1.2.5.1.1 */ +gost_subst_block Gost28147_TC26ParamSetZ = { + {0x1, 0x7, 0xe, 0xd, 0x0, 0x5, 0x8, 0x3, 0x4, 0xf, 0xa, 0x6, 0x9, 0xc, + 0xb, 0x2} + , + {0x8, 0xe, 0x2, 0x5, 0x6, 0x9, 0x1, 0xc, 0xf, 0x4, 0xb, 0x0, 0xd, 0xa, + 0x3, 0x7} + , + {0x5, 0xd, 0xf, 0x6, 0x9, 0x2, 0xc, 0xa, 0xb, 0x7, 0x8, 0x1, 0x4, 0x3, + 0xe, 0x0} + , + {0x7, 0xf, 0x5, 0xa, 0x8, 0x1, 0x6, 0xd, 0x0, 0x9, 0x3, 0xe, 0xb, 0x4, + 0x2, 0xc} + , + {0xc, 0x8, 0x2, 0x1, 0xd, 0x4, 0xf, 0x6, 0x7, 0x0, 0xa, 0x5, 0x3, 0xe, + 0x9, 0xb} + , + {0xb, 0x3, 0x5, 0x8, 0x2, 0xf, 0xa, 0xd, 0xe, 0x1, 0x7, 0x4, 0xc, 0x9, + 0x6, 0x0} + , + {0x6, 0x8, 0x2, 0x3, 0x9, 0xa, 0x5, 0xc, 0x1, 0xe, 0x4, 0x7, 0xb, 0xd, + 0x0, 0xf} + , + {0xc, 0x4, 0x6, 0x2, 0xa, 0x5, 0xb, 0x9, 0xe, 0x8, 0xd, 0x7, 0x0, 0x3, + 0xf, 0x1} +}; + const byte CryptoProKeyMeshingKey[] = { 0x69, 0x00, 0x72, 0x22, 0x64, 0xC9, 0x04, 0x23, 0x8D, 0x3A, 0xDB, 0x96, 0x46, 0xE9, 0x2A, 0xC4, @@ -422,6 +449,17 @@ void gost_key(gost_ctx * c, const byte * k) } } +/* Set 256 bit key into context */ +void magma_key(gost_ctx * c, const byte * k) +{ + int i, j; + for (i = 0, j = 0; i < 8; i++, j += 4) { + c->k[i] = + k[j+3] | (k[j + 2] << 8) | (k[j + 1] << 16) | ((word32) k[j] << + 24); + } +} + /* Retrieve 256-bit key from context */ void gost_get_key(gost_ctx * c, byte * k) {