@mtkruto/node 0.76.1 → 0.77.1
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 -2
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +1 -2
- package/esm/0_errors.d.ts +6 -0
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +11 -0
- package/esm/1_utilities.d.ts +1 -2
- package/esm/1_utilities.d.ts.map +1 -1
- package/esm/1_utilities.js +1 -2
- package/esm/2_tl.d.ts +0 -1
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +0 -1
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +8 -8
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +2 -2
- package/esm/client/1_client_plain.js +14 -14
- package/{script/deps/jsr.io/@std/assert/1.0.12 → esm/deps/jsr.io/@std/assert/1.0.16}/is_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/not_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/throws.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.d.ts.map +1 -1
- package/esm/session/2_session_encrypted.js +6 -5
- package/esm/session/2_session_plain.js +2 -2
- package/esm/tl/0_utilities.d.ts +1 -0
- package/esm/tl/0_utilities.d.ts.map +1 -1
- package/esm/tl/0_utilities.js +3 -0
- package/esm/tl/1_tl_reader.d.ts +6 -8
- package/esm/tl/1_tl_reader.d.ts.map +1 -1
- package/esm/tl/1_tl_reader.js +39 -30
- package/esm/tl/1_tl_writer.d.ts +5 -5
- package/esm/tl/1_tl_writer.d.ts.map +1 -1
- package/esm/tl/1_tl_writer.js +49 -35
- package/esm/transport/0_obfuscation.d.ts.map +1 -1
- package/esm/transport/0_obfuscation.js +2 -2
- package/esm/transport/1_transport_abridged.js +3 -3
- package/esm/transport/1_transport_intermediate.js +2 -2
- package/esm/types/0_link_preview_media_size.d.ts +19 -0
- package/esm/types/0_link_preview_media_size.d.ts.map +1 -1
- package/esm/types/0_link_preview_media_size.js +19 -0
- package/esm/types/7_saved_chat.d.ts.map +1 -1
- package/esm/types/7_saved_chat.js +1 -1
- package/esm/utilities/0_int.d.ts +52 -0
- package/esm/utilities/0_int.d.ts.map +1 -0
- package/esm/utilities/0_int.js +141 -0
- package/esm/utilities/0_int_test.d.ts.map +1 -0
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_auth.js +3 -4
- package/esm/utilities/1_base64.js +1 -1
- package/esm/utilities/1_crypto.d.ts.map +1 -1
- package/esm/utilities/1_crypto.js +2 -3
- package/esm/utilities/1_math.js +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -2
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +2 -4
- package/script/0_errors.d.ts +6 -0
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +13 -1
- package/script/1_utilities.d.ts +1 -2
- package/script/1_utilities.d.ts.map +1 -1
- package/script/1_utilities.js +1 -2
- package/script/2_tl.d.ts +0 -1
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +1 -3
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +7 -7
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +1 -1
- package/script/client/1_client_plain.js +13 -13
- package/{esm/deps/jsr.io/@std/assert/1.0.12 → script/deps/jsr.io/@std/assert/1.0.16}/is_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/not_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/throws.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts.map +1 -1
- package/script/session/2_session_encrypted.d.ts.map +1 -1
- package/script/session/2_session_encrypted.js +5 -4
- package/script/session/2_session_plain.js +1 -1
- package/script/tl/0_utilities.d.ts +1 -0
- package/script/tl/0_utilities.d.ts.map +1 -1
- package/script/tl/0_utilities.js +4 -0
- package/script/tl/1_tl_reader.d.ts +6 -8
- package/script/tl/1_tl_reader.d.ts.map +1 -1
- package/script/tl/1_tl_reader.js +38 -30
- package/script/tl/1_tl_writer.d.ts +5 -5
- package/script/tl/1_tl_writer.d.ts.map +1 -1
- package/script/tl/1_tl_writer.js +49 -35
- package/script/transport/0_obfuscation.d.ts.map +1 -1
- package/script/transport/0_obfuscation.js +1 -1
- package/script/transport/1_transport_abridged.js +2 -2
- package/script/transport/1_transport_intermediate.js +1 -1
- package/script/types/0_link_preview_media_size.d.ts +19 -0
- package/script/types/0_link_preview_media_size.d.ts.map +1 -1
- package/script/types/0_link_preview_media_size.js +19 -0
- package/script/types/7_saved_chat.d.ts.map +1 -1
- package/script/types/7_saved_chat.js +3 -3
- package/script/utilities/0_int.d.ts +52 -0
- package/script/utilities/0_int.d.ts.map +1 -0
- package/script/utilities/{0_bigint.js → 0_int.js} +66 -15
- package/script/utilities/0_int_test.d.ts.map +1 -0
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +4 -5
- package/script/utilities/1_base64.js +2 -2
- package/script/utilities/1_crypto.d.ts.map +1 -1
- package/script/utilities/1_crypto.js +2 -3
- package/script/utilities/1_math.js +4 -4
- package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts +0 -15
- package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.js +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -52
- package/esm/tl/0_tl_error.d.ts +0 -23
- package/esm/tl/0_tl_error.d.ts.map +0 -1
- package/esm/tl/0_tl_error.js +0 -22
- package/esm/utilities/0_bigint.d.ts +0 -10
- package/esm/utilities/0_bigint.d.ts.map +0 -1
- package/esm/utilities/0_bigint.js +0 -91
- package/esm/utilities/0_bigint_test.d.ts.map +0 -1
- package/esm/utilities/0_buffer.d.ts +0 -21
- package/esm/utilities/0_buffer.d.ts.map +0 -1
- package/esm/utilities/0_buffer.js +0 -51
- package/esm/utilities/0_buffer_test.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts +0 -15
- package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.js +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -55
- package/script/tl/0_tl_error.d.ts +0 -23
- package/script/tl/0_tl_error.d.ts.map +0 -1
- package/script/tl/0_tl_error.js +0 -26
- package/script/utilities/0_bigint.d.ts +0 -10
- package/script/utilities/0_bigint.d.ts.map +0 -1
- package/script/utilities/0_bigint_test.d.ts.map +0 -1
- package/script/utilities/0_buffer.d.ts +0 -21
- package/script/utilities/0_buffer.d.ts.map +0 -1
- package/script/utilities/0_buffer.js +0 -54
- package/script/utilities/0_buffer_test.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.js +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.js +0 -0
package/esm/0_deps.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export { assert } from "./deps/jsr.io/@std/assert/1.0.16/assert.js";
|
|
|
21
21
|
export { assertFalse } from "./deps/jsr.io/@std/assert/1.0.16/false.js";
|
|
22
22
|
export { assertEquals } from "./deps/jsr.io/@std/assert/1.0.16/equals.js";
|
|
23
23
|
export { unreachable } from "./deps/jsr.io/@std/assert/1.0.16/unreachable.js";
|
|
24
|
-
export { assertInstanceOf } from "./deps/jsr.io/@std/assert/1.0.16/instance_of.js";
|
|
25
24
|
export { AssertionError } from "./deps/jsr.io/@std/assert/1.0.16/assertion_error.js";
|
|
26
25
|
export { join } from "./deps/jsr.io/@std/path/1.1.3/join.js";
|
|
27
26
|
export { extname } from "./deps/jsr.io/@std/path/1.1.3/extname.js";
|
|
@@ -34,7 +33,7 @@ export { LruCache } from "./deps/jsr.io/@std/cache/0.2.1/lru_cache.js";
|
|
|
34
33
|
export { iterateReader } from "./deps/jsr.io/@std/io/0.225.2/iterate_reader.js";
|
|
35
34
|
export { format } from "./deps/jsr.io/@std/datetime/0.225.5/format.js";
|
|
36
35
|
export { MINUTE, SECOND } from "./deps/jsr.io/@std/datetime/0.225.5/constants.js";
|
|
37
|
-
export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.
|
|
36
|
+
export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.14/to_array_buffer.js";
|
|
38
37
|
export { decodeBase64, encodeBase64 } from "./deps/jsr.io/@std/encoding/1.0.7/base64.js";
|
|
39
38
|
export { encodeHex } from "./deps/jsr.io/@std/encoding/1.0.7/hex.js";
|
|
40
39
|
import { contentType as contentType_ } from "./deps/jsr.io/@std/media-types/1.1.0/content_type.js";
|
package/esm/0_deps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_deps.d.ts","sourceRoot":"","sources":["../src/0_deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"0_deps.d.ts","sourceRoot":"","sources":["../src/0_deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kDAAkD,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACnG,eAAO,MAAM,WAAW,EAAE,OAAO,YAMhC,CAAC;AAEF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,UAMzC;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,+CAA+C,CAAC"}
|
package/esm/0_deps.js
CHANGED
|
@@ -21,7 +21,6 @@ export { assert } from "./deps/jsr.io/@std/assert/1.0.16/assert.js";
|
|
|
21
21
|
export { assertFalse } from "./deps/jsr.io/@std/assert/1.0.16/false.js";
|
|
22
22
|
export { assertEquals } from "./deps/jsr.io/@std/assert/1.0.16/equals.js";
|
|
23
23
|
export { unreachable } from "./deps/jsr.io/@std/assert/1.0.16/unreachable.js";
|
|
24
|
-
export { assertInstanceOf } from "./deps/jsr.io/@std/assert/1.0.16/instance_of.js";
|
|
25
24
|
export { AssertionError } from "./deps/jsr.io/@std/assert/1.0.16/assertion_error.js";
|
|
26
25
|
export { join } from "./deps/jsr.io/@std/path/1.1.3/join.js";
|
|
27
26
|
export { extname } from "./deps/jsr.io/@std/path/1.1.3/extname.js";
|
|
@@ -34,7 +33,7 @@ export { LruCache } from "./deps/jsr.io/@std/cache/0.2.1/lru_cache.js";
|
|
|
34
33
|
export { iterateReader } from "./deps/jsr.io/@std/io/0.225.2/iterate_reader.js";
|
|
35
34
|
export { format } from "./deps/jsr.io/@std/datetime/0.225.5/format.js";
|
|
36
35
|
export { MINUTE, SECOND } from "./deps/jsr.io/@std/datetime/0.225.5/constants.js";
|
|
37
|
-
export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.
|
|
36
|
+
export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.14/to_array_buffer.js";
|
|
38
37
|
export { decodeBase64, encodeBase64 } from "./deps/jsr.io/@std/encoding/1.0.7/base64.js";
|
|
39
38
|
export { encodeHex } from "./deps/jsr.io/@std/encoding/1.0.7/hex.js";
|
|
40
39
|
import { contentType as contentType_ } from "./deps/jsr.io/@std/media-types/1.1.0/content_type.js";
|
package/esm/0_errors.d.ts
CHANGED
|
@@ -32,4 +32,10 @@ export declare class TransportError extends MtkrutoError {
|
|
|
32
32
|
readonly code: number;
|
|
33
33
|
constructor(code: number);
|
|
34
34
|
}
|
|
35
|
+
export declare class TLError extends MtkrutoError {
|
|
36
|
+
#private;
|
|
37
|
+
name: string;
|
|
38
|
+
constructor(message: string, path: string[]);
|
|
39
|
+
get path(): string[];
|
|
40
|
+
}
|
|
35
41
|
//# sourceMappingURL=0_errors.d.ts.map
|
package/esm/0_errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_errors.d.ts","sourceRoot":"","sources":["../src/0_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8BAAsB,YAAa,SAAQ,KAAK;CAC/C;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,UAAW,SAAQ,YAAY;gBAC9B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,cAAe,SAAQ,YAAY;aAClB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC"}
|
|
1
|
+
{"version":3,"file":"0_errors.d.ts","sourceRoot":"","sources":["../src/0_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8BAAsB,YAAa,SAAQ,KAAK;CAC/C;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,UAAW,SAAQ,YAAY;gBAC9B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,cAAe,SAAQ,YAAY;aAClB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC;AAED,qBAAa,OAAQ,SAAQ,YAAY;;IAC9B,IAAI,SAAa;gBAGd,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAK3C,IAAI,IAAI,IAAI,MAAM,EAAE,CAEnB;CACF"}
|
package/esm/0_errors.js
CHANGED
|
@@ -45,3 +45,14 @@ export class TransportError extends MtkrutoError {
|
|
|
45
45
|
this.name = "TransportError";
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
export class TLError extends MtkrutoError {
|
|
49
|
+
name = "TLError";
|
|
50
|
+
#path;
|
|
51
|
+
constructor(message, path) {
|
|
52
|
+
super(`${message}${path.length ? ` at ${path.join(" ")}` : ""}`);
|
|
53
|
+
this.#path = path;
|
|
54
|
+
}
|
|
55
|
+
get path() {
|
|
56
|
+
return this.#path;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/esm/1_utilities.d.ts
CHANGED
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import "./_dnt.polyfills.js";
|
|
21
|
-
export * from "./utilities/
|
|
22
|
-
export * from "./utilities/0_buffer.js";
|
|
21
|
+
export * from "./utilities/0_int.js";
|
|
23
22
|
export * from "./utilities/0_color.js";
|
|
24
23
|
export * from "./utilities/0_gzip.js";
|
|
25
24
|
export * from "./utilities/0_hash.js";
|
package/esm/1_utilities.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_utilities.d.ts","sourceRoot":"","sources":["../src/1_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,
|
|
1
|
+
{"version":3,"file":"1_utilities.d.ts","sourceRoot":"","sources":["../src/1_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,qBAAqB,CAAC;AAG7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
package/esm/1_utilities.js
CHANGED
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import "./_dnt.polyfills.js";
|
|
21
|
-
export * from "./utilities/
|
|
22
|
-
export * from "./utilities/0_buffer.js";
|
|
21
|
+
export * from "./utilities/0_int.js";
|
|
23
22
|
export * from "./utilities/0_color.js";
|
|
24
23
|
export * from "./utilities/0_gzip.js";
|
|
25
24
|
export * from "./utilities/0_hash.js";
|
package/esm/2_tl.d.ts
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
export { TLError } from "./tl/0_tl_error.js";
|
|
21
20
|
export * from "./tl/0_utilities.js";
|
|
22
21
|
export * from "./tl/1_tl_reader.js";
|
|
23
22
|
export * from "./tl/1_tl_writer.js";
|
package/esm/2_tl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_tl.d.ts","sourceRoot":"","sources":["../src/2_tl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,
|
|
1
|
+
{"version":3,"file":"2_tl.d.ts","sourceRoot":"","sources":["../src/2_tl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC"}
|
package/esm/2_tl.js
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
export { TLError } from "./tl/0_tl_error.js";
|
|
21
20
|
export * from "./tl/0_utilities.js";
|
|
22
21
|
export * from "./tl/1_tl_reader.js";
|
|
23
22
|
export * from "./tl/1_tl_writer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_password.d.ts","sourceRoot":"","sources":["../../src/client/0_password.ts"],"names":[],"mappings":"AAuBA,OAAO,
|
|
1
|
+
{"version":3,"file":"0_password.d.ts","sourceRoot":"","sources":["../../src/client/0_password.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAmE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,WAgC5D;AAGD,eAAO,MAAM,CAAC,eAAS,CAAC;AAGxB,eAAO,MAAM,EAAE,GAAI,MAAM,UAAU,EAAE,MAAM,UAAU,qCAAkC,CAAC;AAGxF,eAAO,MAAM,GAAG,GAAU,UAAU,UAAU,EAAE,OAAO,UAAU,EAAE,OAAO,UAAU,qCAA+C,CAAC;AAEpI,wBAAsB,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,oCAIhH;AAGD,eAAO,MAAM,GAAG,GAAU,UAAU,UAAU,EAAE,OAAO,UAAU,CAAC,WAAW,CAAC,EAAE,OAAO,UAAU,qCAAqF,CAAC;AAEvL,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,WAWd;AAED,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,2BASvD;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAyFnH"}
|
package/esm/client/0_password.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import * as dntShim from "../_dnt.shims.js";
|
|
21
21
|
import { concat } from "../0_deps.js";
|
|
22
|
-
import {
|
|
22
|
+
import { encodeText, getRandomInt, intFromBytes, intToBytes, mod, modExp, sha256 } from "../1_utilities.js";
|
|
23
23
|
import { Api } from "../2_tl.js";
|
|
24
24
|
export function isSafePrime(primeBytes, g) {
|
|
25
25
|
// deno-fmt-ignore
|
|
@@ -81,7 +81,7 @@ export function pad(bigint) {
|
|
|
81
81
|
bigint = BigInt(bigint);
|
|
82
82
|
}
|
|
83
83
|
if (typeof bigint === "bigint") {
|
|
84
|
-
return
|
|
84
|
+
return intToBytes(bigint, 256, { byteOrder: "big", isSigned: false });
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
87
|
return concat([new Uint8Array(256 - bigint.length), bigint]);
|
|
@@ -96,7 +96,7 @@ export async function checkPassword(password_, ap) {
|
|
|
96
96
|
// g := algo.g
|
|
97
97
|
const g = algo.g;
|
|
98
98
|
// p := algo.p
|
|
99
|
-
const p =
|
|
99
|
+
const p = intFromBytes(algo.p, { byteOrder: "big", isSigned: false });
|
|
100
100
|
if (!isSafePrime(algo.p, g)) {
|
|
101
101
|
throw new Error("Got unsafe prime");
|
|
102
102
|
}
|
|
@@ -115,18 +115,18 @@ export async function checkPassword(password_, ap) {
|
|
|
115
115
|
// salt2 := algo.salt2
|
|
116
116
|
const salt2 = algo.salt2;
|
|
117
117
|
// g_b := srp_B
|
|
118
|
-
const gB =
|
|
118
|
+
const gB = intFromBytes(srpB, { byteOrder: "big", isSigned: false });
|
|
119
119
|
// k := H(p | g)
|
|
120
|
-
const k =
|
|
120
|
+
const k = intFromBytes(await h(concat([pad(p), pad(g)])), { byteOrder: "big", isSigned: false });
|
|
121
121
|
let u = 0n;
|
|
122
122
|
let a = 0n;
|
|
123
123
|
let gA = 0n;
|
|
124
124
|
for (let i = 0; i < 1_000; i++) {
|
|
125
|
-
a =
|
|
125
|
+
a = getRandomInt(256, false);
|
|
126
126
|
// g_a := pow(g, a) mod p
|
|
127
127
|
gA = modExp(BigInt(g), a, p);
|
|
128
128
|
if (isGoodModExpFirst(gA, p)) {
|
|
129
|
-
u =
|
|
129
|
+
u = intFromBytes(await sha256(concat([pad(gA), pad(gB)])), { byteOrder: "big", isSigned: false });
|
|
130
130
|
if (u > 0n) {
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
@@ -136,7 +136,7 @@ export async function checkPassword(password_, ap) {
|
|
|
136
136
|
throw new Error();
|
|
137
137
|
}
|
|
138
138
|
// x := PH2(password, salt1, salt2)
|
|
139
|
-
const x =
|
|
139
|
+
const x = intFromBytes(await ph2(password, salt1, salt2), { byteOrder: "big", isSigned: false });
|
|
140
140
|
// v := pow(g, x) mod p
|
|
141
141
|
const v = modExp(BigInt(g), x, p);
|
|
142
142
|
// k_v := (k * v) mod p
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_storage_operations.d.ts","sourceRoot":"","sources":["../../src/client/0_storage_operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"0_storage_operations.d.ts","sourceRoot":"","sources":["../../src/client/0_storage_operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAkF,KAAK,YAAY,EAA+C,MAAM,mBAAmB,CAAC;AAEnL,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,GAAG,EAAyB,MAAM,YAAY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20,7 @@
|
|
|
20
20
|
import { MINUTE } from "../0_deps.js";
|
|
21
21
|
import { LruCache, unreachable } from "../0_deps.js";
|
|
22
22
|
import { InputError } from "../0_errors.js";
|
|
23
|
-
import { base64DecodeUrlSafe, base64EncodeUrlSafe,
|
|
23
|
+
import { base64DecodeUrlSafe, base64EncodeUrlSafe, getLogger, intFromBytes, rleDecode, rleEncode, sha1, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
24
24
|
import { awaitablePooledMap } from "../1_utilities.js";
|
|
25
25
|
import { fromString, toString } from "../2_storage.js";
|
|
26
26
|
import { Api, TLReader, TLWriter, X } from "../2_tl.js";
|
|
@@ -699,7 +699,7 @@ class StorageAuth extends StorageValue {
|
|
|
699
699
|
#authKeyId = null;
|
|
700
700
|
async #resetAuthKeyId(auth) {
|
|
701
701
|
if (auth?.authKey) {
|
|
702
|
-
this.#authKeyId =
|
|
702
|
+
this.#authKeyId = intFromBytes((await sha1(auth.authKey)).subarray(-8));
|
|
703
703
|
}
|
|
704
704
|
else {
|
|
705
705
|
this.#authKeyId = null;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { assert, assertEquals, concat, ige256Decrypt, ige256Encrypt, unreachable } from "../0_deps.js";
|
|
21
|
-
import {
|
|
21
|
+
import { factorize, getLogger, getRandomInt, intFromBytes, intToBytes, modExp, rsaPad, sha1 } from "../1_utilities.js";
|
|
22
22
|
import { Mtproto } from "../2_tl.js";
|
|
23
23
|
import { getDcId } from "../3_transport.js";
|
|
24
24
|
import { PUBLIC_KEYS } from "../4_constants.js";
|
|
@@ -43,7 +43,7 @@ export class ClientPlain extends ClientAbstract {
|
|
|
43
43
|
return await Mtproto.deserializeType(Mtproto.mustGetReturnType(function_._), body);
|
|
44
44
|
}
|
|
45
45
|
async createAuthKey() {
|
|
46
|
-
const nonce =
|
|
46
|
+
const nonce = getRandomInt(16);
|
|
47
47
|
LcreateAuthKey.debug("auth key creation started");
|
|
48
48
|
let resPq = null;
|
|
49
49
|
for (let i = 0; i < 10; i++) {
|
|
@@ -62,13 +62,13 @@ export class ClientPlain extends ClientAbstract {
|
|
|
62
62
|
if (!resPq) {
|
|
63
63
|
unreachable();
|
|
64
64
|
}
|
|
65
|
-
const pq_ =
|
|
65
|
+
const pq_ = intFromBytes(resPq.pq, { byteOrder: "big", isSigned: false });
|
|
66
66
|
LcreateAuthKey.debug(`pq=${pq_}`);
|
|
67
67
|
const [p_, q_] = factorize(pq_);
|
|
68
68
|
LcreateAuthKey.debug("factorized pq");
|
|
69
69
|
LcreateAuthKey.debug(`p=${p_}, q=${q_}`);
|
|
70
|
-
const p =
|
|
71
|
-
const q =
|
|
70
|
+
const p = intToBytes(p_, 4, { byteOrder: "big", isSigned: false });
|
|
71
|
+
const q = intToBytes(q_, 4, { byteOrder: "big", isSigned: false });
|
|
72
72
|
let publicKeyFingerprint;
|
|
73
73
|
let publicKey;
|
|
74
74
|
for (const fingerprint of resPq.server_public_key_fingerprints) {
|
|
@@ -85,7 +85,7 @@ export class ClientPlain extends ClientAbstract {
|
|
|
85
85
|
const dc = getDcId(this.dc, this.cdn);
|
|
86
86
|
const pq = resPq.pq;
|
|
87
87
|
const serverNonce = resPq.server_nonce;
|
|
88
|
-
const newNonce =
|
|
88
|
+
const newNonce = getRandomInt(32);
|
|
89
89
|
let encryptedData = await rsaPad(Mtproto.serializeObject({
|
|
90
90
|
_: "p_q_inner_data_dc",
|
|
91
91
|
pq,
|
|
@@ -107,23 +107,23 @@ export class ClientPlain extends ClientAbstract {
|
|
|
107
107
|
});
|
|
108
108
|
assert(Mtproto.is("server_DH_params_ok", dhParams));
|
|
109
109
|
LcreateAuthKey.debug("got server_DH_params_ok");
|
|
110
|
-
const newNonce_ =
|
|
111
|
-
const serverNonce_ =
|
|
110
|
+
const newNonce_ = intToBytes(newNonce, 32);
|
|
111
|
+
const serverNonce_ = intToBytes(serverNonce, 16);
|
|
112
112
|
const tmpAesKey = concat([await sha1(concat([newNonce_, serverNonce_])), (await sha1(concat([serverNonce_, newNonce_]))).subarray(0, 0 + 12)]);
|
|
113
113
|
const tmpAesIv = concat([(await sha1(concat([serverNonce_, newNonce_]))).subarray(12, 12 + 8), await sha1(concat([newNonce_, newNonce_])), newNonce_.subarray(0, 0 + 4)]);
|
|
114
114
|
const answerWithHash = ige256Decrypt(dhParams.encrypted_answer, tmpAesKey, tmpAesIv);
|
|
115
115
|
const dhInnerData = await Mtproto.deserializeType("server_DH_inner_data", answerWithHash.slice(20));
|
|
116
116
|
const { g, g_a: gA_, dh_prime: dhPrime_ } = dhInnerData;
|
|
117
|
-
const gA =
|
|
118
|
-
const dhPrime =
|
|
119
|
-
const b =
|
|
117
|
+
const gA = intFromBytes(gA_, { byteOrder: "big", isSigned: false });
|
|
118
|
+
const dhPrime = intFromBytes(dhPrime_, { byteOrder: "big", isSigned: false });
|
|
119
|
+
const b = getRandomInt(256, false);
|
|
120
120
|
const gB = modExp(BigInt(g), b, dhPrime);
|
|
121
121
|
const data = Mtproto.serializeObject({
|
|
122
122
|
_: "client_DH_inner_data",
|
|
123
123
|
nonce,
|
|
124
124
|
server_nonce: serverNonce,
|
|
125
125
|
retry_id: 0n,
|
|
126
|
-
g_b:
|
|
126
|
+
g_b: intToBytes(gB, 256, { byteOrder: "big" }),
|
|
127
127
|
});
|
|
128
128
|
let dataWithHash = concat([await sha1(data), data]);
|
|
129
129
|
while (dataWithHash.length % 16 !== 0) {
|
|
@@ -141,8 +141,8 @@ export class ClientPlain extends ClientAbstract {
|
|
|
141
141
|
const serverNonceSlice = serverNonce_.subarray(0, 8);
|
|
142
142
|
const salt = newNonce_.subarray(0, 0 + 8).map((v, i) => v ^ serverNonceSlice[i]);
|
|
143
143
|
const authKey_ = modExp(gA, b, dhPrime);
|
|
144
|
-
const authKey =
|
|
144
|
+
const authKey = intToBytes(authKey_, 256, { byteOrder: "big", isSigned: false });
|
|
145
145
|
LcreateAuthKey.debug("auth key created");
|
|
146
|
-
return [authKey,
|
|
146
|
+
return [authKey, intFromBytes(salt)];
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.
|
|
1
|
+
{"version":3,"file":"is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.
|
|
1
|
+
{"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.
|
|
1
|
+
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to_array_buffer.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/streams/1.0.
|
|
1
|
+
{"version":3,"file":"to_array_buffer.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/streams/1.0.14/to_array_buffer.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CACjC,cAAc,EAAE,cAAc,CAAC,UAAU,CAAC,GACzC,OAAO,CAAC,WAAW,CAAC,CAetB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAwD,OAAO,EAAuC,MAAM,YAAY,CAAC;AAChI,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAI5C,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAa7D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CA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AI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAED,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAiBZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAQpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAErC;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAe9B,UAAU,IAAI,IAAI;IA6ErB,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAwX3D"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { assertEquals, concat, delay, ige256Decrypt, ige256Encrypt, initTgCrypto, LruCache, SECOND } from "../0_deps.js";
|
|
21
21
|
import { ConnectionError, TransportError } from "../0_errors.js";
|
|
22
|
-
import {
|
|
22
|
+
import { drop, getLogger, getRandomId, gunzip, intFromBytes, intToBytes, mod, sha1, sha256, toUnixTimestamp } from "../1_utilities.js";
|
|
23
23
|
import { deserializeMessage, Mtproto, repr, serializeMessage, TLReader, X } from "../2_tl.js";
|
|
24
24
|
import { AbortableLoop } from "../client/0_abortable_loop.js";
|
|
25
25
|
import { TLWriter } from "../tl/1_tl_writer.js";
|
|
@@ -55,7 +55,7 @@ export class SessionEncrypted extends Session {
|
|
|
55
55
|
}
|
|
56
56
|
async setAuthKey(key) {
|
|
57
57
|
const hash = await sha1(key);
|
|
58
|
-
this.#authKeyId =
|
|
58
|
+
this.#authKeyId = intFromBytes(hash.slice(-8));
|
|
59
59
|
this.#authKey = key;
|
|
60
60
|
}
|
|
61
61
|
get authKey() {
|
|
@@ -157,7 +157,7 @@ export class SessionEncrypted extends Session {
|
|
|
157
157
|
this.#assertNotDisconnected();
|
|
158
158
|
const buffer = await this.transport.transport.receive();
|
|
159
159
|
if (buffer.length === 4) {
|
|
160
|
-
const int =
|
|
160
|
+
const int = intFromBytes(buffer);
|
|
161
161
|
throw new TransportError(Number(int));
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
@@ -166,6 +166,7 @@ export class SessionEncrypted extends Session {
|
|
|
166
166
|
return decrypted;
|
|
167
167
|
}
|
|
168
168
|
catch (err) {
|
|
169
|
+
this.#L.error("decryption error:", err);
|
|
169
170
|
await this.#invalidateSession("decryption error");
|
|
170
171
|
throw err;
|
|
171
172
|
}
|
|
@@ -190,9 +191,9 @@ export class SessionEncrypted extends Session {
|
|
|
190
191
|
}
|
|
191
192
|
async #decryptMessage(buffer) {
|
|
192
193
|
const reader = new TLReader(buffer);
|
|
193
|
-
assertEquals(reader.readInt64(
|
|
194
|
+
assertEquals(reader.readInt64(), this.#authKeyId);
|
|
194
195
|
const messageKey_ = reader.readInt128();
|
|
195
|
-
const messageKey =
|
|
196
|
+
const messageKey = intToBytes(messageKey_, 16);
|
|
196
197
|
const a = await sha256(concat([messageKey, this.#authKey.subarray(8, 44)]));
|
|
197
198
|
const b = await sha256(concat([this.#authKey.subarray(48, 84), messageKey]));
|
|
198
199
|
const aesKey = concat([a.subarray(0, 8), b.subarray(8, 24), a.subarray(24, 32)]);
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { ConnectionError, TransportError } from "../0_errors.js";
|
|
21
|
-
import {
|
|
21
|
+
import { intFromBytes } from "../1_utilities.js";
|
|
22
22
|
import { TLReader } from "../tl/1_tl_reader.js";
|
|
23
23
|
import { TLWriter } from "../tl/1_tl_writer.js";
|
|
24
24
|
import { Session } from "./1_session.js";
|
|
@@ -43,7 +43,7 @@ export class SessionPlain extends Session {
|
|
|
43
43
|
}
|
|
44
44
|
const buffer = await this.transport.transport.receive();
|
|
45
45
|
if (buffer.length === 4) {
|
|
46
|
-
const int =
|
|
46
|
+
const int = intFromBytes(buffer);
|
|
47
47
|
throw new TransportError(Number(int));
|
|
48
48
|
}
|
|
49
49
|
const reader = new TLReader(buffer);
|
package/esm/tl/0_utilities.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export declare const X = "X";
|
|
|
30
30
|
export declare const VECTOR = 481674261;
|
|
31
31
|
export declare const BOOL_TRUE = 2574415285;
|
|
32
32
|
export declare const BOOL_FALSE = 3162085175;
|
|
33
|
+
export declare function constructorIdToHex(constructorId: number): string;
|
|
33
34
|
//# sourceMappingURL=0_utilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_utilities.d.ts","sourceRoot":"","sources":["../../src/tl/0_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAY3F;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAElD;AAGD,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,CAkB3C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AAID,eAAO,MAAM,CAAC,MAAM,CAAC;AACrB,eAAO,MAAM,MAAM,YAAa,CAAC;AACjC,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,UAAU,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"0_utilities.d.ts","sourceRoot":"","sources":["../../src/tl/0_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAY3F;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAElD;AAGD,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,CAkB3C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AAID,eAAO,MAAM,CAAC,MAAM,CAAC;AACrB,eAAO,MAAM,MAAM,YAAa,CAAC;AACjC,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
package/esm/tl/0_utilities.js
CHANGED
package/esm/tl/1_tl_reader.d.ts
CHANGED
|
@@ -18,22 +18,20 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import type { Schema } from "./0_types.js";
|
|
21
|
-
export declare class TLError extends Error {
|
|
22
|
-
}
|
|
23
21
|
export declare class TLReader {
|
|
24
22
|
#private;
|
|
25
23
|
protected _buffer: Uint8Array;
|
|
26
24
|
constructor(_buffer: Uint8Array);
|
|
27
25
|
get buffer(): Uint8Array;
|
|
28
|
-
read(
|
|
26
|
+
read(byteCount: number): Uint8Array<ArrayBuffer>;
|
|
29
27
|
unread(count: number): void;
|
|
30
|
-
readInt24(
|
|
31
|
-
readInt32(
|
|
28
|
+
readInt24(isSigned?: boolean): number;
|
|
29
|
+
readInt32(isSigned?: boolean): number;
|
|
32
30
|
unreadInt32(): void;
|
|
33
|
-
readInt64(
|
|
31
|
+
readInt64(isSigned?: boolean): bigint;
|
|
34
32
|
readDouble(): number;
|
|
35
|
-
readInt128(
|
|
36
|
-
readInt256(
|
|
33
|
+
readInt128(isSigned?: boolean): bigint;
|
|
34
|
+
readInt256(isSigned?: boolean): bigint;
|
|
37
35
|
readBytes(): Uint8Array<ArrayBuffer>;
|
|
38
36
|
readString(): string;
|
|
39
37
|
readType(name: string, schema: Schema): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_tl_reader.d.ts","sourceRoot":"","sources":["../../src/tl/1_tl_reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"1_tl_reader.d.ts","sourceRoot":"","sources":["../../src/tl/1_tl_reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAoB,MAAM,EAAE,MAAM,cAAc,CAAC;AAG7D,qBAAa,QAAQ;;IAGP,SAAS,CAAC,OAAO,EAAE,UAAU;gBAAnB,OAAO,EAAE,UAAU;IAGzC,IAAI,MAAM,IAAI,UAAU,CAEvB;IAED,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC;IAUhD,MAAM,CAAC,KAAK,EAAE,MAAM;IASpB,SAAS,CAAC,QAAQ,UAAO,GAAG,MAAM;IAKlC,SAAS,CAAC,QAAQ,UAAO,GAAG,MAAM;IAKlC,WAAW;IAIX,SAAS,CAAC,QAAQ,UAAO,GAAG,MAAM;IAKlC,UAAU,IAAI,MAAM;IAKpB,UAAU,CAAC,QAAQ,UAAO,GAAG,MAAM;IAKnC,UAAU,CAAC,QAAQ,UAAO,GAAG,MAAM;IAKnC,SAAS,IAAI,UAAU,CAAC,WAAW,CAAC;IAiBpC,UAAU,IAAI,MAAM;IAId,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CA6H3D"}
|