aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pk_core.cpp')
-rw-r--r--src/pk_core.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/pk_core.cpp b/src/pk_core.cpp
index 200e5c964..939ad1c1f 100644
--- a/src/pk_core.cpp
+++ b/src/pk_core.cpp
@@ -179,21 +179,27 @@ SecureVector<byte> NR_Core::sign(const byte in[], u32bit length,
/*************************************************
* ELG_Core Constructor *
*************************************************/
+ELG_Core::ELG_Core(const DL_Group& group, const BigInt& y)
+ {
+ op = Engine_Core::elg_op(group, y, 0);
+ p_bytes = 0;
+ }
+
+/*************************************************
+* ELG_Core Constructor *
+*************************************************/
ELG_Core::ELG_Core(RandomNumberGenerator& rng,
const DL_Group& group, const BigInt& y, const BigInt& x)
{
op = Engine_Core::elg_op(group, y, x);
- p_bytes = 0;
- if(x != 0)
- {
- const BigInt& p = group.get_p();
- p_bytes = p.bytes();
+ const BigInt& p = group.get_p();
+ p_bytes = p.bytes();
+ if(BLINDING_BITS)
+ {
BigInt k(rng, std::min(p.bits()-1, BLINDING_BITS));
-
- if(k != 0)
- blinder = Blinder(k, power_mod(k, x, p), p);
+ blinder = Blinder(k, power_mod(k, x, p), p);
}
}