mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
fix: multipart secret updates & lint issues
Former-commit-id: 03b9e0c134ec1f4ca80c433d9e4110542d5d8041 [formerly f6c970d916]
Former-commit-id: f2541c7ba4c1c009a70d67c0eff60ec2069e3fd7
This commit is contained in:
@@ -88,12 +88,12 @@ class ZkIdentity {
|
||||
* Creates secret from ZkIdentity
|
||||
* @returns
|
||||
*/
|
||||
genSecret(parts: number = 2): void {
|
||||
genSecret(parts = 2): void {
|
||||
if(parts < 2) throw new Error("Invalid number of parts");
|
||||
if(parts === 2) {
|
||||
this.secret = [this.identityNullifier, this.identityTrapdoor]
|
||||
} else {
|
||||
let initialComponent = Fq.pow(this.identityNullifier, this.identityTrapdoor);
|
||||
const initialComponent = Fq.pow(this.identityTrapdoor, this.identityNullifier);
|
||||
this.secret = [initialComponent]
|
||||
for(let i = 1; i < parts; i++) {
|
||||
this.secret.push(Fq.pow(initialComponent, BigInt(i + 1)))
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
/* eslint @typescript-eslint/no-var-requires: "off" */
|
||||
const ZqField = require("ffjavascript").ZqField
|
||||
|
||||
export const SNARK_FIELD_SIZE = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617")
|
||||
|
||||
const ZqField = require("ffjavascript").ZqField
|
||||
export const Fq = new ZqField(SNARK_FIELD_SIZE)
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationDir": "./dist/types"
|
||||
"declarationDir": "./dist/types",
|
||||
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user