Skip to content

Fatal error: Uncaught Crypto\HashException: Initialization of hash failed at a few algoritm #41

@mrxtraf

Description

@mrxtraf

Several algorithms produce an error when calling the update method.

Fatal error: Uncaught Crypto\HashException: Initialization of hash failed

In particular, the following algorithms.
md4
whirlpool

The rest of the functions are fine.
The module is assembled via phpize.

Version PHP
PHP 8.3.6 (cli) (built: Apr 15 2024 19:21:47) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.6, Copyright (c) Zend Technologies with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies

OS
Linux server99 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Code
$StringForTest = '12345';//Any string gives such an error on these methods.
$OneNameCryptoHash = 'md4';//Or 'whirlpool'
$ClHash = new Crypto\Hash($OneNameCryptoHash);
$ClHash->update($StringForTest);//On this string Fatal Error
$OneHash = $ClHash->hexdigest();
unset($ClHash);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions