On the introductions channel @Luke Boswell suggested that, since I have a strong mathematical background, it would be a good a idea for me to try to make a start on this idea to add built-in cryptography.
I have not contributed before so am likely to need a lot of help getting started.
@Richard Feldman @Brendan Hansknecht what are the first steps here? Do we start with bcrypt and call the zig implementation? Probably also need to add some plumbing to setup compiling crypto stuff to llvm IR
That's definitely an easy start. Instead of rewriting a crypto impl, just use what already exists in zig and should be fast.
are we sure we specifically want bcrypt?
I think sha256 is the least controversial one I can think of
and yeah I think using zig (or C, via Zig) implementations is the way to go here! :100:
sha256 is good for me
So in crates/compiler/builtins/roc do we create a folder Crypt with Sha256.roc as first module?
sounds good to me!
Would the plan be to just have a pure version of Sha256.hash
or would there also be a need for the streaming versions with update
and finalResult
?
that’s a good question; I’d guess both
It seems good to have SHA256 for message digest, but I think those aren’t recommended for password hashing which I expect would be a common use case
yeah I just think that use case needs more design work to figure out which algorithm(s) to recommend, which to include for backwards compatibility, etc
Is the process: Create issue on the main repo -> create a fork -> create a branch on the fork-> make the changes -> create a pull request on the main repo , from the forked branch -> link the PR to the issue ?
That works
Though no need to make an issue specifically
That works.
In this case I'm not sure we need an Issue though.
Also you can make the changes in a fork too, not sure if everyone has write permissions to roc.
If it is work to be done, you can just do it, but tracking in issues can be nice
Is there a concept of std libs in Roc yet? What's the difference between built-ins and platform APIs?
There are 3 current types of libraries I guess.
Hi. Just an update that I have finally found some time to work on this at this fork,. It doesn't work currently but I think I can see what I am doing wrong
Last updated: Jul 06 2025 at 12:14 UTC