13.07.2015, 22:18
There seems to be a bug with SHA256_PassHash and too long strings:
This code
outputs this
This code
pawn Код:
new ret_hash[65];
SHA256_PassHash("1234567890abcdefgh1234567890", "", ret_hash, sizeof(ret_hash));
printf("IS : %s", ret_hash);
printf("SHOULD: %s", "02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3");
SHA256_PassHash("1234567890abcdefgh", "1234567890", ret_hash, sizeof(ret_hash));
printf("IS : %s", ret_hash);
printf("SHOULD: %s", "02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3");
SHA256_PassHash("1234567890abcdefgh1234567890abcdefgh", "", ret_hash, sizeof(ret_hash));
printf("IS : %s", ret_hash);
printf("SHOULD: %s", "88F28A457C964A9FB3A3DC364B4973A3A5F54786CC4D519A58BABB30A9FFE808");
SHA256_PassHash("1234567890abcdefgh", "1234567890abcdefgh", ret_hash, sizeof(ret_hash));
printf("IS : %s", ret_hash);
printf("SHOULD: %s", "88F28A457C964A9FB3A3DC364B4973A3A5F54786CC4D519A58BABB30A9FFE808");
Код:
IS : 02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3 SHOULD: 02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3 IS : 02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3 SHOULD: 02AB0B351B726947624D09D4E0E977B3C59B2D1CAE127B314DB75C7FB95A05D3 IS : DE33E4115A41CDB51CC0E051CB6E31C01F6CE87D1FB95D007F1464ADB8C5547A SHOULD: 88F28A457C964A9FB3A3DC364B4973A3A5F54786CC4D519A58BABB30A9FFE808 IS : DE33E4115A41CDB51CC0E051CB6E31C01F6CE87D1FB95D007F1464ADB8C5547A SHOULD: 88F28A457C964A9FB3A3DC364B4973A3A5F54786CC4D519A58BABB30A9FFE808