@zhoujun_aptos/octopus-ts-sdk-min 0.22.4 → 0.22.6
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/dist/common/index.d.ts +966 -0
- package/dist/common/index.js +4491 -0
- package/dist/common/index.js.map +1 -0
- package/dist/esm/index.d.mts +966 -0
- package/dist/esm/index.mjs +4449 -0
- package/dist/esm/index.mjs.map +1 -0
- package/package.json +22 -8
- package/dist/elgamal.d.ts +0 -31
- package/dist/elgamal.d.ts.map +0 -1
- package/dist/elgamal.js +0 -96
- package/dist/elgamal.js.map +0 -1
- package/dist/enc/index.d.ts +0 -42
- package/dist/enc/index.d.ts.map +0 -1
- package/dist/enc/index.js +0 -211
- package/dist/enc/index.js.map +0 -1
- package/dist/enc/simple_elgamal_ristretto255.d.ts +0 -28
- package/dist/enc/simple_elgamal_ristretto255.d.ts.map +0 -1
- package/dist/enc/simple_elgamal_ristretto255.js +0 -173
- package/dist/enc/simple_elgamal_ristretto255.js.map +0 -1
- package/dist/group.d.ts +0 -39
- package/dist/group.d.ts.map +0 -1
- package/dist/group.js +0 -165
- package/dist/group.js.map +0 -1
- package/dist/ibe/index.d.ts +0 -54
- package/dist/ibe/index.d.ts.map +0 -1
- package/dist/ibe/index.js +0 -280
- package/dist/ibe/index.js.map +0 -1
- package/dist/ibe/otp_hmac_boneh_franklin_bls12381_short_pk.d.ts +0 -38
- package/dist/ibe/otp_hmac_boneh_franklin_bls12381_short_pk.d.ts.map +0 -1
- package/dist/ibe/otp_hmac_boneh_franklin_bls12381_short_pk.js +0 -155
- package/dist/ibe/otp_hmac_boneh_franklin_bls12381_short_pk.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -50
- package/dist/index.js.map +0 -1
- package/dist/shamir_gf256.d.ts +0 -61
- package/dist/shamir_gf256.d.ts.map +0 -1
- package/dist/shamir_gf256.js +0 -295
- package/dist/shamir_gf256.js.map +0 -1
- package/dist/sig/index.d.ts +0 -42
- package/dist/sig/index.d.ts.map +0 -1
- package/dist/sig/index.js +0 -212
- package/dist/sig/index.js.map +0 -1
- package/dist/sig/schnorr_ristretto255.d.ts +0 -29
- package/dist/sig/schnorr_ristretto255.d.ts.map +0 -1
- package/dist/sig/schnorr_ristretto255.js +0 -142
- package/dist/sig/schnorr_ristretto255.js.map +0 -1
- package/dist/silent_setup_encryption.d.ts +0 -93
- package/dist/silent_setup_encryption.d.ts.map +0 -1
- package/dist/silent_setup_encryption.js +0 -342
- package/dist/silent_setup_encryption.js.map +0 -1
- package/dist/silent_setup_encryption_xchain/aptos.d.ts +0 -40
- package/dist/silent_setup_encryption_xchain/aptos.d.ts.map +0 -1
- package/dist/silent_setup_encryption_xchain/aptos.js +0 -125
- package/dist/silent_setup_encryption_xchain/aptos.js.map +0 -1
- package/dist/silent_setup_encryption_xchain/index.d.ts +0 -116
- package/dist/silent_setup_encryption_xchain/index.d.ts.map +0 -1
- package/dist/silent_setup_encryption_xchain/index.js +0 -471
- package/dist/silent_setup_encryption_xchain/index.js.map +0 -1
- package/dist/silent_setup_encryption_xchain/solana.d.ts +0 -42
- package/dist/silent_setup_encryption_xchain/solana.d.ts.map +0 -1
- package/dist/silent_setup_encryption_xchain/solana.js +0 -145
- package/dist/silent_setup_encryption_xchain/solana.js.map +0 -1
- package/dist/sym/aes256gcm.d.ts +0 -27
- package/dist/sym/aes256gcm.d.ts.map +0 -1
- package/dist/sym/aes256gcm.js +0 -107
- package/dist/sym/aes256gcm.js.map +0 -1
- package/dist/sym/index.d.ts +0 -27
- package/dist/sym/index.d.ts.map +0 -1
- package/dist/sym/index.js +0 -154
- package/dist/sym/index.js.map +0 -1
- package/dist/threshold-ibe/aptos.d.ts +0 -42
- package/dist/threshold-ibe/aptos.d.ts.map +0 -1
- package/dist/threshold-ibe/aptos.js +0 -324
- package/dist/threshold-ibe/aptos.js.map +0 -1
- package/dist/threshold-ibe/index.d.ts +0 -147
- package/dist/threshold-ibe/index.d.ts.map +0 -1
- package/dist/threshold-ibe/index.js +0 -453
- package/dist/threshold-ibe/index.js.map +0 -1
- package/dist/threshold-ibe/solana.d.ts +0 -38
- package/dist/threshold-ibe/solana.d.ts.map +0 -1
- package/dist/threshold-ibe/solana.js +0 -197
- package/dist/threshold-ibe/solana.js.map +0 -1
- package/dist/utils.d.ts +0 -12
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -130
- package/dist/utils.js.map +0 -1
- package/dist/worker_config.d.ts +0 -30
- package/dist/worker_config.d.ts.map +0 -1
- package/dist/worker_config.js +0 -142
- package/dist/worker_config.js.map +0 -1
- package/dist/worker_task.d.ts +0 -29
- package/dist/worker_task.d.ts.map +0 -1
- package/dist/worker_task.js +0 -178
- package/dist/worker_task.js.map +0 -1
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
import * as AptosSDK from '@aptos-labs/ts-sdk';
|
|
2
|
+
import { Deserializer, Serializer, Aptos, AccountAddress, Ed25519PublicKey, Ed25519Signature, AccountPublicKey, Signature as Signature$1, PublicKey as PublicKey$1, AptosConfig } from '@aptos-labs/ts-sdk';
|
|
3
|
+
import * as SolanaSDK from '@solana/web3.js';
|
|
4
|
+
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
5
|
+
|
|
6
|
+
declare class Element {
|
|
7
|
+
bytes: Uint8Array;
|
|
8
|
+
constructor(bytes: Uint8Array);
|
|
9
|
+
static dummy(): Element;
|
|
10
|
+
static fromInner(inner: any): Element;
|
|
11
|
+
static groupIdentity(): Element;
|
|
12
|
+
static rand(): Element;
|
|
13
|
+
static deserialize(deserializer: Deserializer): Element;
|
|
14
|
+
static fromBytes(bytes: Uint8Array): Element;
|
|
15
|
+
serialize(serializer: Serializer): void;
|
|
16
|
+
toBytes(): Uint8Array;
|
|
17
|
+
toHex(): string;
|
|
18
|
+
asInner(): any;
|
|
19
|
+
add(other: Element): Element;
|
|
20
|
+
sub(other: Element): Element;
|
|
21
|
+
scale(scalar: Scalar): Element;
|
|
22
|
+
}
|
|
23
|
+
declare class Scalar {
|
|
24
|
+
bytes: Uint8Array;
|
|
25
|
+
constructor(bytes: Uint8Array);
|
|
26
|
+
static dummy(): Scalar;
|
|
27
|
+
static fromU64(x: bigint): Scalar;
|
|
28
|
+
static fromLittleEndianBytesModQ(bytes: Uint8Array): Scalar;
|
|
29
|
+
static rand(): Scalar;
|
|
30
|
+
static deserialize(deserializer: Deserializer): Scalar;
|
|
31
|
+
static fromBytes(bytes: Uint8Array): Scalar;
|
|
32
|
+
serialize(serializer: Serializer): void;
|
|
33
|
+
toBytes(): Uint8Array;
|
|
34
|
+
toHex(): string;
|
|
35
|
+
isZero(): boolean;
|
|
36
|
+
add(other: Scalar): Scalar;
|
|
37
|
+
sub(other: Scalar): Scalar;
|
|
38
|
+
mul(other: Scalar): Scalar;
|
|
39
|
+
neg(): Scalar;
|
|
40
|
+
}
|
|
41
|
+
declare function msm(bases: Element[], scalars: Scalar[]): Element;
|
|
42
|
+
declare function scalarFrom512BitHash(hash: Uint8Array): Scalar;
|
|
43
|
+
|
|
44
|
+
type group_Element = Element;
|
|
45
|
+
declare const group_Element: typeof Element;
|
|
46
|
+
type group_Scalar = Scalar;
|
|
47
|
+
declare const group_Scalar: typeof Scalar;
|
|
48
|
+
declare const group_msm: typeof msm;
|
|
49
|
+
declare const group_scalarFrom512BitHash: typeof scalarFrom512BitHash;
|
|
50
|
+
declare namespace group {
|
|
51
|
+
export { group_Element as Element, group_Scalar as Scalar, group_msm as msm, group_scalarFrom512BitHash as scalarFrom512BitHash };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class Ciphertext$6 {
|
|
55
|
+
c0: Element;
|
|
56
|
+
c1: Element;
|
|
57
|
+
constructor(c0: Element, c1: Element);
|
|
58
|
+
static deserialize(deserializer: Deserializer): Ciphertext$6;
|
|
59
|
+
encode(serializer: Serializer): void;
|
|
60
|
+
toBytes(): Uint8Array;
|
|
61
|
+
add(other: Ciphertext$6): Ciphertext$6;
|
|
62
|
+
scale(scalar: Scalar): Ciphertext$6;
|
|
63
|
+
}
|
|
64
|
+
declare class DecKey {
|
|
65
|
+
encBase: Element;
|
|
66
|
+
privateScalar: Scalar;
|
|
67
|
+
constructor(encBase: Element, privateScalar: Scalar);
|
|
68
|
+
static deserialize(deserializer: Deserializer): DecKey;
|
|
69
|
+
encode(serializer: Serializer): void;
|
|
70
|
+
}
|
|
71
|
+
declare class EncKey {
|
|
72
|
+
encBase: Element;
|
|
73
|
+
publicPoint: Element;
|
|
74
|
+
constructor(encBase: Element, publicPoint: Element);
|
|
75
|
+
static decode(deserializer: Deserializer): EncKey;
|
|
76
|
+
encode(serializer: Serializer): void;
|
|
77
|
+
toBytes(): Uint8Array;
|
|
78
|
+
}
|
|
79
|
+
declare function enc(ek: EncKey, randomizer: Scalar, ptxt: Element): Ciphertext$6;
|
|
80
|
+
declare function dec(dk: DecKey, ciph: Ciphertext$6): Element;
|
|
81
|
+
declare function multiExp(ciphs: Ciphertext$6[], scalars: Scalar[]): Ciphertext$6;
|
|
82
|
+
|
|
83
|
+
type elgamal_DecKey = DecKey;
|
|
84
|
+
declare const elgamal_DecKey: typeof DecKey;
|
|
85
|
+
type elgamal_EncKey = EncKey;
|
|
86
|
+
declare const elgamal_EncKey: typeof EncKey;
|
|
87
|
+
declare const elgamal_dec: typeof dec;
|
|
88
|
+
declare const elgamal_enc: typeof enc;
|
|
89
|
+
declare const elgamal_multiExp: typeof multiExp;
|
|
90
|
+
declare namespace elgamal {
|
|
91
|
+
export { Ciphertext$6 as Ciphertext, elgamal_DecKey as DecKey, elgamal_EncKey as EncKey, elgamal_dec as dec, elgamal_enc as enc, elgamal_multiExp as multiExp };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare class SimpleElGamalRistretto255EncKey {
|
|
95
|
+
elgamalEk: EncKey;
|
|
96
|
+
constructor(elgamalEk: EncKey);
|
|
97
|
+
static deserialize(deserializer: Deserializer): SimpleElGamalRistretto255EncKey;
|
|
98
|
+
serialize(serializer: Serializer): void;
|
|
99
|
+
}
|
|
100
|
+
declare class SimpleElGamalRistretto255DecKey {
|
|
101
|
+
elgamalDk: DecKey;
|
|
102
|
+
constructor(elgamalDk: DecKey);
|
|
103
|
+
static deserialize(deserializer: Deserializer): SimpleElGamalRistretto255DecKey;
|
|
104
|
+
serialize(serializer: Serializer): void;
|
|
105
|
+
}
|
|
106
|
+
declare class SimpleElGamalRistretto255Ciphertext {
|
|
107
|
+
elgamalCiph: Ciphertext$6;
|
|
108
|
+
symmetricCiph: Uint8Array;
|
|
109
|
+
mac: Uint8Array;
|
|
110
|
+
constructor(elgamalCiph: Ciphertext$6, symmetricCiph: Uint8Array, mac: Uint8Array);
|
|
111
|
+
static deserialize(deserializer: Deserializer): SimpleElGamalRistretto255Ciphertext;
|
|
112
|
+
serialize(serializer: Serializer): void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare const SCHEME_SIMPLE_ELGAMAL_RISTRETTO255 = 0;
|
|
116
|
+
declare class EncryptionKey$1 {
|
|
117
|
+
scheme: number;
|
|
118
|
+
inner: SimpleElGamalRistretto255EncKey;
|
|
119
|
+
constructor(scheme: number, inner: SimpleElGamalRistretto255EncKey);
|
|
120
|
+
static deserialize(deserializer: Deserializer): EncryptionKey$1;
|
|
121
|
+
static fromBytes(bytes: Uint8Array): EncryptionKey$1;
|
|
122
|
+
static fromHex(hex: string): EncryptionKey$1;
|
|
123
|
+
serialize(serializer: Serializer): void;
|
|
124
|
+
toBytes(): Uint8Array;
|
|
125
|
+
toHex(): string;
|
|
126
|
+
}
|
|
127
|
+
declare class DecryptionKey$1 {
|
|
128
|
+
scheme: number;
|
|
129
|
+
inner: SimpleElGamalRistretto255DecKey;
|
|
130
|
+
constructor(scheme: number, inner: SimpleElGamalRistretto255DecKey);
|
|
131
|
+
static deserialize(deserializer: Deserializer): DecryptionKey$1;
|
|
132
|
+
static fromBytes(bytes: Uint8Array): DecryptionKey$1;
|
|
133
|
+
static fromHex(hex: string): DecryptionKey$1;
|
|
134
|
+
serialize(serializer: Serializer): void;
|
|
135
|
+
toBytes(): Uint8Array;
|
|
136
|
+
toHex(): string;
|
|
137
|
+
}
|
|
138
|
+
declare class Ciphertext$5 {
|
|
139
|
+
scheme: number;
|
|
140
|
+
inner: SimpleElGamalRistretto255Ciphertext;
|
|
141
|
+
constructor(scheme: number, inner: SimpleElGamalRistretto255Ciphertext);
|
|
142
|
+
static deserialize(deserializer: Deserializer): Ciphertext$5;
|
|
143
|
+
static fromBytes(bytes: Uint8Array): Ciphertext$5;
|
|
144
|
+
static fromHex(hex: string): Ciphertext$5;
|
|
145
|
+
serialize(serializer: Serializer): void;
|
|
146
|
+
toBytes(): Uint8Array;
|
|
147
|
+
toHex(): string;
|
|
148
|
+
}
|
|
149
|
+
declare function keygen$3(schemeId?: number): DecryptionKey$1;
|
|
150
|
+
declare function deriveEncryptionKey(dk: DecryptionKey$1): EncryptionKey$1;
|
|
151
|
+
declare function encrypt$3(ek: EncryptionKey$1, msg: Uint8Array): Ciphertext$5;
|
|
152
|
+
declare function encryptWithRandomness$2(ek: EncryptionKey$1, msg: Uint8Array, randomness: Uint8Array): Ciphertext$5;
|
|
153
|
+
declare function decrypt$3(dk: DecryptionKey$1, ciphertext: Ciphertext$5): Uint8Array | undefined;
|
|
154
|
+
|
|
155
|
+
declare const index$5_SCHEME_SIMPLE_ELGAMAL_RISTRETTO255: typeof SCHEME_SIMPLE_ELGAMAL_RISTRETTO255;
|
|
156
|
+
declare const index$5_deriveEncryptionKey: typeof deriveEncryptionKey;
|
|
157
|
+
declare namespace index$5 {
|
|
158
|
+
export { Ciphertext$5 as Ciphertext, DecryptionKey$1 as DecryptionKey, EncryptionKey$1 as EncryptionKey, index$5_SCHEME_SIMPLE_ELGAMAL_RISTRETTO255 as SCHEME_SIMPLE_ELGAMAL_RISTRETTO255, decrypt$3 as decrypt, index$5_deriveEncryptionKey as deriveEncryptionKey, encrypt$3 as encrypt, encryptWithRandomness$2 as encryptWithRandomness, keygen$3 as keygen };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare const SCHEME_OTP_HAMC_BONEH_FRANKLIN_BLS12381_SHORT_PK = 0;
|
|
162
|
+
declare class MasterPublicKey {
|
|
163
|
+
scheme: number;
|
|
164
|
+
inner: any;
|
|
165
|
+
constructor(scheme: number, inner: any);
|
|
166
|
+
static deserialize(deserializer: Deserializer): MasterPublicKey;
|
|
167
|
+
static fromBytes(bytes: Uint8Array): MasterPublicKey;
|
|
168
|
+
static fromHex(hex: string): MasterPublicKey;
|
|
169
|
+
serialize(serializer: Serializer): void;
|
|
170
|
+
toBytes(): Uint8Array;
|
|
171
|
+
toHex(): string;
|
|
172
|
+
}
|
|
173
|
+
declare class MasterPrivateKey {
|
|
174
|
+
scheme: number;
|
|
175
|
+
inner: any;
|
|
176
|
+
constructor(scheme: number, inner: any);
|
|
177
|
+
static deserialize(deserializer: Deserializer): MasterPrivateKey;
|
|
178
|
+
static fromBytes(bytes: Uint8Array): MasterPrivateKey;
|
|
179
|
+
static fromHex(hex: string): MasterPrivateKey;
|
|
180
|
+
serialize(serializer: Serializer): void;
|
|
181
|
+
toBytes(): Uint8Array;
|
|
182
|
+
toHex(): string;
|
|
183
|
+
}
|
|
184
|
+
declare class IdentityPrivateKey {
|
|
185
|
+
scheme: number;
|
|
186
|
+
inner: any;
|
|
187
|
+
constructor(scheme: number, inner: any);
|
|
188
|
+
static deserialize(deserializer: Deserializer): IdentityPrivateKey;
|
|
189
|
+
static fromBytes(bytes: Uint8Array): IdentityPrivateKey;
|
|
190
|
+
static fromHex(hex: string): IdentityPrivateKey;
|
|
191
|
+
serialize(serializer: Serializer): void;
|
|
192
|
+
toBytes(): Uint8Array;
|
|
193
|
+
toHex(): string;
|
|
194
|
+
}
|
|
195
|
+
declare class Ciphertext$4 {
|
|
196
|
+
scheme: number;
|
|
197
|
+
inner: any;
|
|
198
|
+
constructor(scheme: number, inner: any);
|
|
199
|
+
static deserialize(deserializer: Deserializer): Ciphertext$4;
|
|
200
|
+
static fromBytes(bytes: Uint8Array): Ciphertext$4;
|
|
201
|
+
static fromHex(hex: string): Ciphertext$4;
|
|
202
|
+
serialize(serializer: Serializer): void;
|
|
203
|
+
toBytes(): Uint8Array;
|
|
204
|
+
toHex(): string;
|
|
205
|
+
}
|
|
206
|
+
declare function keygen$2(scheme?: number): MasterPrivateKey;
|
|
207
|
+
declare function derivePublicKey(privateKey: MasterPrivateKey): MasterPublicKey;
|
|
208
|
+
declare function encrypt$2(publicKey: MasterPublicKey, id: Uint8Array, plaintext: Uint8Array): Ciphertext$4;
|
|
209
|
+
/** Do NOT use this, unless you are a maintainer. Use `encrypt` instead. */
|
|
210
|
+
declare function encryptWithRandomness$1(publicKey: MasterPublicKey, id: Uint8Array, plaintext: Uint8Array, randomness: Uint8Array): Ciphertext$4;
|
|
211
|
+
declare function extract(privateKey: MasterPrivateKey, id: Uint8Array): IdentityPrivateKey;
|
|
212
|
+
declare function decrypt$2(identityKey: IdentityPrivateKey, ciphertext: Ciphertext$4): Uint8Array | undefined;
|
|
213
|
+
|
|
214
|
+
type index$4_IdentityPrivateKey = IdentityPrivateKey;
|
|
215
|
+
declare const index$4_IdentityPrivateKey: typeof IdentityPrivateKey;
|
|
216
|
+
type index$4_MasterPrivateKey = MasterPrivateKey;
|
|
217
|
+
declare const index$4_MasterPrivateKey: typeof MasterPrivateKey;
|
|
218
|
+
type index$4_MasterPublicKey = MasterPublicKey;
|
|
219
|
+
declare const index$4_MasterPublicKey: typeof MasterPublicKey;
|
|
220
|
+
declare const index$4_SCHEME_OTP_HAMC_BONEH_FRANKLIN_BLS12381_SHORT_PK: typeof SCHEME_OTP_HAMC_BONEH_FRANKLIN_BLS12381_SHORT_PK;
|
|
221
|
+
declare const index$4_derivePublicKey: typeof derivePublicKey;
|
|
222
|
+
declare const index$4_extract: typeof extract;
|
|
223
|
+
declare namespace index$4 {
|
|
224
|
+
export { Ciphertext$4 as Ciphertext, index$4_IdentityPrivateKey as IdentityPrivateKey, index$4_MasterPrivateKey as MasterPrivateKey, index$4_MasterPublicKey as MasterPublicKey, index$4_SCHEME_OTP_HAMC_BONEH_FRANKLIN_BLS12381_SHORT_PK as SCHEME_OTP_HAMC_BONEH_FRANKLIN_BLS12381_SHORT_PK, decrypt$2 as decrypt, index$4_derivePublicKey as derivePublicKey, encrypt$2 as encrypt, encryptWithRandomness$1 as encryptWithRandomness, index$4_extract as extract, keygen$2 as keygen };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare class SchnorrRistretto255SigningKey {
|
|
228
|
+
base: Element;
|
|
229
|
+
privateScalar: Scalar;
|
|
230
|
+
constructor(base: Element, privateScalar: Scalar);
|
|
231
|
+
static deserialize(deserializer: Deserializer): SchnorrRistretto255SigningKey;
|
|
232
|
+
serialize(serializer: Serializer): void;
|
|
233
|
+
}
|
|
234
|
+
declare class SchnorrRistretto255VerifyingKey {
|
|
235
|
+
base: Element;
|
|
236
|
+
publicPoint: Element;
|
|
237
|
+
constructor(base: Element, publicPoint: Element);
|
|
238
|
+
static deserialize(deserializer: Deserializer): SchnorrRistretto255VerifyingKey;
|
|
239
|
+
serialize(serializer: Serializer): void;
|
|
240
|
+
}
|
|
241
|
+
declare class SchnorrRistretto255Signature {
|
|
242
|
+
challenge: Scalar;
|
|
243
|
+
z: Scalar;
|
|
244
|
+
constructor(challenge: Scalar, z: Scalar);
|
|
245
|
+
static deserialize(deserializer: Deserializer): SchnorrRistretto255Signature;
|
|
246
|
+
serialize(serializer: Serializer): void;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
declare const SCHEME_SCHNORR_RISTRETTO255 = 0;
|
|
250
|
+
declare class SigningKey {
|
|
251
|
+
scheme: number;
|
|
252
|
+
inner: SchnorrRistretto255SigningKey;
|
|
253
|
+
constructor(scheme: number, inner: SchnorrRistretto255SigningKey);
|
|
254
|
+
static deserialize(deserializer: Deserializer): SigningKey;
|
|
255
|
+
static fromBytes(bytes: Uint8Array): SigningKey;
|
|
256
|
+
static fromHex(hex: string): SigningKey;
|
|
257
|
+
serialize(serializer: Serializer): void;
|
|
258
|
+
toBytes(): Uint8Array;
|
|
259
|
+
toHex(): string;
|
|
260
|
+
}
|
|
261
|
+
declare class VerifyingKey {
|
|
262
|
+
scheme: number;
|
|
263
|
+
inner: SchnorrRistretto255VerifyingKey;
|
|
264
|
+
constructor(scheme: number, inner: SchnorrRistretto255VerifyingKey);
|
|
265
|
+
static deserialize(deserializer: Deserializer): VerifyingKey;
|
|
266
|
+
static fromBytes(bytes: Uint8Array): VerifyingKey;
|
|
267
|
+
static fromHex(hex: string): VerifyingKey;
|
|
268
|
+
serialize(serializer: Serializer): void;
|
|
269
|
+
toBytes(): Uint8Array;
|
|
270
|
+
toHex(): string;
|
|
271
|
+
}
|
|
272
|
+
declare class Signature {
|
|
273
|
+
scheme: number;
|
|
274
|
+
inner: SchnorrRistretto255Signature;
|
|
275
|
+
constructor(scheme: number, inner: SchnorrRistretto255Signature);
|
|
276
|
+
static deserialize(deserializer: Deserializer): Signature;
|
|
277
|
+
static fromBytes(bytes: Uint8Array): Signature;
|
|
278
|
+
static fromHex(hex: string): Signature;
|
|
279
|
+
serialize(serializer: Serializer): void;
|
|
280
|
+
toBytes(): Uint8Array;
|
|
281
|
+
toHex(): string;
|
|
282
|
+
}
|
|
283
|
+
declare function keygen$1(schemeId?: number): SigningKey;
|
|
284
|
+
declare function deriveVerifyingKey(sk: SigningKey): VerifyingKey;
|
|
285
|
+
declare function sign(sk: SigningKey, msg: Uint8Array): Signature;
|
|
286
|
+
declare function signWithRandomness(sk: SigningKey, msg: Uint8Array, randomness: Uint8Array): Signature;
|
|
287
|
+
declare function verify(vk: VerifyingKey, msg: Uint8Array, sig: Signature): boolean;
|
|
288
|
+
|
|
289
|
+
declare const index$3_SCHEME_SCHNORR_RISTRETTO255: typeof SCHEME_SCHNORR_RISTRETTO255;
|
|
290
|
+
type index$3_Signature = Signature;
|
|
291
|
+
declare const index$3_Signature: typeof Signature;
|
|
292
|
+
type index$3_SigningKey = SigningKey;
|
|
293
|
+
declare const index$3_SigningKey: typeof SigningKey;
|
|
294
|
+
type index$3_VerifyingKey = VerifyingKey;
|
|
295
|
+
declare const index$3_VerifyingKey: typeof VerifyingKey;
|
|
296
|
+
declare const index$3_deriveVerifyingKey: typeof deriveVerifyingKey;
|
|
297
|
+
declare const index$3_sign: typeof sign;
|
|
298
|
+
declare const index$3_signWithRandomness: typeof signWithRandomness;
|
|
299
|
+
declare const index$3_verify: typeof verify;
|
|
300
|
+
declare namespace index$3 {
|
|
301
|
+
export { index$3_SCHEME_SCHNORR_RISTRETTO255 as SCHEME_SCHNORR_RISTRETTO255, index$3_Signature as Signature, index$3_SigningKey as SigningKey, index$3_VerifyingKey as VerifyingKey, index$3_deriveVerifyingKey as deriveVerifyingKey, keygen$1 as keygen, index$3_sign as sign, index$3_signWithRandomness as signWithRandomness, index$3_verify as verify };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare class Key {
|
|
305
|
+
scheme: number;
|
|
306
|
+
inner: any;
|
|
307
|
+
constructor(scheme: number, inner: any);
|
|
308
|
+
static deserialize(deserializer: Deserializer): Key;
|
|
309
|
+
static fromBytes(bytes: Uint8Array): Key;
|
|
310
|
+
serialize(serializer: Serializer): void;
|
|
311
|
+
toBytes(): Uint8Array;
|
|
312
|
+
toHex(): string;
|
|
313
|
+
}
|
|
314
|
+
declare class Ciphertext$3 {
|
|
315
|
+
scheme: number;
|
|
316
|
+
inner: any;
|
|
317
|
+
constructor(scheme: number, inner: any);
|
|
318
|
+
static dummy(): Ciphertext$3;
|
|
319
|
+
static deserialize(deserializer: Deserializer): Ciphertext$3;
|
|
320
|
+
static fromBytes(bytes: Uint8Array): Ciphertext$3;
|
|
321
|
+
serialize(serializer: Serializer): void;
|
|
322
|
+
toBytes(): Uint8Array;
|
|
323
|
+
toHex(): string;
|
|
324
|
+
}
|
|
325
|
+
declare function keygen(scheme?: number): Key;
|
|
326
|
+
declare function encrypt$1(key: Key, plaintext: Uint8Array): Ciphertext$3;
|
|
327
|
+
declare function encryptWithRandomness(key: Key, plaintext: Uint8Array, randomness: Uint8Array): Ciphertext$3;
|
|
328
|
+
declare function decrypt$1(key: Key, ciphertext: Ciphertext$3): Uint8Array | undefined;
|
|
329
|
+
|
|
330
|
+
type index$2_Key = Key;
|
|
331
|
+
declare const index$2_Key: typeof Key;
|
|
332
|
+
declare const index$2_encryptWithRandomness: typeof encryptWithRandomness;
|
|
333
|
+
declare const index$2_keygen: typeof keygen;
|
|
334
|
+
declare namespace index$2 {
|
|
335
|
+
export { Ciphertext$3 as Ciphertext, index$2_Key as Key, decrypt$1 as decrypt, encrypt$1 as encrypt, index$2_encryptWithRandomness as encryptWithRandomness, index$2_keygen as keygen };
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare class WorkerConfig {
|
|
339
|
+
expiryTimeMicrosecs: number;
|
|
340
|
+
endpoint: string;
|
|
341
|
+
encEk: EncryptionKey$1;
|
|
342
|
+
sigVk: VerifyingKey;
|
|
343
|
+
ibeMpk: MasterPublicKey;
|
|
344
|
+
constructor(expiryTimeMicrosecs: number, endpoint: string, encEk: EncryptionKey$1, sigVk: VerifyingKey, ibeMpk: MasterPublicKey);
|
|
345
|
+
static dummy(): WorkerConfig;
|
|
346
|
+
static deserialize(deserializer: Deserializer): WorkerConfig;
|
|
347
|
+
static fromBytes(bytes: Uint8Array): WorkerConfig;
|
|
348
|
+
static fromHex(hex: string): WorkerConfig;
|
|
349
|
+
serialize(serializer: Serializer): void;
|
|
350
|
+
toBytes(): Uint8Array;
|
|
351
|
+
toHex(): string;
|
|
352
|
+
toPrettyJson(): string;
|
|
353
|
+
}
|
|
354
|
+
declare function view(aptos: Aptos, worker: AccountAddress): Promise<WorkerConfig>;
|
|
355
|
+
declare function get(workerEndpoint: string): Promise<WorkerConfig>;
|
|
356
|
+
declare function randWorker(): {
|
|
357
|
+
addr: AccountAddress;
|
|
358
|
+
config: WorkerConfig;
|
|
359
|
+
encDk: DecryptionKey$1;
|
|
360
|
+
sigSk: SigningKey;
|
|
361
|
+
ibeMsk: MasterPrivateKey;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
type worker_config_WorkerConfig = WorkerConfig;
|
|
365
|
+
declare const worker_config_WorkerConfig: typeof WorkerConfig;
|
|
366
|
+
declare const worker_config_get: typeof get;
|
|
367
|
+
declare const worker_config_randWorker: typeof randWorker;
|
|
368
|
+
declare const worker_config_view: typeof view;
|
|
369
|
+
declare namespace worker_config {
|
|
370
|
+
export { worker_config_WorkerConfig as WorkerConfig, worker_config_get as get, worker_config_randWorker as randWorker, worker_config_view as view };
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* This file contains Aptos-specific implementations for silent setup encryption.
|
|
375
|
+
* For cross-chain support, use `silent_setup_encryption_xchain.ts` instead.
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
declare class EncryptionContext$1 {
|
|
379
|
+
workers: AccountAddress[];
|
|
380
|
+
threshold: number;
|
|
381
|
+
moduleAddr: AccountAddress;
|
|
382
|
+
moduleName: string;
|
|
383
|
+
constructor({ workers, threshold, moduleAddr, moduleName }: {
|
|
384
|
+
workers: AccountAddress[];
|
|
385
|
+
threshold: number;
|
|
386
|
+
moduleAddr: AccountAddress;
|
|
387
|
+
moduleName: string;
|
|
388
|
+
});
|
|
389
|
+
serialize(serializer: Serializer): void;
|
|
390
|
+
toBytes(): Uint8Array;
|
|
391
|
+
loadEncryptor(aptos: Aptos): Promise<Encryptor$1>;
|
|
392
|
+
}
|
|
393
|
+
declare class DecryptionContext$1 {
|
|
394
|
+
workers: AccountAddress[];
|
|
395
|
+
threshold: number;
|
|
396
|
+
moduleAddr: AccountAddress;
|
|
397
|
+
moduleName: string;
|
|
398
|
+
domain: Uint8Array;
|
|
399
|
+
constructor({ workers, threshold, moduleAddr, moduleName, domain }: {
|
|
400
|
+
workers: AccountAddress[];
|
|
401
|
+
threshold: number;
|
|
402
|
+
moduleAddr: AccountAddress;
|
|
403
|
+
moduleName: string;
|
|
404
|
+
domain: Uint8Array;
|
|
405
|
+
});
|
|
406
|
+
static dummy(): DecryptionContext$1;
|
|
407
|
+
static deserialize(deserializer: Deserializer): DecryptionContext$1;
|
|
408
|
+
serialize(serializer: Serializer): void;
|
|
409
|
+
toBytes(): Uint8Array;
|
|
410
|
+
toHex(): string;
|
|
411
|
+
toWalletSignMessage(): string;
|
|
412
|
+
loadDecryptor({ aptos, userAddr, publicKey, signature }: {
|
|
413
|
+
aptos: Aptos;
|
|
414
|
+
userAddr: AccountAddress;
|
|
415
|
+
publicKey: Ed25519PublicKey;
|
|
416
|
+
signature: Ed25519Signature;
|
|
417
|
+
}): Promise<Decryptor$1>;
|
|
418
|
+
}
|
|
419
|
+
declare class Ciphertext$2 {
|
|
420
|
+
decryptionContext: DecryptionContext$1;
|
|
421
|
+
aesCiph: Ciphertext$3;
|
|
422
|
+
ibeCiphs: Ciphertext$4[];
|
|
423
|
+
constructor(decryptionContext: DecryptionContext$1, aesCiph: Ciphertext$3, ibeCiphs: Ciphertext$4[]);
|
|
424
|
+
static dummy(): Ciphertext$2;
|
|
425
|
+
static deserialize(deserializer: Deserializer): Ciphertext$2;
|
|
426
|
+
static fromBytes(bytes: Uint8Array): Ciphertext$2;
|
|
427
|
+
static fromHex(hex: string): Ciphertext$2;
|
|
428
|
+
serialize(serializer: Serializer): void;
|
|
429
|
+
toBytes(): Uint8Array;
|
|
430
|
+
}
|
|
431
|
+
declare class Encryptor$1 {
|
|
432
|
+
domain: EncryptionContext$1;
|
|
433
|
+
workerConfigs: WorkerConfig[];
|
|
434
|
+
constructor(domain: EncryptionContext$1, workerConfigs: WorkerConfig[]);
|
|
435
|
+
encrypt({ domain, plaintext }: {
|
|
436
|
+
domain: Uint8Array;
|
|
437
|
+
plaintext: Uint8Array;
|
|
438
|
+
}): Ciphertext$2;
|
|
439
|
+
}
|
|
440
|
+
declare class Decryptor$1 {
|
|
441
|
+
ibeDecryptionKeys: (IdentityPrivateKey | null)[];
|
|
442
|
+
decryptionContext: DecryptionContext$1;
|
|
443
|
+
constructor(decryptionContext: DecryptionContext$1, ibeDecryptionKeys: (IdentityPrivateKey | null)[]);
|
|
444
|
+
decrypt(ciphertext: Ciphertext$2): Uint8Array | undefined;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* A message from a user to a MPC worker to request a decryption key.
|
|
448
|
+
*/
|
|
449
|
+
declare class RequestForDecryptionKey$1 {
|
|
450
|
+
decryptionContext: DecryptionContext$1;
|
|
451
|
+
userAddr: AccountAddress;
|
|
452
|
+
publicKey: Ed25519PublicKey;
|
|
453
|
+
signature: Ed25519Signature;
|
|
454
|
+
constructor(decryptionContext: DecryptionContext$1, userAddr: AccountAddress, publicKey: Ed25519PublicKey, signature: Ed25519Signature);
|
|
455
|
+
static deserialize(deserializer: Deserializer): RequestForDecryptionKey$1;
|
|
456
|
+
static fromBytes(bytes: Uint8Array): RequestForDecryptionKey$1;
|
|
457
|
+
static fromHex(hex: string): RequestForDecryptionKey$1;
|
|
458
|
+
serialize(serializer: Serializer): void;
|
|
459
|
+
toBytes(): Uint8Array;
|
|
460
|
+
toHex(): string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
declare namespace silent_setup_encryption {
|
|
464
|
+
export { Ciphertext$2 as Ciphertext, DecryptionContext$1 as DecryptionContext, Decryptor$1 as Decryptor, EncryptionContext$1 as EncryptionContext, Encryptor$1 as Encryptor, RequestForDecryptionKey$1 as RequestForDecryptionKey };
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare class ContractID$5 {
|
|
468
|
+
chainId: number;
|
|
469
|
+
moduleAddr: AccountAddress;
|
|
470
|
+
moduleName: string;
|
|
471
|
+
constructor(chainId: number, moduleAddr: AccountAddress, moduleName: string);
|
|
472
|
+
static dummy(): ContractID$5;
|
|
473
|
+
static deserialize(deserializer: Deserializer): ContractID$5;
|
|
474
|
+
static fromBytes(bytes: Uint8Array): ContractID$5;
|
|
475
|
+
static fromHex(hex: string): ContractID$5;
|
|
476
|
+
serialize(serializer: Serializer): void;
|
|
477
|
+
toBytes(): Uint8Array;
|
|
478
|
+
toHex(): string;
|
|
479
|
+
}
|
|
480
|
+
declare const POP_SCHEME__V0 = 0;
|
|
481
|
+
declare class ProofOfPermission$5 {
|
|
482
|
+
scheme: number;
|
|
483
|
+
inner: any;
|
|
484
|
+
private constructor();
|
|
485
|
+
static newV0(v0: ProofOfPermissionV0): ProofOfPermission$5;
|
|
486
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission$5;
|
|
487
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission$5;
|
|
488
|
+
static fromHex(hex: string): ProofOfPermission$5;
|
|
489
|
+
serialize(serializer: Serializer): void;
|
|
490
|
+
toBytes(): Uint8Array;
|
|
491
|
+
toHex(): string;
|
|
492
|
+
}
|
|
493
|
+
declare class ProofOfPermissionV0 {
|
|
494
|
+
userAddr: AccountAddress;
|
|
495
|
+
publicKey: Ed25519PublicKey;
|
|
496
|
+
signature: Ed25519Signature;
|
|
497
|
+
constructor(userAddr: AccountAddress, publicKey: Ed25519PublicKey, signature: Ed25519Signature);
|
|
498
|
+
static deserialize(deserializer: Deserializer): ProofOfPermissionV0;
|
|
499
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermissionV0;
|
|
500
|
+
static fromHex(hex: string): ProofOfPermissionV0;
|
|
501
|
+
serialize(serializer: Serializer): void;
|
|
502
|
+
toBytes(): Uint8Array;
|
|
503
|
+
toHex(): string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare const aptos_POP_SCHEME__V0: typeof POP_SCHEME__V0;
|
|
507
|
+
type aptos_ProofOfPermissionV0 = ProofOfPermissionV0;
|
|
508
|
+
declare const aptos_ProofOfPermissionV0: typeof ProofOfPermissionV0;
|
|
509
|
+
declare namespace aptos {
|
|
510
|
+
export { ContractID$5 as ContractID, aptos_POP_SCHEME__V0 as POP_SCHEME__V0, ProofOfPermission$5 as ProofOfPermission, aptos_ProofOfPermissionV0 as ProofOfPermissionV0 };
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
declare const SCHEME_V0 = 0;
|
|
514
|
+
declare class ContractID$4 {
|
|
515
|
+
scheme: number;
|
|
516
|
+
inner: any;
|
|
517
|
+
private constructor();
|
|
518
|
+
static newV0(v0: ContractIDV0): ContractID$4;
|
|
519
|
+
static deserialize(deserializer: Deserializer): ContractID$4;
|
|
520
|
+
static fromBytes(bytes: Uint8Array): ContractID$4;
|
|
521
|
+
static fromHex(hex: string): ContractID$4;
|
|
522
|
+
serialize(serializer: Serializer): void;
|
|
523
|
+
toBytes(): Uint8Array;
|
|
524
|
+
toHex(): string;
|
|
525
|
+
}
|
|
526
|
+
declare class ContractIDV0 {
|
|
527
|
+
knownChainName: string;
|
|
528
|
+
programId: PublicKey;
|
|
529
|
+
constructor(knownChainName: string, programId: PublicKey);
|
|
530
|
+
static deserialize(deserializer: Deserializer): ContractIDV0;
|
|
531
|
+
static fromBytes(bytes: Uint8Array): ContractIDV0;
|
|
532
|
+
static fromHex(hex: string): ContractIDV0;
|
|
533
|
+
serialize(serializer: Serializer): void;
|
|
534
|
+
toBytes(): Uint8Array;
|
|
535
|
+
toHex(): string;
|
|
536
|
+
}
|
|
537
|
+
declare const POP_SCHEME__UNVERSIONED_TXN = 0;
|
|
538
|
+
declare const POP_SCHEME__VERSIONED_TXN = 1;
|
|
539
|
+
declare class ProofOfPermission$4 {
|
|
540
|
+
scheme: number;
|
|
541
|
+
inner: Transaction | VersionedTransaction;
|
|
542
|
+
private constructor();
|
|
543
|
+
static newVersioned(txn: VersionedTransaction): ProofOfPermission$4;
|
|
544
|
+
static newUnversioned(txn: Transaction): ProofOfPermission$4;
|
|
545
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission$4;
|
|
546
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission$4;
|
|
547
|
+
static fromHex(hex: string): ProofOfPermission$4;
|
|
548
|
+
serialize(serializer: Serializer): void;
|
|
549
|
+
toBytes(): Uint8Array;
|
|
550
|
+
toHex(): string;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
type solana_ContractIDV0 = ContractIDV0;
|
|
554
|
+
declare const solana_ContractIDV0: typeof ContractIDV0;
|
|
555
|
+
declare const solana_POP_SCHEME__UNVERSIONED_TXN: typeof POP_SCHEME__UNVERSIONED_TXN;
|
|
556
|
+
declare const solana_POP_SCHEME__VERSIONED_TXN: typeof POP_SCHEME__VERSIONED_TXN;
|
|
557
|
+
declare const solana_SCHEME_V0: typeof SCHEME_V0;
|
|
558
|
+
declare namespace solana {
|
|
559
|
+
export { ContractID$4 as ContractID, solana_ContractIDV0 as ContractIDV0, solana_POP_SCHEME__UNVERSIONED_TXN as POP_SCHEME__UNVERSIONED_TXN, solana_POP_SCHEME__VERSIONED_TXN as POP_SCHEME__VERSIONED_TXN, ProofOfPermission$4 as ProofOfPermission, solana_SCHEME_V0 as SCHEME_V0 };
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare const SCHEME_APTOS = 0;
|
|
563
|
+
declare const SCHEME_SOLANA = 1;
|
|
564
|
+
declare class ContractID$3 {
|
|
565
|
+
scheme: number;
|
|
566
|
+
inner: any;
|
|
567
|
+
private constructor();
|
|
568
|
+
static newAptos(id: ContractID$5): ContractID$3;
|
|
569
|
+
static newSolana(id: ContractID$4): ContractID$3;
|
|
570
|
+
static dummy(): ContractID$3;
|
|
571
|
+
static deserialize(deserializer: Deserializer): ContractID$3;
|
|
572
|
+
static fromBytes(bytes: Uint8Array): ContractID$3;
|
|
573
|
+
static fromHex(hex: string): ContractID$3;
|
|
574
|
+
serialize(serializer: Serializer): void;
|
|
575
|
+
toBytes(): Uint8Array;
|
|
576
|
+
toHex(): string;
|
|
577
|
+
}
|
|
578
|
+
declare class ProofOfPermission$3 {
|
|
579
|
+
scheme: number;
|
|
580
|
+
inner: any;
|
|
581
|
+
private constructor();
|
|
582
|
+
static newAptos(id: ProofOfPermission$5): ProofOfPermission$3;
|
|
583
|
+
static newSolana(id: ProofOfPermission$4): ProofOfPermission$3;
|
|
584
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission$3;
|
|
585
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission$3;
|
|
586
|
+
static fromHex(hex: string): ProofOfPermission$3;
|
|
587
|
+
serialize(serializer: Serializer): void;
|
|
588
|
+
toBytes(): Uint8Array;
|
|
589
|
+
toHex(): string;
|
|
590
|
+
}
|
|
591
|
+
declare class EncryptionContext {
|
|
592
|
+
workers: string[];
|
|
593
|
+
threshold: number;
|
|
594
|
+
contractId: ContractID$3;
|
|
595
|
+
constructor({ workers, threshold, contractId }: {
|
|
596
|
+
workers: string[];
|
|
597
|
+
threshold: number;
|
|
598
|
+
contractId: ContractID$3;
|
|
599
|
+
});
|
|
600
|
+
static deserialize(deserializer: Deserializer): EncryptionContext;
|
|
601
|
+
static fromBytes(bytes: Uint8Array): EncryptionContext;
|
|
602
|
+
static fromHex(hex: string): EncryptionContext;
|
|
603
|
+
serialize(serializer: Serializer): void;
|
|
604
|
+
toBytes(): Uint8Array;
|
|
605
|
+
toHex(): string;
|
|
606
|
+
loadEncryptor(): Promise<Encryptor>;
|
|
607
|
+
}
|
|
608
|
+
declare class DecryptionContext {
|
|
609
|
+
workers: string[];
|
|
610
|
+
threshold: number;
|
|
611
|
+
contractId: ContractID$3;
|
|
612
|
+
domain: Uint8Array;
|
|
613
|
+
constructor({ workers, threshold, contractId, domain }: {
|
|
614
|
+
workers: string[];
|
|
615
|
+
threshold: number;
|
|
616
|
+
contractId: ContractID$3;
|
|
617
|
+
domain: Uint8Array;
|
|
618
|
+
});
|
|
619
|
+
static dummy(): DecryptionContext;
|
|
620
|
+
static deserialize(deserializer: Deserializer): DecryptionContext;
|
|
621
|
+
static fromBytes(bytes: Uint8Array): DecryptionContext;
|
|
622
|
+
static fromHex(hex: string): DecryptionContext;
|
|
623
|
+
serialize(serializer: Serializer): void;
|
|
624
|
+
toBytes(): Uint8Array;
|
|
625
|
+
toHex(): string;
|
|
626
|
+
loadDecryptor(proof: ProofOfPermission$3): Promise<Decryptor>;
|
|
627
|
+
}
|
|
628
|
+
declare class Ciphertext$1 {
|
|
629
|
+
decryptionContext: DecryptionContext;
|
|
630
|
+
aesCiph: Ciphertext$3;
|
|
631
|
+
ibeCiphs: Ciphertext$4[];
|
|
632
|
+
constructor(decryptionContext: DecryptionContext, aesCiph: Ciphertext$3, ibeCiphs: Ciphertext$4[]);
|
|
633
|
+
static dummy(): Ciphertext$1;
|
|
634
|
+
static deserialize(deserializer: Deserializer): Ciphertext$1;
|
|
635
|
+
static fromBytes(bytes: Uint8Array): Ciphertext$1;
|
|
636
|
+
static fromHex(hex: string): Ciphertext$1;
|
|
637
|
+
serialize(serializer: Serializer): void;
|
|
638
|
+
toBytes(): Uint8Array;
|
|
639
|
+
}
|
|
640
|
+
declare class Encryptor {
|
|
641
|
+
domain: EncryptionContext;
|
|
642
|
+
workerConfigs: WorkerConfig[];
|
|
643
|
+
constructor(domain: EncryptionContext, workerConfigs: WorkerConfig[]);
|
|
644
|
+
encrypt({ domain, plaintext }: {
|
|
645
|
+
domain: Uint8Array;
|
|
646
|
+
plaintext: Uint8Array;
|
|
647
|
+
}): Ciphertext$1;
|
|
648
|
+
}
|
|
649
|
+
declare class Decryptor {
|
|
650
|
+
ibeDecryptionKeys: (IdentityPrivateKey | null)[];
|
|
651
|
+
decryptionContext: DecryptionContext;
|
|
652
|
+
constructor(decryptionContext: DecryptionContext, ibeDecryptionKeys: (IdentityPrivateKey | null)[]);
|
|
653
|
+
decrypt(ciphertext: Ciphertext$1): Uint8Array | undefined;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* A message from a user to a MPC worker to request a decryption key.
|
|
657
|
+
*/
|
|
658
|
+
declare class RequestForDecryptionKey {
|
|
659
|
+
decryptionContext: DecryptionContext;
|
|
660
|
+
proofOfPermission: ProofOfPermission$3;
|
|
661
|
+
constructor(decryptionContext: DecryptionContext, proofOfPermission: ProofOfPermission$3);
|
|
662
|
+
static deserialize(deserializer: Deserializer): RequestForDecryptionKey;
|
|
663
|
+
static fromBytes(bytes: Uint8Array): RequestForDecryptionKey;
|
|
664
|
+
static fromHex(hex: string): RequestForDecryptionKey;
|
|
665
|
+
serialize(serializer: Serializer): void;
|
|
666
|
+
toBytes(): Uint8Array;
|
|
667
|
+
toHex(): string;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
type index$1_DecryptionContext = DecryptionContext;
|
|
671
|
+
declare const index$1_DecryptionContext: typeof DecryptionContext;
|
|
672
|
+
type index$1_Decryptor = Decryptor;
|
|
673
|
+
declare const index$1_Decryptor: typeof Decryptor;
|
|
674
|
+
type index$1_EncryptionContext = EncryptionContext;
|
|
675
|
+
declare const index$1_EncryptionContext: typeof EncryptionContext;
|
|
676
|
+
type index$1_Encryptor = Encryptor;
|
|
677
|
+
declare const index$1_Encryptor: typeof Encryptor;
|
|
678
|
+
type index$1_RequestForDecryptionKey = RequestForDecryptionKey;
|
|
679
|
+
declare const index$1_RequestForDecryptionKey: typeof RequestForDecryptionKey;
|
|
680
|
+
declare const index$1_SCHEME_APTOS: typeof SCHEME_APTOS;
|
|
681
|
+
declare const index$1_SCHEME_SOLANA: typeof SCHEME_SOLANA;
|
|
682
|
+
declare namespace index$1 {
|
|
683
|
+
export { aptos as Aptos, Ciphertext$1 as Ciphertext, ContractID$3 as ContractID, index$1_DecryptionContext as DecryptionContext, index$1_Decryptor as Decryptor, index$1_EncryptionContext as EncryptionContext, index$1_Encryptor as Encryptor, ProofOfPermission$3 as ProofOfPermission, index$1_RequestForDecryptionKey as RequestForDecryptionKey, index$1_SCHEME_APTOS as SCHEME_APTOS, index$1_SCHEME_SOLANA as SCHEME_SOLANA, solana as Solana };
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare class ContractID$2 {
|
|
687
|
+
chainId: number;
|
|
688
|
+
moduleAddr: AccountAddress;
|
|
689
|
+
moduleName: string;
|
|
690
|
+
functionName: string;
|
|
691
|
+
constructor(chainId: number, moduleAddr: AccountAddress, moduleName: string, functionName: string);
|
|
692
|
+
static dummy(): ContractID$2;
|
|
693
|
+
static deserialize(deserializer: Deserializer): ContractID$2;
|
|
694
|
+
static fromBytes(bytes: Uint8Array): ContractID$2;
|
|
695
|
+
static fromHex(hex: string): ContractID$2;
|
|
696
|
+
serialize(serializer: Serializer): void;
|
|
697
|
+
toBytes(): Uint8Array;
|
|
698
|
+
toHex(): string;
|
|
699
|
+
toPrettyMessage(indent?: number): string;
|
|
700
|
+
}
|
|
701
|
+
declare class ProofOfPermission$2 {
|
|
702
|
+
userAddr: AccountAddress;
|
|
703
|
+
publicKeyScheme: number;
|
|
704
|
+
publicKey: AccountPublicKey;
|
|
705
|
+
signatureScheme: number;
|
|
706
|
+
signature: Signature$1;
|
|
707
|
+
fullMessage: string;
|
|
708
|
+
constructor({ userAddr, publicKey, signature, fullMessage }: {
|
|
709
|
+
userAddr: AccountAddress;
|
|
710
|
+
publicKey: PublicKey$1;
|
|
711
|
+
signature: Signature$1;
|
|
712
|
+
fullMessage: string;
|
|
713
|
+
});
|
|
714
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission$2;
|
|
715
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission$2;
|
|
716
|
+
static fromHex(hex: string): ProofOfPermission$2;
|
|
717
|
+
serialize(serializer: Serializer): void;
|
|
718
|
+
toBytes(): Uint8Array;
|
|
719
|
+
toHex(): string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
declare class ContractID$1 {
|
|
723
|
+
knownChainName: string;
|
|
724
|
+
programId: PublicKey;
|
|
725
|
+
constructor({ knownChainName, programId }: {
|
|
726
|
+
knownChainName: string;
|
|
727
|
+
programId: PublicKey;
|
|
728
|
+
});
|
|
729
|
+
static deserialize(deserializer: Deserializer): ContractID$1;
|
|
730
|
+
static fromBytes(bytes: Uint8Array): ContractID$1;
|
|
731
|
+
static fromHex(hex: string): ContractID$1;
|
|
732
|
+
serialize(serializer: Serializer): void;
|
|
733
|
+
toBytes(): Uint8Array;
|
|
734
|
+
toHex(): string;
|
|
735
|
+
toPrettyMessage(indent?: number): string;
|
|
736
|
+
}
|
|
737
|
+
declare class ProofOfPermission$1 {
|
|
738
|
+
static readonly SCHEME_UNVERSIONED = 0;
|
|
739
|
+
static readonly SCHEME_VERSIONED = 1;
|
|
740
|
+
scheme: number;
|
|
741
|
+
inner: Transaction | VersionedTransaction;
|
|
742
|
+
private constructor();
|
|
743
|
+
static newVersioned(txn: VersionedTransaction): ProofOfPermission$1;
|
|
744
|
+
static newUnversioned(txn: Transaction): ProofOfPermission$1;
|
|
745
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission$1;
|
|
746
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission$1;
|
|
747
|
+
static fromHex(hex: string): ProofOfPermission$1;
|
|
748
|
+
serialize(serializer: Serializer): void;
|
|
749
|
+
toBytes(): Uint8Array;
|
|
750
|
+
toHex(): string;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* @module threshold-ibe
|
|
755
|
+
*
|
|
756
|
+
*
|
|
757
|
+
*/
|
|
758
|
+
|
|
759
|
+
declare class Committee {
|
|
760
|
+
workerEndpoints: string[];
|
|
761
|
+
threshold: number;
|
|
762
|
+
constructor({ workerEndpoints, threshold }: {
|
|
763
|
+
workerEndpoints: string[];
|
|
764
|
+
threshold: number;
|
|
765
|
+
});
|
|
766
|
+
static dummy(): Committee;
|
|
767
|
+
static deserialize(deserializer: Deserializer): Committee;
|
|
768
|
+
serialize(serializer: Serializer): void;
|
|
769
|
+
toPrettyMessage(indent?: number): string;
|
|
770
|
+
}
|
|
771
|
+
declare class ContractID {
|
|
772
|
+
static readonly SCHEME_APTOS = 0;
|
|
773
|
+
static readonly SCHEME_SOLANA = 1;
|
|
774
|
+
scheme: number;
|
|
775
|
+
inner: any;
|
|
776
|
+
private constructor();
|
|
777
|
+
static newAptos({ chainId, moduleAddr, moduleName, functionName }: {
|
|
778
|
+
chainId: number;
|
|
779
|
+
moduleAddr: AptosSDK.AccountAddress;
|
|
780
|
+
moduleName: string;
|
|
781
|
+
functionName: string;
|
|
782
|
+
}): ContractID;
|
|
783
|
+
static newSolana({ knownChainName, programId }: {
|
|
784
|
+
knownChainName: string;
|
|
785
|
+
programId: SolanaSDK.PublicKey;
|
|
786
|
+
}): ContractID;
|
|
787
|
+
static dummy(): ContractID;
|
|
788
|
+
static deserialize(deserializer: Deserializer): ContractID;
|
|
789
|
+
static fromBytes(bytes: Uint8Array): ContractID;
|
|
790
|
+
static fromHex(hex: string): ContractID;
|
|
791
|
+
serialize(serializer: Serializer): void;
|
|
792
|
+
toBytes(): Uint8Array;
|
|
793
|
+
toHex(): string;
|
|
794
|
+
toPrettyMessage(indent?: number): string;
|
|
795
|
+
}
|
|
796
|
+
declare class EncryptionKey {
|
|
797
|
+
ibeMpks: MasterPublicKey[];
|
|
798
|
+
constructor({ ibeMpks }: {
|
|
799
|
+
ibeMpks: MasterPublicKey[];
|
|
800
|
+
});
|
|
801
|
+
static fetch({ committee }: {
|
|
802
|
+
committee: Committee;
|
|
803
|
+
}): Promise<EncryptionKey>;
|
|
804
|
+
}
|
|
805
|
+
declare class DecryptionKey {
|
|
806
|
+
ibeDecryptionKeys: (IdentityPrivateKey | null)[];
|
|
807
|
+
private constructor();
|
|
808
|
+
static fetch({ committee, contractId, domain, proof }: {
|
|
809
|
+
committee: Committee;
|
|
810
|
+
contractId: ContractID;
|
|
811
|
+
domain: Uint8Array;
|
|
812
|
+
proof: ProofOfPermission;
|
|
813
|
+
}): Promise<DecryptionKey>;
|
|
814
|
+
}
|
|
815
|
+
declare class Ciphertext {
|
|
816
|
+
aesCiph: Ciphertext$3;
|
|
817
|
+
ibeCiphs: Ciphertext$4[];
|
|
818
|
+
constructor(aesCiph: Ciphertext$3, ibeCiphs: Ciphertext$4[]);
|
|
819
|
+
static dummy(): Ciphertext;
|
|
820
|
+
static deserialize(deserializer: Deserializer): Ciphertext;
|
|
821
|
+
static fromBytes(bytes: Uint8Array): Ciphertext;
|
|
822
|
+
static fromHex(hex: string): Ciphertext;
|
|
823
|
+
serialize(serializer: Serializer): void;
|
|
824
|
+
toBytes(): Uint8Array;
|
|
825
|
+
}
|
|
826
|
+
declare class FullDecryptionDomain {
|
|
827
|
+
committee: Committee;
|
|
828
|
+
contractId: ContractID;
|
|
829
|
+
domain: Uint8Array;
|
|
830
|
+
constructor({ committee, contractId, domain }: {
|
|
831
|
+
committee: Committee;
|
|
832
|
+
contractId: ContractID;
|
|
833
|
+
domain: Uint8Array;
|
|
834
|
+
});
|
|
835
|
+
static dummy(): FullDecryptionDomain;
|
|
836
|
+
static deserialize(deserializer: Deserializer): FullDecryptionDomain;
|
|
837
|
+
static fromBytes(bytes: Uint8Array): FullDecryptionDomain;
|
|
838
|
+
static fromHex(hex: string): FullDecryptionDomain;
|
|
839
|
+
serialize(serializer: Serializer): void;
|
|
840
|
+
toBytes(): Uint8Array;
|
|
841
|
+
toHex(): string;
|
|
842
|
+
toPrettyMessage(indent?: number): string;
|
|
843
|
+
getSolanaContractID(): ContractID$1;
|
|
844
|
+
getAptosContractID(): ContractID$2;
|
|
845
|
+
}
|
|
846
|
+
declare class ProofOfPermission {
|
|
847
|
+
static readonly SCHEME_APTOS = 0;
|
|
848
|
+
static readonly SCHEME_SOLANA = 1;
|
|
849
|
+
scheme: number;
|
|
850
|
+
inner: any;
|
|
851
|
+
private constructor();
|
|
852
|
+
/** @deprecated Use `ProofOfPermission.createAptos()` instead */
|
|
853
|
+
static newAptos(id: ProofOfPermission$2): ProofOfPermission;
|
|
854
|
+
/** @deprecated Use `ProofOfPermission.createSolana()` instead */
|
|
855
|
+
static newSolana(id: ProofOfPermission$1): ProofOfPermission;
|
|
856
|
+
static createAptos({ userAddr, publicKey, signature, fullMessage }: {
|
|
857
|
+
userAddr: AptosSDK.AccountAddress;
|
|
858
|
+
publicKey: AptosSDK.PublicKey;
|
|
859
|
+
signature: AptosSDK.Signature;
|
|
860
|
+
fullMessage: string;
|
|
861
|
+
}): ProofOfPermission;
|
|
862
|
+
static createSolana({ txn }: {
|
|
863
|
+
txn: SolanaSDK.Transaction | SolanaSDK.VersionedTransaction;
|
|
864
|
+
}): ProofOfPermission;
|
|
865
|
+
static deserialize(deserializer: Deserializer): ProofOfPermission;
|
|
866
|
+
static fromBytes(bytes: Uint8Array): ProofOfPermission;
|
|
867
|
+
static fromHex(hex: string): ProofOfPermission;
|
|
868
|
+
serialize(serializer: Serializer): void;
|
|
869
|
+
toBytes(): Uint8Array;
|
|
870
|
+
toHex(): string;
|
|
871
|
+
}
|
|
872
|
+
declare function encrypt({ committee, encryptionKey, contractId, domain, plaintext }: {
|
|
873
|
+
committee: Committee;
|
|
874
|
+
encryptionKey: EncryptionKey;
|
|
875
|
+
contractId: ContractID;
|
|
876
|
+
domain: Uint8Array;
|
|
877
|
+
plaintext: Uint8Array;
|
|
878
|
+
}): {
|
|
879
|
+
fullDecryptionDomain: FullDecryptionDomain;
|
|
880
|
+
ciphertext: Ciphertext;
|
|
881
|
+
};
|
|
882
|
+
declare function decrypt({ decryptionKey, ciphertext }: {
|
|
883
|
+
decryptionKey: DecryptionKey;
|
|
884
|
+
ciphertext: Ciphertext;
|
|
885
|
+
}): Uint8Array | undefined;
|
|
886
|
+
declare function verifyAndExtract({ ibeMsk, committee, contractId, domain, proof }: {
|
|
887
|
+
ibeMsk: MasterPrivateKey;
|
|
888
|
+
committee: Committee;
|
|
889
|
+
contractId: ContractID;
|
|
890
|
+
domain: Uint8Array;
|
|
891
|
+
proof: ProofOfPermission;
|
|
892
|
+
}): Promise<IdentityPrivateKey>;
|
|
893
|
+
|
|
894
|
+
type index_Ciphertext = Ciphertext;
|
|
895
|
+
declare const index_Ciphertext: typeof Ciphertext;
|
|
896
|
+
type index_Committee = Committee;
|
|
897
|
+
declare const index_Committee: typeof Committee;
|
|
898
|
+
type index_ContractID = ContractID;
|
|
899
|
+
declare const index_ContractID: typeof ContractID;
|
|
900
|
+
type index_DecryptionKey = DecryptionKey;
|
|
901
|
+
declare const index_DecryptionKey: typeof DecryptionKey;
|
|
902
|
+
type index_EncryptionKey = EncryptionKey;
|
|
903
|
+
declare const index_EncryptionKey: typeof EncryptionKey;
|
|
904
|
+
type index_FullDecryptionDomain = FullDecryptionDomain;
|
|
905
|
+
declare const index_FullDecryptionDomain: typeof FullDecryptionDomain;
|
|
906
|
+
type index_ProofOfPermission = ProofOfPermission;
|
|
907
|
+
declare const index_ProofOfPermission: typeof ProofOfPermission;
|
|
908
|
+
declare const index_decrypt: typeof decrypt;
|
|
909
|
+
declare const index_encrypt: typeof encrypt;
|
|
910
|
+
declare const index_verifyAndExtract: typeof verifyAndExtract;
|
|
911
|
+
declare namespace index {
|
|
912
|
+
export { index_Ciphertext as Ciphertext, index_Committee as Committee, index_ContractID as ContractID, index_DecryptionKey as DecryptionKey, index_EncryptionKey as EncryptionKey, index_FullDecryptionDomain as FullDecryptionDomain, index_ProofOfPermission as ProofOfPermission, index_decrypt as decrypt, index_encrypt as encrypt, index_verifyAndExtract as verifyAndExtract };
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare const CONTRACT_ADDRESS_HEX: string;
|
|
916
|
+
declare const SHELBYNET_CONTRACT_ADDRESS_HEX: string;
|
|
917
|
+
declare function randBytes(length: number): Uint8Array;
|
|
918
|
+
declare function xorBytes(blinder: Uint8Array<ArrayBufferLike>, plaintext: Uint8Array<ArrayBufferLike>): Uint8Array;
|
|
919
|
+
declare function concatBytes(a: Uint8Array, b: Uint8Array): Uint8Array;
|
|
920
|
+
declare function kdf(seed: Uint8Array, dst: Uint8Array, targetLength: number): Uint8Array;
|
|
921
|
+
declare function hmac_sha3_256(key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
922
|
+
declare function sha3_256(message: Uint8Array): Uint8Array;
|
|
923
|
+
declare function sha3_512(message: Uint8Array): Uint8Array;
|
|
924
|
+
declare function getAptosConfig(networkName: string): AptosConfig;
|
|
925
|
+
|
|
926
|
+
declare const utils_CONTRACT_ADDRESS_HEX: typeof CONTRACT_ADDRESS_HEX;
|
|
927
|
+
declare const utils_SHELBYNET_CONTRACT_ADDRESS_HEX: typeof SHELBYNET_CONTRACT_ADDRESS_HEX;
|
|
928
|
+
declare const utils_concatBytes: typeof concatBytes;
|
|
929
|
+
declare const utils_getAptosConfig: typeof getAptosConfig;
|
|
930
|
+
declare const utils_hmac_sha3_256: typeof hmac_sha3_256;
|
|
931
|
+
declare const utils_kdf: typeof kdf;
|
|
932
|
+
declare const utils_randBytes: typeof randBytes;
|
|
933
|
+
declare const utils_sha3_256: typeof sha3_256;
|
|
934
|
+
declare const utils_sha3_512: typeof sha3_512;
|
|
935
|
+
declare const utils_xorBytes: typeof xorBytes;
|
|
936
|
+
declare namespace utils {
|
|
937
|
+
export { utils_CONTRACT_ADDRESS_HEX as CONTRACT_ADDRESS_HEX, utils_SHELBYNET_CONTRACT_ADDRESS_HEX as SHELBYNET_CONTRACT_ADDRESS_HEX, utils_concatBytes as concatBytes, utils_getAptosConfig as getAptosConfig, utils_hmac_sha3_256 as hmac_sha3_256, utils_kdf as kdf, utils_randBytes as randBytes, utils_sha3_256 as sha3_256, utils_sha3_512 as sha3_512, utils_xorBytes as xorBytes };
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
declare class WorkerTask {
|
|
941
|
+
taskType: number;
|
|
942
|
+
inner: any;
|
|
943
|
+
constructor(taskType: number, inner: any);
|
|
944
|
+
static newSilentSetupDecryptionKey(decryptionContext: DecryptionContext$1, userAddr: AccountAddress, publicKey: Ed25519PublicKey, signature: Ed25519Signature): WorkerTask;
|
|
945
|
+
static newXChainSilentSetupDecryptionKey(decryptionContext: DecryptionContext, proofOfPermission: ProofOfPermission$3): WorkerTask;
|
|
946
|
+
static newThresholdIbeDecryptionKey(args: {
|
|
947
|
+
committee: Committee;
|
|
948
|
+
contractId: ContractID;
|
|
949
|
+
domain: Uint8Array;
|
|
950
|
+
proof: ProofOfPermission;
|
|
951
|
+
}): WorkerTask;
|
|
952
|
+
static deserialize(deserializer: Deserializer): WorkerTask;
|
|
953
|
+
static fromBytes(bytes: Uint8Array): WorkerTask;
|
|
954
|
+
static fromHex(hex: string): WorkerTask;
|
|
955
|
+
serialize(serializer: Serializer): void;
|
|
956
|
+
toBytes(): Uint8Array;
|
|
957
|
+
toHex(): string;
|
|
958
|
+
unpackThresholdIbeDecryptionKey(): {
|
|
959
|
+
committee: Committee;
|
|
960
|
+
contractId: ContractID;
|
|
961
|
+
domain: Uint8Array;
|
|
962
|
+
proof: ProofOfPermission;
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export { elgamal as ElGamal, index$5 as Enc, group as Group, index$4 as IBE, index$3 as Sig, silent_setup_encryption as SilentSetupEncryption, index$1 as SilentSetupEncryptionXChain, index$2 as Sym, index as ThresholdIbe, utils as Utils, worker_config as WorkerConfig, WorkerTask };
|