return o = t.sent, f = o.xor(i), a = $o(f, this.moduleP.bitLength() - 1), s = this.publicKey.modPow(a, this.moduleP), u = this.generatorG.modPow(a, this.moduleP).toString(), c = s.multiply(n).remainder(this.moduleP).toString(), t.abrupt("return", {
return o = t.sent, f = o.xor(i), a = vf(f, this.moduleP.bitLength() - 1), s = n.modPow(new df("2"), this.moduleP), u = this.generatorG.modPow(a, this.moduleP).toString(), c = this.publicKey.modPow(a, this.moduleP).multiply(s).remainder(this.moduleP).toString(), t.abrupt("return", {
a: u,
a: u,
b: c
b: c
});
});
case 21:
case 21:
case "end":
case "end":
return t.stop()
return t.stop()
}
}
}, t, this)
}, t, this)
}));
}));
return function(e, r) {
return function(e, r) {
return t.apply(this, arguments)
return t.apply(this, arguments)
}
}
}()
}()
}, {
}, {
key: "decrypt",
key: "decrypt",
value: function() {
value: function() {
var t = tr(regeneratorRuntime.mark(function t(e) {
var t = tr(regeneratorRuntime.mark(function t(e) {
var r;
var r, n, i, o;
return regeneratorRuntime.wrap(function(t) {
return regeneratorRuntime.wrap(function(t) {
for (;;) switch (t.prev = t.next) {
for (;;) switch (t.prev = t.next) {
case 0:
case 0:
return r = this.getDecryptor(e), t.abrupt("return", new zo(e.b.toString()).multiply(r).remainder(this.moduleP).toString());
if (r = this.getDecryptor(e), n = new df(e.b.toString()).multiply(r).remainder(this.moduleP), 0 === n.modPow(this.moduleP.subtract(df.ONE).divide(new df("2")), this.moduleP).compareTo(df.ONE)) {
case 2:
t.next = 5;
break
}
throw new Error("Data is incorrect: encrypted value should be quadratic residue moduleP");
case 5:
return i = n.modPow(this.moduleP.add(df.ONE).divide(new df("4")), this.moduleP), o = this.moduleP.subtract(i), t.abrupt("return", o.compareTo(i) > 0 ? i.toString() : o.toString());