File tree Expand file tree Collapse file tree 4 files changed +5
-88
lines changed Expand file tree Collapse file tree 4 files changed +5
-88
lines changed Original file line number Diff line number Diff line change 33#[ cfg( feature = "arithmetic" ) ]
44mod blinded;
55#[ cfg( feature = "arithmetic" ) ]
6- mod invert;
7- #[ cfg( feature = "arithmetic" ) ]
86mod nonzero;
97mod primitive;
108
119pub use self :: primitive:: ScalarPrimitive ;
1210#[ cfg( feature = "arithmetic" ) ]
13- pub use self :: { blinded:: BlindedScalar , invert :: invert_vartime , nonzero:: NonZeroScalar } ;
11+ pub use self :: { blinded:: BlindedScalar , nonzero:: NonZeroScalar } ;
1412
1513use crypto_bigint:: Integer ;
1614use subtle:: Choice ;
Original file line number Diff line number Diff line change 11//! Random blinding support for [`Scalar`]
22
3- use super :: { invert_vartime , Scalar } ;
3+ use super :: Scalar ;
44use crate :: { ops:: Invert , CurveArithmetic } ;
55use group:: ff:: Field ;
66use rand_core:: CryptoRngCore ;
5757 fn invert ( & self ) -> CtOption < Scalar < C > > {
5858 // prevent side channel analysis of scalar inversion by pre-and-post-multiplying
5959 // with the random masking scalar
60- let masked_scalar = self . scalar * self . mask ;
61- invert_vartime :: < C > ( & masked_scalar) . map ( |s| s * self . mask )
60+ ( self . scalar * self . mask )
61+ . invert_vartime ( )
62+ . map ( |s| s * self . mask )
6263 }
6364}
6465
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6767 pub fn from_uint ( uint : C :: Uint ) -> CtOption < Self > {
6868 ScalarPrimitive :: new ( uint) . and_then ( |scalar| Self :: new ( scalar. into ( ) ) )
6969 }
70-
71- /// Perform an inversion in variable-time.
72- ///
73- /// ⚠️ WARNING!
74- ///
75- /// This method should not be used with (unblinded) secret scalars, as its
76- /// variable-time operation can potentially leak secrets through
77- /// sidechannels.
78- pub fn invert_vartime ( & self ) -> Self {
79- Self {
80- scalar : super :: invert_vartime :: < C > ( & self . scalar ) . unwrap ( ) ,
81- }
82- }
8370}
8471
8572impl < C > AsRef < Scalar < C > > for NonZeroScalar < C >
You can’t perform that action at this time.
0 commit comments