mtcute/packages/tl/raw-schema.json

1 line
757 KiB
JSON
Raw Normal View History

{"mtproto":{"$root":{"classes":[{"name":"resPQ","id":85337187,"type":"ResPQ","arguments":[{"name":"nonce","type":"Int128","description":"Client nonce that was generated earlier"},{"name":"serverNonce","type":"Int128","description":"Random number generated by the server, used in the later steps"},{"name":"pq","type":"Buffer","description":"Big endian representation of a natural number, which is a product of two different odd prime numbers. Normally, this value is `<= 2^63-1`. Client is expected to decompose this product to `p` and `q`.\n"},{"name":"serverPublicKeyFingerprints","type":"Long[]","description":"List of public RSA key fingerprints, which are computed as follows:\n - First, the modulus and the exponent are extracted from the key\n - Then, the following TL type is written: `rsa_public_key n:string e:string = RSAPublicKey`\n - This is a bare type, meaning there's no 4-byte type number before it\n - `n` is the modulus, `e` is the exponent, encoded as big-endian\n - Finally, SHA1 is computed, and its last 8 bytes are taken and parsed as LE long\n (i.e. `parse_int64_le(sha1(rsa_public_key).slice(-8))`)\n\nClient is expected to choose out of those keys any single one that it has\nembedded in itself and return one of them in the following request.\n"}],"description":"Response for the first step of Authorization key derivation process"},{"name":"p_q_inner_data_dc","id":2851430293,"type":"P_Q_inner_data","arguments":[{"name":"pq","type":"Buffer"},{"name":"p","type":"Buffer"},{"name":"q","type":"Buffer"},{"name":"nonce","type":"Int128"},{"name":"serverNonce","type":"Int128"},{"name":"newNonce","type":"Int256"},{"name":"dc","type":"number"}]},{"name":"p_q_inner_data_temp_dc","id":1459478408,"type":"P_Q_inner_data","arguments":[{"name":"pq","type":"Buffer"},{"name":"p","type":"Buffer"},{"name":"q","type":"Buffer"},{"name":"nonce","type":"Int128"},{"name":"serverNonce","type":"Int128"},{"name":"newNonce","type":"Int256"},{"name":"dc","type":"number"},{"name":"expiresIn","type":"number"}]},{"name":"server_DH_params_ok","id":3504867164,"type":"Server_DH_Params","arguments":[{"name":"nonce","type":"Int128","description":"Client nonce that was generated earlier"},{"name":"serverNonce","type":"Int128","description":"Server nonce that was received earlier"},{"name":"encryptedAnswer","type":"Buffer","description":"Encrypted DH parameters, obtained as follows:\n - Let `answer` be a serialization of {@link tl.mtproto.RawServer_DH_inner_data}\n - `hash1 = sha1(concat(newNonce, serverNonce))`\n - `hash2 = sha1(concat(serverNonce, newNonce))`\n - `hash3 = sha1(concat(newNonce, newNonce))`\n - `key = concat(hash1, hash2.slice(0, 12))`\n - `iv = concat(hash2.slice(12, 20), hash3, newNonce.slice(0, 4))`\n - `encryptedAnswer = aes256_ige_encrypt(answer, key, iv)\n"}],"description":"PQ decomposition was correct, server-side variables for DH are returned"},{"name":"server_DH_inner_data","id":3045658042,"type":"Server_DH_inner_data","arguments":[{"name":"nonce","type":"Int128","description":"Client nonce that was generated earlier"},{"name":"serverNonce","type":"Int128","description":"Server nonce that was received earlier"},{"name":"g","type":"number","description":"`g` number (generator) used for Diffie-Hellman"},{"name":"dhPrime","type":"Buffer","description":"`p` prime number (modulus) used for Diffie-Hellman"},{"name":"gA","type":"Buffer","description":"`gA` number (`gA = g ^ A % p`, where `A` is server secret) used for Diffie-Hellman"},{"name":"serverTime","type":"number","description":"Server UNIX timestamp (in seconds)"}],"description":"Inner data that is returned in {@link tl.mtproto.RawServer_DH_params_ok}, containing server-side variables for Diffie-Hellman exchange\n"},{"name":"client_DH_inner_data","id":1715713620,"type":"Client_DH_Inner_Data","arguments":[{"name":"nonce","type":"Int128","description":"Client nonce that was generated earlier"},{"name":"serverNonce","type":"Int128","description":"Server nonce that was received earlier"},{"name":"retryId","type":"Long","description":"Retry ID. When requesting for the first t