@cathaysia/crown-wasm 0.26.4 โ 0.26.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/README.md +13 -1
- package/crown_wasm.d.ts +166 -166
- package/crown_wasm_bg.js +688 -688
- package/crown_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
[](https://github.com/cathaysia/crown/actions/workflows/deploy.yml)
|
|
8
8
|
[](https://github.com/cathaysia/crown/actions/workflows/check-build-cross.yaml)
|
|
9
9
|
|
|
10
|
+
> ๐ **Documentation**: <https://docs.rs/crown/latest/crown/> ยท ๐ฎ **Playground**: <https://cathaysia.github.io/crown/>
|
|
11
|
+
|
|
10
12
|
> [!IMPORTANT]
|
|
11
13
|
> ALL ALGORITHMS ARE IMPLEMENTED FOLLOWING STANDARD SPECIFICATIONS, BUT THE LIBRARY HAS NOT UNDERGONE A FORMAL SECURITY AUDIT.
|
|
12
14
|
>
|
|
@@ -14,10 +16,20 @@
|
|
|
14
16
|
>
|
|
15
17
|
> THE AUTHORS ASSUME NO RESPONSIBILITY OR LIABILITY FOR ANY DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
16
18
|
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
Full API reference is available at **<https://docs.rs/crown/latest/crown/>**.
|
|
22
|
+
|
|
23
|
+
## Playground
|
|
24
|
+
|
|
25
|
+
Try Crown online without installation โ encrypt, decrypt, hash and more in your browser:
|
|
26
|
+
|
|
27
|
+
**<https://cathaysia.github.io/crown/>**
|
|
28
|
+
|
|
17
29
|
## Features
|
|
18
30
|
|
|
19
31
|
* **API-first design**: clean and intuitive, minimal boilerplate
|
|
20
|
-
* **First-class documentation**: comprehensive guides, examples, and references to get you started quickly
|
|
32
|
+
* **First-class documentation**: comprehensive guides, examples, and references to get you started quickly โ see [docs.rs](https://docs.rs/crown/latest/crown/)
|
|
21
33
|
* **`no_std` support**: works in embedded and bare-metal environments.
|
|
22
34
|
* **Modern cryptographic primitives**: symmetric/asymmetric encryption, hashing, AEAD
|
|
23
35
|
|
package/crown_wasm.d.ts
CHANGED
|
@@ -4,258 +4,258 @@ export class AeadCipher {
|
|
|
4
4
|
private constructor();
|
|
5
5
|
free(): void;
|
|
6
6
|
[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;
|
|
7
|
+
static new_kasumi_gcm(key: Uint8Array): AeadCipher;
|
|
8
|
+
static new_kasumi_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
56
9
|
static new_kasumi_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
57
10
|
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;
|
|
11
|
+
static new_kseed_gcm(key: Uint8Array): AeadCipher;
|
|
62
12
|
static new_kseed_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
13
|
+
static new_kseed_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
14
|
+
static new_kseed_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
15
|
+
static new_anubis_gcm(key: Uint8Array): AeadCipher;
|
|
16
|
+
static new_anubis_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
17
|
+
static new_camellia_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
18
|
+
static new_multi2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
63
19
|
static new_multi2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
64
20
|
static new_multi2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
65
|
-
static
|
|
66
|
-
static
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
static new_chacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
22
|
+
static new_xchacha20_poly1305(key: Uint8Array): AeadCipher;
|
|
23
|
+
nonce_size(): number;
|
|
24
|
+
open_in_place_separate_tag(data: Uint8Array, tag: Uint8Array, nonce: Uint8Array, aad: Uint8Array): void;
|
|
25
|
+
seal_in_place_separate_tag(data: Uint8Array, nonce: Uint8Array, aad: Uint8Array): Uint8Array;
|
|
26
|
+
tag_size(): number;
|
|
27
|
+
static new_anubis_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
28
|
+
static new_anubis_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
29
|
+
static new_noekeon_gcm(key: Uint8Array): AeadCipher;
|
|
30
|
+
static new_noekeon_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
69
31
|
static new_noekeon_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
70
32
|
static new_noekeon_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
71
|
-
static
|
|
33
|
+
static new_khazad_gcm(key: Uint8Array): AeadCipher;
|
|
34
|
+
static new_khazad_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
35
|
+
static new_khazad_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
36
|
+
static new_khazad_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
37
|
+
static new_serpent_gcm(key: Uint8Array): AeadCipher;
|
|
38
|
+
static new_serpent_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
72
39
|
static new_serpent_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
40
|
static new_serpent_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
74
|
-
static
|
|
41
|
+
static new_idea_gcm(key: Uint8Array): AeadCipher;
|
|
42
|
+
static new_idea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
43
|
+
static new_idea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
44
|
+
static new_idea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
45
|
+
static new_rc2_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
46
|
+
static new_rc2_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
47
|
+
static new_rc2_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
48
|
+
static new_rc5_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
49
|
+
static new_rc5_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
50
|
+
static new_rc5_eax(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
51
|
+
static new_camellia_gcm(key: Uint8Array, rounds?: number | null): AeadCipher;
|
|
52
|
+
static new_camellia_ccm(key: Uint8Array, tag_size: number, nonce_size: number, rounds?: number | null): AeadCipher;
|
|
53
|
+
static new_tripledes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
54
|
+
static new_tripledes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
55
|
+
static new_tea_gcm(key: Uint8Array): AeadCipher;
|
|
56
|
+
static new_tea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
57
|
+
static new_tea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
58
|
+
static new_tea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
59
|
+
static new_twofish_gcm(key: Uint8Array): AeadCipher;
|
|
60
|
+
static new_twofish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
75
61
|
static new_twofish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
76
62
|
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
|
|
63
|
+
static new_xtea_gcm(key: Uint8Array): AeadCipher;
|
|
64
|
+
static new_xtea_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
65
|
+
static new_xtea_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
66
|
+
static new_xtea_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
67
|
+
static new_rc6_gcm(key: Uint8Array): AeadCipher;
|
|
68
|
+
static new_rc6_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
69
|
+
static new_rc6_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
70
|
+
static new_rc6_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
71
|
+
static new_sm4_gcm(key: Uint8Array): AeadCipher;
|
|
72
|
+
static new_sm4_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
73
|
+
static new_sm4_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
74
|
+
static new_sm4_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
75
|
+
static new_skipjack_gcm(key: Uint8Array): AeadCipher;
|
|
76
|
+
static new_skipjack_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
86
77
|
static new_skipjack_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
87
78
|
static new_skipjack_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
88
|
-
static
|
|
89
|
-
static
|
|
79
|
+
static new_aes_gcm(key: Uint8Array): AeadCipher;
|
|
80
|
+
static new_aes_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
81
|
+
static new_aes_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
82
|
+
static new_aes_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
83
|
+
static new_aria_gcm(key: Uint8Array): AeadCipher;
|
|
84
|
+
static new_aria_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
85
|
+
static new_aria_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
86
|
+
static new_aria_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
87
|
+
static new_blowfish_gcm(key: Uint8Array): AeadCipher;
|
|
90
88
|
static new_blowfish_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
91
|
-
static
|
|
92
|
-
static
|
|
93
|
-
static
|
|
89
|
+
static new_blowfish_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
90
|
+
static new_blowfish_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
91
|
+
static new_cast5_gcm(key: Uint8Array): AeadCipher;
|
|
92
|
+
static new_cast5_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
93
|
+
static new_cast5_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
94
|
+
static new_cast5_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
95
|
+
static new_des_gcm(key: Uint8Array): AeadCipher;
|
|
96
|
+
static new_des_ocb3(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
97
|
+
static new_des_ccm(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
98
|
+
static new_des_eax(key: Uint8Array, tag_size: number, nonce_size: number): AeadCipher;
|
|
94
99
|
static new_tripledes_gcm(key: Uint8Array): AeadCipher;
|
|
95
100
|
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
101
|
}
|
|
102
102
|
export class BlockCipher {
|
|
103
103
|
private constructor();
|
|
104
104
|
free(): void;
|
|
105
105
|
[Symbol.dispose](): void;
|
|
106
|
+
static new_multi2_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
107
|
+
decrypt(data: Uint8Array): number;
|
|
108
|
+
encrypt(data: Uint8Array, pos: number): number;
|
|
106
109
|
static new_aes_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
110
|
+
static new_aria_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
111
|
+
static new_blowfish_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
112
|
+
static new_cast5_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
107
113
|
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;
|
|
114
|
+
static new_tripledes_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
112
115
|
static new_tea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
113
|
-
static
|
|
114
|
-
static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
116
|
+
static new_twofish_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
115
117
|
static new_xtea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
116
|
-
static
|
|
118
|
+
static new_idea_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
119
|
+
static new_rc6_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
120
|
+
static new_sm4_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
121
|
+
static new_skipjack_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
122
|
+
static new_kasumi_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
117
123
|
static new_kseed_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
118
124
|
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
125
|
static new_noekeon_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
126
|
+
static new_khazad_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
123
127
|
static new_serpent_cbc(key: Uint8Array, iv: Uint8Array): BlockCipher;
|
|
124
|
-
static
|
|
125
|
-
static
|
|
128
|
+
static new_rc2_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
129
|
+
static new_rc5_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
126
130
|
static new_camellia_cbc(key: Uint8Array, iv: Uint8Array, rounds?: number | null): BlockCipher;
|
|
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;
|
|
131
131
|
}
|
|
132
132
|
export class Hash {
|
|
133
133
|
private constructor();
|
|
134
134
|
free(): void;
|
|
135
135
|
[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
|
-
static new_blake2b(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
142
|
-
static new_blake2s(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
143
136
|
static new_md2_hmac(key: Uint8Array): Hash;
|
|
137
|
+
static new_md2(): Hash;
|
|
144
138
|
static new_md4_hmac(key: Uint8Array): Hash;
|
|
139
|
+
static new_md4(): Hash;
|
|
145
140
|
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;
|
|
141
|
+
static new_md5(): Hash;
|
|
153
142
|
static new_sha1_hmac(key: Uint8Array): Hash;
|
|
154
|
-
static
|
|
155
|
-
static
|
|
143
|
+
static new_sha1(): Hash;
|
|
144
|
+
static new_sha224(): Hash;
|
|
156
145
|
static new_sha224_hmac(key: Uint8Array): Hash;
|
|
146
|
+
static new_sha256(): Hash;
|
|
157
147
|
static new_sha256_hmac(key: Uint8Array): Hash;
|
|
148
|
+
static new_sha384(): Hash;
|
|
158
149
|
static new_sha384_hmac(key: Uint8Array): Hash;
|
|
150
|
+
static new_sha512(): Hash;
|
|
159
151
|
static new_sha512_hmac(key: Uint8Array): Hash;
|
|
152
|
+
static new_sha512_224(): Hash;
|
|
153
|
+
static new_sha512_224_hmac(key: Uint8Array): Hash;
|
|
154
|
+
static new_sha512_256(): Hash;
|
|
155
|
+
static new_sha512_256_hmac(key: Uint8Array): Hash;
|
|
156
|
+
static new_sha3_224(): Hash;
|
|
160
157
|
static new_sha3_224_hmac(key: Uint8Array): Hash;
|
|
158
|
+
static new_sha3_256(): Hash;
|
|
161
159
|
static new_sha3_256_hmac(key: Uint8Array): Hash;
|
|
160
|
+
static new_sha3_384(): Hash;
|
|
162
161
|
static new_sha3_384_hmac(key: Uint8Array): Hash;
|
|
162
|
+
static new_sha3_512(): Hash;
|
|
163
163
|
static new_sha3_512_hmac(key: Uint8Array): Hash;
|
|
164
|
+
static new_shake128(): Hash;
|
|
164
165
|
static new_shake128_hmac(key: Uint8Array): Hash;
|
|
166
|
+
static new_shake256(): Hash;
|
|
165
167
|
static new_shake256_hmac(key: Uint8Array): Hash;
|
|
166
|
-
static
|
|
167
|
-
static
|
|
168
|
+
static new_sm3_hmac(key: Uint8Array): Hash;
|
|
169
|
+
static new_sm3(): Hash;
|
|
170
|
+
static new_blake2s(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
171
|
+
static new_blake2b(key: Uint8Array | null | undefined, output_len: number): Hash;
|
|
172
|
+
block_size(): number;
|
|
168
173
|
sum(): Uint8Array;
|
|
169
174
|
read(buf: Uint8Array): number;
|
|
170
175
|
size(): number;
|
|
171
176
|
flush(): void;
|
|
172
177
|
reset(): void;
|
|
173
178
|
write(data: Uint8Array): number;
|
|
174
|
-
static new_md2(): Hash;
|
|
175
|
-
static new_md4(): Hash;
|
|
176
|
-
static new_md5(): Hash;
|
|
177
|
-
static new_sm3(): Hash;
|
|
178
|
-
static new_sha1(): Hash;
|
|
179
179
|
}
|
|
180
180
|
export class StreamCipher {
|
|
181
181
|
private constructor();
|
|
182
182
|
free(): void;
|
|
183
183
|
[Symbol.dispose](): void;
|
|
184
|
+
static new_multi2_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
185
|
+
static new_multi2_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
186
|
+
static new_multi2_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
187
|
+
static new_rc4(key: Uint8Array): StreamCipher;
|
|
188
|
+
static new_salsa20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
189
|
+
static new_chacha20(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
184
190
|
static new_rabbit(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
191
|
+
static new_sosemanuk(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
192
|
+
static new_sober128(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
193
|
+
decrypt(data: Uint8Array): void;
|
|
194
|
+
encrypt(data: Uint8Array): void;
|
|
185
195
|
static new_aes_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
186
196
|
static new_aes_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
187
197
|
static new_aes_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
198
|
+
static new_aria_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
199
|
+
static new_aria_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
200
|
+
static new_aria_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
201
|
+
static new_blowfish_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
202
|
+
static new_blowfish_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
203
|
+
static new_blowfish_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
204
|
+
static new_cast5_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
205
|
+
static new_cast5_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
206
|
+
static new_cast5_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
188
207
|
static new_des_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
189
208
|
static new_des_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
190
209
|
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;
|
|
210
|
+
static new_tripledes_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
211
|
+
static new_tripledes_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
212
|
+
static new_tripledes_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
204
213
|
static new_tea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
205
214
|
static new_tea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
206
215
|
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;
|
|
216
|
+
static new_twofish_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
217
|
+
static new_twofish_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
218
|
+
static new_twofish_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
215
219
|
static new_xtea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
216
220
|
static new_xtea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
217
221
|
static new_xtea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
218
|
-
static
|
|
219
|
-
static
|
|
220
|
-
static
|
|
222
|
+
static new_idea_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
223
|
+
static new_idea_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
224
|
+
static new_idea_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
225
|
+
static new_rc6_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
226
|
+
static new_rc6_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
227
|
+
static new_rc6_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
228
|
+
static new_sm4_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
229
|
+
static new_sm4_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
230
|
+
static new_sm4_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
231
|
+
static new_skipjack_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
232
|
+
static new_skipjack_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
233
|
+
static new_skipjack_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
234
|
+
static new_kasumi_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
235
|
+
static new_kasumi_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
236
|
+
static new_kasumi_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
221
237
|
static new_kseed_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
222
238
|
static new_kseed_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
223
239
|
static new_kseed_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
224
|
-
static new_sosemanuk(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
225
240
|
static new_anubis_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
226
241
|
static new_anubis_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
227
242
|
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
243
|
static new_noekeon_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
238
244
|
static new_noekeon_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
239
245
|
static new_noekeon_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
246
|
+
static new_khazad_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
247
|
+
static new_khazad_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
248
|
+
static new_khazad_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
240
249
|
static new_serpent_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
241
250
|
static new_serpent_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
242
251
|
static new_serpent_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
243
|
-
static
|
|
244
|
-
static
|
|
245
|
-
static
|
|
246
|
-
static
|
|
247
|
-
static
|
|
248
|
-
static
|
|
252
|
+
static new_rc2_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
253
|
+
static new_rc2_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
254
|
+
static new_rc2_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
255
|
+
static new_rc5_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
256
|
+
static new_rc5_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
257
|
+
static new_rc5_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
249
258
|
static new_camellia_cfb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
250
259
|
static new_camellia_ctr(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
251
260
|
static new_camellia_ofb(key: Uint8Array, iv: Uint8Array, rounds?: number | null): StreamCipher;
|
|
252
|
-
static new_skipjack_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
253
|
-
static new_skipjack_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
254
|
-
static new_skipjack_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
255
|
-
static new_tripledes_cfb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
256
|
-
static new_tripledes_ctr(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
257
|
-
static new_tripledes_ofb(key: Uint8Array, iv: Uint8Array): StreamCipher;
|
|
258
|
-
decrypt(data: Uint8Array): void;
|
|
259
|
-
encrypt(data: Uint8Array): void;
|
|
260
|
-
static new_rc4(key: Uint8Array): StreamCipher;
|
|
261
261
|
}
|