@@ -13,7 +13,6 @@ use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
13
13
use rand:: { CryptoRng , RngCore } ;
14
14
use serde:: { Deserialize , Serialize } ;
15
15
use subtle:: { Choice , ConditionallySelectable , ConstantTimeEq , CtOption } ;
16
- use zeroize:: Zeroize ;
17
16
18
17
// use crate::util::{adc, mac, sbb};
19
18
/// Compute a + b + carry, returning the result and the new carry over.
@@ -359,12 +358,6 @@ where
359
358
}
360
359
}
361
360
362
- impl Zeroize for Scalar {
363
- fn zeroize ( & mut self ) {
364
- self . 0 = [ 0u64 ; 4 ] ;
365
- }
366
- }
367
-
368
361
impl Scalar {
369
362
/// Returns zero, the additive identity.
370
363
#[ inline]
@@ -609,22 +602,17 @@ impl Scalar {
609
602
// externally, but there's no corresponding distinction for
610
603
// field elements.
611
604
612
- use zeroize:: Zeroizing ;
613
-
614
605
let n = inputs. len ( ) ;
615
606
let one = Scalar :: one ( ) ;
616
607
617
- // Place scratch storage in a Zeroizing wrapper to wipe it when
618
- // we pass out of scope.
619
- let scratch_vec = vec ! [ one; n] ;
620
- let mut scratch = Zeroizing :: new ( scratch_vec) ;
608
+ let mut scratch_vec = vec ! [ one; n] ;
621
609
622
610
// Keep an accumulator of all of the previous products
623
611
let mut acc = Scalar :: one ( ) ;
624
612
625
613
// Pass through the input vector, recording the previous
626
614
// products in the scratch space
627
- for ( input, scratch) in inputs. iter ( ) . zip ( scratch . iter_mut ( ) ) {
615
+ for ( input, scratch) in inputs. iter ( ) . zip ( scratch_vec . iter_mut ( ) ) {
628
616
* scratch = acc;
629
617
630
618
acc = acc * input;
@@ -641,7 +629,7 @@ impl Scalar {
641
629
642
630
// Pass through the vector backwards to compute the inverses
643
631
// in place
644
- for ( input, scratch) in inputs. iter_mut ( ) . rev ( ) . zip ( scratch . iter ( ) . rev ( ) ) {
632
+ for ( input, scratch) in inputs. iter_mut ( ) . rev ( ) . zip ( scratch_vec . iter ( ) . rev ( ) ) {
645
633
let tmp = & acc * input. clone ( ) ;
646
634
* input = & acc * scratch;
647
635
acc = tmp;
0 commit comments