Home

Awesome

Overview

Standard GOST R 34.11–2012 «Information technology. Cryptographic data security. Hash-function» came into the effect in 2013. The standard is based on previously published hash function Stribog.

This project includes two implementations of the hash function in C and Sage. Sage version provides additional functionality including generating of tables and test vectors for C.

Propositions, comments, speedup or other improvements are welcome for both program and description (presentation) sources.

Authors

Oleksandr Kazymyrov: okazymyrov (at) gmail.com

Acknowledgements

Oleksii Shevchuk and Dmitry Olshansky for C code improvements.

Comments

According to an example, bytes stored on a hard drive or transmited to a channel have Little-endian notation for GOST R 34.11-94. The same notation has to be used for GOST R 34.11-2012 (it is not regulated). That is, the message from Appendix 2.2

M<sub>2</sub> = 0xFBE2E5F0EEE3C820FBEAFAEBEF20FFFBF0E1E0F0F520E0ED20E8ECE0EBE5F0 \ F2F120FFF0EEEC20F120FAF2FEE5E2202CE8F6F3EDE220E8E6EEE1E8F0F2D1202CE8F0F2E5E220E5D1

on the disk will have from

0xD1E520E2E5F2F0E82C20D1F2F0E8E1EEE6E820E2EDF3F6E82C20E2E5FEF2FA20F120ECEEF0FF20F1F2 \ F0E5EBE0ECE820EDE020F5F0E0E1F0FBFF20EFEBFAEAFB20C8E3EEF0E5E2FB

Moreover, decoding the last string using WIN-1251 gives "Се ветри, Стрибожи внуци, веютъ с моря стрелами на храбрыя плъкы Игоревы", which is a phrase from "The Tale of Igor's Campaign".

Therefore, the current implementation is the proof of concept with representation given in the standard. For real applications the code must be changed to correct endianness (depends on your platform).

Versions

Version 1.1.2

C

Version 1.1.1

Sage

Version 1.1

C

Sage

Version 1.0

C

Sage:

References