macaroon icon indicating copy to clipboard operation
macaroon copied to clipboard

Replace libsodium with pure-Rust alternatives

Open dotxlem opened this issue 2 years ago • 1 comments

For a project I'm working on, I wanted to use macaroon in a WebAssembly module (wasm32-wasi target). Unfortunately, libsodium makes this difficult if not impossible.

I've republished my fork with the changes for testing, but I wanted to see if there was any interest in bringing this upstream.

The main change is the replacing of libsodium with the following crates:

chacha20poly1305 = "0.10"
sha2 = "0.10"
hmac = "0.12"
rand = "0.8"

Additionally I refactored the crypto stuff around the Encryptor and Decryptor traits -- the idea being to allow the client to provide it's own encryption mechanism via a service like Vault for example.

This also takes care of #83 and #84!

dotxlem avatar Dec 29 '22 20:12 dotxlem

I should point out that the new traits are hidden behind the original encrypt/decrypt_key functions and not yet exposed in the API :)

dotxlem avatar Dec 30 '22 18:12 dotxlem