Skip to content

Whirlpool Hash doesn't work correctly on big-endian platform #1528

@pingwcy

Description

@pingwcy

Hello VeraCrypt Team and Dear Mounir,

I have identified an issue in the current implementation of the Whirlpool hash algorithm. It appears that the algorithm has an endianness problem and can only function correctly on little-endian platforms. On big-endian systems(such as MIPS), the algorithm produces incorrect hash values. Unfortunately, this issue is silent, meaning that it does not raise any error or warning but instead simply outputs an incorrect hash.

In the function 'static void WhirlpoolTransform(uint64 *digest, const uint64 block)', the 'Whirlpool_C[0256 + K.ch[0 * 8 + 7]]' leads to the endian issue.

I have fixed this issue by updating the implementation to correctly handle both little-endian and big-endian platforms. The changes have been pushed, and I kindly request you to review the updated version.

Thank you very much for your time and attention to this matter!

Best regards,
Cunyuan Wang

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions