@cathaysia/crown-wasm 0.26.5 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/crown_wasm.d.ts +263 -171
- package/crown_wasm_bg.js +1627 -670
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/crown_wasm.d.ts
CHANGED
|
@@ -1,261 +1,353 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function ed25519_keygen(): Uint8Array;
|
|
4
|
+
export function ed25519_sign(secret: Uint8Array, msg: Uint8Array): Uint8Array;
|
|
5
|
+
export function ed25519_verify(_public: Uint8Array, msg: Uint8Array, sig: Uint8Array): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns `public || private`.
|
|
8
|
+
*/
|
|
9
|
+
export function ml_dsa_keygen(variant: number, seed: Uint8Array): Uint8Array;
|
|
10
|
+
export function ml_dsa_sign(variant: number, _private: Uint8Array, msg: Uint8Array, ctx: Uint8Array): Uint8Array;
|
|
11
|
+
export function ml_dsa_verify(variant: number, _public: Uint8Array, msg: Uint8Array, ctx: Uint8Array, sig: Uint8Array): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Returns `public || private`.
|
|
14
|
+
*/
|
|
15
|
+
export function slh_dsa_keygen(name: string, seed: Uint8Array): Uint8Array;
|
|
16
|
+
export function slh_dsa_sign(name: string, _private: Uint8Array, msg: Uint8Array, ctx: Uint8Array): Uint8Array;
|
|
17
|
+
export function slh_dsa_verify(name: string, _public: Uint8Array, msg: Uint8Array, ctx: Uint8Array, sig: Uint8Array): boolean;
|
|
18
|
+
export function aes_key_wrap(key: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
19
|
+
export function aes_key_unwrap(key: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
20
|
+
export function aes_key_wrap_padded(key: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
21
|
+
export function aes_key_unwrap_padded(key: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
22
|
+
export function ff1_encrypt_decimal(key: Uint8Array, tweak: Uint8Array, input: string): string;
|
|
23
|
+
export function ff1_decrypt_decimal(key: Uint8Array, tweak: Uint8Array, input: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* PBKDF2-HMAC-SHA256.
|
|
26
|
+
*/
|
|
27
|
+
export function pbkdf2(password: Uint8Array, salt: Uint8Array, iterations: number, length: number): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* HKDF-Extract + Expand with SHA-256. `info` may be empty.
|
|
30
|
+
*/
|
|
31
|
+
export function hkdf(ikm: Uint8Array, salt: Uint8Array, info: Uint8Array, length: number): Uint8Array;
|
|
32
|
+
/**
|
|
33
|
+
* TLS 1.2 PRF with SHA-256. `seed` is the label+seed material.
|
|
34
|
+
*/
|
|
35
|
+
export function tls1_prf(secret: Uint8Array, seed: Uint8Array, length: number): Uint8Array;
|
|
36
|
+
/**
|
|
37
|
+
* SSKDF (hash-based) with SHA-256.
|
|
38
|
+
*/
|
|
39
|
+
export function sskdf(secret: Uint8Array, info: Uint8Array, length: number): Uint8Array;
|
|
40
|
+
/**
|
|
41
|
+
* X963KDF with SHA-256.
|
|
42
|
+
*/
|
|
43
|
+
export function x963_kdf(secret: Uint8Array, info: Uint8Array, length: number): Uint8Array;
|
|
44
|
+
/**
|
|
45
|
+
* HOTP (RFC 4226).
|
|
46
|
+
*/
|
|
47
|
+
export function hotp(key: Uint8Array, counter: number, digits: number): number;
|
|
48
|
+
/**
|
|
49
|
+
* TOTP (RFC 6238).
|
|
50
|
+
*/
|
|
51
|
+
export function totp(key: Uint8Array, time: number, step: number, digits: number, t0: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* Returns `public || private`.
|
|
54
|
+
*/
|
|
55
|
+
export function ml_kem_keygen(variant: number, seed: Uint8Array): Uint8Array;
|
|
56
|
+
/**
|
|
57
|
+
* Returns `ciphertext || shared_secret`.
|
|
58
|
+
*/
|
|
59
|
+
export function ml_kem_encapsulate(variant: number, _public: Uint8Array, message: Uint8Array): Uint8Array;
|
|
60
|
+
export function ml_kem_decapsulate(variant: number, _private: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
3
61
|
export class AeadCipher {
|
|
4
62
|
private constructor();
|
|
5
63
|
free(): void;
|
|
6
64
|
[Symbol.dispose](): void;
|
|
7
|
-
|
|
8
|
-
static
|
|
9
|
-
static new_aes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
10
|
-
static new_aes_gcm(key: Uint8Array): AeadCipher;
|
|
11
|
-
static new_des_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
12
|
-
static new_des_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
13
|
-
static new_des_gcm(key: Uint8Array): AeadCipher;
|
|
14
|
-
static new_rc2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
15
|
-
static new_rc2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
16
|
-
static new_rc2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
17
|
-
static new_rc5_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
18
|
-
static new_rc5_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
19
|
-
static new_rc5_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
20
|
-
static new_rc6_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
21
|
-
static new_rc6_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
22
|
-
static new_rc6_gcm(key: Uint8Array): AeadCipher;
|
|
23
|
-
static new_sm4_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
24
|
-
static new_sm4_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
25
|
-
static new_sm4_gcm(key: Uint8Array): AeadCipher;
|
|
26
|
-
static new_tea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
27
|
-
static new_tea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
28
|
-
static new_tea_gcm(key: Uint8Array): AeadCipher;
|
|
29
|
-
static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
30
|
-
static new_aria_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
31
|
-
static new_aria_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
32
|
-
static new_aria_gcm(key: Uint8Array): AeadCipher;
|
|
33
|
-
static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
34
|
-
static new_idea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
35
|
-
static new_idea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
36
|
-
static new_idea_gcm(key: Uint8Array): AeadCipher;
|
|
37
|
-
static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
38
|
-
static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
39
|
-
static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
40
|
-
static new_xtea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
41
|
-
static new_xtea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
42
|
-
static new_xtea_gcm(key: Uint8Array): AeadCipher;
|
|
43
|
-
static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
44
|
-
static new_cast5_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
45
|
-
static new_cast5_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
46
|
-
static new_cast5_gcm(key: Uint8Array): AeadCipher;
|
|
47
|
-
static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
48
|
-
static new_kseed_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
49
|
-
static new_kseed_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
50
|
-
static new_kseed_gcm(key: Uint8Array): AeadCipher;
|
|
51
|
-
static new_xtea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
52
|
-
static new_anubis_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
53
|
-
static new_anubis_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
54
|
-
static new_anubis_gcm(key: Uint8Array): AeadCipher;
|
|
55
|
-
static new_cast5_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
65
|
+
static new_kasumi_gcm(key: Uint8Array): AeadCipher;
|
|
66
|
+
static new_kasumi_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
56
67
|
static new_kasumi_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
57
68
|
static new_kasumi_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
58
|
-
static
|
|
59
|
-
static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
60
|
-
static new_khazad_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
61
|
-
static new_khazad_gcm(key: Uint8Array): AeadCipher;
|
|
69
|
+
static new_kseed_gcm(key: Uint8Array): AeadCipher;
|
|
62
70
|
static new_kseed_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
71
|
+
static new_kseed_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
72
|
+
static new_kseed_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
|
+
static new_anubis_gcm(key: Uint8Array): AeadCipher;
|
|
74
|
+
static new_anubis_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
75
|
+
static new_camellia_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
76
|
+
static new_multi2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
63
77
|
static new_multi2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
64
78
|
static new_multi2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
65
|
-
static
|
|
66
|
-
static
|
|
67
|
-
static
|
|
68
|
-
static
|
|
79
|
+
static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
80
|
+
static new_xchacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
81
|
+
static new_aes_gcm_siv(key: Uint8Array): AeadCipher;
|
|
82
|
+
static new_ascon_aead128(key: Uint8Array): AeadCipher;
|
|
83
|
+
static new_aes_siv(key: Uint8Array): AeadCipher;
|
|
84
|
+
nonce_size(): number;
|
|
85
|
+
open_in_place_separate_tag(data: Uint8Array, tag: Uint8Array, nonce: Uint8Array, aad: Uint8Array): void;
|
|
86
|
+
seal_in_place_separate_tag(data: Uint8Array, nonce: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
87
|
+
tag_size(): number;
|
|
88
|
+
static new_anubis_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
89
|
+
static new_anubis_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
90
|
+
static new_noekeon_gcm(key: Uint8Array): AeadCipher;
|
|
91
|
+
static new_noekeon_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
69
92
|
static new_noekeon_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
70
93
|
static new_noekeon_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
71
|
-
static
|
|
94
|
+
static new_khazad_gcm(key: Uint8Array): AeadCipher;
|
|
95
|
+
static new_khazad_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
96
|
+
static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
97
|
+
static new_khazad_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
98
|
+
static new_serpent_gcm(key: Uint8Array): AeadCipher;
|
|
99
|
+
static new_serpent_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
72
100
|
static new_serpent_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
101
|
static new_serpent_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
74
|
-
static
|
|
102
|
+
static new_idea_gcm(key: Uint8Array): AeadCipher;
|
|
103
|
+
static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
104
|
+
static new_idea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
105
|
+
static new_idea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
106
|
+
static new_rc2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
107
|
+
static new_rc2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
108
|
+
static new_rc2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
109
|
+
static new_rc5_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
110
|
+
static new_rc5_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
111
|
+
static new_rc5_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
112
|
+
static new_camellia_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
113
|
+
static new_camellia_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
114
|
+
static new_tripledes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
115
|
+
static new_tripledes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
116
|
+
static new_tea_gcm(key: Uint8Array): AeadCipher;
|
|
117
|
+
static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
118
|
+
static new_tea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
119
|
+
static new_tea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
120
|
+
static new_twofish_gcm(key: Uint8Array): AeadCipher;
|
|
121
|
+
static new_twofish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
75
122
|
static new_twofish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
76
123
|
static new_twofish_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
77
|
-
static
|
|
78
|
-
static
|
|
79
|
-
static
|
|
80
|
-
static
|
|
81
|
-
static
|
|
82
|
-
static
|
|
83
|
-
static
|
|
84
|
-
static
|
|
85
|
-
static
|
|
124
|
+
static new_xtea_gcm(key: Uint8Array): AeadCipher;
|
|
125
|
+
static new_xtea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
126
|
+
static new_xtea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
127
|
+
static new_xtea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
128
|
+
static new_rc6_gcm(key: Uint8Array): AeadCipher;
|
|
129
|
+
static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
130
|
+
static new_rc6_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
131
|
+
static new_rc6_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
132
|
+
static new_sm4_gcm(key: Uint8Array): AeadCipher;
|
|
133
|
+
static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
134
|
+
static new_sm4_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
135
|
+
static new_sm4_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
136
|
+
static new_skipjack_gcm(key: Uint8Array): AeadCipher;
|
|
137
|
+
static new_skipjack_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
86
138
|
static new_skipjack_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
87
139
|
static new_skipjack_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
88
|
-
static
|
|
89
|
-
static
|
|
140
|
+
static new_aes_gcm(key: Uint8Array): AeadCipher;
|
|
141
|
+
static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
142
|
+
static new_aes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
143
|
+
static new_aes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
144
|
+
static new_aria_gcm(key: Uint8Array): AeadCipher;
|
|
145
|
+
static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
146
|
+
static new_aria_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
147
|
+
static new_aria_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
148
|
+
static new_blowfish_gcm(key: Uint8Array): AeadCipher;
|
|
90
149
|
static new_blowfish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
91
|
-
static
|
|
92
|
-
static
|
|
93
|
-
static
|
|
150
|
+
static new_blowfish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
151
|
+
static new_blowfish_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
152
|
+
static new_cast5_gcm(key: Uint8Array): AeadCipher;
|
|
153
|
+
static new_cast5_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
154
|
+
static new_cast5_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
155
|
+
static new_cast5_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
156
|
+
static new_des_gcm(key: Uint8Array): AeadCipher;
|
|
157
|
+
static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
158
|
+
static new_des_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
159
|
+
static new_des_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
94
160
|
static new_tripledes_gcm(key: Uint8Array): AeadCipher;
|
|
95
161
|
static new_tripledes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
96
|
-
static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
97
|
-
static new_xchacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
98
|
-
open_in_place_separate_tag(data: Uint8Array, tag: Uint8Array, nonce: Uint8Array, aad: Uint8Array): void;
|
|
99
|
-
seal_in_place_separate_tag(data: Uint8Array, nonce: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
100
|
-
tag_size(): number;
|
|
101
162
|
}
|
|
102
163
|
export class BlockCipher {
|
|
103
164
|
private constructor();
|
|
104
165
|
free(): void;
|
|
105
166
|
[Symbol.dispose](): void;
|
|
167
|
+
static new_camellia_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
168
|
+
static new_multi2_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
169
|
+
decrypt(data: Uint8Array): number;
|
|
170
|
+
encrypt(data: Uint8Array, pos: number): number;
|
|
106
171
|
static new_aes_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
172
|
+
static new_aria_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
173
|
+
static new_blowfish_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
174
|
+
static new_cast5_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
107
175
|
static new_des_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
108
|
-
static
|
|
109
|
-
static new_rc5_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
110
|
-
static new_rc6_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
111
|
-
static new_sm4_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
176
|
+
static new_tripledes_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
112
177
|
static new_tea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
113
|
-
static
|
|
114
|
-
static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
178
|
+
static new_twofish_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
115
179
|
static new_xtea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
116
|
-
static
|
|
180
|
+
static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
181
|
+
static new_rc6_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
182
|
+
static new_sm4_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
183
|
+
static new_skipjack_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
184
|
+
static new_kasumi_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
117
185
|
static new_kseed_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
118
186
|
static new_anubis_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
119
|
-
static new_kasumi_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
120
|
-
static new_khazad_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
121
|
-
static new_multi2_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
122
187
|
static new_noekeon_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
188
|
+
static new_khazad_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
123
189
|
static new_serpent_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
124
|
-
static
|
|
125
|
-
static
|
|
126
|
-
static
|
|
127
|
-
static new_skipjack_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
128
|
-
static new_tripledes_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
129
|
-
decrypt(data: Uint8Array): number;
|
|
130
|
-
encrypt(data: Uint8Array, pos: number): number;
|
|
190
|
+
static new_desx_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
191
|
+
static new_rc2_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
192
|
+
static new_rc5_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
131
193
|
}
|
|
132
194
|
export class Hash {
|
|
133
195
|
private constructor();
|
|
134
196
|
free(): void;
|
|
135
197
|
[Symbol.dispose](): void;
|
|
136
|
-
block_size(): number;
|
|
137
|
-
static new_sha224(): Hash;
|
|
138
|
-
static new_sha256(): Hash;
|
|
139
|
-
static new_sha384(): Hash;
|
|
140
|
-
static new_sha512(): Hash;
|
|
141
198
|
static new_blake2b(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
142
|
-
|
|
199
|
+
block_size(): number;
|
|
200
|
+
sum(): Uint8Array;
|
|
201
|
+
read(buf: Uint8Array): number;
|
|
202
|
+
size(): number;
|
|
203
|
+
flush(): void;
|
|
204
|
+
reset(): void;
|
|
205
|
+
write(data: Uint8Array): number;
|
|
143
206
|
static new_md2_hmac(key: Uint8Array): Hash;
|
|
207
|
+
static new_md2(): Hash;
|
|
144
208
|
static new_md4_hmac(key: Uint8Array): Hash;
|
|
209
|
+
static new_md4(): Hash;
|
|
145
210
|
static new_md5_hmac(key: Uint8Array): Hash;
|
|
146
|
-
static
|
|
147
|
-
static new_sha3_256(): Hash;
|
|
148
|
-
static new_sha3_384(): Hash;
|
|
149
|
-
static new_sha3_512(): Hash;
|
|
150
|
-
static new_shake128(): Hash;
|
|
151
|
-
static new_shake256(): Hash;
|
|
152
|
-
static new_sm3_hmac(key: Uint8Array): Hash;
|
|
211
|
+
static new_md5(): Hash;
|
|
153
212
|
static new_sha1_hmac(key: Uint8Array): Hash;
|
|
154
|
-
static
|
|
155
|
-
static
|
|
213
|
+
static new_sha1(): Hash;
|
|
214
|
+
static new_sha224(): Hash;
|
|
156
215
|
static new_sha224_hmac(key: Uint8Array): Hash;
|
|
216
|
+
static new_sha256(): Hash;
|
|
157
217
|
static new_sha256_hmac(key: Uint8Array): Hash;
|
|
218
|
+
static new_sha384(): Hash;
|
|
158
219
|
static new_sha384_hmac(key: Uint8Array): Hash;
|
|
220
|
+
static new_sha512(): Hash;
|
|
159
221
|
static new_sha512_hmac(key: Uint8Array): Hash;
|
|
222
|
+
static new_sha512_224(): Hash;
|
|
223
|
+
static new_sha512_224_hmac(key: Uint8Array): Hash;
|
|
224
|
+
static new_sha512_256(): Hash;
|
|
225
|
+
static new_sha512_256_hmac(key: Uint8Array): Hash;
|
|
226
|
+
static new_sha3_224(): Hash;
|
|
160
227
|
static new_sha3_224_hmac(key: Uint8Array): Hash;
|
|
228
|
+
static new_sha3_256(): Hash;
|
|
161
229
|
static new_sha3_256_hmac(key: Uint8Array): Hash;
|
|
230
|
+
static new_sha3_384(): Hash;
|
|
162
231
|
static new_sha3_384_hmac(key: Uint8Array): Hash;
|
|
232
|
+
static new_sha3_512(): Hash;
|
|
163
233
|
static new_sha3_512_hmac(key: Uint8Array): Hash;
|
|
234
|
+
static new_shake128(): Hash;
|
|
164
235
|
static new_shake128_hmac(key: Uint8Array): Hash;
|
|
236
|
+
static new_shake256(): Hash;
|
|
165
237
|
static new_shake256_hmac(key: Uint8Array): Hash;
|
|
166
|
-
static
|
|
167
|
-
static new_sha512_256_hmac(key: Uint8Array): Hash;
|
|
168
|
-
sum(): Uint8Array;
|
|
169
|
-
read(buf: Uint8Array): number;
|
|
170
|
-
size(): number;
|
|
171
|
-
flush(): void;
|
|
172
|
-
reset(): void;
|
|
173
|
-
write(data: Uint8Array): number;
|
|
174
|
-
static new_md2(): Hash;
|
|
175
|
-
static new_md4(): Hash;
|
|
176
|
-
static new_md5(): Hash;
|
|
238
|
+
static new_sm3_hmac(key: Uint8Array): Hash;
|
|
177
239
|
static new_sm3(): Hash;
|
|
178
|
-
static
|
|
240
|
+
static new_md5_sha1(): Hash;
|
|
241
|
+
static new_md5_sha1_hmac(key: Uint8Array): Hash;
|
|
242
|
+
static new_ripemd160(): Hash;
|
|
243
|
+
static new_ripemd160_hmac(key: Uint8Array): Hash;
|
|
244
|
+
static new_mdc2_hmac(key: Uint8Array): Hash;
|
|
245
|
+
static new_mdc2(): Hash;
|
|
246
|
+
static new_whirlpool(): Hash;
|
|
247
|
+
static new_whirlpool_hmac(key: Uint8Array): Hash;
|
|
248
|
+
static new_blake2s(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
249
|
+
}
|
|
250
|
+
export class Mac {
|
|
251
|
+
private constructor();
|
|
252
|
+
free(): void;
|
|
253
|
+
[Symbol.dispose](): void;
|
|
254
|
+
static new_kmac128(key: Uint8Array, custom: Uint8Array, output_len: number): Mac;
|
|
255
|
+
static new_kmac256(key: Uint8Array, custom: Uint8Array, output_len: number): Mac;
|
|
256
|
+
static new_siphash(key: Uint8Array, output_len: number): Mac;
|
|
257
|
+
static new_cmac_aes(key: Uint8Array): Mac;
|
|
258
|
+
static new_gmac_aes(key: Uint8Array, iv: Uint8Array): Mac;
|
|
259
|
+
sum(): Uint8Array;
|
|
260
|
+
write(data: Uint8Array): void;
|
|
179
261
|
}
|
|
180
262
|
export class StreamCipher {
|
|
181
263
|
private constructor();
|
|
182
264
|
free(): void;
|
|
183
265
|
[Symbol.dispose](): void;
|
|
266
|
+
static new_multi2_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
267
|
+
static new_multi2_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
268
|
+
static new_multi2_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
269
|
+
static new_rc4(key: Uint8Array): StreamCipher;
|
|
270
|
+
static new_salsa20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
271
|
+
static new_chacha20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
184
272
|
static new_rabbit(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
273
|
+
static new_sosemanuk(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
274
|
+
static new_sober128(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
275
|
+
decrypt(data: Uint8Array): void;
|
|
276
|
+
encrypt(data: Uint8Array): void;
|
|
185
277
|
static new_aes_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
186
278
|
static new_aes_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
187
279
|
static new_aes_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
280
|
+
static new_aria_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
281
|
+
static new_aria_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
282
|
+
static new_aria_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
283
|
+
static new_blowfish_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
284
|
+
static new_blowfish_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
285
|
+
static new_blowfish_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
286
|
+
static new_cast5_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
287
|
+
static new_cast5_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
288
|
+
static new_cast5_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
188
289
|
static new_des_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
189
290
|
static new_des_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
190
291
|
static new_des_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
191
|
-
static
|
|
192
|
-
static
|
|
193
|
-
static
|
|
194
|
-
static new_rc5_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
195
|
-
static new_rc5_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
196
|
-
static new_rc5_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
197
|
-
static new_rc6_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
198
|
-
static new_rc6_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
199
|
-
static new_rc6_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
200
|
-
static new_salsa20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
201
|
-
static new_sm4_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
202
|
-
static new_sm4_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
203
|
-
static new_sm4_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
292
|
+
static new_tripledes_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
293
|
+
static new_tripledes_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
294
|
+
static new_tripledes_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
204
295
|
static new_tea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
205
296
|
static new_tea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
206
297
|
static new_tea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
207
|
-
static
|
|
208
|
-
static
|
|
209
|
-
static
|
|
210
|
-
static new_chacha20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
211
|
-
static new_idea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
212
|
-
static new_idea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
213
|
-
static new_idea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
214
|
-
static new_sober128(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
298
|
+
static new_twofish_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
299
|
+
static new_twofish_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
300
|
+
static new_twofish_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
215
301
|
static new_xtea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
216
302
|
static new_xtea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
217
303
|
static new_xtea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
218
|
-
static
|
|
219
|
-
static
|
|
220
|
-
static
|
|
304
|
+
static new_idea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
305
|
+
static new_idea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
306
|
+
static new_idea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
307
|
+
static new_rc6_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
308
|
+
static new_rc6_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
309
|
+
static new_rc6_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
310
|
+
static new_sm4_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
311
|
+
static new_sm4_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
312
|
+
static new_sm4_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
313
|
+
static new_skipjack_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
314
|
+
static new_skipjack_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
315
|
+
static new_skipjack_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
316
|
+
static new_kasumi_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
317
|
+
static new_kasumi_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
318
|
+
static new_kasumi_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
221
319
|
static new_kseed_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
222
320
|
static new_kseed_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
223
321
|
static new_kseed_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
224
|
-
static new_sosemanuk(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
225
322
|
static new_anubis_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
226
323
|
static new_anubis_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
227
324
|
static new_anubis_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
228
|
-
static new_kasumi_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
229
|
-
static new_kasumi_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
230
|
-
static new_kasumi_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
231
|
-
static new_khazad_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
232
|
-
static new_khazad_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
233
|
-
static new_khazad_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
234
|
-
static new_multi2_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
235
|
-
static new_multi2_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
236
|
-
static new_multi2_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
237
325
|
static new_noekeon_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
238
326
|
static new_noekeon_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
239
327
|
static new_noekeon_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
328
|
+
static new_khazad_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
329
|
+
static new_khazad_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
330
|
+
static new_khazad_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
240
331
|
static new_serpent_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
241
332
|
static new_serpent_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
242
333
|
static new_serpent_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
243
|
-
static
|
|
244
|
-
static
|
|
245
|
-
static
|
|
246
|
-
static
|
|
247
|
-
static
|
|
248
|
-
static
|
|
334
|
+
static new_rc2_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
335
|
+
static new_rc2_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
336
|
+
static new_rc2_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
337
|
+
static new_rc5_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
338
|
+
static new_rc5_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
339
|
+
static new_rc5_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
249
340
|
static new_camellia_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
250
341
|
static new_camellia_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
251
342
|
static new_camellia_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
static
|
|
258
|
-
decrypt(data: Uint8Array): void;
|
|
259
|
-
encrypt(data: Uint8Array): void;
|
|
260
|
-
static
|
|
343
|
+
}
|
|
344
|
+
export class Xts {
|
|
345
|
+
private constructor();
|
|
346
|
+
free(): void;
|
|
347
|
+
[Symbol.dispose](): void;
|
|
348
|
+
static new_sm4_gb(key: Uint8Array): Xts;
|
|
349
|
+
decrypt(tweak: Uint8Array, data: Uint8Array): void;
|
|
350
|
+
encrypt(tweak: Uint8Array, data: Uint8Array): void;
|
|
351
|
+
static new_aes(key: Uint8Array): Xts;
|
|
352
|
+
static new_sm4(key: Uint8Array): Xts;
|
|
261
353
|
}
|