aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecdh
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/ecdh')
-rw-r--r--src/pubkey/ecdh/ecdh.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pubkey/ecdh/ecdh.cpp b/src/pubkey/ecdh/ecdh.cpp
index bf8a57b3b..8d13e7f65 100644
--- a/src/pubkey/ecdh/ecdh.cpp
+++ b/src/pubkey/ecdh/ecdh.cpp
@@ -24,7 +24,9 @@ SecureVector<byte> ECDH_KA_Operation::agree(const byte w[], u32bit w_len)
PointGFp point = OS2ECP(w, w_len, curve);
PointGFp S = (cofactor * point) * l_times_priv;
- S.check_invariants();
+
+ if(!S.on_the_curve())
+ throw Internal_Error("ECDH: Agreed value was not on the curve");
return BigInt::encode_1363(S.get_affine_x(),
curve.get_p().bytes());