aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/if_algo
diff options
context:
space:
mode:
authorDaniel Neus <[email protected]>2016-01-11 11:55:42 +0100
committerDaniel Neus <[email protected]>2016-03-05 19:50:29 +0100
commitf95cd9245d2e889a756b187452dafaf68e795179 (patch)
treed0d8afe2159821f3c89545ea7711fba05c97e720 /src/lib/pubkey/if_algo
parenta3ce0bd1e9e018ea69741c4380bf065cccedec93 (diff)
Remaining cppcheck fixes that are not covered by GH #444
Diffstat (limited to 'src/lib/pubkey/if_algo')
-rw-r--r--src/lib/pubkey/if_algo/if_algo.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/pubkey/if_algo/if_algo.cpp b/src/lib/pubkey/if_algo/if_algo.cpp
index a79cad116..e5f3ae20f 100644
--- a/src/lib/pubkey/if_algo/if_algo.cpp
+++ b/src/lib/pubkey/if_algo/if_algo.cpp
@@ -97,13 +97,11 @@ IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(RandomNumberGenerator& rng,
const BigInt& prime2,
const BigInt& exp,
const BigInt& d_exp,
- const BigInt& mod)
+ const BigInt& mod) :
+ m_d{ d_exp }, m_p{ prime1 }, m_q{ prime2 }, m_d1{}, m_d2{}, m_c{ inverse_mod( m_q, m_p ) }
{
- m_p = prime1;
- m_q = prime2;
- m_e = exp;
- m_d = d_exp;
m_n = mod.is_nonzero() ? mod : m_p * m_q;
+ m_e = exp;
if(m_d == 0)
{
@@ -116,7 +114,6 @@ IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(RandomNumberGenerator& rng,
m_d1 = m_d % (m_p - 1);
m_d2 = m_d % (m_q - 1);
- m_c = inverse_mod(m_q, m_p);
load_check(rng);
}