@inco/js 0.9.0-devnet-test-10 → 0.10.0-devnet-1
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.
- package/README.md +503 -47
- package/dist/cjs/advancedacl/session-key.d.ts +5 -5
- package/dist/cjs/advancedacl/session-key.js +33 -9
- package/dist/cjs/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/cjs/attestedcompute/attested-compute.js +15 -7
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +33 -96
- package/dist/cjs/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/cjs/attestedreveal/attested-reveal.js +31 -0
- package/dist/cjs/attestedreveal/index.d.ts +2 -0
- package/dist/cjs/attestedreveal/index.js +21 -0
- package/dist/cjs/attestedreveal/types.d.ts +4 -0
- package/dist/cjs/attestedreveal/types.js +13 -0
- package/dist/cjs/binary.d.ts +82 -0
- package/dist/cjs/binary.js +87 -5
- package/dist/cjs/chain.d.ts +29 -4
- package/dist/cjs/chain.js +34 -6
- package/dist/cjs/eip712/eip712.d.ts +18 -0
- package/dist/cjs/eip712/eip712.js +51 -0
- package/dist/cjs/eip712/index.d.ts +1 -0
- package/dist/cjs/eip712/index.js +8 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.js +94 -0
- package/dist/cjs/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/cjs/elistattesteddecrypt/index.js +22 -0
- package/dist/cjs/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/cjs/elistattesteddecrypt/types.js +16 -0
- package/dist/cjs/encryption/encryption.d.ts +115 -0
- package/dist/cjs/encryption/encryption.js +98 -7
- package/dist/cjs/encryption/index.d.ts +1 -1
- package/dist/cjs/encryption/index.js +17 -16
- package/dist/cjs/generated/abis/lightning.d.ts +1119 -107
- package/dist/cjs/generated/abis/lightning.js +762 -52
- package/dist/cjs/generated/abis/test-elist.d.ts +20 -2
- package/dist/cjs/generated/abis/test-elist.js +16 -3
- package/dist/cjs/generated/abis/verifier.d.ts +118 -15
- package/dist/cjs/generated/abis/verifier.js +71 -19
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +36 -41
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +3 -3
- package/dist/cjs/generated/lightning.d.ts +150 -0
- package/dist/cjs/generated/lightning.js +157 -1
- package/dist/cjs/generated/local-node.d.ts +9 -9
- package/dist/cjs/generated/local-node.js +37 -10
- package/dist/cjs/handle.d.ts +72 -0
- package/dist/cjs/handle.js +113 -9
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/kms/client.d.ts +1 -1
- package/dist/cjs/kms/client.js +4 -3
- package/dist/cjs/kms/quorumClient.d.ts +18 -12
- package/dist/cjs/kms/quorumClient.js +212 -231
- package/dist/cjs/kms/quorumConsistency.d.ts +82 -0
- package/dist/cjs/kms/quorumConsistency.js +269 -0
- package/dist/cjs/kms/signatureVerification.d.ts +35 -0
- package/dist/cjs/kms/signatureVerification.js +88 -0
- package/dist/cjs/kms/thresholdPromises.d.ts +4 -3
- package/dist/cjs/kms/thresholdPromises.js +25 -15
- package/dist/cjs/lite/attested-compute.d.ts +2 -2
- package/dist/cjs/lite/attested-compute.js +2 -3
- package/dist/cjs/lite/attested-decrypt.d.ts +2 -2
- package/dist/cjs/lite/attested-decrypt.js +2 -3
- package/dist/cjs/lite/hadu.d.ts +1 -1
- package/dist/cjs/lite/hadu.js +3 -3
- package/dist/cjs/lite/index.d.ts +6 -2
- package/dist/cjs/lite/index.js +8 -14
- package/dist/cjs/lite/lightning.d.ts +96 -47
- package/dist/cjs/lite/lightning.js +221 -267
- package/dist/cjs/lite/types.d.ts +47 -0
- package/dist/cjs/lite/types.js +3 -0
- package/dist/cjs/lite/xwing.d.ts +33 -2
- package/dist/cjs/lite/xwing.js +62 -7
- package/dist/cjs/local/local-node.d.ts +18 -0
- package/dist/cjs/local/local-node.js +18 -3
- package/dist/cjs/reencryption/eip712.d.ts +27 -0
- package/dist/cjs/reencryption/eip712.js +20 -7
- package/dist/cjs/reencryption/types.d.ts +24 -0
- package/dist/cjs/retry.d.ts +14 -0
- package/dist/cjs/retry.js +58 -2
- package/dist/cjs/test/mocks.d.ts +6 -1
- package/dist/cjs/test/mocks.js +31 -6
- package/dist/cjs/viem.d.ts +361 -1
- package/dist/cjs/viem.js +14 -1
- package/dist/esm/advancedacl/session-key.d.ts +5 -5
- package/dist/esm/advancedacl/session-key.js +33 -9
- package/dist/esm/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/esm/attestedcompute/attested-compute.js +13 -5
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/esm/attesteddecrypt/attested-decrypt.js +34 -96
- package/dist/esm/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/esm/attestedreveal/attested-reveal.js +28 -0
- package/dist/esm/attestedreveal/index.d.ts +2 -0
- package/dist/esm/attestedreveal/index.js +3 -0
- package/dist/esm/attestedreveal/types.d.ts +4 -0
- package/dist/esm/attestedreveal/types.js +9 -0
- package/dist/esm/binary.d.ts +82 -0
- package/dist/esm/binary.js +87 -5
- package/dist/esm/chain.d.ts +29 -4
- package/dist/esm/chain.js +33 -5
- package/dist/esm/eip712/eip712.d.ts +18 -0
- package/dist/esm/eip712/eip712.js +46 -0
- package/dist/esm/eip712/index.d.ts +1 -0
- package/dist/esm/eip712/index.js +2 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.js +89 -0
- package/dist/esm/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/esm/elistattesteddecrypt/index.js +3 -0
- package/dist/esm/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/esm/elistattesteddecrypt/types.js +12 -0
- package/dist/esm/encryption/encryption.d.ts +115 -0
- package/dist/esm/encryption/encryption.js +98 -7
- package/dist/esm/encryption/index.d.ts +1 -1
- package/dist/esm/encryption/index.js +2 -2
- package/dist/esm/generated/abis/lightning.d.ts +1119 -107
- package/dist/esm/generated/abis/lightning.js +761 -51
- package/dist/esm/generated/abis/test-elist.d.ts +20 -2
- package/dist/esm/generated/abis/test-elist.js +16 -3
- package/dist/esm/generated/abis/verifier.d.ts +118 -15
- package/dist/esm/generated/abis/verifier.js +71 -19
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +35 -40
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +3 -3
- package/dist/esm/generated/lightning.d.ts +150 -0
- package/dist/esm/generated/lightning.js +157 -1
- package/dist/esm/generated/local-node.d.ts +9 -9
- package/dist/esm/generated/local-node.js +37 -10
- package/dist/esm/handle.d.ts +72 -0
- package/dist/esm/handle.js +110 -8
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kms/client.d.ts +1 -1
- package/dist/esm/kms/client.js +3 -2
- package/dist/esm/kms/quorumClient.d.ts +18 -12
- package/dist/esm/kms/quorumClient.js +213 -232
- package/dist/esm/kms/quorumConsistency.d.ts +82 -0
- package/dist/esm/kms/quorumConsistency.js +260 -0
- package/dist/esm/kms/signatureVerification.d.ts +35 -0
- package/dist/esm/kms/signatureVerification.js +84 -0
- package/dist/esm/kms/thresholdPromises.d.ts +4 -3
- package/dist/esm/kms/thresholdPromises.js +25 -15
- package/dist/esm/lite/attested-compute.d.ts +2 -2
- package/dist/esm/lite/attested-compute.js +3 -3
- package/dist/esm/lite/attested-decrypt.d.ts +2 -2
- package/dist/esm/lite/attested-decrypt.js +3 -3
- package/dist/esm/lite/hadu.d.ts +1 -1
- package/dist/esm/lite/hadu.js +2 -2
- package/dist/esm/lite/index.d.ts +6 -2
- package/dist/esm/lite/index.js +5 -3
- package/dist/esm/lite/lightning.d.ts +96 -47
- package/dist/esm/lite/lightning.js +217 -263
- package/dist/esm/lite/types.d.ts +47 -0
- package/dist/esm/lite/types.js +2 -0
- package/dist/esm/lite/xwing.d.ts +33 -2
- package/dist/esm/lite/xwing.js +59 -7
- package/dist/esm/local/local-node.d.ts +18 -0
- package/dist/esm/local/local-node.js +18 -3
- package/dist/esm/reencryption/eip712.d.ts +27 -0
- package/dist/esm/reencryption/eip712.js +20 -7
- package/dist/esm/reencryption/types.d.ts +24 -0
- package/dist/esm/retry.d.ts +14 -0
- package/dist/esm/retry.js +56 -2
- package/dist/esm/test/mocks.d.ts +6 -1
- package/dist/esm/test/mocks.js +31 -8
- package/dist/esm/viem.d.ts +361 -1
- package/dist/esm/viem.js +15 -2
- package/dist/types/advancedacl/session-key.d.ts +5 -5
- package/dist/types/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/types/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/types/attestedreveal/index.d.ts +2 -0
- package/dist/types/attestedreveal/types.d.ts +4 -0
- package/dist/types/binary.d.ts +82 -0
- package/dist/types/chain.d.ts +29 -4
- package/dist/types/eip712/eip712.d.ts +18 -0
- package/dist/types/eip712/index.d.ts +1 -0
- package/dist/types/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/types/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/types/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/types/encryption/encryption.d.ts +115 -0
- package/dist/types/encryption/index.d.ts +1 -1
- package/dist/types/generated/abis/lightning.d.ts +1119 -107
- package/dist/types/generated/abis/test-elist.d.ts +20 -2
- package/dist/types/generated/abis/verifier.d.ts +118 -15
- package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/types/generated/lightning.d.ts +150 -0
- package/dist/types/generated/local-node.d.ts +9 -9
- package/dist/types/handle.d.ts +72 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/kms/client.d.ts +1 -1
- package/dist/types/kms/quorumClient.d.ts +18 -12
- package/dist/types/kms/quorumConsistency.d.ts +82 -0
- package/dist/types/kms/signatureVerification.d.ts +35 -0
- package/dist/types/kms/thresholdPromises.d.ts +4 -3
- package/dist/types/lite/attested-compute.d.ts +2 -2
- package/dist/types/lite/attested-decrypt.d.ts +2 -2
- package/dist/types/lite/hadu.d.ts +1 -1
- package/dist/types/lite/index.d.ts +6 -2
- package/dist/types/lite/lightning.d.ts +96 -47
- package/dist/types/lite/types.d.ts +47 -0
- package/dist/types/lite/xwing.d.ts +33 -2
- package/dist/types/local/local-node.d.ts +18 -0
- package/dist/types/reencryption/eip712.d.ts +27 -0
- package/dist/types/reencryption/types.d.ts +24 -0
- package/dist/types/retry.d.ts +14 -0
- package/dist/types/test/mocks.d.ts +6 -1
- package/dist/types/viem.d.ts +361 -1
- package/package.json +19 -21
- package/dist/cjs/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/cjs/generated/abis/lightning-preview.js +0 -857
- package/dist/esm/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/esm/generated/abis/lightning-preview.js +0 -854
- package/dist/types/generated/abis/lightning-preview.d.ts +0 -1385
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HexString } from '../binary.js';
|
|
2
|
+
import type { EncryptionScheme, EncryptResultOf, PlaintextOf, SupportedFheType } from '../encryption/encryption.js';
|
|
3
|
+
import { handleTypes } from '../index.js';
|
|
4
|
+
import type { BackoffConfig } from '../retry.js';
|
|
5
|
+
/**
|
|
6
|
+
* Custom error class for elist attested decrypt operations.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EListAttestedDecryptError extends Error {
|
|
9
|
+
readonly cause?: unknown | undefined;
|
|
10
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
11
|
+
}
|
|
12
|
+
export type EListDecryptionAttestation<S extends EncryptionScheme, T extends SupportedFheType> = {
|
|
13
|
+
handle: HexString;
|
|
14
|
+
commitmentProof: PlaintextOf<S, typeof handleTypes.euint256>;
|
|
15
|
+
values: PlaintextOf<S, T>[];
|
|
16
|
+
covalidatorSignatures: Uint8Array[];
|
|
17
|
+
commitments: Uint8Array[];
|
|
18
|
+
};
|
|
19
|
+
export type EncryptedEListDecryptionAttestation<S extends EncryptionScheme, T extends SupportedFheType> = {
|
|
20
|
+
handle: HexString;
|
|
21
|
+
commitmentProof: PlaintextOf<S, typeof handleTypes.euint256>;
|
|
22
|
+
values: EncryptResultOf<S, T>[];
|
|
23
|
+
covalidatorSignatures: Uint8Array[];
|
|
24
|
+
commitments: Uint8Array[];
|
|
25
|
+
};
|
|
26
|
+
export type EListAttestedDecryptor<S extends EncryptionScheme> = <T extends SupportedFheType>(args: EListAttestedDecryptFnArgs<S, T>) => Promise<EListDecryptionAttestation<S, T>>;
|
|
27
|
+
export type EListAttestedDecryptFnArgs<S extends EncryptionScheme, T extends SupportedFheType> = {
|
|
28
|
+
/** The handle to decrypt */
|
|
29
|
+
handle: HexString;
|
|
30
|
+
backoffConfig?: Partial<BackoffConfig>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error class for elist attested decrypt operations.
|
|
3
|
+
*/
|
|
4
|
+
export class EListAttestedDecryptError extends Error {
|
|
5
|
+
cause;
|
|
6
|
+
constructor(message, cause) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.cause = cause;
|
|
9
|
+
this.name = 'EListAttestedDecryptError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZWxpc3RhdHRlc3RlZGRlY3J5cHQvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVUE7O0dBRUc7QUFDSCxNQUFNLE9BQU8seUJBQTBCLFNBQVEsS0FBSztJQUdoQztJQUZsQixZQUNFLE9BQWUsRUFDQyxLQUFlO1FBRS9CLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUZDLFVBQUssR0FBTCxLQUFLLENBQVU7UUFHL0IsSUFBSSxDQUFDLElBQUksR0FBRywyQkFBMkIsQ0FBQztJQUMxQyxDQUFDO0NBQ0YifQ==
|
|
@@ -1,37 +1,79 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { ByteArray, Hex } from 'viem';
|
|
3
3
|
import { Bytes32 } from '../binary.js';
|
|
4
|
+
/**
|
|
5
|
+
* A function that encrypts a plaintext value, embedding its {@link InputContext} into the resulting ciphertext.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam S - The encryption scheme (e.g. X-Wing).
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const result = await encrypt({ plaintext: { scheme: 2, type: 5, value: 42n }, context });
|
|
11
|
+
* // result.handle, result.ciphertext, result.prehandle
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
4
14
|
export type Encryptor<S extends EncryptionScheme = EncryptionScheme> = <T extends SupportedFheType>(plaintext: PlaintextWithContextOf<S, T>) => Promise<EncryptResultOf<S, T>>;
|
|
15
|
+
/**
|
|
16
|
+
* A function that decrypts a ciphertext back to its plaintext value.
|
|
17
|
+
*
|
|
18
|
+
* @typeParam S - The encryption scheme (e.g. X-Wing).
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const plaintext = await decrypt({ scheme: 2, type: 5, value: '0x...' });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
5
24
|
export type Decryptor<S extends EncryptionScheme = EncryptionScheme> = <T extends SupportedFheType>(ciphertext: CiphertextOf<S, T>) => Promise<PlaintextOf<S, T>>;
|
|
25
|
+
/**
|
|
26
|
+
* Subset of ENCRYPTION types currently supported for encryption/decryption.
|
|
27
|
+
*
|
|
28
|
+
* @remarks TODO: review need of `euint64` and `euint160` — `Lib.sol` only supports `euint256` and `ebool`.
|
|
29
|
+
*/
|
|
6
30
|
export declare const supportedFheTypes: {
|
|
7
31
|
readonly euint64: 5;
|
|
8
32
|
readonly euint160: 7;
|
|
9
33
|
readonly euint256: 8;
|
|
10
34
|
readonly ebool: 0;
|
|
11
35
|
};
|
|
36
|
+
/** Schema that validates a string is one of the supported ENCRYPTION type names. */
|
|
12
37
|
export declare const SupportedFheTypeName: Schema.SchemaClass<"ebool" | "euint64" | "euint160" | "euint256", "ebool" | "euint64" | "euint160" | "euint256", never>;
|
|
38
|
+
/** A supported ENCRYPTION type name (e.g. `"euint256"`, `"ebool"`). */
|
|
13
39
|
export type SupportedFheTypeName = typeof SupportedFheTypeName.Type;
|
|
40
|
+
/** Schema that validates a number is one of the supported ENCRYPTION type integer identifiers. */
|
|
14
41
|
export declare const SupportedFheType: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
|
|
42
|
+
/** Integer identifier of a supported ENCRYPTION type (a subset of all ENCRYPTION types). */
|
|
15
43
|
export type SupportedFheType = typeof SupportedFheType.Type;
|
|
44
|
+
/** Map of encryption scheme names to their integer identifiers. Currently only X-Wing (2) is supported. */
|
|
16
45
|
export declare const encryptionSchemes: {
|
|
17
46
|
readonly xwing: 2;
|
|
18
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Returns the human-readable name of an encryption scheme.
|
|
50
|
+
* @param scheme - The encryption scheme integer identifier.
|
|
51
|
+
* @returns The scheme name (e.g. `"X-Wing"`).
|
|
52
|
+
* @throws If the scheme identifier is unknown.
|
|
53
|
+
*/
|
|
19
54
|
export declare function getEncryptionSchemeName(scheme: number): string;
|
|
55
|
+
/** The typeof {@link encryptionSchemes} — mapping from scheme names to integer IDs. */
|
|
20
56
|
export type EncryptionSchemes = typeof encryptionSchemes;
|
|
57
|
+
/** The integer identifier for the X-Wing encryption scheme (`2`). */
|
|
21
58
|
export type XwingScheme = EncryptionSchemes['xwing'];
|
|
59
|
+
/** Schema that validates a value is a known encryption scheme identifier. */
|
|
22
60
|
export declare const EncryptionScheme: Schema.Literal<[2]>;
|
|
61
|
+
/** An encryption scheme identifier (currently only X-Wing = `2`). */
|
|
23
62
|
export type EncryptionScheme = typeof EncryptionScheme.Type;
|
|
24
63
|
type DistType<P, S extends EncryptionScheme, T extends SupportedFheType> = P extends any ? P & {
|
|
25
64
|
scheme: S;
|
|
26
65
|
type: T;
|
|
27
66
|
} : never;
|
|
67
|
+
/** Schema for an ENCRYPTION ciphertext: encryption scheme, ENCRYPTION type, and the encrypted value as a hex string. */
|
|
28
68
|
export declare const Ciphertext: Schema.Struct<{
|
|
29
69
|
scheme: Schema.Literal<[2]>;
|
|
30
70
|
type: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
|
|
31
71
|
value: Schema.TemplateLiteral<`0x${string}`>;
|
|
32
72
|
}>;
|
|
73
|
+
/** An ENCRYPTION ciphertext containing the encryption scheme, ENCRYPTION type, and encrypted hex value. */
|
|
33
74
|
export type Ciphertext = typeof Ciphertext.Type;
|
|
34
75
|
export type CiphertextOf<S extends EncryptionScheme, T extends SupportedFheType> = DistType<Ciphertext, S, T>;
|
|
76
|
+
/** Schema for a ciphertext paired with the {@link InputContext} it was encrypted under. */
|
|
35
77
|
export declare const CiphertextWithContext: Schema.Struct<{
|
|
36
78
|
ciphertext: Schema.Struct<{
|
|
37
79
|
scheme: Schema.Literal<[2]>;
|
|
@@ -46,10 +88,12 @@ export declare const CiphertextWithContext: Schema.Struct<{
|
|
|
46
88
|
version: typeof Schema.Number;
|
|
47
89
|
}>;
|
|
48
90
|
}>;
|
|
91
|
+
/** A ciphertext paired with the {@link InputContext} it was encrypted under. */
|
|
49
92
|
export type CiphertextWithContext = typeof CiphertextWithContext.Type;
|
|
50
93
|
export type CiphertextWithContextOf<S extends EncryptionScheme, T extends SupportedFheType> = CiphertextWithContext & {
|
|
51
94
|
ciphertext: CiphertextOf<S, T>;
|
|
52
95
|
};
|
|
96
|
+
/** Schema for the result of an encryption operation: ciphertext, input context, prehandle, and final handle. */
|
|
53
97
|
export declare const EncryptResult: Schema.Struct<{
|
|
54
98
|
ciphertext: Schema.Struct<{
|
|
55
99
|
scheme: Schema.Literal<[2]>;
|
|
@@ -66,10 +110,16 @@ export declare const EncryptResult: Schema.Struct<{
|
|
|
66
110
|
prehandle: Schema.brand<Schema.filter<Schema.transformOrFail<Schema.Union<[typeof Schema.String, Schema.refine<object & Uint8Array<ArrayBufferLike>, Schema.Schema<object, object, never>>]>, Schema.TemplateLiteral<`0x${string}`>, never>>, "Bytes32">;
|
|
67
111
|
handle: Schema.brand<Schema.filter<Schema.transformOrFail<Schema.Union<[typeof Schema.String, Schema.refine<object & Uint8Array<ArrayBufferLike>, Schema.Schema<object, object, never>>]>, Schema.TemplateLiteral<`0x${string}`>, never>>, "Bytes32">;
|
|
68
112
|
}>;
|
|
113
|
+
/** The result of an encryption operation, containing the ciphertext, context, prehandle, and deterministic handle. */
|
|
69
114
|
export type EncryptResult = typeof EncryptResult.Type;
|
|
70
115
|
export type EncryptResultOf<S extends EncryptionScheme, T extends SupportedFheType> = EncryptResult & {
|
|
71
116
|
ciphertext: CiphertextOf<S, T>;
|
|
72
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Schema for an ENCRYPTION plaintext value. The `value` field type depends on the ENCRYPTION type:
|
|
120
|
+
* - `euint64` / `euint160` / `euint256`: `bigint`
|
|
121
|
+
* - `ebool`: `boolean`
|
|
122
|
+
*/
|
|
73
123
|
export declare const Plaintext: Schema.Union<[Schema.Struct<{
|
|
74
124
|
scheme: Schema.Literal<[2]>;
|
|
75
125
|
type: Schema.Literal<[5, 7, 8]>;
|
|
@@ -79,8 +129,10 @@ export declare const Plaintext: Schema.Union<[Schema.Struct<{
|
|
|
79
129
|
type: Schema.Literal<[0]>;
|
|
80
130
|
value: typeof Schema.Boolean;
|
|
81
131
|
}>]>;
|
|
132
|
+
/** An ENCRYPTION plaintext value — `bigint` for integer types, `boolean` for `ebool`. */
|
|
82
133
|
export type Plaintext = typeof Plaintext.Type;
|
|
83
134
|
export type PlaintextOf<S extends EncryptionScheme, T extends SupportedFheType> = DistType<Plaintext, S, T>;
|
|
135
|
+
/** Schema for a plaintext paired with the {@link InputContext} it will be encrypted under. */
|
|
84
136
|
export declare const PlaintextWithContext: Schema.Struct<{
|
|
85
137
|
plaintext: Schema.Union<[Schema.Struct<{
|
|
86
138
|
scheme: Schema.Literal<[2]>;
|
|
@@ -99,20 +151,83 @@ export declare const PlaintextWithContext: Schema.Struct<{
|
|
|
99
151
|
version: typeof Schema.Number;
|
|
100
152
|
}>;
|
|
101
153
|
}>;
|
|
154
|
+
/** A plaintext paired with the {@link InputContext} it will be encrypted under. */
|
|
102
155
|
export type PlaintextWithContext = typeof PlaintextWithContext.Type;
|
|
103
156
|
export type PlaintextWithContextOf<S extends EncryptionScheme, T extends SupportedFheType> = PlaintextWithContext & {
|
|
104
157
|
plaintext: PlaintextOf<S, T>;
|
|
105
158
|
};
|
|
159
|
+
/**
|
|
160
|
+
* Converts a `bigint` to a typed {@link Plaintext} value.
|
|
161
|
+
*
|
|
162
|
+
* For integer ENCRYPTION types (`euint64`, `euint160`, `euint256`) the value is passed through as-is.
|
|
163
|
+
* For `ebool`, non-zero values become `true`.
|
|
164
|
+
*
|
|
165
|
+
* @param scheme - The encryption scheme identifier.
|
|
166
|
+
* @param type - The ENCRYPTION type to interpret the value as.
|
|
167
|
+
* @param bigPt - The raw bigint plaintext value.
|
|
168
|
+
* @returns A typed `Plaintext` matching the given scheme and ENCRYPTION type.
|
|
169
|
+
* @throws If `type` is not a supported ENCRYPTION type.
|
|
170
|
+
*/
|
|
106
171
|
export declare function bigintToPlaintext<S extends EncryptionScheme, T extends SupportedFheType>(scheme: S, type: T, bigPt: bigint): PlaintextOf<S, T>;
|
|
172
|
+
/**
|
|
173
|
+
* Decodes an ABI-encoded ciphertext input into its components.
|
|
174
|
+
*
|
|
175
|
+
* The input format is: `4-byte version || abi.encode(bytes32 handle, bytes ciphertext)`.
|
|
176
|
+
*
|
|
177
|
+
* @param input - The raw encoded input as a byte array or hex string.
|
|
178
|
+
* @returns The decoded version, handle, and ciphertext.
|
|
179
|
+
*/
|
|
107
180
|
export declare function decodeCiphertextInput(input: ByteArray | Hex): {
|
|
108
181
|
version: number;
|
|
109
182
|
handle: Hex;
|
|
110
183
|
ciphertext: Hex;
|
|
111
184
|
};
|
|
185
|
+
/**
|
|
186
|
+
* Encodes a handle and ciphertext into the on-chain input format.
|
|
187
|
+
*
|
|
188
|
+
* The output format is: `4-byte version || abi.encode(bytes32 handle, bytes ciphertext)`.
|
|
189
|
+
*
|
|
190
|
+
* @param version - The encoding version (int32).
|
|
191
|
+
* @param handle - The 32-byte handle as a hex string.
|
|
192
|
+
* @param ciphertext - The ciphertext as a hex string.
|
|
193
|
+
* @returns The ABI-encoded input as a hex string.
|
|
194
|
+
*/
|
|
112
195
|
export declare function encodeCiphertextInput(version: number, handle: Hex, ciphertext: Hex): Hex;
|
|
196
|
+
/**
|
|
197
|
+
* Converts a {@link Plaintext} to its `bigint` representation.
|
|
198
|
+
*
|
|
199
|
+
* Integer types pass through directly; `ebool` maps `true` → `1n`, `false` → `0n`.
|
|
200
|
+
*
|
|
201
|
+
* @param plaintext - The plaintext to convert.
|
|
202
|
+
* @returns The bigint representation of the plaintext value.
|
|
203
|
+
*/
|
|
113
204
|
export declare function plaintextToBigint(plaintext: Plaintext): bigint;
|
|
205
|
+
/**
|
|
206
|
+
* Converts a {@link Plaintext} to a {@link Bytes32} hex string.
|
|
207
|
+
* @param plaintext - The plaintext to convert.
|
|
208
|
+
* @returns A 32-byte hex representation of the plaintext value.
|
|
209
|
+
*/
|
|
114
210
|
export declare function plaintextToBytes32(plaintext: Plaintext): Bytes32;
|
|
211
|
+
/**
|
|
212
|
+
* Converts a {@link Plaintext} to a 32-byte `Buffer`.
|
|
213
|
+
* @param plaintext - The plaintext to convert.
|
|
214
|
+
* @returns A 32-byte big-endian buffer of the plaintext value.
|
|
215
|
+
*/
|
|
115
216
|
export declare function plaintextToBytes(plaintext: Plaintext): Buffer;
|
|
217
|
+
/**
|
|
218
|
+
* Parses a {@link Bytes32} hex string into a typed {@link Plaintext}.
|
|
219
|
+
* @param plaintext - The 32-byte hex value to interpret.
|
|
220
|
+
* @param scheme - The encryption scheme identifier.
|
|
221
|
+
* @param type - The ENCRYPTION type to interpret the bytes as.
|
|
222
|
+
* @returns A typed `Plaintext` value.
|
|
223
|
+
*/
|
|
116
224
|
export declare function bytes32ToPlaintext(plaintext: Bytes32, scheme: EncryptionScheme, type: SupportedFheType): Plaintext;
|
|
225
|
+
/**
|
|
226
|
+
* Parses a `Uint8Array` into a typed {@link Plaintext}.
|
|
227
|
+
* @param plaintext - The byte array to interpret.
|
|
228
|
+
* @param scheme - The encryption scheme identifier.
|
|
229
|
+
* @param type - The ENCRYPTION type to interpret the bytes as.
|
|
230
|
+
* @returns A typed `Plaintext` value.
|
|
231
|
+
*/
|
|
117
232
|
export declare function bytesToPlaintext(plaintext: Uint8Array, scheme: EncryptionScheme, type: SupportedFheType): Plaintext;
|
|
118
233
|
export {};
|
|
@@ -2,7 +2,11 @@ import { Schema } from 'effect';
|
|
|
2
2
|
import { bytesToHex, decodeAbiParameters, encodeAbiParameters, hexToBytes, } from 'viem';
|
|
3
3
|
import { bigintToBytes, bigintToBytes32, Bytes32, bytesToBigInt, HexString, } from '../binary.js';
|
|
4
4
|
import { handleTypes, InputContext } from '../handle.js';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Subset of ENCRYPTION types currently supported for encryption/decryption.
|
|
7
|
+
*
|
|
8
|
+
* @remarks TODO: review need of `euint64` and `euint160` — `Lib.sol` only supports `euint256` and `ebool`.
|
|
9
|
+
*/
|
|
6
10
|
export const supportedFheTypes = {
|
|
7
11
|
euint64: handleTypes.euint64,
|
|
8
12
|
euint160: handleTypes.euint160,
|
|
@@ -10,12 +14,21 @@ export const supportedFheTypes = {
|
|
|
10
14
|
ebool: handleTypes.ebool,
|
|
11
15
|
};
|
|
12
16
|
const supportedFheTypeNames = Object.keys(supportedFheTypes);
|
|
17
|
+
/** Schema that validates a string is one of the supported ENCRYPTION type names. */
|
|
13
18
|
export const SupportedFheTypeName = Schema.Literal(...supportedFheTypeNames);
|
|
19
|
+
/** Schema that validates a number is one of the supported ENCRYPTION type integer identifiers. */
|
|
14
20
|
// TODO: extend to all types
|
|
15
21
|
export const SupportedFheType = Schema.Literal(...Object.values(supportedFheTypes));
|
|
22
|
+
/** Map of encryption scheme names to their integer identifiers. Currently only X-Wing (2) is supported. */
|
|
16
23
|
export const encryptionSchemes = {
|
|
17
24
|
xwing: 2,
|
|
18
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Returns the human-readable name of an encryption scheme.
|
|
28
|
+
* @param scheme - The encryption scheme integer identifier.
|
|
29
|
+
* @returns The scheme name (e.g. `"X-Wing"`).
|
|
30
|
+
* @throws If the scheme identifier is unknown.
|
|
31
|
+
*/
|
|
19
32
|
export function getEncryptionSchemeName(scheme) {
|
|
20
33
|
switch (scheme) {
|
|
21
34
|
case encryptionSchemes.xwing:
|
|
@@ -24,22 +37,31 @@ export function getEncryptionSchemeName(scheme) {
|
|
|
24
37
|
throw new Error(`Unknown encryption scheme: ${scheme}`);
|
|
25
38
|
}
|
|
26
39
|
}
|
|
40
|
+
/** Schema that validates a value is a known encryption scheme identifier. */
|
|
27
41
|
export const EncryptionScheme = Schema.Literal(encryptionSchemes.xwing);
|
|
42
|
+
/** Schema for an ENCRYPTION ciphertext: encryption scheme, ENCRYPTION type, and the encrypted value as a hex string. */
|
|
28
43
|
export const Ciphertext = Schema.Struct({
|
|
29
44
|
scheme: EncryptionScheme,
|
|
30
45
|
type: SupportedFheType,
|
|
31
46
|
value: HexString,
|
|
32
47
|
});
|
|
48
|
+
/** Schema for a ciphertext paired with the {@link InputContext} it was encrypted under. */
|
|
33
49
|
export const CiphertextWithContext = Schema.Struct({
|
|
34
50
|
ciphertext: Ciphertext,
|
|
35
51
|
context: InputContext,
|
|
36
52
|
});
|
|
53
|
+
/** Schema for the result of an encryption operation: ciphertext, input context, prehandle, and final handle. */
|
|
37
54
|
export const EncryptResult = Schema.Struct({
|
|
38
55
|
ciphertext: Ciphertext,
|
|
39
56
|
context: InputContext,
|
|
40
57
|
prehandle: Bytes32,
|
|
41
58
|
handle: Bytes32,
|
|
42
59
|
});
|
|
60
|
+
/**
|
|
61
|
+
* Schema for an ENCRYPTION plaintext value. The `value` field type depends on the ENCRYPTION type:
|
|
62
|
+
* - `euint64` / `euint160` / `euint256`: `bigint`
|
|
63
|
+
* - `ebool`: `boolean`
|
|
64
|
+
*/
|
|
43
65
|
export const Plaintext = Schema.Union(Schema.Struct({
|
|
44
66
|
scheme: EncryptionScheme,
|
|
45
67
|
type: Schema.Literal(handleTypes.euint64, handleTypes.euint160, handleTypes.euint256),
|
|
@@ -49,10 +71,23 @@ export const Plaintext = Schema.Union(Schema.Struct({
|
|
|
49
71
|
type: Schema.Literal(handleTypes.ebool),
|
|
50
72
|
value: Schema.Boolean,
|
|
51
73
|
}));
|
|
74
|
+
/** Schema for a plaintext paired with the {@link InputContext} it will be encrypted under. */
|
|
52
75
|
export const PlaintextWithContext = Schema.Struct({
|
|
53
76
|
plaintext: Plaintext,
|
|
54
77
|
context: InputContext,
|
|
55
78
|
});
|
|
79
|
+
/**
|
|
80
|
+
* Converts a `bigint` to a typed {@link Plaintext} value.
|
|
81
|
+
*
|
|
82
|
+
* For integer ENCRYPTION types (`euint64`, `euint160`, `euint256`) the value is passed through as-is.
|
|
83
|
+
* For `ebool`, non-zero values become `true`.
|
|
84
|
+
*
|
|
85
|
+
* @param scheme - The encryption scheme identifier.
|
|
86
|
+
* @param type - The ENCRYPTION type to interpret the value as.
|
|
87
|
+
* @param bigPt - The raw bigint plaintext value.
|
|
88
|
+
* @returns A typed `Plaintext` matching the given scheme and ENCRYPTION type.
|
|
89
|
+
* @throws If `type` is not a supported ENCRYPTION type.
|
|
90
|
+
*/
|
|
56
91
|
export function bigintToPlaintext(scheme, type, bigPt) {
|
|
57
92
|
switch (type) {
|
|
58
93
|
case handleTypes.euint64:
|
|
@@ -74,15 +109,29 @@ export function bigintToPlaintext(scheme, type, bigPt) {
|
|
|
74
109
|
}
|
|
75
110
|
throw new Error(`Unsupported Encryption Scheme type: ${type}`);
|
|
76
111
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
112
|
+
/**
|
|
113
|
+
* ABI parameter schema for on-chain ciphertext input encoding.
|
|
114
|
+
*
|
|
115
|
+
* Compatible with Solidity's `abi.decode(input, (bytes32, bytes))`:
|
|
116
|
+
* ```solidity
|
|
117
|
+
* (bytes32 externalHandle, bytes memory ciphertext) = abi.decode(input, (bytes32, bytes));
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* This is the source of truth for the encoding format and does not refer to
|
|
121
|
+
* an actual contract or Solidity type's ABI.
|
|
122
|
+
*/
|
|
82
123
|
const ciphertextInputAbi = [
|
|
83
124
|
{ name: 'handle', type: 'bytes32' },
|
|
84
125
|
{ name: 'ciphertext', type: 'bytes' },
|
|
85
126
|
];
|
|
127
|
+
/**
|
|
128
|
+
* Decodes an ABI-encoded ciphertext input into its components.
|
|
129
|
+
*
|
|
130
|
+
* The input format is: `4-byte version || abi.encode(bytes32 handle, bytes ciphertext)`.
|
|
131
|
+
*
|
|
132
|
+
* @param input - The raw encoded input as a byte array or hex string.
|
|
133
|
+
* @returns The decoded version, handle, and ciphertext.
|
|
134
|
+
*/
|
|
86
135
|
export function decodeCiphertextInput(input) {
|
|
87
136
|
const bytes = typeof input === 'string' ? hexToBytes(input) : input;
|
|
88
137
|
const buf = new Uint8Array(bytes).buffer;
|
|
@@ -90,6 +139,16 @@ export function decodeCiphertextInput(input) {
|
|
|
90
139
|
const [handle, ciphertext] = decodeAbiParameters(ciphertextInputAbi, bytes.slice(4));
|
|
91
140
|
return { version, handle, ciphertext };
|
|
92
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Encodes a handle and ciphertext into the on-chain input format.
|
|
144
|
+
*
|
|
145
|
+
* The output format is: `4-byte version || abi.encode(bytes32 handle, bytes ciphertext)`.
|
|
146
|
+
*
|
|
147
|
+
* @param version - The encoding version (int32).
|
|
148
|
+
* @param handle - The 32-byte handle as a hex string.
|
|
149
|
+
* @param ciphertext - The ciphertext as a hex string.
|
|
150
|
+
* @returns The ABI-encoded input as a hex string.
|
|
151
|
+
*/
|
|
93
152
|
export function encodeCiphertextInput(version, handle, ciphertext) {
|
|
94
153
|
const rest = hexToBytes(encodeAbiParameters(ciphertextInputAbi, [handle, ciphertext]));
|
|
95
154
|
const buf = new ArrayBuffer(rest.length + 4);
|
|
@@ -99,6 +158,14 @@ export function encodeCiphertextInput(version, handle, ciphertext) {
|
|
|
99
158
|
view.set(rest, 4);
|
|
100
159
|
return bytesToHex(view);
|
|
101
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Converts a {@link Plaintext} to its `bigint` representation.
|
|
163
|
+
*
|
|
164
|
+
* Integer types pass through directly; `ebool` maps `true` → `1n`, `false` → `0n`.
|
|
165
|
+
*
|
|
166
|
+
* @param plaintext - The plaintext to convert.
|
|
167
|
+
* @returns The bigint representation of the plaintext value.
|
|
168
|
+
*/
|
|
102
169
|
export function plaintextToBigint(plaintext) {
|
|
103
170
|
switch (plaintext.type) {
|
|
104
171
|
case handleTypes.euint64:
|
|
@@ -109,16 +176,40 @@ export function plaintextToBigint(plaintext) {
|
|
|
109
176
|
return plaintext.value ? 1n : 0n;
|
|
110
177
|
}
|
|
111
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Converts a {@link Plaintext} to a {@link Bytes32} hex string.
|
|
181
|
+
* @param plaintext - The plaintext to convert.
|
|
182
|
+
* @returns A 32-byte hex representation of the plaintext value.
|
|
183
|
+
*/
|
|
112
184
|
export function plaintextToBytes32(plaintext) {
|
|
113
185
|
return bigintToBytes32(plaintextToBigint(plaintext));
|
|
114
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Converts a {@link Plaintext} to a 32-byte `Buffer`.
|
|
189
|
+
* @param plaintext - The plaintext to convert.
|
|
190
|
+
* @returns A 32-byte big-endian buffer of the plaintext value.
|
|
191
|
+
*/
|
|
115
192
|
export function plaintextToBytes(plaintext) {
|
|
116
193
|
return bigintToBytes(plaintextToBigint(plaintext));
|
|
117
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Parses a {@link Bytes32} hex string into a typed {@link Plaintext}.
|
|
197
|
+
* @param plaintext - The 32-byte hex value to interpret.
|
|
198
|
+
* @param scheme - The encryption scheme identifier.
|
|
199
|
+
* @param type - The ENCRYPTION type to interpret the bytes as.
|
|
200
|
+
* @returns A typed `Plaintext` value.
|
|
201
|
+
*/
|
|
118
202
|
export function bytes32ToPlaintext(plaintext, scheme, type) {
|
|
119
203
|
return bigintToPlaintext(scheme, type, BigInt(plaintext));
|
|
120
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Parses a `Uint8Array` into a typed {@link Plaintext}.
|
|
207
|
+
* @param plaintext - The byte array to interpret.
|
|
208
|
+
* @param scheme - The encryption scheme identifier.
|
|
209
|
+
* @param type - The ENCRYPTION type to interpret the bytes as.
|
|
210
|
+
* @returns A typed `Plaintext` value.
|
|
211
|
+
*/
|
|
121
212
|
export function bytesToPlaintext(plaintext, scheme, type) {
|
|
122
213
|
return bigintToPlaintext(scheme, type, BigInt(bytesToBigInt(plaintext)));
|
|
123
214
|
}
|
|
124
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
215
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jcnlwdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbmNyeXB0aW9uL2VuY3J5cHRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUNoQyxPQUFPLEVBR0wsVUFBVSxFQUNWLG1CQUFtQixFQUNuQixtQkFBbUIsRUFFbkIsVUFBVSxHQUNYLE1BQU0sTUFBTSxDQUFDO0FBQ2QsT0FBTyxFQUNMLGFBQWEsRUFDYixlQUFlLEVBQ2YsT0FBTyxFQUNQLGFBQWEsRUFDYixTQUFTLEdBQ1YsTUFBTSxjQUFjLENBQUM7QUFDdEIsT0FBTyxFQUFFLFdBQVcsRUFBRSxZQUFZLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFpQ3pEOzs7O0dBSUc7Q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ENBQUM7QUFDckQsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxrQkFBa0IsQ0FDaEMsU0FBa0IsRUFDbEIsTUFBd0IsRUFDeEIsSUFBc0I7SUFFdEIsT0FBTyxpQkFBaUIsQ0FBQyxNQUFNLEVBQUUsSUFBSSxFQUFFLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDO0FBQzVELENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsZ0JBQWdCLENBQzlCLFNBQXFCLEVBQ3JCLE1BQXdCLEVBQ3hCLElBQXNCO0lBRXRCLE9BQU8saUJBQWlCLENBQUMsTUFBTSxFQUFFLElBQUksRUFBRSxNQUFNLENBQUMsYUFBYSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMzRSxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Ciphertext, EncryptionScheme, Plaintext, SupportedFheType, SupportedFheTypeName, bigintToPlaintext, bytes32ToPlaintext, bytesToPlaintext, encryptionSchemes, getEncryptionSchemeName, plaintextToBigint, plaintextToBytes, plaintextToBytes32, supportedFheTypes, type EncryptionSchemes, } from './encryption.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export { Ciphertext, EncryptionScheme, Plaintext, SupportedFheType, SupportedFheTypeName, bigintToPlaintext, bytes32ToPlaintext, bytesToPlaintext, encryptionSchemes, getEncryptionSchemeName, plaintextToBigint, plaintextToBytes, plaintextToBytes32, supportedFheTypes, } from './encryption.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZW5jcnlwdGlvbi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsVUFBVSxFQUNWLGdCQUFnQixFQUNoQixTQUFTLEVBQ1QsZ0JBQWdCLEVBQ2hCLG9CQUFvQixFQUNwQixpQkFBaUIsRUFDakIsa0JBQWtCLEVBQ2xCLGdCQUFnQixFQUNoQixpQkFBaUIsRUFDakIsdUJBQXVCLEVBQ3ZCLGlCQUFpQixFQUNqQixnQkFBZ0IsRUFDaEIsa0JBQWtCLEVBQ2xCLGlCQUFpQixHQUVsQixNQUFNLGlCQUFpQixDQUFDIn0=
|