@mtkruto/node 0.0.999 → 0.1.100
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/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/3_errors.d.ts +1531 -0
- package/esm/3_errors.js +1531 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +25 -0
- package/esm/4_errors.js +64 -0
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/4_client.d.ts +2 -1
- package/esm/client/4_client.js +24 -41
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.3.2}/mod.d.ts +2 -6
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/mod.js +158 -0
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.d.ts +2 -0
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +308 -0
- package/esm/mod.d.ts +3 -2
- package/esm/mod.js +3 -2
- package/esm/tl/2_types.d.ts +1 -1
- package/esm/tl/2_types.js +1 -2
- package/esm/tl/3_functions.d.ts +1 -1
- package/esm/tl/3_functions.js +1 -2
- package/esm/transport/0_obfuscation.js +1 -1
- package/esm/transport/0_transport.js +2 -2
- package/esm/types/0__file_id.js +0 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_bot_command_scope.js +1 -1
- package/esm/types/1_chat.d.ts +1 -1
- package/esm/types/1_chat.js +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/3_message.d.ts +12 -12
- package/esm/types/3_message.js +12 -12
- package/esm/types/5_inline_query_result.d.ts +1 -1
- package/esm/types/5_inline_query_result.js +1 -1
- package/esm/utilities/0_crypto.d.ts +1 -2
- package/esm/utilities/0_crypto.js +5 -12
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +3 -4
- package/script/3_errors.d.ts +1531 -0
- package/script/3_errors.js +2053 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +25 -0
- package/script/4_errors.js +88 -0
- package/script/client/2_client_plain.js +1 -1
- package/script/client/4_client.d.ts +2 -1
- package/script/client/4_client.js +24 -41
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.3.2}/mod.d.ts +2 -6
- package/script/deps/deno.land/x/tgcrypto@0.3.2/mod.js +171 -0
- package/script/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.d.ts +2 -0
- package/script/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +310 -0
- package/script/mod.d.ts +3 -2
- package/script/mod.js +16 -3
- package/script/tl/2_types.d.ts +1 -1
- package/script/tl/2_types.js +0 -1
- package/script/tl/3_functions.d.ts +1 -1
- package/script/tl/3_functions.js +0 -1
- package/script/transport/0_obfuscation.js +1 -1
- package/script/transport/0_transport.js +2 -2
- package/script/types/0__file_id.js +0 -1
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat.d.ts +1 -1
- package/script/types/1_chat.js +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/3_message.d.ts +12 -12
- package/script/types/3_message.js +12 -12
- package/script/types/5_inline_query_result.d.ts +1 -1
- package/script/types/5_inline_query_result.js +1 -1
- package/script/utilities/0_crypto.d.ts +1 -2
- package/script/utilities/0_crypto.js +4 -11
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/mod.js +0 -68
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1078
- package/script/deps/deno.land/x/tgcrypto@0.1.3/mod.js +0 -82
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1080
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.factorize = exports.cbc256Decrypt = exports.cbc256Encrypt = exports.ctr256Decrypt = exports.ctr256Encrypt = exports.ige256Decrypt = exports.ige256Encrypt = exports.init = void 0;
|
|
7
|
-
const tgcrypto_js_1 = __importDefault(require("./tgcrypto.js"));
|
|
8
|
-
// deno-lint-ignore no-explicit-any
|
|
9
|
-
let module_;
|
|
10
|
-
const promise = (0, tgcrypto_js_1.default)().then((v) => module_ = v);
|
|
11
|
-
async function init() {
|
|
12
|
-
await promise;
|
|
13
|
-
}
|
|
14
|
-
exports.init = init;
|
|
15
|
-
/**
|
|
16
|
-
* Performs IGE-256 encryption.
|
|
17
|
-
*
|
|
18
|
-
* @param data The unencrypted data, larger than a byte, divisible by 16
|
|
19
|
-
* @param key 32-byte encryption key
|
|
20
|
-
* @param iv 32-byte initialization vector
|
|
21
|
-
*/
|
|
22
|
-
function ige256Encrypt(data, key, iv) {
|
|
23
|
-
return module_.ige256Encrypt(data, key, iv);
|
|
24
|
-
}
|
|
25
|
-
exports.ige256Encrypt = ige256Encrypt;
|
|
26
|
-
/**
|
|
27
|
-
* Performs IGE-256 decryption.
|
|
28
|
-
*
|
|
29
|
-
* @param data The encrypted data, larger than a byte, divisible by 16
|
|
30
|
-
* @param key 32-byte encryption key
|
|
31
|
-
* @param iv 32-byte initialization vector
|
|
32
|
-
*/
|
|
33
|
-
function ige256Decrypt(data, key, iv) {
|
|
34
|
-
return module_.ige256Decrypt(data, key, iv);
|
|
35
|
-
}
|
|
36
|
-
exports.ige256Decrypt = ige256Decrypt;
|
|
37
|
-
/**
|
|
38
|
-
* Performs CTR-256 encryption.
|
|
39
|
-
*
|
|
40
|
-
* @param data The data, larger than a byte
|
|
41
|
-
* @param key 32-byte encryption key
|
|
42
|
-
* @param iv 16-byte initialization vector
|
|
43
|
-
* @param state 1-byte state
|
|
44
|
-
*/
|
|
45
|
-
function ctr256Encrypt(data, key, iv, state) {
|
|
46
|
-
return module_.ctr256Encrypt(data, key, iv, state);
|
|
47
|
-
}
|
|
48
|
-
exports.ctr256Encrypt = ctr256Encrypt;
|
|
49
|
-
/**
|
|
50
|
-
* Alias of `ctr256Encrypt`
|
|
51
|
-
*/
|
|
52
|
-
function ctr256Decrypt(data, key, iv, state) {
|
|
53
|
-
return module_.ctr256Decrypt(data, key, iv, state);
|
|
54
|
-
}
|
|
55
|
-
exports.ctr256Decrypt = ctr256Decrypt;
|
|
56
|
-
/**
|
|
57
|
-
* Performs CBC-256 encryption.
|
|
58
|
-
*
|
|
59
|
-
* @param data The unencrypted data, larger than a byte, divisible by 16
|
|
60
|
-
* @param key 32-byte encryption key
|
|
61
|
-
* @param iv 16-byte initialization vector
|
|
62
|
-
*/
|
|
63
|
-
function cbc256Encrypt(data, key, iv) {
|
|
64
|
-
return module_.cbc256Encrypt(data, key, iv);
|
|
65
|
-
}
|
|
66
|
-
exports.cbc256Encrypt = cbc256Encrypt;
|
|
67
|
-
/**
|
|
68
|
-
* Performs CBC-256 decryption.
|
|
69
|
-
*
|
|
70
|
-
* @param data The encrypted data, larger than a byte, divisible by 16
|
|
71
|
-
* @param key 32-byte encryption key
|
|
72
|
-
* @param iv 16-byte initialization vector
|
|
73
|
-
*/
|
|
74
|
-
function cbc256Decrypt(data, key, iv) {
|
|
75
|
-
return module_.cbc256Decrypt(data, key, iv);
|
|
76
|
-
}
|
|
77
|
-
exports.cbc256Decrypt = cbc256Decrypt;
|
|
78
|
-
function factorize(pq) {
|
|
79
|
-
const vector = module_.factorize(pq);
|
|
80
|
-
return [vector.get(0), vector.get(1)];
|
|
81
|
-
}
|
|
82
|
-
exports.factorize = factorize;
|