🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@auxo-dev/o1js-encrypt

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auxo-dev/o1js-encrypt - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+575
build/cjs/src/ecelgamal/hash-encoding.d.ts
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PADDING_BIT = exports.EMPTY_COMMITMENT = exports.DecComProof = exports.EncComProof = exports.DecCom = exports.EncCom = exports.InputCom = exports.Enc = exports.Dec = exports.EncProof = exports.DecProof = exports.Input = void 0;
const o1js_1 = require("o1js");
const auxo_libs_1 = require("@auxo-dev/auxo-libs");
exports.EMPTY_COMMITMENT = (0, o1js_1.Field)(0);
exports.PADDING_BIT = (0, o1js_1.Bool)(false);
class Input extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
c: auxo_libs_1.Bit255,
U: o1js_1.Group,
}) {
}
exports.Input = Input;
const Enc = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let U = o1js_1.Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = o1js_1.Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let plainBits = auxo_libs_1.Bit255.fromScalar(plain);
let cipherBits = auxo_libs_1.Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Enc = Enc;
class EncProof extends o1js_1.ZkProgram.Proof(Enc) {
}
exports.EncProof = EncProof;
const Dec = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, prvKey) {
let V = input.U.scale(prvKey);
let k = o1js_1.Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let decrypted = auxo_libs_1.Bit255.xor(kBits, input.c);
decrypted.assertEquals(auxo_libs_1.Bit255.fromScalar(plain), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Dec = Dec;
class DecProof extends o1js_1.ZkProgram.Proof(Dec) {
}
exports.DecProof = DecProof;
class InputCom extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
c: auxo_libs_1.Bit255,
U: o1js_1.Group,
commitment: o1js_1.Field,
}) {
}
exports.InputCom = InputCom;
const EncCom = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let U = o1js_1.Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = o1js_1.Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let plainBits = auxo_libs_1.Bit255.fromScalar(plain);
let cipherBits = auxo_libs_1.Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.EncCom = EncCom;
class EncComProof extends o1js_1.ZkProgram.Proof(EncCom) {
}
exports.EncComProof = EncComProof;
const DecCom = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, prvKey, random) {
let V = input.U.scale(prvKey);
let k = o1js_1.Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let decrypted = auxo_libs_1.Bit255.xor(kBits, input.c);
o1js_1.Group.generator
.scale(prvKey)
.assertEquals(input.pubKey, auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
decrypted.assertEquals(auxo_libs_1.Bit255.fromScalar(plain), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([
decrypted.toScalar().toFields(),
random.toFields(),
].flat()), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.DecCom = DecCom;
class DecComProof extends o1js_1.ZkProgram.Proof(DecCom) {
}
exports.DecComProof = DecComProof;
//# sourceMappingURL=hash-encoding.js.map
{"version":3,"file":"hash-encoding.js","sourceRoot":"","sources":["../../../../src/ecelgamal/hash-encoding.ts"],"names":[],"mappings":";;;AAAA,+BAA+E;AAC/E,mDAAoD;AAMvC,QAAA,gBAAgB,GAAG,IAAA,YAAK,EAAC,CAAC,CAAC,CAAC;AAC5B,QAAA,WAAW,GAAG,IAAA,WAA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KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC3C,YAAK,CAAC,SAAS;qBACV,KAAK,CAAC,MAAM,CAAC;qBACb,YAAY,CACT,KAAK,CAAC,MAAM,EACZ,iBAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACN,SAAS,CAAC,YAAY,CAClB,kBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EACxB,iBAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,eAAQ,CAAC,IAAI,CACT;oBACI,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;oBAC/B,MAAM,CAAC,QAAQ,EAAE;iBACpB,CAAC,IAAI,EAAE,CACX,EACD,iBAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AAtMwB,wBAAM;AAwMjC,MAAM,WAAY,SAAQ,gBAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG;AAxMJ,kCAAW"}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PADDING_BIT = exports.EMPTY_COMMITMENT = exports.DecComProof = exports.EncComProof = exports.DecCom = exports.EncCom = exports.InputCom = exports.Enc = exports.Dec = exports.EncProof = exports.DecProof = exports.Input = void 0;
const o1js_1 = require("o1js");
const auxo_libs_1 = require("@auxo-dev/auxo-libs");
exports.EMPTY_COMMITMENT = (0, o1js_1.Field)(0);
exports.PADDING_BIT = (0, o1js_1.Bool)(false);
class Input extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
C: o1js_1.Group,
R: o1js_1.Group,
}) {
}
exports.Input = Input;
const Enc = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let C = o1js_1.Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = o1js_1.Group.generator.scale(random);
C.assertEquals(input.C, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Enc = Enc;
class EncProof extends o1js_1.ZkProgram.Proof(Enc) {
}
exports.EncProof = EncProof;
const Dec = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, acc_plain, prvKey) {
let M = o1js_1.Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Dec = Dec;
class DecProof extends o1js_1.ZkProgram.Proof(Dec) {
}
exports.DecProof = DecProof;
class InputCom extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
C: o1js_1.Group,
R: o1js_1.Group,
commitment: o1js_1.Field,
}) {
}
exports.InputCom = InputCom;
const EncCom = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let C = o1js_1.Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = o1js_1.Group.generator.scale(random);
C.assertEquals(input.C, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.EncCom = EncCom;
class EncComProof extends o1js_1.ZkProgram.Proof(EncCom) {
}
exports.EncComProof = EncComProof;
const DecCom = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar, o1js_1.Scalar],
async method(input, acc_plain, prvKey, random) {
let M = o1js_1.Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([acc_plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.DecCom = DecCom;
class DecComProof extends o1js_1.ZkProgram.Proof(DecCom) {
}
exports.DecComProof = DecComProof;
//# sourceMappingURL=point-encoding.js.map
{"version":3,"file":"point-encoding.js","sourceRoot":"","sources":["../../../../src/ecelgamal/point-encoding.ts"],"names":[],"mappings":";;;AAAA,+BAA+E;AAC/E,mDAA4C;AAM/B,QAAA,gBAAgB,GAAG,IAAA,YAAK,EAAC,CAAC,CAAC,CAAC;AAC5B,QAAA,WAAW,GAAG,IAAA,WAAI,EAAC,KAAK,CAAC,CAAC;AAEvC,MAAM,KAAM,SAAQ,IAAA,aAAM,EAAC;IACvB,MAAM,EAAE,YAAK;IACb,CAAC,EAAE,YAAK;IACR,CAAC,EAAE,YAAK;CACX,CAAC;CAAG;AAVI,sBAAK;AAYd,MAAM,GAAG,GAAG,IAAA,gBAAS,EAAC;IAClB,IAAI,6BAAqC;IACzC,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE;QACL,OAAO,EAAE;YACL,aAAa,EAAE,CAAC,aAAM,EAAE,aAAM,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,KAAa,EAAE,MAAc;gBACpD,IAAI,CAAC,GAAG,YAAK,CAAC,SAAS;qBAClB,KAAK,CAAC,KAAK,CAAC;qBACZ,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBACrC,IAAI,CAAC,GAAG,YAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACtC,CAAC,CAAC,YAAY,CACV,KAAK,CAAC,CAAC,EACP,iBAAK,CAAC,kBAAkB,CACpB,GAAG,CAAC,IAAI,EACR,SAAS,yBAEZ,CACJ,CAAC;gBACF,CAAC,CAAC,YAAY,CACV,KAAK,CAAC,CAAC,EACP,iBAAK,CAAC,kBAAkB,CACpB,GAAG,CAAC,IAAI,EACR,SAAS,yBAEZ,CACJ,CAAC;YACN,CAA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EAAE;QACL,OAAO,EAAE;YACL,aAAa,EAAE,CAAC,aAAM,EAAE,aAAM,EAAE,aAAM,CAAC;YACvC,KAAK,CAAC,MAAM,CACR,KAAe,EACf,SAAiB,EACjB,MAAc,EACd,MAAc;gBAEd,IAAI,CAAC,GAAG,YAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC,CAAC,YAAY,CACV,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAClC,iBAAK,CAAC,kBAAkB,CACpB,GAAG,CAAC,IAAI,EACR,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,eAAQ,CAAC,IAAI,CACT,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CACnD,EACD,iBAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AA/KwB,wBAAM;AAiLjC,MAAM,WAAY,SAAQ,gBAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG;AAjLJ,kCAAW"}
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Bool, Field, Group, Poseidon, Scalar, Struct, ZkProgram } from 'o1js';
import { Bit255, Utils } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export const EMPTY_COMMITMENT = Field(0);
export const PADDING_BIT = Bool(false);
class Input extends Struct({
pubKey: Group,
c: Bit255,
U: Group,
}) {
}
const Enc = ZkProgram({
name: "EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let U = Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let plainBits = Bit255.fromScalar(plain);
let cipherBits = Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncProof extends ZkProgram.Proof(Enc) {
}
const Dec = ZkProgram({
name: "EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, prvKey) {
let V = input.U.scale(prvKey);
let k = Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let decrypted = Bit255.xor(kBits, input.c);
decrypted.assertEquals(Bit255.fromScalar(plain), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecProof extends ZkProgram.Proof(Dec) {
}
class InputCom extends Struct({
pubKey: Group,
c: Bit255,
U: Group,
commitment: Field,
}) {
}
const EncCom = ZkProgram({
name: "EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let U = Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let plainBits = Bit255.fromScalar(plain);
let cipherBits = Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(Poseidon.hash([plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncComProof extends ZkProgram.Proof(EncCom) {
}
const DecCom = ZkProgram({
name: "EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar, Scalar],
async method(input, plain, prvKey, random) {
let V = input.U.scale(prvKey);
let k = Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let decrypted = Bit255.xor(kBits, input.c);
Group.generator
.scale(prvKey)
.assertEquals(input.pubKey, Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
decrypted.assertEquals(Bit255.fromScalar(plain), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(Poseidon.hash([
decrypted.toScalar().toFields(),
random.toFields(),
].flat()), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecComProof extends ZkProgram.Proof(DecCom) {
}
//# sourceMappingURL=hash-encoding.js.map
{"version":3,"file":"hash-encoding.js","sourceRoot":"","sources":["../../../../src/ecelgamal/hash-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AA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AK,CAAC,CAAC,CAAC,CAAC;gBAC3C,KAAK,CAAC,SAAS;qBACV,KAAK,CAAC,MAAM,CAAC;qBACb,YAAY,CACT,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACN,SAAS,CAAC,YAAY,CAClB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EACxB,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,QAAQ,CAAC,IAAI,CACT;oBACI,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;oBAC/B,MAAM,CAAC,QAAQ,EAAE;iBACpB,CAAC,IAAI,EAAE,CACX,EACD,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG"}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Bool, Field, Group, Poseidon, Scalar, Struct, ZkProgram } from 'o1js';
import { Utils } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export const EMPTY_COMMITMENT = Field(0);
export const PADDING_BIT = Bool(false);
class Input extends Struct({
pubKey: Group,
C: Group,
R: Group,
}) {
}
const Enc = ZkProgram({
name: "AHE-EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let C = Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = Group.generator.scale(random);
C.assertEquals(input.C, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncProof extends ZkProgram.Proof(Enc) {
}
const Dec = ZkProgram({
name: "AHE-EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar],
async method(input, acc_plain, prvKey) {
let M = Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecProof extends ZkProgram.Proof(Dec) {
}
class InputCom extends Struct({
pubKey: Group,
C: Group,
R: Group,
commitment: Field,
}) {
}
const EncCom = ZkProgram({
name: "AHE-EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let C = Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = Group.generator.scale(random);
C.assertEquals(input.C, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(Poseidon.hash([plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncComProof extends ZkProgram.Proof(EncCom) {
}
const DecCom = ZkProgram({
name: "AHE-EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar, Scalar],
async method(input, acc_plain, prvKey, random) {
let M = Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(Poseidon.hash([acc_plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecComProof extends ZkProgram.Proof(DecCom) {
}
//# sourceMappingURL=point-encoding.js.map
{"version":3,"file":"point-encoding.js","sourceRoot":"","sources":["../../../../src/ecelgamal/point-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AAE9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;AA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C,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CACnD,EACD,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG"}
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
+3
-3
import * as Lib from './lib';
import * as Standard from './ecelgamal.js';
import * as AddHomomorphic from './ahecelgamal.js';
export { Lib, Standard, AddHomomorphic };
import * as HashEncoding from './hash-encoding.js';
import * as PointEncoding from './point-encoding.js';
export { Lib, HashEncoding, PointEncoding };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddHomomorphic = exports.Standard = exports.Lib = void 0;
exports.PointEncoding = exports.HashEncoding = exports.Lib = void 0;
const tslib_1 = require("tslib");
const Lib = tslib_1.__importStar(require("./lib"));
exports.Lib = Lib;
const Standard = tslib_1.__importStar(require("./ecelgamal.js"));
exports.Standard = Standard;
const AddHomomorphic = tslib_1.__importStar(require("./ahecelgamal.js"));
exports.AddHomomorphic = AddHomomorphic;
const HashEncoding = tslib_1.__importStar(require("./hash-encoding.js"));
exports.HashEncoding = HashEncoding;
const PointEncoding = tslib_1.__importStar(require("./point-encoding.js"));
exports.PointEncoding = PointEncoding;
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecelgamal/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAGpB,kBAAG;AAFZ,iEAA2C;AAE7B,4BAAQ;AADtB,yEAAmD;AAC3B,wCAAc"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecelgamal/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAGpB,kBAAG;AAFZ,yEAAmD;AAErC,oCAAY;AAD1B,2EAAqD;AACzB,sCAAa"}
import * as Lib from './lib';
import * as Standard from './ecelgamal.js';
import * as AddHomomorphic from './ahecelgamal.js';
export { Lib, Standard, AddHomomorphic };
import * as HashEncoding from './hash-encoding.js';
import * as PointEncoding from './point-encoding.js';
export { Lib, HashEncoding, PointEncoding };
import * as Lib from './lib';
import * as Standard from './ecelgamal.js';
import * as AddHomomorphic from './ahecelgamal.js';
export { Lib, Standard, AddHomomorphic };
import * as HashEncoding from './hash-encoding.js';
import * as PointEncoding from './point-encoding.js';
export { Lib, HashEncoding, PointEncoding };
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecelgamal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecelgamal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
import * as Lib from './lib';
import * as Standard from './ecelgamal.js';
import * as AddHomomorphic from './ahecelgamal.js';
export { Lib, Standard, AddHomomorphic };
import * as HashEncoding from './hash-encoding.js';
import * as PointEncoding from './point-encoding.js';
export { Lib, HashEncoding, PointEncoding };
{
"name": "@auxo-dev/o1js-encrypt",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -64,5 +64,5 @@ "author": "",

"dependencies": {
"@auxo-dev/auxo-libs": "^0.6.3",
"@auxo-dev/auxo-libs": "^1.0.0",
"o1js": "1.8.0"
}
}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PADDING_BIT = exports.EMPTY_COMMITMENT = exports.DecComProof = exports.EncComProof = exports.DecCom = exports.EncCom = exports.InputCom = exports.Enc = exports.Dec = exports.EncProof = exports.DecProof = exports.Input = void 0;
const o1js_1 = require("o1js");
const auxo_libs_1 = require("@auxo-dev/auxo-libs");
exports.EMPTY_COMMITMENT = (0, o1js_1.Field)(0);
exports.PADDING_BIT = (0, o1js_1.Bool)(false);
class Input extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
C: o1js_1.Group,
R: o1js_1.Group,
}) {
}
exports.Input = Input;
const Enc = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let C = o1js_1.Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = o1js_1.Group.generator.scale(random);
C.assertEquals(input.C, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Enc = Enc;
class EncProof extends o1js_1.ZkProgram.Proof(Enc) {
}
exports.EncProof = EncProof;
const Dec = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, acc_plain, prvKey) {
let M = o1js_1.Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Dec = Dec;
class DecProof extends o1js_1.ZkProgram.Proof(Dec) {
}
exports.DecProof = DecProof;
class InputCom extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
C: o1js_1.Group,
R: o1js_1.Group,
commitment: o1js_1.Field,
}) {
}
exports.InputCom = InputCom;
const EncCom = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let C = o1js_1.Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = o1js_1.Group.generator.scale(random);
C.assertEquals(input.C, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.EncCom = EncCom;
class EncComProof extends o1js_1.ZkProgram.Proof(EncCom) {
}
exports.EncComProof = EncComProof;
const DecCom = (0, o1js_1.ZkProgram)({
name: "AHE-EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar, o1js_1.Scalar],
async method(input, acc_plain, prvKey, random) {
let M = o1js_1.Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([acc_plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.DecCom = DecCom;
class DecComProof extends o1js_1.ZkProgram.Proof(DecCom) {
}
exports.DecComProof = DecComProof;
//# sourceMappingURL=ahecelgamal.js.map
{"version":3,"file":"ahecelgamal.js","sourceRoot":"","sources":["../../../../src/ecelgamal/ahecelgamal.ts"],"names":[],"mappings":";;;A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AAK,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC,CAAC,YAAY,CACV,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAClC,iBAAK,CAAC,kBAAkB,CACpB,GAAG,CAAC,IAAI,EACR,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,eAAQ,CAAC,IAAI,CACT,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CACnD,EACD,iBAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AA/KwB,wBAAM;AAiLjC,MAAM,WAAY,SAAQ,gBAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG;AAjLJ,kCAAW"}
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PADDING_BIT = exports.EMPTY_COMMITMENT = exports.DecComProof = exports.EncComProof = exports.DecCom = exports.EncCom = exports.InputCom = exports.Enc = exports.Dec = exports.EncProof = exports.DecProof = exports.Input = void 0;
const o1js_1 = require("o1js");
const auxo_libs_1 = require("@auxo-dev/auxo-libs");
exports.EMPTY_COMMITMENT = (0, o1js_1.Field)(0);
exports.PADDING_BIT = (0, o1js_1.Bool)(false);
class Input extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
c: auxo_libs_1.Bit255,
U: o1js_1.Group,
}) {
}
exports.Input = Input;
const Enc = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let U = o1js_1.Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = o1js_1.Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let plainBits = auxo_libs_1.Bit255.fromScalar(plain);
let cipherBits = auxo_libs_1.Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, auxo_libs_1.Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Enc = Enc;
class EncProof extends o1js_1.ZkProgram.Proof(Enc) {
}
exports.EncProof = EncProof;
const Dec = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, prvKey) {
let V = input.U.scale(prvKey);
let k = o1js_1.Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let decrypted = auxo_libs_1.Bit255.xor(kBits, input.c);
decrypted.assertEquals(auxo_libs_1.Bit255.fromScalar(plain), auxo_libs_1.Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.Dec = Dec;
class DecProof extends o1js_1.ZkProgram.Proof(Dec) {
}
exports.DecProof = DecProof;
class InputCom extends (0, o1js_1.Struct)({
pubKey: o1js_1.Group,
c: auxo_libs_1.Bit255,
U: o1js_1.Group,
commitment: o1js_1.Field,
}) {
}
exports.InputCom = InputCom;
const EncCom = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, random) {
let U = o1js_1.Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = o1js_1.Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let plainBits = auxo_libs_1.Bit255.fromScalar(plain);
let cipherBits = auxo_libs_1.Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([plain.toFields(), random.toFields()].flat()), auxo_libs_1.Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.EncCom = EncCom;
class EncComProof extends o1js_1.ZkProgram.Proof(EncCom) {
}
exports.EncComProof = EncComProof;
const DecCom = (0, o1js_1.ZkProgram)({
name: "EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [o1js_1.Scalar, o1js_1.Scalar, o1js_1.Scalar],
async method(input, plain, prvKey, random) {
let V = input.U.scale(prvKey);
let k = o1js_1.Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = auxo_libs_1.Bit255.fromBits([...k.toBits(), exports.PADDING_BIT]);
let decrypted = auxo_libs_1.Bit255.xor(kBits, input.c);
o1js_1.Group.generator
.scale(prvKey)
.assertEquals(input.pubKey, auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
decrypted.assertEquals(auxo_libs_1.Bit255.fromScalar(plain), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(o1js_1.Poseidon.hash([
decrypted.toScalar().toFields(),
random.toFields(),
].flat()), auxo_libs_1.Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
exports.DecCom = DecCom;
class DecComProof extends o1js_1.ZkProgram.Proof(DecCom) {
}
exports.DecComProof = DecComProof;
//# sourceMappingURL=ecelgamal.js.map
{"version":3,"file":"ecelgamal.js","sourceRoot":"","sources":["../../../../src/ecelgamal/ecelgamal.ts"],"names":[],"mappings":";;;AAAA,+BAA+E;AAC/E,mDAAoD;AAMvC,QAAA,gBAAgB,GAAG,IAAA,YAAK,EAAC,CAAC,CAAC,CAAC;AAC5B,QAAA,WAAW,GAAG,IAAA,WAAI,EAAC,KAAK,CAAC,CAAC;AAEvC,MAAM,KAAM,SAAQ,IAAA,aAAM,EAAC;IACvB,MAAM,EAAE,YAAK;IACb,CAAC,EAAE,kBAAM;IACT,CAAC,EAAE,YAAK;CACX,CAAC;CAAG;AAVI,sBAAK;AAYd,MAAM,GAAG,GAAG,IAAA,gBAAS,EAAC;IAClB,IAAI,yBAAmC;IACvC,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE;QACL,OAAO,EAAE;YACL,aAAa,EAAE,CAAC,aAAM,EAAE,aAAM,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,KAAa,EAAE,MAAc;gBACpD,IAAI,CAAC,GAAG,YAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACtC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACnC,IAAI,CAAC,GAAG,eAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC3D,IAAI,KAAK,GAAG,kBAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CA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C,MAAM,WAAY,SAAQ,gBAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG;AAxMJ,kCAAW"}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Bool, Field, Group, Poseidon, Scalar, Struct, ZkProgram } from 'o1js';
import { Utils } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export const EMPTY_COMMITMENT = Field(0);
export const PADDING_BIT = Bool(false);
class Input extends Struct({
pubKey: Group,
C: Group,
R: Group,
}) {
}
const Enc = ZkProgram({
name: "AHE-EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let C = Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = Group.generator.scale(random);
C.assertEquals(input.C, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncProof extends ZkProgram.Proof(Enc) {
}
const Dec = ZkProgram({
name: "AHE-EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar],
async method(input, acc_plain, prvKey) {
let M = Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecProof extends ZkProgram.Proof(Dec) {
}
class InputCom extends Struct({
pubKey: Group,
C: Group,
R: Group,
commitment: Field,
}) {
}
const EncCom = ZkProgram({
name: "AHE-EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let C = Group.generator
.scale(plain)
.add(input.pubKey.scale(random));
let R = Group.generator.scale(random);
C.assertEquals(input.C, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
R.assertEquals(input.R, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(Poseidon.hash([plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncComProof extends ZkProgram.Proof(EncCom) {
}
const DecCom = ZkProgram({
name: "AHE-EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar, Scalar],
async method(input, acc_plain, prvKey, random) {
let M = Group.generator.scale(acc_plain);
M.assertEquals(input.C.sub(input.R.scale(prvKey)), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(Poseidon.hash([acc_plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecComProof extends ZkProgram.Proof(DecCom) {
}
//# sourceMappingURL=ahecelgamal.js.map
{"version":3,"file":"ahecelgamal.js","sourceRoot":"","sources":["../../../../src/ecelgamal/ahecel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E,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;YACvC,KAAK,CAAC,MAAM,CACR,KAAe,EACf,SAAiB,EACjB,MAAc,EACd,MAAc;gBAEd,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC,CAAC,YAAY,CACV,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAClC,KAAK,CAAC,kBAAkB,CACpB,GAAG,CAAC,IAAI,EACR,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,QAAQ,CAAC,IAAI,CACT,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CACnD,EACD,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG"}
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Bool, Field, Group, Poseidon, Scalar, Struct, ZkProgram } from 'o1js';
import { Bit255, Utils } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export const EMPTY_COMMITMENT = Field(0);
export const PADDING_BIT = Bool(false);
class Input extends Struct({
pubKey: Group,
c: Bit255,
U: Group,
}) {
}
const Enc = ZkProgram({
name: "EC-ElGamal-Encryption",
publicInput: Input,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let U = Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let plainBits = Bit255.fromScalar(plain);
let cipherBits = Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, Utils.buildAssertMessage(Enc.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncProof extends ZkProgram.Proof(Enc) {
}
const Dec = ZkProgram({
name: "EC-ElGamal-Decryption",
publicInput: Input,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, prvKey) {
let V = input.U.scale(prvKey);
let k = Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let decrypted = Bit255.xor(kBits, input.c);
decrypted.assertEquals(Bit255.fromScalar(plain), Utils.buildAssertMessage(Dec.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecProof extends ZkProgram.Proof(Dec) {
}
class InputCom extends Struct({
pubKey: Group,
c: Bit255,
U: Group,
commitment: Field,
}) {
}
const EncCom = ZkProgram({
name: "EC-ElGamal-Encryption",
publicInput: InputCom,
methods: {
encrypt: {
privateInputs: [Scalar, Scalar],
async method(input, plain, random) {
let U = Group.generator.scale(random);
let V = input.pubKey.scale(random);
let k = Poseidon.hash([U.toFields(), V.toFields()].flat());
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let plainBits = Bit255.fromScalar(plain);
let cipherBits = Bit255.xor(kBits, plainBits);
cipherBits.assertEquals(input.c, Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
U.assertEquals(input.U, Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
input.commitment.assertEquals(Poseidon.hash([plain.toFields(), random.toFields()].flat()), Utils.buildAssertMessage(EncCom.name, 'encrypt', "Incorrect encryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class EncComProof extends ZkProgram.Proof(EncCom) {
}
const DecCom = ZkProgram({
name: "EC-ElGamal-Decryption",
publicInput: InputCom,
methods: {
decrypt: {
privateInputs: [Scalar, Scalar, Scalar],
async method(input, plain, prvKey, random) {
let V = input.U.scale(prvKey);
let k = Poseidon.hash(input.U.toFields().concat(V.toFields()));
let kBits = Bit255.fromBits([...k.toBits(), PADDING_BIT]);
let decrypted = Bit255.xor(kBits, input.c);
Group.generator
.scale(prvKey)
.assertEquals(input.pubKey, Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
decrypted.assertEquals(Bit255.fromScalar(plain), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
input.commitment.assertEquals(Poseidon.hash([
decrypted.toScalar().toFields(),
random.toFields(),
].flat()), Utils.buildAssertMessage(DecCom.name, 'decrypt', "Incorrect decryption"));
},
},
dummy: {
privateInputs: [],
async method() {
return;
},
},
},
});
class DecComProof extends ZkProgram.Proof(DecCom) {
}
//# sourceMappingURL=ecelgamal.js.map
{"version":3,"file":"ecelgamal.js","sourceRoot":"","sources":["../../../../src/ecelgamal/ecelgamal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EA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AM,CAAC;qBACb,YAAY,CACT,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACN,SAAS,CAAC,YAAY,CAClB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EACxB,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;gBACF,KAAK,CAAC,UAAU,CAAC,YAAY,CACzB,QAAQ,CAAC,IAAI,CACT;oBACI,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;oBAC/B,MAAM,CAAC,QAAQ,EAAE;iBACpB,CAAC,IAAI,EAAE,CACX,EACD,KAAK,CAAC,kBAAkB,CACpB,MAAM,CAAC,IAAI,EACX,SAAS,yBAEZ,CACJ,CAAC;YACN,CAAC;SACJ;QACD,KAAK,EAAE;YACH,aAAa,EAAE,EAAE;YACjB,KAAK,CAAC,MAAM;gBACR,OAAO;YACX,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC;AAEH,MAAM,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;CAAG"}
import { Field, Scalar } from 'o1js';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
C: {
x: bigint;
y: bigint;
};
R: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
C: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
R: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
C: {
x: string;
y: string;
};
R: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
C: import("o1js/dist/node/lib/provable/group.js").Group;
R: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}
import { Field, Scalar } from 'o1js';
import { Bit255 } from '@auxo-dev/auxo-libs';
export { Input, DecProof, EncProof, Dec, Enc };
export { InputCom, EncCom, DecCom, EncComProof, DecComProof };
export declare const EMPTY_COMMITMENT: import("o1js/dist/node/lib/provable/field.js").Field;
export declare const PADDING_BIT: import("o1js/dist/node/lib/provable/bool.js").Bool;
declare const Input_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
};
};
declare class Input extends Input_base {
}
declare const Enc: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const EncProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncProof extends EncProof_base {
}
declare const Dec: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<Input, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: Input, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<Input, void>>;
dummy: (publicInput: Input, ...args: [] & any[]) => Promise<import("o1js").Proof<Input, void>>;
};
declare const DecProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: Input;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: Input;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof Input;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecProof extends DecProof_base {
}
declare const InputCom_base: (new (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) & {
_isStruct: true;
} & Omit<import("o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}, {
pubKey: {
x: bigint;
y: bigint;
};
c: {
head: bigint;
tail: bigint;
};
U: {
x: bigint;
y: bigint;
};
commitment: bigint;
}>, "fromFields"> & {
fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
} & {
fromValue: (value: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
c: Bit255 | {
head: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
tail: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
};
U: import("o1js/dist/node/lib/provable/group.js").Group | {
x: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
y: bigint | number | import("o1js/dist/node/lib/provable/field.js").Field;
};
commitment: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
toInput: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
}) => {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
};
fromJSON: (x: {
pubKey: {
x: string;
y: string;
};
c: {
head: string;
tail: string;
};
U: {
x: string;
y: string;
};
commitment: string;
}) => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
empty: () => {
pubKey: import("o1js/dist/node/lib/provable/group.js").Group;
c: Bit255;
U: import("o1js/dist/node/lib/provable/group.js").Group;
commitment: import("o1js/dist/node/lib/provable/field.js").Field;
};
};
declare class InputCom extends InputCom_base {
}
declare const EncCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
encrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
encrypt: [typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
encrypt: (publicInput: InputCom, ...args: [Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const EncComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class EncComProof extends EncComProof_base {
}
declare const DecCom: {
name: string;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<InputCom, void>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
decrypt: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
dummy: {
rows: number;
digest: string;
gates: import("o1js/dist/node/snarky.js").Gate[];
publicInputSize: number;
print(): void;
summary(): Partial<Record<import("o1js/dist/node/snarky.js").GateType | "Total rows", number>>;
};
}>;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
privateInputTypes: {
decrypt: [typeof Scalar, typeof Scalar, typeof Scalar];
dummy: [];
};
rawMethods: {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<void>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<void>;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
decrypt: (publicInput: InputCom, ...args: [Scalar, Scalar, Scalar] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
dummy: (publicInput: InputCom, ...args: [] & any[]) => Promise<import("o1js").Proof<InputCom, void>>;
};
declare const DecComProof_base: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: InputCom;
publicOutput: void;
maxProofsVerified: 0 | 2 | 1;
}): {
verify(): void;
verifyIf(condition: import("o1js/dist/node/lib/provable/bool.js").Bool): void;
publicInput: InputCom;
publicOutput: void;
proof: unknown;
maxProofsVerified: 0 | 2 | 1;
shouldVerify: import("o1js/dist/node/lib/provable/bool.js").Bool;
toJSON(): import("o1js").JsonProof;
};
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
tag: () => {
name: string;
publicInputType: typeof InputCom;
publicOutputType: import("o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<void, void, null>;
};
fromJSON<S extends (new (...args: any) => import("o1js").Proof<unknown, unknown>) & {
prototype: import("o1js").Proof<any, any>;
fromJSON: typeof import("o1js").Proof.fromJSON;
dummy: typeof import("o1js").Proof.dummy;
publicInputType: import("o1js").FlexibleProvablePure<any>;
publicOutputType: import("o1js").FlexibleProvablePure<any>;
tag: () => {
name: string;
};
} & {
prototype: import("o1js").Proof<unknown, unknown>;
}>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
};
declare class DecComProof extends DecComProof_base {
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet