From cc885bf505ac6f2adf205fbba2485bab5f947778 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 13 Mar 2021 14:45:53 -0800 Subject: [PATCH] Add zeroize(drop) to Share --- src/math.rs | 2 +- src/share.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/math.rs b/src/math.rs index 2151033..ee69252 100644 --- a/src/math.rs +++ b/src/math.rs @@ -79,7 +79,7 @@ mod tests { #[test] fn evaluator_works() { 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!( values, vec![(GF256(1), vec![GF256(4)]), (GF256(2), vec![GF256(13)])] diff --git a/src/share.rs b/src/share.rs index 6135794..c9d1592 100644 --- a/src/share.rs +++ b/src/share.rs @@ -35,6 +35,7 @@ use zeroize::Zeroize; #[derive(Clone)] #[cfg_attr(feature = "fuzzing", derive(Arbitrary, Debug))] #[cfg_attr(feature = "zeroize_memory", derive(Zeroize))] +#[cfg_attr(feature = "zeroize_memory", zeroize(drop))] pub struct Share { pub x: GF256, pub y: Vec,