samuel-lucas6 / Geralt

A modern cryptographic library for .NET 8+ based on libsodium and inspired by Monocypher.
https://www.geralt.xyz/
MIT License
48 stars 3 forks source link

Implement crypto_secretstream as IncrementalXChaCha20Poly1305 #5

Closed Jack-Edwards closed 2 years ago

Jack-Edwards commented 2 years ago

I am not very comfortable with references and pointers in C#, but I did my best to copy your patterns.

I'm going to leave some comments in the PR in some areas I'm unsure of.

samuel-lucas6 commented 2 years ago

This was a pleasant surprise! Thanks Jack! I will try to take a look today.

Jack-Edwards commented 2 years ago

Thanks. I'm looking into alternatives to libsodium-core and I think Geralt is the closest to what I'm looking for. crypto_secretstream support may be the only thing missing for my use-case.

samuel-lucas6 commented 2 years ago

I'm looking into alternatives to libsodium-core and I think Geralt is the closest to what I'm looking for.

That's good to hear. Please feel free to share any feedback on the API and documentation. I need to rewrite all the tests to try and reduce repetition at some point, and I'd like to change the BLAKE2b stream implementation so it uses spans.

crypto_secretstream support may be the only thing missing for my use-case.

Yes, I think it makes sense now there's IncrementalBLAKE2b and Poly1305.

Jack-Edwards commented 2 years ago

@samuel-lucas6 I implemented most of your feedback and resolved some compiler messages I hadn't seen before. I'll leave it up to you to resolve any open conversations.

Edit: Okay now I've implemented most of your feedback. Some of your comments were only showing up under Files Changed.

samuel-lucas6 commented 2 years ago

Appreciate it. Last thing is could you merge the no associated data and associated data methods for Pull like you did for Push? Not a fan of the GitHub editor. Then I'll merge.

Jack-Edwards commented 2 years ago

The overload for Pull is gone.