@interfold/sdk 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ import { ProofData } from '@aztec/bb.js';
2
+
3
+ /**
4
+ * Describes the inputs to Greco circuit
5
+ */
6
+ interface CircuitInputs {
7
+ pk0is: string[][];
8
+ pk1is: string[][];
9
+ ct0is: string[][];
10
+ ct1is: string[][];
11
+ u: string[];
12
+ e0: string[];
13
+ e1: string[];
14
+ e0is: string[][];
15
+ e0_quotients: string[][];
16
+ k1: string[];
17
+ r1is: string[][];
18
+ r2is: string[][];
19
+ p1is: string[][];
20
+ p2is: string[][];
21
+ pk_commitment: string;
22
+ }
23
+ /**
24
+ * Generate a proof for a given circuit and circuit inputs
25
+ * @dev Defaults to the UltraHonkBackend
26
+ * @param circuitInputs - The circuit inputs
27
+ * @param circuit - The circuit
28
+ * @returns The proof
29
+ */
30
+ declare const generateProof: (circuitInputs: CircuitInputs) => Promise<ProofData>;
31
+
32
+ interface BfvParams {
33
+ degree: number;
34
+ plaintextModulus: bigint;
35
+ moduli: bigint[];
36
+ error1Variance: string | undefined;
37
+ }
38
+ type ThresholdBfvParamsPresetName = 'INSECURE_THRESHOLD_512' | 'SECURE_THRESHOLD_8192';
39
+ declare const ThresholdBfvParamsPresetNames: readonly ["INSECURE_THRESHOLD_512", "SECURE_THRESHOLD_8192"];
40
+ interface VerifiableEncryptionResult {
41
+ encryptedData: Uint8Array;
42
+ proof: ProofData;
43
+ }
44
+ interface EncryptedValueAndPublicInputs {
45
+ encryptedData: Uint8Array;
46
+ circuitInputs: CircuitInputs;
47
+ }
48
+
49
+ declare function getThresholdBfvParamsSet(presetName: ThresholdBfvParamsPresetName): Promise<BfvParams>;
50
+ declare function generatePublicKey(presetName: ThresholdBfvParamsPresetName): Promise<Uint8Array>;
51
+ declare function computePublicKeyCommitment(pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<Uint8Array>;
52
+ declare function encryptNumber(data: bigint, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<Uint8Array>;
53
+ declare function encryptVector(data: BigUint64Array, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<Uint8Array>;
54
+ declare function encryptNumberAndGenInputs(data: bigint, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<EncryptedValueAndPublicInputs>;
55
+ declare function encryptNumberAndGenProof(data: bigint, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<VerifiableEncryptionResult>;
56
+ declare function encryptVectorAndGenInputs(data: BigUint64Array, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<EncryptedValueAndPublicInputs>;
57
+ declare function encryptVectorAndGenProof(data: BigUint64Array, pk: Uint8Array, presetName: ThresholdBfvParamsPresetName): Promise<VerifiableEncryptionResult>;
58
+
59
+ export { type BfvParams, type EncryptedValueAndPublicInputs, type ThresholdBfvParamsPresetName, ThresholdBfvParamsPresetNames, type VerifiableEncryptionResult, computePublicKeyCommitment, encryptNumber, encryptNumberAndGenInputs, encryptNumberAndGenProof, encryptVector, encryptVectorAndGenInputs, encryptVectorAndGenProof, generateProof, generatePublicKey, getThresholdBfvParamsSet };