randombit / botan

Cryptography Toolkit

Home Page:https://botan.randombit.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Streebog incorrect output

guidovranken opened this issue · comments

operation name: Digest
digest: STREEBOG-256
cleartext: {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 0x0f, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2d, 0xff, 0xf2, 0xff, 
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x23, 0xff, 0x27, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x2c} (64 bytes)

Module Veracrypt result:

{0x68, 0xe8, 0xd7, 0x7a, 0x02, 0xaa, 0xc4, 0xa8, 0x44, 0xa1, 0xd8, 0xe4, 0x6b, 0x27, 0xf3, 0x5b, 
 0xb9, 0x29, 0x3e, 0x3d, 0xc5, 0x84, 0xdc, 0x0e, 0x42, 0xa7, 0xe1, 0xb0, 0x79, 0x94, 0x53, 0x80} (32 bytes)

Module libgcrypt result:

{0x68, 0xe8, 0xd7, 0x7a, 0x02, 0xaa, 0xc4, 0xa8, 0x44, 0xa1, 0xd8, 0xe4, 0x6b, 0x27, 0xf3, 0x5b, 
 0xb9, 0x29, 0x3e, 0x3d, 0xc5, 0x84, 0xdc, 0x0e, 0x42, 0xa7, 0xe1, 0xb0, 0x79, 0x94, 0x53, 0x80} (32 bytes)

Module Botan result:

{0xfa, 0x07, 0xff, 0x3e, 0xfd, 0x87, 0xd4, 0xd0, 0x53, 0xd4, 0x16, 0x81, 0x3c, 0xbb, 0xd4, 0x8d, 
 0x87, 0x8b, 0xbd, 0xbf, 0x55, 0x8d, 0xcc, 0xf3, 0xfc, 0x8e, 0xa5, 0x60, 0x2f, 0xf0, 0x7b, 0x5d} (32 bytes)

Though not included in this log, LibreSSL produces the same output as Veracrypt and libgcrypt.
Both libgcrypt and LibreSSL had issues with Streebog in the past:

https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/gost/streebog.c?rev=1.6&content-type=text/x-cvsweb-markup

gpg/libgcrypt@da6cd4f

Thanks!

Fixed, thanks