X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fgost3410_vko.py;h=6c52f6d11b451eb9bc4e9186589bc0ebbe812cc3;hp=0d49838b49c602e8492715f8d4e84461714ebe58;hb=e2f15375a1eaa167f2c1af7e393d6db54afdffdb;hpb=f3a3246bc9da027e0527b89204e1b95ed52af5c6 diff --git a/pygost/gost3410_vko.py b/pygost/gost3410_vko.py index 0d49838..6c52f6d 100644 --- a/pygost/gost3410_vko.py +++ b/pygost/gost3410_vko.py @@ -33,6 +33,8 @@ def ukm_unmarshal(ukm): def kek(curve, prv, pub, ukm): + if not curve.contains(pub): + raise ValueError("pub is not on the curve") key = curve.exp(prv, pub[0], pub[1]) key = curve.exp(curve.cofactor * ukm, key[0], key[1]) return pub_marshal(key)