Skip to content

Conversation

jdowning100
Copy link
Contributor

Problem

The createHash('KECCAK-256') function was failing with "Unknown hash algorithm" error on iOS, even though getHashes() listed KECCAK-256 as available. This was caused by a mismatch between the legacy OpenSSL API (EVP_get_digestbyname) used in createHash() and the provider-based API that enumerates available algorithms.

Solution

Added a dedicated keccak256() function that uses OpenSSL's modern provider-aware API (EVP_MD_fetch) to properly access KECCAK-256 digests. Also added unit test.

Future work

This could be extended to support all hash functions using the new OpenSSL API, but this satisfied my needs for my project. I might also add a PR to extend keccak256 support to the legacy 0.7.15 package because that is what everyone is using on npm (however as I understand it this would require upgrading the OpenSSL version on that package to 3.x)

@boorad
Copy link
Collaborator

boorad commented Jul 16, 2025

hey @jdowning100, thanks for this!

Can you fix up the formatting?

@boorad
Copy link
Collaborator

boorad commented Aug 29, 2025

see #778

@boorad boorad closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants