X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost89.c;h=ccf338e29d8a3acf5e363dde47206f8a2da87ff5;hb=25729ddc501fecd873943450dec45e15d885c20f;hp=47b7ba0227c5aec79e04fac4ffc54d318c00f588;hpb=cba16944bff9d8c5dcf37be641822cd3de6d2ec1;p=openssl-gost%2Fengine.git diff --git a/gost89.c b/gost89.c index 47b7ba0..ccf338e 100644 --- a/gost89.c +++ b/gost89.c @@ -449,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) {