jlouis / enacl

Erlang bindings for NaCl / libsodium
MIT License
197 stars 59 forks source link

secretstream support? #29

Closed joagre closed 4 years ago

joagre commented 6 years ago

Hi, Would it be hard to add support for secret streams?

https://download.libsodium.org/doc/secret-key_cryptography/secretstream.html

Cheers /Joakim

jlouis commented 6 years ago

This wouldn't be too hard.

The interface in general would follow that of crypto where you initialize a context/state on the C NIF side and use an NIF resource to track that state along different calls. Once you have this, the API should be somewhat easy to stamp out.

Testing the API is equally easy if you generate messages in a list and process them.

It is a new kind of API though, so some work needs to be done in order to pull it off.

jlouis commented 4 years ago

Update on this one:

I'm working toward a cleaner repository on the C side of things. This significantly simplifies the implementation of this issue. I'm probably going to slipstream it in once the dust settles from the cleanup.

jlouis commented 4 years ago

This should now be possible to add. The general implementation follows that of either multi-part signatures or generic hashing.

spscream commented 4 years ago

I implemented it in #44

jlouis commented 4 years ago

This has now been merged. Is slated for next release, once we have some EQC tests for the new API.