Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix in Test for soundness #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions prover/rangeProof/rangeProofVerifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var RangeProofVerifier = /** @class */ (function () {
function RangeProofVerifier() {
}
RangeProofVerifier.prototype.verify = function (params, input, proof) {
try {
var vectorBase = params.getVectorBase();
var base = params.getBase();
var n = vectorBase.getGs().size();
Expand Down Expand Up @@ -49,6 +50,11 @@ var RangeProofVerifier = /** @class */ (function () {
var verifier = new efficientInnerProductVerifier_1.EfficientInnerProductVerifier();
// console.log(P.getX().toString(16));
return verifier.verify(primeBase, P, proof.getProductProof());
}
catch(error){
console.log("failed with error",error)
return false;
}
};
return RangeProofVerifier;
}());
Expand Down
6 changes: 6 additions & 0 deletions prover/rangeProof/rangeProofVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {EfficientInnerProductVerifier} from "../innerProduct/efficientInnerProdu
export class RangeProofVerifier {

public verify(params: GeneratorParams, input: ECPoint, proof: RangeProof) : Boolean {
try {
const vectorBase = params.getVectorBase();
const base = params.getBase();
const n = vectorBase.getGs().size();
Expand Down Expand Up @@ -56,6 +57,11 @@ export class RangeProofVerifier {
const verifier = new EfficientInnerProductVerifier();
// console.log(P.getX().toString(16));
return verifier.verify(primeBase, P, proof.getProductProof());
}
catch(error){
console.log("failed with error",error)
return false;
}

}
}
2 changes: 1 addition & 1 deletion tests/rangeProofTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function testSoundness() {
let valid = verifier.verify(parameters, v, proof);
console.log("Proof is " + valid + "\n");
console.log("Change\n");
valid = verifier.verify(parameters, v_change, proof_change);
valid = verifier.verify(parameters, v_change, proof);
console.log("Proof is " + valid + "\n");
}

Expand Down