fix: update @zk-kit/types imports

Former-commit-id: fa528d7f4716ae89caf42094a6881d759fbe12c8 [formerly 32bae89c9ef02158b0db05561aec42da639d106c] [formerly dae06e161b404c8c1eee19a1f6f3a418c571f343 [formerly 55b87223dd]]
Former-commit-id: 4864d1c452a47f79c118c0fa8dbbe108a79c4244 [formerly ba7aeb72520cc6ed58ea976d1d6e7f93d0065a0b]
Former-commit-id: 05d8c4623951fb95c17b3193b36d8b729b763fd0
This commit is contained in:
cedoor
2022-01-14 20:16:18 +01:00
parent f99b6e462e
commit 209eddae9f
11 changed files with 7797 additions and 3432 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
import { genRandomIdentity, genIdentityFromMessage, genRandomNumber } from "./strategies"
import * as bigintConversion from "bigint-conversion"
import * as ciromlibjs from "circomlibjs"
import { Identity, SerializedIdentity } from "@libsem/types"
import { Identity, SerializedIdentity } from "@zk-kit/types"
import {Fq} from "./utils"
const poseidonHash = (data: Array<bigint>): bigint => {

View File

@@ -1,4 +1,4 @@
import ZkIdentity, { Strategy, SecretType } from "./identity"
import { Identity } from "@libsem/types"
import { Identity } from "@zk-kit/types"
export { ZkIdentity, Identity, Strategy, SecretType }

View File

@@ -1,7 +1,7 @@
import * as crypto from "crypto"
import * as bigintConversion from "bigint-conversion"
import { sha256 as _sha256 } from "js-sha256"
import { Identity } from "@libsem/types"
import { Identity } from "@zk-kit/types"
const genRandomNumber = (numBytes = 31): bigint => {
return bigintConversion.bufToBigint(crypto.randomBytes(numBytes))

View File

@@ -1 +1 @@
c19ab4cde3bef488137cfb08b81d2bd8b9177f12
e5d0402e2f351e1adbbe9c28b51d3c65986fdc04

View File

@@ -1,6 +1,6 @@
import Semaphore from "./semaphore"
import RLN from "./rln"
import { generateMerkleProof, genExternalNullifier, genSignalHash, Fq } from "./utils"
import { Identity, MerkleProof, FullProof } from "@libsem/types"
import { Identity, MerkleProof, FullProof } from "@zk-kit/types"
export { Semaphore, RLN, generateMerkleProof, genExternalNullifier, genSignalHash, Identity, MerkleProof, FullProof }

View File

@@ -1,6 +1,6 @@
import { ZkProtocol } from "./zk-protocol"
import { genSignalHash, poseidonHash } from "./utils"
import { Identity, MerkleProof } from "@libsem/types"
import { Identity, MerkleProof } from "@zk-kit/types"
class Semaphore extends ZkProtocol {
/**

View File

@@ -2,7 +2,7 @@
const Tree = require("incrementalquintree/build/IncrementalQuinTree")
import * as ciromlibjs from "circomlibjs"
import * as ethers from "ethers"
import { MerkleProof } from "@libsem/types"
import { MerkleProof } from "@zk-kit/types"
export const SNARK_FIELD_SIZE = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617")

View File

@@ -1,7 +1,7 @@
/* eslint @typescript-eslint/no-var-requires: "off" */
const { groth16 } = require("snarkjs")
import { SNARK_FIELD_SIZE } from "./utils"
import { FullProof } from "@libsem/types"
import { FullProof } from "@zk-kit/types"
import * as fs from "fs";
import { builder } from "./witness_calculator";

View File

@@ -1,13 +1,13 @@
{
"name": "@libsem/types",
"version": "1.0.0",
"name": "@zk-kit/types",
"version": "1.0.9",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@libsem/types",
"version": "1.0.0",
"license": "ISC",
"name": "@zk-kit/types",
"version": "1.0.9",
"license": "MIT",
"devDependencies": {
"rimraf": "^3.0.2",
"ts-node": "^10.3.0"

View File

@@ -4,10 +4,10 @@ export interface Identity {
}
export type Proof = {
pi_a: Array<string>,
pi_b: [ [Array<string>], [Array<string>], [Array<string>] ],
pi_a: Array<string>
pi_b: [[Array<string>], [Array<string>], [Array<string>]]
pi_c: Array<string>
protocol: string,
protocol: string
curve: string
}
@@ -23,8 +23,9 @@ export interface MerkleProof {
}
export declare type SerializedIdentity = {
identityNullifier: string;
identityTrapdoor: string;
secret: string[];
multipartSecret: string[];
};
identityNullifier: string
identityTrapdoor: string
secret: string[]
multipartSecret: string[]
}