https://traditio.wiki/%D0%93%D0%9E%D0%A1%D0%A2_28147-89 An example was analyzed according to GOST 28147-89. Everything is clear until the shift. B1 7F E0 85 shifted by 11 bits in the direction of the higher digits and it turned out: 2F 8C FD 03 Explain, please, how does the shift occur here? In my understanding, a shift of 11 bits towards the high-order bits of the original expression gives FF 04 2D 8B. Tell me please.
1 answer
With a cyclic shift, the number is rolled into a ring, and the "extruded" bits are not lost, but inserted "from the back side".
It was (do not forget about the reverse):
85 E0 7F B1 == 1000 0101 111 0 0000 0111 1111 1011 0001
We make a cyclic shift (i.e., just cut off the selected bits from the head and stick to the ass), we get
0000 0011 1111 1101 1000 1 100 0010 1111 == 03 FD 8C 2F
Again the reverse - and we get exactly what is in the article.
- You are a great fellow! I would not have guessed. Thank you very much - Alexander
|