📜 ⬆️ ⬇️

GOST 34.11-2012 Stribog for flat assembler (x86)

image

In continuation of the theme OS Systemicus (since this algorithm is used there) I cite the complete code for implementing GOST 34.11-2012 in assembler. The same “library” is used in this program - http://omegicus.com/gost_34.11-2012_stribog


')
UPD1: not in the know, can lay it out on a habr not by the rules - say, delete ...
UPD2: moved to pastebin ...

I will not describe anything - it’s already written enough, I’ll just lay out the code. Who is interested not in the code, but in the details of the algorithm - please do not read or minus ...

Immediately I warn you, the code is not optimized. I give the code entirely to the good hands of the optimizers) If anyone succeeds in speeding it up, post it too.

How to use:
         mov ebx, 512;  512 bit version
         mov esi buff
         mov edi, MH
         mov ecx, dword [m_sz]
         call GOST_3411_2012
         ;
         mov ebx, 256;  256 bit version
         mov esi buff
         mov edi, MH
         mov ecx, dword [m_sz]
         call GOST_3411_2012


In the first case, the 512-bit version is used, the source is ^ buff, the result is ^ MH, the length of the source data is in m_sz.
In the second case, everything is the same, but the 256-bit version of the algorithm is used.

So, the code section: http://pastebin.com/zzL8TXtb

And the data for the code: http://pastebin.com/DAqUZ9dM

Source: https://habr.com/ru/post/219859/


All Articles