Argyle-Software / kyber

A rust implementation of the Kyber post-quantum KEM
https://docs.rs/pqc_kyber/
Apache License 2.0
163 stars 37 forks source link

Update keypair and client_init functions to use properly returned types #91

Closed MoonaAyati closed 10 months ago

MoonaAyati commented 1 year ago

Since these two functions do not return a result we can not use the "?" operator in the examples.

mberry commented 1 year ago

Hello,

The return types have changed on the master branch due to a PR for RNG errors for embedded devices raised here

This PR reverts that behaviour that was already merged.

Non-security releases generally happen on a Tuesday (Singapore/Sydney working hours), v0.7.0 may happen today or next week, time permitting.

I will add some migration notes for 0.6 -> 0.7 in the changelog, apart from certain embedded platforms this is something you should never encounter when running userspace programs and a panic is likely appropriate for anyone using .try_fill() on an RNG, you have much bigger problems on your system if that function cannot execute properly.

Panicking was the original behaviour on .fill(), there's now simply the choice to match/handle it rather than always panic.

More detail on this here: https://rust-random.github.io/rand/rand/trait.Rng.html#method.fill