mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-09 00:35:24 +00:00
Add a test for mismatch
This commit is contained in:
parent
32011119cd
commit
ab04cdd85d
@ -7,5 +7,5 @@ clean:
|
|||||||
|
|
||||||
build: kzg.cxx Makefile
|
build: kzg.cxx Makefile
|
||||||
cd ../../src; make lib
|
cd ../../src; make lib
|
||||||
yarn build
|
yarn
|
||||||
cp build/Release/kzg.node .
|
cp build/Release/kzg.node .
|
||||||
|
@ -42,4 +42,12 @@ describe("C-KZG", () => {
|
|||||||
const proof = computeAggregateKzgProof(blobs);
|
const proof = computeAggregateKzgProof(blobs);
|
||||||
expect(verifyAggregateKzgProof(blobs, commitments, proof)).toBe(true);
|
expect(verifyAggregateKzgProof(blobs, commitments, proof)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.only("fails when given incorrect commitments", () => {
|
||||||
|
const blobs = new Array(2).fill(0).map(generateRandomBlob);
|
||||||
|
const commitments = blobs.map(blobToKzgCommitment);
|
||||||
|
commitments[0][0] += 1;
|
||||||
|
const proof = computeAggregateKzgProof(blobs);
|
||||||
|
expect(verifyAggregateKzgProof(blobs, commitments, proof)).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user