endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
761 stars 68 forks source link

add sha256 a la base64 #2335

Open dckc opened 6 days ago

dckc commented 6 days ago

What is the Problem Being Solved?

Importing sha256 from @cosmjs/crypto failed trying to import node:crypto. Attempts to work around that using a newer @noble/hashes ran into a limitation around package exports:

Description of the Design

sketch: https://github.com/Agoric/agoric-sdk/pull/9576#discussion_r1655591371

cc @kriskowal

Security Considerations

sha256 callers rely on cryptographic hash properties (other than constant time)

Scaling Considerations

I'm not currently aware of a need to hash large quantities of data, so dropping down to native code isn't likely to have a significant impact.

Test Plan

@noble/hashes is extensively tested; any deviation should be carefully tested.

Compatibility / Upgrade Considerations

This would be a new feature.