Open
Description
Describe the bug
As reported in #8997:
Since OpenSSL 3.4 the SHAKE-128 and SHAKE-256 implementations have no default digest length link
This was fixed in #9002 for nif_hash_init
, but not for nif_hash
(used when byte_size(Data) < ?MAX_BYTES_TO_NIF
in crypto:hash/2).
To Reproduce
1> crypto:hash(shake256, ~"foobar").
** exception error: {error,{"hash.c",126},"Low-level call failed"}
in function crypto:hash/2
called as crypto:hash(shake256,<<"foobar">>)
Expected behavior
2> crypto:hash(shake256, ~"foobar") == crypto:hash_final(crypto:hash_update(crypto:hash_init(shake256), ~"foobar")).
true
Affected versions
I've tested this on OTP 27.3.4, but the relevant code in hash.c
on master
appears untouched.
This becomes an issue when openssl is updated to version >= 3.4. My openssl version is OpenSSL 3.4.1