SpinResearch / RustySecrets

🔑 Threshold Shamir's secret sharing in Rust
BSD 3-Clause "New" or "Revised" License
258 stars 33 forks source link

`rusty_secrets::sss::generate_shares` returns `String`s? #20

Closed burdges closed 7 years ago

burdges commented 7 years ago

Appears rusty_secrets::sss::generate_shares returns Result<Vec<String>>, which sounds odd for ciphertext. In fact, collections::string::String says "Strings are always valid UTF-8. This has a few implications, the first of which is that if you need a non-UTF-8 string, consider OsString. It is similar, but without the UTF-8 constraint." I suppose your encoding via protobuf makes all that fine though and you mean to send this over text channels anyways?

FredericJacobs commented 7 years ago

Hey @burdges! Thanks for looking into RustySecrets.

The reason it was done this way is because in the context of an application that relies on RustySecrets we wanted to return shares in the format described in the README.

I guess you're right that in the sss module we could return data and leave it to library consumers to choose how to deal with that.

burdges commented 7 years ago

Cool. I'll close this since it sounds like everything makes sense. I'd think anyone who cares about some lower level version could extract it from gf256.rs and interpolation.rs or something.