mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
import @openpassport/zk-kit in other repos
This commit is contained in:
@@ -5,9 +5,9 @@ import { circuitToSelectorMode, DEFAULT_MAJORITY, getCountryCode, PASSPORT_ATTES
|
||||
import { revealBitmapFromAttributes } from '../../../common/src/utils/revealBitmap';
|
||||
import useUserStore from '../stores/userStore';
|
||||
import namejson from '../../../common/ofacdata/outputs/nameSMT.json';
|
||||
import { SMT } from '@ashpect/smt';
|
||||
import { SMT } from '@openpassport/zk-kit-smt';
|
||||
import { poseidon2 } from 'poseidon-lite';
|
||||
import { LeanIMT } from '@zk-kit/imt';
|
||||
import { LeanIMT } from '@openpassport/zk-kit-lean-imt';
|
||||
import { fetchTreeFromUrl } from '../../../common/src/utils/pubkeyTree';
|
||||
|
||||
export const generateCircuitInputsInApp = async (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
import { COMMITMENT_TREE_TRACKER_URL, PASSPORT_ATTESTATION_ID } from "../../../common/src/constants/constants";
|
||||
import { LeanIMT } from "@zk-kit/imt";
|
||||
import { LeanIMT, LeanIMTHashFunction } from "@openpassport/zk-kit-lean-imt";
|
||||
import { poseidon2, poseidon6 } from "poseidon-lite";
|
||||
import { PassportData } from "../../../common/src/utils/types";
|
||||
import { generateCommitment, getLeaf } from "../../../common/src/utils/pubkeyTree";
|
||||
@@ -20,12 +20,8 @@ export async function isCommitmentRegistered(secret: string, passportData: Passp
|
||||
}
|
||||
console.log('response.data:', response.data);
|
||||
|
||||
const imt = new LeanIMT(
|
||||
(a: bigint, b: bigint) => poseidon2([a, b]),
|
||||
[]
|
||||
);
|
||||
|
||||
imt.import(response.data);
|
||||
const hashFunction: LeanIMTHashFunction = (a: bigint, b: bigint) => poseidon2([a, b]);
|
||||
const imt = LeanIMT.import(hashFunction, response.data);
|
||||
|
||||
const pubkey_leaf = getLeaf(passportData.dsc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user