Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"author": "0Kims",
"license": "GPL-3.0",
"devDependencies": {
"blake-hash": "^2.0.0",
"@noble/hashes": "^1.7.1",
"chai": "^4.3.4",
"circom_tester": "0.0.13",
"circom_tester": "0.0.20",
"circomlibjs": "^0.1.4",
"mocha": "^9.1.3"
}
}
}
4 changes: 2 additions & 2 deletions test/babyjub.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const chai = require("chai");
const path = require("path");

const createBlakeHash = require("blake-hash");
const { blake512 } = require('@noble/hashes/blake1');
const buildEddsa = require("circomlibjs").buildEddsa;

const assert = chai.assert;
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("Baby Jub test", function () {
it("Should extract the public key from the private one", async () => {

const rawpvk = Buffer.from("0001020304050607080900010203040506070809000102030405060708090021", "hex");
const pvk = eddsa.pruneBuffer(createBlakeHash("blake512").update(rawpvk).digest().slice(0,32));
const pvk = eddsa.pruneBuffer(blake512(rawpvk).slice(0,32));
const S = Scalar.shr(utils.leBuff2int(pvk), 3);

const A = eddsa.prv2pub(rawpvk);
Expand Down