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 3
3
#[ cfg( feature = "arithmetic" ) ]
4
4
mod blinded;
5
5
#[ cfg( feature = "arithmetic" ) ]
6
- mod invert;
7
- #[ cfg( feature = "arithmetic" ) ]
8
6
mod nonzero;
9
7
mod primitive;
10
8
11
9
pub use self :: primitive:: ScalarPrimitive ;
12
10
#[ cfg( feature = "arithmetic" ) ]
13
- pub use self :: { blinded:: BlindedScalar , invert :: invert_vartime , nonzero:: NonZeroScalar } ;
11
+ pub use self :: { blinded:: BlindedScalar , nonzero:: NonZeroScalar } ;
14
12
15
13
use crypto_bigint:: Integer ;
16
14
use subtle:: Choice ;
Original file line number Diff line number Diff line change 1
1
//! Random blinding support for [`Scalar`]
2
2
3
- use super :: { invert_vartime , Scalar } ;
3
+ use super :: Scalar ;
4
4
use crate :: { ops:: Invert , CurveArithmetic } ;
5
5
use group:: ff:: Field ;
6
6
use rand_core:: CryptoRngCore ;
57
57
fn invert ( & self ) -> CtOption < Scalar < C > > {
58
58
// prevent side channel analysis of scalar inversion by pre-and-post-multiplying
59
59
// 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 )
62
63
}
63
64
}
64
65
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 67
67
pub fn from_uint ( uint : C :: Uint ) -> CtOption < Self > {
68
68
ScalarPrimitive :: new ( uint) . and_then ( |scalar| Self :: new ( scalar. into ( ) ) )
69
69
}
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
- }
83
70
}
84
71
85
72
impl < C > AsRef < Scalar < C > > for NonZeroScalar < C >
You can’t perform that action at this time.
0 commit comments