@lib-q/types 0.0.2
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 +9 -0
- package/index.d.ts +120 -0
- package/index.js +5 -0
- package/package.json +32 -0
package/README.md
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error object (`lib_q_core::wasm_common::wasm_js_error`).
|
|
3
|
+
*/
|
|
4
|
+
export interface LibQWasmError {
|
|
5
|
+
/** Stable string category, e.g. `LIB_Q_HPKE`. */
|
|
6
|
+
code: string;
|
|
7
|
+
/** FNV-1a 32-bit id of `code` for numeric switching. */
|
|
8
|
+
codeNumeric: number;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** `@lib-q/hpke` — single-shot seal */
|
|
13
|
+
export interface HpkeSealResult {
|
|
14
|
+
encapsulatedKeyHex: string;
|
|
15
|
+
ciphertextHex: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Serialized sender context (snake_case keys as emitted by `serde` on the Rust structs). */
|
|
19
|
+
export interface HpkeSenderWire {
|
|
20
|
+
encapsulated_key_hex: string;
|
|
21
|
+
shared_secret_hex: string;
|
|
22
|
+
exporter_secret_hex: string;
|
|
23
|
+
key_hex: string;
|
|
24
|
+
nonce_hex: string;
|
|
25
|
+
aead: string;
|
|
26
|
+
sequence_number: number;
|
|
27
|
+
max_sequence_number: number;
|
|
28
|
+
state: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** `@lib-q/hpke` — `hpkeSetupSender` */
|
|
32
|
+
export interface HpkeSetupSenderResult {
|
|
33
|
+
encapsulated_key_hex: string;
|
|
34
|
+
sender: HpkeSenderWire;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** `@lib-q/hpke` — `hpkeSenderSeal` */
|
|
38
|
+
export interface HpkeSenderSealResult {
|
|
39
|
+
ciphertext_hex: string;
|
|
40
|
+
sender: HpkeSenderWire;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Receiver context wire (snake_case). */
|
|
44
|
+
export interface HpkeReceiverWire {
|
|
45
|
+
shared_secret_hex: string;
|
|
46
|
+
key_hex: string;
|
|
47
|
+
nonce_hex: string;
|
|
48
|
+
aead: string;
|
|
49
|
+
sequence_number: number;
|
|
50
|
+
max_sequence_number: number;
|
|
51
|
+
state: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** `@lib-q/hpke` — `hpkeSetupReceiver` */
|
|
55
|
+
export interface HpkeSetupReceiverResult {
|
|
56
|
+
receiver: HpkeReceiverWire;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** `@lib-q/hpke` — `hpkeReceiverOpen` */
|
|
60
|
+
export interface HpkeReceiverOpenResult {
|
|
61
|
+
plaintext: Uint8Array;
|
|
62
|
+
receiver: HpkeReceiverWire;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** `@lib-q/cb-kem` */
|
|
66
|
+
export interface CbKemKeypair {
|
|
67
|
+
public_key_hex: string;
|
|
68
|
+
secret_key_hex: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface CbKemEncapsulateResult {
|
|
72
|
+
ciphertext_hex: string;
|
|
73
|
+
shared_secret_hex: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface CbKemDecapsulateResult {
|
|
77
|
+
sharedSecretHex: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** `@lib-q/hqc` */
|
|
81
|
+
export interface HqcKeygenResult {
|
|
82
|
+
publicKey: string;
|
|
83
|
+
secretKey: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface HqcEncapsulateResult {
|
|
87
|
+
ciphertext: string;
|
|
88
|
+
sharedSecret: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface HqcDecapsulateResult {
|
|
92
|
+
sharedSecretHex: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** `@lib-q/slh-dsa` — shapes depend on parameter set; keys and signatures are hex strings in JS. */
|
|
96
|
+
export interface SlhDsaKeypair {
|
|
97
|
+
verifying_key_hex: string;
|
|
98
|
+
signing_key_hex: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface SlhDsaSignResult {
|
|
102
|
+
signature_hex: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** `@lib-q/zkp` — preimage API (object return from prove path) */
|
|
106
|
+
export interface ZkpPreimageProof {
|
|
107
|
+
/** Proof payload; exact fields depend on build configuration. */
|
|
108
|
+
[key: string]: unknown;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** `@lib-q/prf` — Gold PRF return shape (`goldPrfU256BeHex`). */
|
|
112
|
+
export interface GoldPrfU256HexOut {
|
|
113
|
+
output_hex: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** `@lib-q/prf` — hex string outputs */
|
|
117
|
+
export type PrfHexString = string;
|
|
118
|
+
|
|
119
|
+
/** `@lib-q/random` */
|
|
120
|
+
export type SecureRandomBytes = Uint8Array;
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lib-q/types",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "TypeScript typings for @lib-q WASM packages",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/Enkom-Tech/libQ.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Enkom-Tech/libQ#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Enkom-Tech/libQ/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": "[\"typescript\",\"lib-q\",\"wasm\",\"types\"]",
|
|
16
|
+
"main": "./index.js",
|
|
17
|
+
"module": "./index.js",
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"import": "./index.js",
|
|
23
|
+
"default": "./index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"index.d.ts",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"author": "lib-Q Contributors"
|
|
32
|
+
}
|