Commit 764ed69
committed
Remove
Allow cloning on a stream cipher or RNG is problematic because it
duplicates internal states, which can lead to keystream reuse / RNG
output duplication, which in cryptographic contexts can be catastrophic.
Instead, for things like tests ciphers can be initialized from the same
seed repeatedly, which is what this PR changes the e.g. `chacha20` tests
to do. This is a much more explicit way of deliberately duplicating
stream ciphers/RNGs for the purposes of testing.
See also:
- #220
- #461
- RustCrypto/block-modes/pull/91
- rust-random/rand#1101Clone impls on ciphers/RNGs1 parent f0bb120 commit 764ed69
4 files changed
+15
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 221 | | |
231 | 222 | | |
232 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | | - | |
311 | 309 | | |
312 | 310 | | |
313 | 311 | | |
| |||
951 | 949 | | |
952 | 950 | | |
953 | 951 | | |
954 | | - | |
955 | | - | |
| 952 | + | |
| 953 | + | |
956 | 954 | | |
957 | | - | |
| 955 | + | |
958 | 956 | | |
959 | 957 | | |
960 | | - | |
961 | | - | |
962 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
963 | 961 | | |
964 | | - | |
| 962 | + | |
965 | 963 | | |
966 | | - | |
| 964 | + | |
967 | 965 | | |
968 | 966 | | |
969 | | - | |
| 967 | + | |
970 | 968 | | |
971 | | - | |
| 969 | + | |
972 | 970 | | |
973 | | - | |
| 971 | + | |
974 | 972 | | |
975 | 973 | | |
976 | 974 | | |
| |||
1110 | 1108 | | |
1111 | 1109 | | |
1112 | 1110 | | |
1113 | | - | |
1114 | | - | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1115 | 1114 | | |
1116 | 1115 | | |
1117 | 1116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
262 | 261 | | |
263 | 262 | | |
264 | 263 | | |
265 | | - | |
266 | 264 | | |
267 | 265 | | |
268 | 266 | | |
| |||
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
304 | | - | |
305 | 302 | | |
306 | 303 | | |
307 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
0 commit comments