Fix bug where ciphertexts could end up negative

This commit is contained in:
2023-04-06 12:15:19 +01:00
parent 474fe9f70a
commit 9d1d64f1d9
4 changed files with 119 additions and 38 deletions

View File

@ -76,12 +76,12 @@ class Strength {
const data = ev.detail;
if (data.region === region && data.stage === "PROOF") {
if (proofSessionVerifier.verify(BigInt(data.z))) {
console.log("verified");
let result = proofSessionVerifier.verify(BigInt(data.z));
if (result > 0) {
this.assumedStrength = plainText;
controller.abort();
} else {
console.warn("Failed to verify ciphertext!");
console.warn(`Failed to verify ciphertext! ${result}`);
}
}
},