Add zeroize(drop) to Share

This commit is contained in:
Garrett Thornburg 2021-03-13 14:45:53 -08:00
parent a1b0dab5b2
commit cc885bf505
2 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,7 @@ mod tests {
#[test] #[test]
fn evaluator_works() { fn evaluator_works() {
let iter = get_evaluator(vec![vec![GF256(3), GF256(2), GF256(5)]]); let iter = get_evaluator(vec![vec![GF256(3), GF256(2), GF256(5)]]);
let values: Vec<_> = iter.take(2).map(|s| (s.x, s.y)).collect(); let values: Vec<_> = iter.take(2).map(|s| (s.x.clone(), s.y.clone())).collect();
assert_eq!( assert_eq!(
values, values,
vec![(GF256(1), vec![GF256(4)]), (GF256(2), vec![GF256(13)])] vec![(GF256(1), vec![GF256(4)]), (GF256(2), vec![GF256(13)])]

View File

@ -35,6 +35,7 @@ use zeroize::Zeroize;
#[derive(Clone)] #[derive(Clone)]
#[cfg_attr(feature = "fuzzing", derive(Arbitrary, Debug))] #[cfg_attr(feature = "fuzzing", derive(Arbitrary, Debug))]
#[cfg_attr(feature = "zeroize_memory", derive(Zeroize))] #[cfg_attr(feature = "zeroize_memory", derive(Zeroize))]
#[cfg_attr(feature = "zeroize_memory", zeroize(drop))]
pub struct Share { pub struct Share {
pub x: GF256, pub x: GF256,
pub y: Vec<GF256>, pub y: Vec<GF256>,