smtdb key string

This commit is contained in:
Jordi Baylina 2020-04-20 11:01:11 +02:00
parent 0efecf16fa
commit 48c721c8af
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112
3 changed files with 10 additions and 9 deletions

14
package-lock.json generated

@ -632,12 +632,12 @@
} }
}, },
"circom": { "circom": {
"version": "0.5.9", "version": "0.5.10",
"resolved": "https://registry.npmjs.org/circom/-/circom-0.5.9.tgz", "resolved": "https://registry.npmjs.org/circom/-/circom-0.5.10.tgz",
"integrity": "sha512-SCJoY2FoVpFsRlRcmRgLP5ko0jSxREAmQh7CM6gQ6V9KI5wXm8vR+5phj6wek/p0TnO5s3wR88JPMfjAm8P2Mw==", "integrity": "sha512-50cVHDG7EbkuS6Ht3SDKBDeR/2M+/XSUxfpJMBL1TmFO2B/ucwUIwBNS00bpdtkT080dqwOVtuiYTLQ27prImw==",
"requires": { "requires": {
"chai": "^4.2.0", "chai": "^4.2.0",
"circom_runtime": "0.0.5", "circom_runtime": "0.0.6",
"fastfile": "0.0.1", "fastfile": "0.0.1",
"ffiasm": "0.0.2", "ffiasm": "0.0.2",
"ffjavascript": "0.1.0", "ffjavascript": "0.1.0",
@ -649,9 +649,9 @@
} }
}, },
"circom_runtime": { "circom_runtime": {
"version": "0.0.5", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.0.5.tgz", "resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.0.6.tgz",
"integrity": "sha512-WEZHnRO1AJIDI2w1yX6rq4G1/MMKnExT3qirjBQR7x43i9Ww3E/wusBHTbXWLb8aYyxsBU07LGy0YXPywPGYvA==", "integrity": "sha512-o0T5MuWzxnxinWG3+CygS/kZouoP+z5ZrufUwqKJy3gsVFJhkbqMpfKmcBGjhExB3uatA7cKyOiRAOLOz5+t5w==",
"requires": { "requires": {
"ffjavascript": "0.1.0", "ffjavascript": "0.1.0",
"fnv-plus": "^1.3.1" "fnv-plus": "^1.3.1"

@ -26,7 +26,7 @@
"dependencies": { "dependencies": {
"blake-hash": "^1.1.0", "blake-hash": "^1.1.0",
"blake2b": "^2.1.3", "blake2b": "^2.1.3",
"circom": "0.5.9", "circom": "0.5.10",
"ffjavascript": "0.1.0", "ffjavascript": "0.1.0",
"web3": "^1.2.6" "web3": "^1.2.6"
}, },

@ -1,6 +1,7 @@
const F = require("./poseidon.js").F; const F = require("./poseidon.js").F;
const Scalar = require("ffjavascript").Scalar; const Scalar = require("ffjavascript").Scalar;
const utils = require("ffjavascript").utils;
class SMTMemDb { class SMTMemDb {
constructor() { constructor() {
@ -14,7 +15,7 @@ class SMTMemDb {
_key2str(k) { _key2str(k) {
// const keyS = bigInt(key).leInt2Buff(32).toString("hex"); // const keyS = bigInt(key).leInt2Buff(32).toString("hex");
const keyS = Scalar.e(k); const keyS = k.toString();
return keyS; return keyS;
} }