Commit 0dabd78
authored
kem: remove associated
All of our `kem` implementations either use `type Error = Infallible` or
use the error type exclusively for handling RNG errors.
That's good, because having an error case for decapsulation introduces a
potential sidechannel, which can be eliminated by instead using implicit
rejection that returns a pseudorandom rejection symbol as its output.
This removes the `Error` types and makes `Decapsulate::decapsulate`
infallible in order to close the potential sidechannel having fallible
decapsulation provides.
`Encapsulate::encapsulate_with_rng` now only uses the `Result` for
handling RNG errors and returns `R::Error`, which should hopefully help
mitigate the concerns in #2214.
For end users, `Encapsulate::encapsulate` now provides infallible
encapsulation using the system RNG.Error types (#2216)1 parent 4e195b4 commit 0dabd78
1 file changed
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 47 | | |
51 | | - | |
| 48 | + | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
| |||
0 commit comments