File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ const MEMORY_SIZE: usize = MEMORY_BLOCKS * MEMORY_BLOCKSIZE;
51
51
/// [Jitterentropy](http://www.chronox.de/jent.html) version 2.1.0.
52
52
///
53
53
/// [`OsRng`]: ../os/struct.OsRng.html
54
- #[ derive( Clone ) ]
55
54
pub struct JitterRng {
56
55
data : u64 , // Actual random number
57
56
// Number of rounds to run the entropy collector per 64 bits
@@ -120,6 +119,20 @@ impl fmt::Debug for JitterRng {
120
119
}
121
120
}
122
121
122
+ impl Clone for JitterRng {
123
+ fn clone ( & self ) -> JitterRng {
124
+ JitterRng {
125
+ data : self . data ,
126
+ rounds : self . rounds ,
127
+ timer : self . timer ,
128
+ mem_prev_index : self . mem_prev_index ,
129
+ // The 32 bits that may still be unused from the previous round are
130
+ // for the original to use, not for the clone.
131
+ data_half_used : false ,
132
+ }
133
+ }
134
+ }
135
+
123
136
/// An error that can occur when [`JitterRng::test_timer`] fails.
124
137
///
125
138
/// [`JitterRng::test_timer`]: struct.JitterRng.html#method.test_timer
You can’t perform that action at this time.
0 commit comments