Closed faern closed 2 years ago
Even though, I agree with the change, I am afraid it does not have a chance.
How does it change the public API? The shake256
function is private and all errors exposed from the library are just opaque anyway.
Oh sorry, my bad. I did not read the (crate)
suffix. Ready for merge.
I forgot the v2
branch existed. I really think we need to rework fallibility there. The crypto operations are not infallible by themselves, even if they contained a lot of invalidly fallible operations (like this one).
Sorry for pushing a bunch of stuff to the 1.0
branch. I really just want to help make 2.0
get out the door asap.
I think it is legitimate to improve branch 1.x where possible. I appreciate it.
I have difficulties to judge fallibility on branch 2.x. @dkales has a better overview on the changes of 2.x.
The solution available in v2
is even better than here. I missed the digest_xof
helper function :+1:
I think it is legitimate to improve branch 1.x where possible. I appreciate it.
I don't think the v1 branch should be used by anyone in production. That RNG is not meant for real use. Which is why I want v2 got get ready. Because we already use this in production, albeit currently depending on git. https://github.com/mullvad/mullvadvpn-app/blob/master/talpid-tunnel-config-client/Cargo.toml#L20-L24
After running the testsuite, I merged the PR. I also added a commit for digest_xof
. Thank you!
SHAKE256 output can be obtained infallibly. We only had an error branch here because the read was done using
std::io::Read::read
instead of directly fromXofReader::read
. The error that was here could not actually happen. Because thestd::io::Read
impl onXofReader
was infallible, it was just forced to have aResult
as the return type due to how the trait is defined.I also took the opportunity to upgrade
sha3
. This is not strictly needed to make it infallible, but I figured we better get the latest dependencies anyway.