Update content of files

This commit is contained in:
GitHub Action 2024-08-05 19:39:23 +00:00
parent ea794b7640
commit 1200877503
11 changed files with 306 additions and 230 deletions

View file

@ -49,7 +49,7 @@ An error is characterized by several parameters:</p>
<h4><a class="anchor" href="#error-type" id="error-type" name="error-type"><i class="anchor-icon"></i></a>Error Type</h4>
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
<h4><a class="anchor" href="#error-database" id="error-database" name="error-database"><i class="anchor-icon"></i></a>Error Database</h4>
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400617/3/khGRQ1O193g.130737.json/65fdbec5768d6fb1a1">here »</a>, what follows is a description of its fields: </p>
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400453/1/28JOIN-zhX4.133746.json/0399e2c6585e7b6b70">here »</a>, what follows is a description of its fields: </p>
<ul>
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
<li>Keys: Error codes as strings (numeric strings)</li>

View file

@ -86,7 +86,7 @@
<li><a href="/api/search#apps-tab">Mini App Store »</a></li>
<li><a href="/api/links#ton-sites">TON sites »</a></li>
<li>Mini App deep links were removed and replaced with <a href="/api/links#main-mini-app-links">Main Mini App deep links »</a>: (i.e. the syntax of Main Mini App links is equal to the one previously used for Mini App links, but the handling logic has changed).<br>
This also deprecates the <code>start_param</code> and <code>compact</code> parameters of <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> (replaced by <a href="/method/messages.requestMainWebView">messages.requestMainWebView</a>). </li>
This also deprecates the <code>start_param</code> and <code>compact</code> parameters of <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a> (replaced by <a href="/method/messages.requestMainWebView">messages.requestMainWebView</a>).</li>
<li>Allow specifying the exact frame to use for video thumbnails/static previews through the new <a href="/constructor/documentAttributeVideo">documentAttributeVideo</a>.<code>video_start_ts</code> parameter (especially useful for stories).<br>
The <code>video_start_ts</code> attribute may also be <a href="/api/stories#editing-stories">edited using a new, special editing flow that does not require reuploading the entire story »</a>.</li>
</ul>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>updateChannel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="A new channel or supergroup is available, or info about an existing channel has changed and must be refeteched.">
<meta property="description" content="Channel/supergroup (channel and/or channelFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated channel, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (channelFull) must be invalidated for channel_id when receiving this update.">
<meta property="og:title" content="updateChannel">
<meta property="og:image" content="">
<meta property="og:description" content="A new channel or supergroup is available, or info about an existing channel has changed and must be refeteched.">
<meta property="og:description" content="Channel/supergroup (channel and/or channelFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated channel, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (channelFull) must be invalidated for channel_id when receiving this update.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,9 +42,9 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateChannel" >updateChannel</a></li></ul></div>
<h1 id="dev_page_title">updateChannel</h1>
<div id="dev_page_content"><p>Channel/supergroup (<a href="/constructor/channel">channel</a> and/or <a href="/constructor/channelFull">channelFull</a>) information was updated. </p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/channel">channel</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually. </p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/channelFull">channelFull</a>) must be invalidated for <code>channel_id</code> when receiving this update. </p>
<div id="dev_page_content"><p>Channel/supergroup (<a href="/constructor/channel">channel</a> and/or <a href="/constructor/channelFull">channelFull</a>) information was updated.</p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/channel">channel</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.</p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/channelFull">channelFull</a>) must be invalidated for <code>channel_id</code> when receiving this update.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -76,7 +76,46 @@
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/Update">Update</a></p></div>
<p><a href="/type/Update">Update</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#channel" id="channel" name="channel"><i class="anchor-icon"></i></a><a href="/constructor/channel">channel</a></h4>
<p>Channel/supergroup info</p>
<p>When updating the <a href="/api/peers">local peer database</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).</p>
<p>The only exception to the above rule is when the <code>min</code> flag is set, in which case <strong>only</strong> the following fields must be applied over any locally stored version:</p>
<ul>
<li><code>title</code></li>
<li><code>megagroup</code></li>
<li><code>color</code></li>
<li><code>photo</code></li>
<li><code>username</code></li>
<li><code>usernames</code></li>
<li><code>has_geo</code></li>
<li><code>noforwards</code></li>
<li><code>emoji_status</code></li>
<li><code>has_link</code></li>
<li><code>slow_mode_enabled</code></li>
<li><code>scam</code></li>
<li><code>fake</code></li>
<li><code>gigagroup</code></li>
<li><code>forum</code></li>
<li><code>level</code></li>
<li><code>restricted</code></li>
<li><code>restriction_reason</code></li>
<li><code>join_to_send</code></li>
<li><code>join_request</code></li>
<li><code>is_verified</code></li>
<li><code>default_banned_rights</code></li>
</ul>
<p>See <a href="https://github.com/tdlib/td/blob/a24af0992245f838f2b4b418a0a2d5fa9caa27b5/td/telegram/ChatManager.cpp#L8329">here »</a> for an implementation of the logic to use when updating the <a href="/api/peers">local user peer database</a>.</p>
<h4><a class="anchor" href="#channelfull" id="channelfull" name="channelfull"><i class="anchor-icon"></i></a><a href="/constructor/channelFull">channelFull</a></h4>
<p>Full info about a <a href="/api/channel#channels">channel</a>, <a href="/api/channel#supergroups">supergroup</a> or <a href="/api/channel#gigagroups">gigagroup</a>.</p>
<p>When updating the <a href="/api/peers">local peer database »</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).</p>
<h4><a class="anchor" href="#updates" id="updates" name="updates"><i class="anchor-icon"></i></a><a href="/constructor/updates">Updates</a></h4>
<p>Full constructor of updates</p>
<h4><a class="anchor" href="#updatescombined" id="updatescombined" name="updatescombined"><i class="anchor-icon"></i></a><a href="/constructor/updatesCombined">updatesCombined</a></h4>
<p>Constructor for a group of updates.</p>
<h4><a class="anchor" href="#peer-database" id="peer-database" name="peer-database"><i class="anchor-icon"></i></a><a href="/api/peers">Peer database</a></h4>
<p>Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information.</p></div>
</div>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>updateChat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="A new chat is available">
<meta property="description" content="Chat (chat and/or chatFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated chat, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (chatFull) must be invalidated for chat_id when receiving this update.">
<meta property="og:title" content="updateChat">
<meta property="og:image" content="">
<meta property="og:description" content="A new chat is available">
<meta property="og:description" content="Chat (chat and/or chatFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated chat, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (chatFull) must be invalidated for chat_id when receiving this update.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,9 +42,9 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateChat" >updateChat</a></li></ul></div>
<h1 id="dev_page_title">updateChat</h1>
<div id="dev_page_content"><p>Chat (<a href="/constructor/chat">chat</a> and/or <a href="/constructor/chatFull">chatFull</a>) information was updated. </p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/chat">chat</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually. </p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/chatFull">chatFull</a>) must be invalidated for <code>chat_id</code> when receiving this update. </p>
<div id="dev_page_content"><p>Chat (<a href="/constructor/chat">chat</a> and/or <a href="/constructor/chatFull">chatFull</a>) information was updated.</p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/chat">chat</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.</p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/chatFull">chatFull</a>) must be invalidated for <code>chat_id</code> when receiving this update.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -76,7 +76,21 @@
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/Update">Update</a></p></div>
<p><a href="/type/Update">Update</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#chat" id="chat" name="chat"><i class="anchor-icon"></i></a><a href="/constructor/chat">chat</a></h4>
<p>Info about a group.</p>
<p>When updating the <a href="/api/peers">local peer database</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).</p>
<p>See <a href="https://github.com/tdlib/td/blob/a24af0992245f838f2b4b418a0a2d5fa9caa27b5/td/telegram/ChatManager.cpp#L5152">here »</a> for an implementation of the logic to use when updating the <a href="/api/peers">local user peer database</a>.</p>
<h4><a class="anchor" href="#chatfull" id="chatfull" name="chatfull"><i class="anchor-icon"></i></a><a href="/constructor/chatFull">chatFull</a></h4>
<p>Full info about a <a href="/api/channel#basic-groups">basic group</a>.</p>
<p>When updating the <a href="/api/peers">local peer database »</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).</p>
<h4><a class="anchor" href="#updates" id="updates" name="updates"><i class="anchor-icon"></i></a><a href="/constructor/updates">Updates</a></h4>
<p>Full constructor of updates</p>
<h4><a class="anchor" href="#updatescombined" id="updatescombined" name="updatescombined"><i class="anchor-icon"></i></a><a href="/constructor/updatesCombined">updatesCombined</a></h4>
<p>Constructor for a group of updates.</p>
<h4><a class="anchor" href="#peer-database" id="peer-database" name="peer-database"><i class="anchor-icon"></i></a><a href="/api/peers">Peer database</a></h4>
<p>Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information.</p></div>
</div>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>updateUser</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="User (user and/or userFull) information was updated, it must be refetched using users.getFullUser.">
<meta property="description" content="User (user and/or userFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated user, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (userFull) must be invalidated for user_id when receiving this update.">
<meta property="og:title" content="updateUser">
<meta property="og:image" content="">
<meta property="og:description" content="User (user and/or userFull) information was updated, it must be refetched using users.getFullUser.">
<meta property="og:description" content="User (user and/or userFull) information was updated. This update can only be received through getDifference or in updates/updatesCombined constructors, so it will always come bundled with the updated user, that should be applied as usual », without re-fetching the info manually. However, full peer information will not come bundled in updates, so the full peer cache (userFull) must be invalidated for user_id when receiving this update.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,9 +42,9 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/updateUser" >updateUser</a></li></ul></div>
<h1 id="dev_page_title">updateUser</h1>
<div id="dev_page_content"><p>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated. </p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/user">user</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually. </p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/userFull">userFull</a>) must be invalidated for <code>user_id</code> when receiving this update. </p>
<div id="dev_page_content"><p>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated.</p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/user">user</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.</p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/userFull">userFull</a>) must be invalidated for <code>user_id</code> when receiving this update.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -85,8 +85,12 @@
<h4><a class="anchor" href="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4>
<p>Extended user info</p>
<p>When updating the <a href="/api/peers">local peer database »</a>, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).</p>
<h4><a class="anchor" href="#usersgetfulluser" id="usersgetfulluser" name="usersgetfulluser"><i class="anchor-icon"></i></a><a href="/method/users.getFullUser">users.getFullUser</a></h4>
<p>Returns extended user info by ID.</p></div>
<h4><a class="anchor" href="#updates" id="updates" name="updates"><i class="anchor-icon"></i></a><a href="/constructor/updates">Updates</a></h4>
<p>Full constructor of updates</p>
<h4><a class="anchor" href="#updatescombined" id="updatescombined" name="updatescombined"><i class="anchor-icon"></i></a><a href="/constructor/updatesCombined">updatesCombined</a></h4>
<p>Constructor for a group of updates.</p>
<h4><a class="anchor" href="#peer-database" id="peer-database" name="peer-database"><i class="anchor-icon"></i></a><a href="/api/peers">Peer database</a></h4>
<p>Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information.</p></div>
</div>

View file

@ -87,7 +87,9 @@
<h4><a class="anchor" href="#profile" id="profile" name="profile"><i class="anchor-icon"></i></a><a href="/api/profile">Profile</a></h4>
<p>Telegram offers many customization options for your profile!</p>
<h4><a class="anchor" href="#updateuser" id="updateuser" name="updateuser"><i class="anchor-icon"></i></a><a href="/constructor/updateUser">updateUser</a></h4>
<p>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated, it must be refetched using <a href="/method/users.getFullUser">users.getFullUser</a>.</p></div>
<p>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated.</p>
<p>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/user">user</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.</p>
<p>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/userFull">userFull</a>) must be invalidated for <code>user_id</code> when receiving this update.</p></div>
</div>

View file

@ -360,6 +360,11 @@
</tr>
<tr>
<td>400</td>
<td>INPUT_FILE_INVALID</td>
<td>The specified <a href="/type/InputFile">InputFile</a> is invalid.</td>
</tr>
<tr>
<td>400</td>
<td>INPUT_USER_DEACTIVATED</td>
<td>The specified user was deleted.</td>
</tr>
@ -626,6 +631,8 @@
<p>Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.</p>
<h4><a class="anchor" href="#file-references" id="file-references" name="file-references"><i class="anchor-icon"></i></a><a href="/api/file_reference">File references</a></h4>
<p>How to handle file references.</p>
<h4><a class="anchor" href="#inputfile" id="inputfile" name="inputfile"><i class="anchor-icon"></i></a><a href="/type/InputFile">InputFile</a></h4>
<p>Defines a file uploaded by the client.</p>
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p>
<h4><a class="anchor" href="#client-configuration" id="client-configuration" name="client-configuration"><i class="anchor-icon"></i></a><a href="/api/config">Client configuration</a></h4>

View file

@ -120,6 +120,11 @@
<tbody>
<tr>
<td>400</td>
<td>CHAT_ADMIN_REQUIRED</td>
<td>You must be an admin in this chat to do this.</td>
</tr>
<tr>
<td>400</td>
<td>PEER_ID_INVALID</td>
<td>The provided peer id is invalid.</td>
</tr>

View file

@ -118,6 +118,11 @@
<td>USER_ALREADY_INVITED</td>
<td>You have already invited this user.</td>
</tr>
<tr>
<td>403</td>
<td>USER_NOT_PARTICIPANT</td>
<td>You're not a member of this supergroup/channel.</td>
</tr>
</tbody>
</table></div>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 08 C0 03 00 51 C4 B0 66
0010 | 14 00 00 00 F1 8E 7E BE C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 14 0C 00 93 27 B1 66
0010 | 14 00 00 00 F1 8E 7E BE 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>08C0030051C4B066</code></td>
<td><code>D8140C009327B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -95,7 +95,7 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,11 +104,11 @@
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
<!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 FC F2 5F 51 C4 B0 66
0010 | 90 00 00 00 63 24 16 05 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 08 11 CD ED 18 20 2E B6
0040 | F9 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 24 58 F6 93 27 B1 66
0010 | B8 00 00 00 63 24 16 05 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8 FC C6 82 D4 9F EF C8 2A
0030 | A4 B0 8F 37 AA 9D 24 39 08 33 8D 6B F6 9D 05 E1
0040 | 27 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
0060 | 85 1D 9D D0</code></pre>
<p>Payload (de)serialization:</p>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01FCF25F51C4B066</code></td>
<td><code>012458F69327B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>90000000</code> (144 in decimal)</td>
<td><code>B8000000</code> (184 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0811CDED18202EB6F9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1282942156745389817</td>
<td><code>08338D6BF69D05E127000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3714743974591062311</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -208,22 +208,22 @@
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq -->
<pre><code>pq = 1282942156745389817</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1282942156745389817 = 1062853151 * 1207073767</code></p>
<pre><code>p = 1062853151
q = 1207073767</code></pre>
<pre><code>pq = 3714743974591062311</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>3714743974591062311 = 1870744487 * 1985703553</code></p>
<pre><code>p = 1870744487
q = 1985703553</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 11 CD ED 18 20 2E B6 F9 00 00 00
0010 | 04 3F 59 DA 1F 00 00 00 04 47 F2 7B E7 00 00 00
0020 | C0 71 76 9B 1F CB C3 B7 02 96 59 4F 9D 52 E6 0C
0030 | FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F E6 8B 80 F2
0040 | 24 DB 66 6D 6D 71 11 39 29 30 81 04 85 B3 0A 5C
0050 | 6F 3C D8 1D 6D D4 62 8D 7E 37 E5 ED BB 49 AB 09
<pre><code>0000 | 95 5F F5 A9 08 33 8D 6B F6 9D 05 E1 27 00 00 00
0010 | 04 6F 81 4B A7 00 00 00 04 76 5B 6E 81 00 00 00
0020 | 59 4F 64 40 6F E5 94 0D 08 C1 86 CE A3 28 CF B8
0030 | FC C6 82 D4 9F EF C8 2A A4 B0 8F 37 AA 9D 24 39
0040 | BA A2 CB 19 63 BC 73 CA 1E 0D 80 FE 20 FE CD ED
0050 | 92 79 C5 79 5B A6 59 1B F2 27 4C 4E 11 40 A4 1B
0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
@ -246,37 +246,37 @@ q = 1207073767</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0811CDED18202EB6F9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1282942156745389817</td>
<td><code>08338D6BF69D05E127000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3714743974591062311</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>p</td>
<td>16, 8</td>
<td><code>043F59DA1F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1062853151</td>
<td><code>046F814BA7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1870744487</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>24, 8</td>
<td><code>0447F27BE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1207073767</td>
<td><code>04765B6E81000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1985703553</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>nonce</td>
<td>32, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>24DB666D6D7111392930810485B30A5C</code> <code>6F3CD81D6DD4628D7E37E5EDBB49AB09</code></td>
<td><code>BAA2CB1963BC73CA1E0D80FE20FECDED</code> <code>9279C5795BA6591BF2274C4E1140A41B</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1207073767</code></pre>
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
<!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A90811CDED18202EB6F9000000043F59DA1F0000000447F27BE7000000C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F224DB666D6D7111392930810485B30A5C6F3CD81D6DD4628D7E37E5EDBB49AB0902000000
random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D241166ED12A867C04AA552D3A7BD18454CCF4BC0D8695BCC10BF7F1619E0F6761B159195A9BD28E468DF8E01BB5271306FC46529D7E30D870065073808201AEA7DD</code></pre>
<pre><code>data = 955FF5A908338D6BF69D05E127000000046F814BA700000004765B6E81000000594F64406FE5940D08C186CEA328CFB8FCC682D49FEFC82AA4B08F37AA9D2439BAA2CB1963BC73CA1E0D80FE20FECDED9279C5795BA6591BF2274C4E1140A41B02000000
random_padding_bytes = 54491B42804106991885E723F2BAD5C3F9F8334A7774A97E2507D388BCEB7A90887201973F86BEAB2B9FA5FD7A9D19DF6193BF76FACED0A36D9DB8562C0181FB07A3F21294B6C3C5EBC2AC1ED009B66A077DA73D40605C76962104C5</code></pre>
<!-- end p_q_inner_data_input -->
<p>And this is the output:</p>
<!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = 41059822C147A6C8EEB3B7CB01204CD7D9DD4485089B96757FADF1786C7064A0CBDB1D6A4182EC57B9F8CC5BD50ABA6BD06C5726910408EAD3D5D18D0A9EF800020F5841C3F4E14733E5E7EFB878938B0FD037505829546989E3F97FB24540709758E7FB182AAB73F05052C922D6516E2C17707EFC9725D69E69BD70DA73DBB099FD576731CF8377E7FD85D53156DDA908FCB7B5D6E11C9755F04DA2BBEE0A7A742148058D21E1F00DBB344982DD3A1E2B1A86283258B19A88077BC9AD93E962459E031826588A1B9E9153B381EDE160C825549FE6562DF21BB0893DDAEA355A02167DAC055C43EFCB6EBD689DCAE1BF3266C6BD1E12F5B283F47781F03421B1</code></pre>
<pre><code>encrypted_data = C726BD8325746D0D1924C152DFD50B2A93CA041AF620CB9844055255028337F6ECFA5F26BD70F84D29BE04D0F00A05C2718495360153F7BAFF0F5C8719902DFE34E77B1A282D36D5566C80F555CAF54DBF92CD4CE0C3B458CEEE1191C895DC2D42AE876CA60315D6424BC8E99BE2AD2BF926948B559F2BAA0AFFE3BEC4A2A2C5FB614E0C6A3E84ECF023979F99E19FC86D81FF39777A89292E50963EB374A765AEB977CE34292E36E3B186AA334A746E29D81942D7B7DA6EAE328463C896087B66E377E455B75ABCE1248520BAE7D3CEBE739A72502E8C1005301024971AEB9175B8AB49B27BC9D093939EE0A7BF1BB9BC985B876F4E0D2FD13544B55755C4AF</code></pre>
<!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p>
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
<!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 68 34 0C 00 51 C4 B0 66
0010 | 40 01 00 00 BE E4 12 D7 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 04 3F 59 DA 1F 00 00 00
0040 | 04 47 F2 7B E7 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 41 05 98 22 C1 47 A6 C8 EE B3 B7 CB
0060 | 01 20 4C D7 D9 DD 44 85 08 9B 96 75 7F AD F1 78
0070 | 6C 70 64 A0 CB DB 1D 6A 41 82 EC 57 B9 F8 CC 5B
0080 | D5 0A BA 6B D0 6C 57 26 91 04 08 EA D3 D5 D1 8D
0090 | 0A 9E F8 00 02 0F 58 41 C3 F4 E1 47 33 E5 E7 EF
00A0 | B8 78 93 8B 0F D0 37 50 58 29 54 69 89 E3 F9 7F
00B0 | B2 45 40 70 97 58 E7 FB 18 2A AB 73 F0 50 52 C9
00C0 | 22 D6 51 6E 2C 17 70 7E FC 97 25 D6 9E 69 BD 70
00D0 | DA 73 DB B0 99 FD 57 67 31 CF 83 77 E7 FD 85 D5
00E0 | 31 56 DD A9 08 FC B7 B5 D6 E1 1C 97 55 F0 4D A2
00F0 | BB EE 0A 7A 74 21 48 05 8D 21 E1 F0 0D BB 34 49
0100 | 82 DD 3A 1E 2B 1A 86 28 32 58 B1 9A 88 07 7B C9
0110 | AD 93 E9 62 45 9E 03 18 26 58 8A 1B 9E 91 53 B3
0120 | 81 ED E1 60 C8 25 54 9F E6 56 2D F2 1B B0 89 3D
0130 | DA EA 35 5A 02 16 7D AC 05 5C 43 EF CB 6E BD 68
0140 | 9D CA E1 BF 32 66 C6 BD 1E 12 F5 B2 83 F4 77 81
0150 | F0 34 21 B1</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 D2 09 00 94 27 B1 66
0010 | 40 01 00 00 BE E4 12 D7 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8 FC C6 82 D4 9F EF C8 2A
0030 | A4 B0 8F 37 AA 9D 24 39 04 6F 81 4B A7 00 00 00
0040 | 04 76 5B 6E 81 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 C7 26 BD 83 25 74 6D 0D 19 24 C1 52
0060 | DF D5 0B 2A 93 CA 04 1A F6 20 CB 98 44 05 52 55
0070 | 02 83 37 F6 EC FA 5F 26 BD 70 F8 4D 29 BE 04 D0
0080 | F0 0A 05 C2 71 84 95 36 01 53 F7 BA FF 0F 5C 87
0090 | 19 90 2D FE 34 E7 7B 1A 28 2D 36 D5 56 6C 80 F5
00A0 | 55 CA F5 4D BF 92 CD 4C E0 C3 B4 58 CE EE 11 91
00B0 | C8 95 DC 2D 42 AE 87 6C A6 03 15 D6 42 4B C8 E9
00C0 | 9B E2 AD 2B F9 26 94 8B 55 9F 2B AA 0A FF E3 BE
00D0 | C4 A2 A2 C5 FB 61 4E 0C 6A 3E 84 EC F0 23 97 9F
00E0 | 99 E1 9F C8 6D 81 FF 39 77 7A 89 29 2E 50 96 3E
00F0 | B3 74 A7 65 AE B9 77 CE 34 29 2E 36 E3 B1 86 AA
0100 | 33 4A 74 6E 29 D8 19 42 D7 B7 DA 6E AE 32 84 63
0110 | C8 96 08 7B 66 E3 77 E4 55 B7 5A BC E1 24 85 20
0120 | BA E7 D3 CE BE 73 9A 72 50 2E 8C 10 05 30 10 24
0130 | 97 1A EB 91 75 B8 AB 49 B2 7B C9 D0 93 93 9E E0
0140 | A7 BF 1B B9 BC 98 5B 87 6F 4E 0D 2F D1 35 44 B5
0150 | 57 55 C4 AF</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
<table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>68340C0051C4B066</code></td>
<td><code>18D209009427B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -363,25 +363,25 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>043F59DA1F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1062853151</td>
<td><code>046F814BA7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1870744487</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>64, 8</td>
<td><code>0447F27BE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1207073767</td>
<td><code>04765B6E81000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1985703553</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -393,7 +393,7 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010041059822C147A6C8EEB3B7CB</code> <code>01204CD7D9DD4485089B96757FADF178</code> <code>6C7064A0CBDB1D6A4182EC57B9F8CC5B</code> <code>D50ABA6BD06C5726910408EAD3D5D18D</code> <code>0A9EF800020F5841C3F4E14733E5E7EF</code> <code>B878938B0FD037505829546989E3F97F</code> <code>B24540709758E7FB182AAB73F05052C9</code> <code>22D6516E2C17707EFC9725D69E69BD70</code> <code>DA73DBB099FD576731CF8377E7FD85D5</code> <code>3156DDA908FCB7B5D6E11C9755F04DA2</code> <code>BBEE0A7A742148058D21E1F00DBB3449</code> <code>82DD3A1E2B1A86283258B19A88077BC9</code> <code>AD93E962459E031826588A1B9E9153B3</code> <code>81EDE160C825549FE6562DF21BB0893D</code> <code>DAEA355A02167DAC055C43EFCB6EBD68</code> <code>9DCAE1BF3266C6BD1E12F5B283F47781</code><br> <code>F03421B1</code></td>
<td><code>FE000100C726BD8325746D0D1924C152</code> <code>DFD50B2A93CA041AF620CB9844055255</code> <code>028337F6ECFA5F26BD70F84D29BE04D0</code> <code>F00A05C2718495360153F7BAFF0F5C87</code> <code>19902DFE34E77B1A282D36D5566C80F5</code> <code>55CAF54DBF92CD4CE0C3B458CEEE1191</code> <code>C895DC2D42AE876CA60315D6424BC8E9</code> <code>9BE2AD2BF926948B559F2BAA0AFFE3BE</code> <code>C4A2A2C5FB614E0C6A3E84ECF023979F</code> <code>99E19FC86D81FF39777A89292E50963E</code> <code>B374A765AEB977CE34292E36E3B186AA</code> <code>334A746E29D81942D7B7DA6EAE328463</code> <code>C896087B66E377E455B75ABCE1248520</code> <code>BAE7D3CEBE739A72502E8C1005301024</code> <code>971AEB9175B8AB49B27BC9D093939EE0</code> <code>A7BF1BB9BC985B876F4E0D2FD13544B5</code><br> <code>5755C4AF</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 F2 35 52 C4 B0 66
0010 | D0 02 00 00 5C 07 E8 D0 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 FE 50 02 00 3E FB F4 11
0040 | C4 C0 93 47 57 EC DD B4 C0 00 D7 D6 41 CA 91 58
0050 | 3E 64 2F 45 89 CE 4B 0E BE F1 69 14 38 BC 79 73
0060 | 03 40 40 86 22 48 83 2C 19 33 4F AA 62 5A FF 40
0070 | 66 44 D2 8B 1C 77 C4 64 A4 24 1A 43 12 6D CF 13
0080 | D1 29 4A F2 C7 2A 2F BC C0 3E 9A 3B 8A 8B 46 61
0090 | 67 48 B6 87 2D 69 71 F0 2F 6D 37 1F A4 B6 F5 E1
00A0 | 38 19 73 C3 99 67 8F 14 69 AB 05 F3 97 28 19 27
00B0 | F3 86 93 E4 38 1F 64 52 0F 48 45 99 B1 C8 A2 CB
00C0 | 70 5F AE 3C C2 15 8B F1 E6 0A 7C 59 B3 44 BD 15
00D0 | AC 5F A7 55 6F AA C2 B2 61 E4 31 BA 23 C6 1B F4
00E0 | DD 11 7F 40 DD DA 22 5A 81 2A BA 33 B8 26 10 FA
00F0 | AD E9 69 7E 79 74 38 D8 C3 21 13 EE 43 E4 08 6D
0100 | 0A 46 15 09 6C 96 80 58 A7 4E 07 98 69 16 B1 77
0110 | 5D 82 C4 5C 54 94 B7 20 7A 04 14 E6 46 12 0D E3
0120 | CA 25 E1 23 5F 63 D4 EB 27 42 49 3B 7E 96 09 45
0130 | 33 72 E6 47 D2 54 50 13 7C CA 55 98 53 FC B6 6B
0140 | 93 89 82 03 6D 2C BB 9C 05 7C CB 14 26 27 AC AB
0150 | 41 52 64 B3 73 6E 21 50 84 75 B3 75 45 FC 31 43
0160 | 75 7E E8 8A 9B 5C 73 36 87 7F E9 A7 D5 43 10 D2
0170 | 7A 44 85 C2 1D 35 C5 5F 50 88 B1 58 19 6F FD B4
0180 | 54 70 DD 8C 21 8E 2F B9 16 A8 3F 3E EE 39 96 46
0190 | C8 F3 42 EF D1 9B FF 83 BE C0 D4 11 84 5B EB 39
01A0 | 7A A3 3D EF 75 21 C5 3D AA F1 6E BE 8F EC E0 78
01B0 | CE EE B9 0D 37 27 0D 01 81 81 BB 7E 19 3D 9C E7
01C0 | 0A 98 C2 5A 14 47 C9 22 65 EC 91 69 7F BF 7D 1E
01D0 | 0C 82 B2 87 84 3C D9 EA 3E A4 62 75 F0 D3 BC D2
01E0 | 32 94 FE 43 39 48 B8 78 04 1D 77 65 2E 15 0E 3E
01F0 | 70 B6 8B D5 27 21 62 F6 1B 61 49 02 42 F9 71 6B
0200 | CA A4 E3 E3 7C 0F D3 41 A6 1A AE C2 DD 3B 03 44
0210 | 0D 75 D7 07 20 6F 51 D5 CA 83 C9 44 1D 2F 3A F7
0220 | C6 AB 43 51 51 EA D9 38 F7 C6 D1 BE E9 86 E1 F3
0230 | 28 17 0E 7B 94 97 E7 F2 04 BD F0 D6 92 4A D3 F0
0240 | 79 0F BA 77 0A 03 D7 6B B6 31 9A 30 F7 54 F0 EB
0250 | B3 F8 60 58 C6 06 D2 D5 59 07 31 DD 79 9E 74 65
0260 | 59 90 4B CE 60 99 0B 63 08 0D 2C F3 75 00 87 28
0270 | D9 D0 E3 83 75 CF F1 BC 3C 22 FB 84 58 17 75 C3
0280 | 6B F2 6B 66 17 5E 56 34 2D 88 F7 6C</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 68 00 DA 94 27 B1 66
0010 | D4 02 00 00 5C 07 E8 D0 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8 FC C6 82 D4 9F EF C8 2A
0030 | A4 B0 8F 37 AA 9D 24 39 FE 50 02 00 6A 03 A3 91
0040 | 4B B5 91 EE E8 5D B6 89 35 38 6D EF 88 17 37 A0
0050 | 9F 27 A2 C9 FF D1 4B 0D D5 18 CC 90 5F 35 51 B2
0060 | 16 C6 62 13 9C 4B B2 49 C8 D8 BE 51 CB AC AD EF
0070 | 6B 3D 7F 52 00 ED C4 54 8A 6F 6C 27 32 E2 61 AC
0080 | 11 DB 43 C1 A8 F4 CD 55 AB B6 87 9A 6D 65 1A 22
0090 | FF 72 C3 F7 48 EE EB 77 0D 82 AE F6 81 9A E3 AD
00A0 | F7 E7 EF 84 4E 88 A8 04 8F 5F 29 9E 49 78 86 EE
00B0 | 13 A9 E3 23 97 9C 05 22 6C 1C 1A 0E 22 06 B5 0E
00C0 | 67 6C 4B 41 FF 8A 51 A7 81 F8 B7 19 D6 28 DA AC
00D0 | F1 2D 75 D0 C0 65 78 E9 E3 B6 15 6F EA 19 00 C7
00E0 | CA E1 5A E8 CC 7E F8 9A 15 79 91 B1 C1 5A 36 5A
00F0 | 78 3A 42 70 9D E1 FD 28 BF 2F B4 39 ED F5 B4 97
0100 | C1 99 B6 04 69 B1 82 5C 04 3B CF 04 B4 C2 AA B7
0110 | 46 B5 95 FB 48 AB 88 48 22 01 BE 25 A9 E7 B4 AC
0120 | 08 1E D9 6B 8F D4 55 38 58 25 6B 51 B0 8C 96 3B
0130 | 4E 7A 5E F0 FA 5D 79 FA 88 13 84 03 28 6C A0 CD
0140 | 5E 60 28 19 44 BC B4 75 E0 46 43 9B 2B 9B 9C 2F
0150 | 3D 66 55 CB 07 A6 DD 85 53 92 92 46 F8 5B B0 9B
0160 | D0 EA D1 B8 40 47 1A 03 96 2A 53 D2 E8 85 D2 6C
0170 | 8C 29 1E 63 C6 9D DC 32 29 62 DC 2F EF B8 66 EA
0180 | 50 1C C6 DC 55 79 83 A3 D8 93 42 80 B2 1A E8 EA
0190 | B1 9E 25 A0 5C A6 36 30 08 B3 7F 95 A7 78 4B 8A
01A0 | D4 B4 72 EA 2F F6 A8 25 4E E9 96 9C 07 F3 B6 30
01B0 | CB B9 70 86 91 61 74 1E 27 26 5A 20 88 D4 11 C0
01C0 | 06 57 0B F6 AC 3C 17 9D 95 E6 7B 0B 32 92 6E 5E
01D0 | D3 17 D6 E2 21 E9 68 CA 98 11 7E 41 0E 1A 61 94
01E0 | 59 79 DE 12 EE 28 73 9A EF 9C BC AC 72 E3 CC 5C
01F0 | F0 9A 51 F5 FD 66 F1 15 DC B6 E4 C6 69 DE 93 75
0200 | 79 9A 21 5C 88 A4 8A 67 1D 1E 31 7E 14 95 D0 59
0210 | A9 C2 44 D1 0A C3 70 E2 75 55 32 4D D7 54 20 40
0220 | 2D 24 70 A3 66 88 36 D2 41 7E FD 5E 6A E8 D3 79
0230 | E9 4D 2A 59 3D B8 3D 10 97 23 C8 7B E6 9F 17 E0
0240 | 56 4F 5E 95 26 2D 82 D0 A2 99 B5 C7 44 D0 58 53
0250 | BA E1 28 A5 FC 8E 30 53 5F 9F 01 53 D3 88 6B D6
0260 | 0A A5 68 8E D0 4F 43 DD 01 9D 07 56 F4 32 E0 CF
0270 | 47 7B CC 22 90 48 67 8B 44 05 D1 75 E7 07 1A 92
0280 | 2A 6E 65 D3 8F 4A 6A 19 52 E9 79 B5</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,13 +464,13 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01F4F23552C4B066</code></td>
<td><code>016800DA9427B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>D0020000</code> (720 in decimal)</td>
<td><code>D4020000</code> (724 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE5002003EFBF411C4C0934757ECDDB4</code> <code>C000D7D641CA91583E642F4589CE4B0E</code> <code>BEF1691438BC7973034040862248832C</code> <code>19334FAA625AFF406644D28B1C77C464</code> <code>A4241A43126DCF13D1294AF2C72A2FBC</code> <code>C03E9A3B8A8B46616748B6872D6971F0</code> <code>2F6D371FA4B6F5E1381973C399678F14</code> <code>69AB05F397281927F38693E4381F6452</code> <code>0F484599B1C8A2CB705FAE3CC2158BF1</code> <code>E60A7C59B344BD15AC5FA7556FAAC2B2</code> <code>61E431BA23C61BF4DD117F40DDDA225A</code> <code>812ABA33B82610FAADE9697E797438D8</code> <code>C32113EE43E4086D0A4615096C968058</code> <code>A74E07986916B1775D82C45C5494B720</code> <code>7A0414E646120DE3CA25E1235F63D4EB</code> <code>2742493B7E9609453372E647D2545013</code> <code>7CCA559853FCB66B938982036D2CBB9C</code> <code>057CCB142627ACAB415264B3736E2150</code> <code>8475B37545FC3143757EE88A9B5C7336</code> <code>877FE9A7D54310D27A4485C21D35C55F</code> <code>5088B158196FFDB45470DD8C218E2FB9</code> <code>16A83F3EEE399646C8F342EFD19BFF83</code> <code>BEC0D411845BEB397AA33DEF7521C53D</code> <code>AAF16EBE8FECE078CEEEB90D37270D01</code> <code>8181BB7E193D9CE70A98C25A1447C922</code> <code>65EC91697FBF7D1E0C82B287843CD9EA</code> <code>3EA46275F0D3BCD23294FE433948B878</code> <code>041D77652E150E3E70B68BD5272162F6</code> <code>1B61490242F9716BCAA4E3E37C0FD341</code> <code>A61AAEC2DD3B03440D75D707206F51D5</code> <code>CA83C9441D2F3AF7C6AB435151EAD938</code> <code>F7C6D1BEE986E1F328170E7B9497E7F2</code> <code>04BDF0D6924AD3F0790FBA770A03D76B</code> <code>B6319A30F754F0EBB3F86058C606D2D5</code> <code>590731DD799E746559904BCE60990B63</code> <code>080D2CF375008728D9D0E38375CFF1BC</code> <code>3C22FB84581775C36BF26B66175E5634</code><br> <code>2D88F76C</code></td>
<td><code>FE5002006A03A3914BB591EEE85DB689</code> <code>35386DEF881737A09F27A2C9FFD14B0D</code> <code>D518CC905F3551B216C662139C4BB249</code> <code>C8D8BE51CBACADEF6B3D7F5200EDC454</code> <code>8A6F6C2732E261AC11DB43C1A8F4CD55</code> <code>ABB6879A6D651A22FF72C3F748EEEB77</code> <code>0D82AEF6819AE3ADF7E7EF844E88A804</code> <code>8F5F299E497886EE13A9E323979C0522</code> <code>6C1C1A0E2206B50E676C4B41FF8A51A7</code> <code>81F8B719D628DAACF12D75D0C06578E9</code> <code>E3B6156FEA1900C7CAE15AE8CC7EF89A</code> <code>157991B1C15A365A783A42709DE1FD28</code> <code>BF2FB439EDF5B497C199B60469B1825C</code> <code>043BCF04B4C2AAB746B595FB48AB8848</code> <code>2201BE25A9E7B4AC081ED96B8FD45538</code> <code>58256B51B08C963B4E7A5EF0FA5D79FA</code> <code>88138403286CA0CD5E60281944BCB475</code> <code>E046439B2B9B9C2F3D6655CB07A6DD85</code> <code>53929246F85BB09BD0EAD1B840471A03</code> <code>962A53D2E885D26C8C291E63C69DDC32</code> <code>2962DC2FEFB866EA501CC6DC557983A3</code> <code>D8934280B21AE8EAB19E25A05CA63630</code> <code>08B37F95A7784B8AD4B472EA2FF6A825</code> <code>4EE9969C07F3B630CBB970869161741E</code> <code>27265A2088D411C006570BF6AC3C179D</code> <code>95E67B0B32926E5ED317D6E221E968CA</code> <code>98117E410E1A61945979DE12EE28739A</code> <code>EF9CBCAC72E3CC5CF09A51F5FD66F115</code> <code>DCB6E4C669DE9375799A215C88A48A67</code> <code>1D1E317E1495D059A9C244D10AC370E2</code> <code>7555324DD75420402D2470A3668836D2</code> <code>417EFD5E6AE8D379E94D2A593DB83D10</code> <code>9723C87BE69F17E0564F5E95262D82D0</code> <code>A299B5C744D05853BAE128A5FC8E3053</code> <code>5F9F0153D3886BD60AA5688ED04F43DD</code> <code>019D0756F432E0CF477BCC229048678B</code> <code>4405D175E7071A922A6E65D38F4A6A19</code><br> <code>52E979B5</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D2411
<!-- end server_DH_params_ok -->
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
<!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = 3EFBF411C4C0934757ECDDB4C000D7D641CA91583E642F4589CE4B0EBEF1691438BC7973034040862248832C19334FAA625AFF406644D28B1C77C464A4241A43126DCF13D1294AF2C72A2FBCC03E9A3B8A8B46616748B6872D6971F02F6D371FA4B6F5E1381973C399678F1469AB05F397281927F38693E4381F64520F484599B1C8A2CB705FAE3CC2158BF1E60A7C59B344BD15AC5FA7556FAAC2B261E431BA23C61BF4DD117F40DDDA225A812ABA33B82610FAADE9697E797438D8C32113EE43E4086D0A4615096C968058A74E07986916B1775D82C45C5494B7207A0414E646120DE3CA25E1235F63D4EB2742493B7E9609453372E647D25450137CCA559853FCB66B938982036D2CBB9C057CCB142627ACAB415264B3736E21508475B37545FC3143757EE88A9B5C7336877FE9A7D54310D27A4485C21D35C55F5088B158196FFDB45470DD8C218E2FB916A83F3EEE399646C8F342EFD19BFF83BEC0D411845BEB397AA33DEF7521C53DAAF16EBE8FECE078CEEEB90D37270D018181BB7E193D9CE70A98C25A1447C92265EC91697FBF7D1E0C82B287843CD9EA3EA46275F0D3BCD23294FE433948B878041D77652E150E3E70B68BD5272162F61B61490242F9716BCAA4E3E37C0FD341A61AAEC2DD3B03440D75D707206F51D5CA83C9441D2F3AF7C6AB435151EAD938F7C6D1BEE986E1F328170E7B9497E7F204BDF0D6924AD3F0790FBA770A03D76BB6319A30F754F0EBB3F86058C606D2D5590731DD799E746559904BCE60990B63080D2CF375008728D9D0E38375CFF1BC3C22FB84581775C36BF26B66175E56342D88F76C
tmp_aes_key = 1C0F164CA2D4D7649EA8E7E71D3E57E07B12A42C559E803D2BE4B7AD7815F40A
tmp_aes_iv = C1BECE401B0BF7D064A43FF2F1BFEB3A6CE92CB730DC95BE537B3FA824DB666D</code></pre>
<pre><code>encrypted_answer = 6A03A3914BB591EEE85DB68935386DEF881737A09F27A2C9FFD14B0DD518CC905F3551B216C662139C4BB249C8D8BE51CBACADEF6B3D7F5200EDC4548A6F6C2732E261AC11DB43C1A8F4CD55ABB6879A6D651A22FF72C3F748EEEB770D82AEF6819AE3ADF7E7EF844E88A8048F5F299E497886EE13A9E323979C05226C1C1A0E2206B50E676C4B41FF8A51A781F8B719D628DAACF12D75D0C06578E9E3B6156FEA1900C7CAE15AE8CC7EF89A157991B1C15A365A783A42709DE1FD28BF2FB439EDF5B497C199B60469B1825C043BCF04B4C2AAB746B595FB48AB88482201BE25A9E7B4AC081ED96B8FD4553858256B51B08C963B4E7A5EF0FA5D79FA88138403286CA0CD5E60281944BCB475E046439B2B9B9C2F3D6655CB07A6DD8553929246F85BB09BD0EAD1B840471A03962A53D2E885D26C8C291E63C69DDC322962DC2FEFB866EA501CC6DC557983A3D8934280B21AE8EAB19E25A05CA6363008B37F95A7784B8AD4B472EA2FF6A8254EE9969C07F3B630CBB970869161741E27265A2088D411C006570BF6AC3C179D95E67B0B32926E5ED317D6E221E968CA98117E410E1A61945979DE12EE28739AEF9CBCAC72E3CC5CF09A51F5FD66F115DCB6E4C669DE9375799A215C88A48A671D1E317E1495D059A9C244D10AC370E27555324DD75420402D2470A3668836D2417EFD5E6AE8D379E94D2A593DB83D109723C87BE69F17E0564F5E95262D82D0A299B5C744D05853BAE128A5FC8E30535F9F0153D3886BD60AA5688ED04F43DD019D0756F432E0CF477BCC229048678B4405D175E7071A922A6E65D38F4A6A1952E979B5
tmp_aes_key = 8C6A747D8344EEEF66F475E0647C84D91AFADA51BD116E0C5D609543803E0546
tmp_aes_iv = BF342C37B1E3FB36406B6C51A0D5A90FEE68596273490937AC274295BAA2CB19</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 0E8F91C9FE26FE594A413BD9367C77A5058BD8F1BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010021B70FF38A9F2A3CCDD828C64539BA07C16E088AC09690E9C7AF62ADEE33C013495AE4CCDBE15FC6A6C54A0A94B1A9074502F6E120A5BE5FE4DBC30BBD5F290992CEC047D911075FFA259DB67B168D5D194250C6A402D5123971EE7097B4551813997DA8E0310F3049A7B03DCB6416FB858DD2B4516A2D40CAE5064F5E3E7D623933BF1C79BFFC0A37A990784F1D5CA60BBB36DFBA19BEABB4EFD092F48C3E35853AB7EFD9C71CFB0377749337D5212FEA0B3D8C76C522973245891A2916931722F2259559CEAC0AC0D58C7BB439F237AFEEBA5901AA521E2844315F19D4D604786AFC1714FCAB3F86768D6D671BD4283293848658CF3A39C3E13471168E0B1E52C4B0669C7B308A78E27683
answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010021B70FF38A9F2A3CCDD828C64539BA07C16E088AC09690E9C7AF62ADEE33C013495AE4CCDBE15FC6A6C54A0A94B1A9074502F6E120A5BE5FE4DBC30BBD5F290992CEC047D911075FFA259DB67B168D5D194250C6A402D5123971EE7097B4551813997DA8E0310F3049A7B03DCB6416FB858DD2B4516A2D40CAE5064F5E3E7D623933BF1C79BFFC0A37A990784F1D5CA60BBB36DFBA19BEABB4EFD092F48C3E35853AB7EFD9C71CFB0377749337D5212FEA0B3D8C76C522973245891A2916931722F2259559CEAC0AC0D58C7BB439F237AFEEBA5901AA521E2844315F19D4D604786AFC1714FCAB3F86768D6D671BD4283293848658CF3A39C3E13471168E0B1E52C4B0669C7B308A78E27683</code></pre>
<pre><code>answer_with_hash = CE468DB257720A1B6A0719B75477DFC9A497ECFABA0D89B5594F64406FE5940D08C186CEA328CFB8FCC682D49FEFC82AA4B08F37AA9D243903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010075A3EC04AB6BDC40BC07D280BA1A1FC4A00D5E2DD4BF010DA9983862010CCCE200A67DB836ACE0841C862772C4416F98F36797601DE5BEB12613B09860B25C38AFFFEFA0541DE81A9DC79E93C203967F545278FBCC1B9579B4213554DDF89F6192EB07828C998CD11C3A793A8D8C586F90FD29393352704C0E665D6962E581A1977020C5D6A18D654C0ECBA11EFFD73EF391A2BF3E7DA7703BFCCA42576B6D5D5553B03295EE0D2D9657A232BBE66DE6391D4DCF077F9AB726ADAD5424685E829ED06E9A58DBF337F923C0495A6D7D144B5A0AA8854BEF2EE86ADFBF5EE0702B4F467D0237F412393BA502188DED02A9363DE35B7273B90D487C8214916DF7C09427B166E7C33D00374D7A29
answer = BA0D89B5594F64406FE5940D08C186CEA328CFB8FCC682D49FEFC82AA4B08F37AA9D243903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010075A3EC04AB6BDC40BC07D280BA1A1FC4A00D5E2DD4BF010DA9983862010CCCE200A67DB836ACE0841C862772C4416F98F36797601DE5BEB12613B09860B25C38AFFFEFA0541DE81A9DC79E93C203967F545278FBCC1B9579B4213554DDF89F6192EB07828C998CD11C3A793A8D8C586F90FD29393352704C0E665D6962E581A1977020C5D6A18D654C0ECBA11EFFD73EF391A2BF3E7DA7703BFCCA42576B6D5D5553B03295EE0D2D9657A232BBE66DE6391D4DCF077F9AB726ADAD5424685E829ED06E9A58DBF337F923C0495A6D7D144B5A0AA8854BEF2EE86ADFBF5EE0702B4F467D0237F412393BA502188DED02A9363DE35B7273B90D487C8214916DF7C09427B166E7C33D00374D7A29</code></pre>
<!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 C0 71 76 9B 1F CB C3 B7 02 96 59 4F
0010 | 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F
0020 | E6 8B 80 F2 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 59 4F 64 40 6F E5 94 0D 08 C1 86 CE
0010 | A3 28 CF B8 FC C6 82 D4 9F EF C8 2A A4 B0 8F 37
0020 | AA 9D 24 39 03 00 00 00 FE 00 01 00 C7 1C AE B9
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 21 B7 0F F3 8A 9F 2A 3C CD D8 28 C6 45 39 BA 07
0140 | C1 6E 08 8A C0 96 90 E9 C7 AF 62 AD EE 33 C0 13
0150 | 49 5A E4 CC DB E1 5F C6 A6 C5 4A 0A 94 B1 A9 07
0160 | 45 02 F6 E1 20 A5 BE 5F E4 DB C3 0B BD 5F 29 09
0170 | 92 CE C0 47 D9 11 07 5F FA 25 9D B6 7B 16 8D 5D
0180 | 19 42 50 C6 A4 02 D5 12 39 71 EE 70 97 B4 55 18
0190 | 13 99 7D A8 E0 31 0F 30 49 A7 B0 3D CB 64 16 FB
01A0 | 85 8D D2 B4 51 6A 2D 40 CA E5 06 4F 5E 3E 7D 62
01B0 | 39 33 BF 1C 79 BF FC 0A 37 A9 90 78 4F 1D 5C A6
01C0 | 0B BB 36 DF BA 19 BE AB B4 EF D0 92 F4 8C 3E 35
01D0 | 85 3A B7 EF D9 C7 1C FB 03 77 74 93 37 D5 21 2F
01E0 | EA 0B 3D 8C 76 C5 22 97 32 45 89 1A 29 16 93 17
01F0 | 22 F2 25 95 59 CE AC 0A C0 D5 8C 7B B4 39 F2 37
0200 | AF EE BA 59 01 AA 52 1E 28 44 31 5F 19 D4 D6 04
0210 | 78 6A FC 17 14 FC AB 3F 86 76 8D 6D 67 1B D4 28
0220 | 32 93 84 86 58 CF 3A 39 C3 E1 34 71 16 8E 0B 1E
0230 | 52 C4 B0 66</code></pre>
0130 | 75 A3 EC 04 AB 6B DC 40 BC 07 D2 80 BA 1A 1F C4
0140 | A0 0D 5E 2D D4 BF 01 0D A9 98 38 62 01 0C CC E2
0150 | 00 A6 7D B8 36 AC E0 84 1C 86 27 72 C4 41 6F 98
0160 | F3 67 97 60 1D E5 BE B1 26 13 B0 98 60 B2 5C 38
0170 | AF FF EF A0 54 1D E8 1A 9D C7 9E 93 C2 03 96 7F
0180 | 54 52 78 FB CC 1B 95 79 B4 21 35 54 DD F8 9F 61
0190 | 92 EB 07 82 8C 99 8C D1 1C 3A 79 3A 8D 8C 58 6F
01A0 | 90 FD 29 39 33 52 70 4C 0E 66 5D 69 62 E5 81 A1
01B0 | 97 70 20 C5 D6 A1 8D 65 4C 0E CB A1 1E FF D7 3E
01C0 | F3 91 A2 BF 3E 7D A7 70 3B FC CA 42 57 6B 6D 5D
01D0 | 55 53 B0 32 95 EE 0D 2D 96 57 A2 32 BB E6 6D E6
01E0 | 39 1D 4D CF 07 7F 9A B7 26 AD AD 54 24 68 5E 82
01F0 | 9E D0 6E 9A 58 DB F3 37 F9 23 C0 49 5A 6D 7D 14
0200 | 4B 5A 0A A8 85 4B EF 2E E8 6A DF BF 5E E0 70 2B
0210 | 4F 46 7D 02 37 F4 12 39 3B A5 02 18 8D ED 02 A9
0220 | 36 3D E3 5B 72 73 B9 0D 48 7C 82 14 91 6D F7 C0
0230 | 94 27 B1 66</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010021B70FF38A9F2A3CCDD828C6</code> <code>4539BA07C16E088AC09690E9C7AF62AD</code> <code>EE33C013495AE4CCDBE15FC6A6C54A0A</code> <code>94B1A9074502F6E120A5BE5FE4DBC30B</code> <code>BD5F290992CEC047D911075FFA259DB6</code> <code>7B168D5D194250C6A402D5123971EE70</code> <code>97B4551813997DA8E0310F3049A7B03D</code> <code>CB6416FB858DD2B4516A2D40CAE5064F</code> <code>5E3E7D623933BF1C79BFFC0A37A99078</code> <code>4F1D5CA60BBB36DFBA19BEABB4EFD092</code> <code>F48C3E35853AB7EFD9C71CFB03777493</code> <code>37D5212FEA0B3D8C76C522973245891A</code> <code>2916931722F2259559CEAC0AC0D58C7B</code> <code>B439F237AFEEBA5901AA521E2844315F</code> <code>19D4D604786AFC1714FCAB3F86768D6D</code> <code>671BD4283293848658CF3A39C3E13471</code><br> <code>168E0B1E</code></td>
<td><code>FE00010075A3EC04AB6BDC40BC07D280</code> <code>BA1A1FC4A00D5E2DD4BF010DA9983862</code> <code>010CCCE200A67DB836ACE0841C862772</code> <code>C4416F98F36797601DE5BEB12613B098</code> <code>60B25C38AFFFEFA0541DE81A9DC79E93</code> <code>C203967F545278FBCC1B9579B4213554</code> <code>DDF89F6192EB07828C998CD11C3A793A</code> <code>8D8C586F90FD29393352704C0E665D69</code> <code>62E581A1977020C5D6A18D654C0ECBA1</code> <code>1EFFD73EF391A2BF3E7DA7703BFCCA42</code> <code>576B6D5D5553B03295EE0D2D9657A232</code> <code>BBE66DE6391D4DCF077F9AB726ADAD54</code> <code>24685E829ED06E9A58DBF337F923C049</code> <code>5A6D7D144B5A0AA8854BEF2EE86ADFBF</code> <code>5EE0702B4F467D0237F412393BA50218</code> <code>8DED02A9363DE35B7273B90D487C8214</code><br> <code>916DF7C0</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>52C4B066</code> (1722860626 in decimal)</td>
<td><code>9427B166</code> (1722886036 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
<p>First, generate a secure random 2048-bit number b:</p>
<!-- start b -->
<pre><code>b = 51220E7EDC04CEF18D889264586AB10364478035A19BFB702E3C55165DE25689281B7BEF7B00409F1AFA693C46CF50E56017E9EF840620A00A3146292A92417731DBD931869598534A3D8E1AC7381B405C93839FAD470195F2EC60D7529782A3D0D4C964AC5C13A5855BBEA0CB786135AAFAAFAC15B3B0AFC08DFD3FE29F4FC295FE0E22DCA14A5BD45071FB8F76212CE4C14B3C1FC199D6C5CF625BB539C3249E0E895F65247CA8418B44B090520F218FC6A90A4CD21EEAE7635C95C8B5412BA516A22DD19C853946EF8A6752A21475632B21FD925B09C526970D8C82E60B5410E7656DBD4DEA3D50D55007BC3BEAADFAC66E6A89C34397D06A2D1FA176148F</code></pre>
<pre><code>b = 5C2257535C997956854AA30924A38DAB1783515B43C350D76471349996252F939799A5F4C2106C4F502E479B29D1C772856CF765D402E80B5FD50922DB218F3D1F80DC4E679F0548E3F1B5E110E5D241174009AC1F317B5945B6A52160C207E4A1BC5791AB6B7C4980DCBE6C0CE8818EEC64CC373F053D47D6978B1AF7AF4ED5AADCD58339BF13C8E8BD01E0FA65E865E99E573EB9ECA2C647BC9FE82FAD37B7AF30BD5A0E7CD830FAA0C9317173BEE0600C141F9F267CCB0333E2F832ACDA530866E2CB3C92D209B6AA52EAEAD3F4A9BB1AA7336EB40DDEF495763C165B88C48B1CF81000566B7C5C8CEF62AEB979721D15FF0937AA23FDBA246F1A2551E131</code></pre>
<!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b -->
<pre><code>g_b = B79279F22787A4096E04D75FC65E107788E0F733D0A28A0AE0807ED158C7C63111DC9F66B71F59D056C0103A48617BE80BF020E8B8A803219C795DC9DC30423829D0DC647215083482E888A52D259546FE5CF301E87D1C9F31C2A05F7D9F63BECA6CE440DD41C476D8FC372FC0F39604385CD9063D61F55AEE119AB51EF3A1C9D31152C5043B4123D4E56C120B8F171A7F9A419C6E75C06C3129B577DBF5C2337A9F03EF045163E1EF32C1021E580DBA94E63501792D5372A6B89F5459CF5A80797F7EF5FEC9445AADD8EE6977372337B150813E4B4310610900F06D7BED8D18CF50846DCDEA44F2D3716D62ACB1B8D0D06501600D90F6F9682668B7EF64C0CB</code></pre>
<pre><code>g_b = 141DA0AC0D32A6491542B5520675902F9F8281DFF31DB7E45FD7C218AC6FF82E718CC126DB9952B93775056383C32A1E81A410F61E763D7072F04106BD8342A8D0978A1992303C2927DB2106F76D6761302FB5D1F15B3D57E927A44114C2815FA740AF2E248505F7FF5712A16BD9DB68245A1496F40528F6C0DA376F5FF4A5071560BF504906E84555C9E7E466F8DCB1888E11F5C817D54FF4E81FAADC6673C4B9EC5373F80A91FC845011FD38ABDBF33C8FE10060120261BFD9676FEE772D4F779EE7AC1F72D27176FABEE4946F483BF7230DA67A84221D6A89834446AC75439756BD1C97A41D95EA486F751787DB52BC9049F35C981F4036178691966F0A16</code></pre>
<!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 C0 71 76 9B 1F CB C3 B7 02 96 59 4F
0010 | 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F
0020 | E6 8B 80 F2 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | B7 92 79 F2 27 87 A4 09 6E 04 D7 5F C6 5E 10 77
0040 | 88 E0 F7 33 D0 A2 8A 0A E0 80 7E D1 58 C7 C6 31
0050 | 11 DC 9F 66 B7 1F 59 D0 56 C0 10 3A 48 61 7B E8
0060 | 0B F0 20 E8 B8 A8 03 21 9C 79 5D C9 DC 30 42 38
0070 | 29 D0 DC 64 72 15 08 34 82 E8 88 A5 2D 25 95 46
0080 | FE 5C F3 01 E8 7D 1C 9F 31 C2 A0 5F 7D 9F 63 BE
0090 | CA 6C E4 40 DD 41 C4 76 D8 FC 37 2F C0 F3 96 04
00A0 | 38 5C D9 06 3D 61 F5 5A EE 11 9A B5 1E F3 A1 C9
00B0 | D3 11 52 C5 04 3B 41 23 D4 E5 6C 12 0B 8F 17 1A
00C0 | 7F 9A 41 9C 6E 75 C0 6C 31 29 B5 77 DB F5 C2 33
00D0 | 7A 9F 03 EF 04 51 63 E1 EF 32 C1 02 1E 58 0D BA
00E0 | 94 E6 35 01 79 2D 53 72 A6 B8 9F 54 59 CF 5A 80
00F0 | 79 7F 7E F5 FE C9 44 5A AD D8 EE 69 77 37 23 37
0100 | B1 50 81 3E 4B 43 10 61 09 00 F0 6D 7B ED 8D 18
0110 | CF 50 84 6D CD EA 44 F2 D3 71 6D 62 AC B1 B8 D0
0120 | D0 65 01 60 0D 90 F6 F9 68 26 68 B7 EF 64 C0 CB</code></pre>
<pre><code>0000 | 54 B6 43 66 59 4F 64 40 6F E5 94 0D 08 C1 86 CE
0010 | A3 28 CF B8 FC C6 82 D4 9F EF C8 2A A4 B0 8F 37
0020 | AA 9D 24 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 14 1D A0 AC 0D 32 A6 49 15 42 B5 52 06 75 90 2F
0040 | 9F 82 81 DF F3 1D B7 E4 5F D7 C2 18 AC 6F F8 2E
0050 | 71 8C C1 26 DB 99 52 B9 37 75 05 63 83 C3 2A 1E
0060 | 81 A4 10 F6 1E 76 3D 70 72 F0 41 06 BD 83 42 A8
0070 | D0 97 8A 19 92 30 3C 29 27 DB 21 06 F7 6D 67 61
0080 | 30 2F B5 D1 F1 5B 3D 57 E9 27 A4 41 14 C2 81 5F
0090 | A7 40 AF 2E 24 85 05 F7 FF 57 12 A1 6B D9 DB 68
00A0 | 24 5A 14 96 F4 05 28 F6 C0 DA 37 6F 5F F4 A5 07
00B0 | 15 60 BF 50 49 06 E8 45 55 C9 E7 E4 66 F8 DC B1
00C0 | 88 8E 11 F5 C8 17 D5 4F F4 E8 1F AA DC 66 73 C4
00D0 | B9 EC 53 73 F8 0A 91 FC 84 50 11 FD 38 AB DB F3
00E0 | 3C 8F E1 00 60 12 02 61 BF D9 67 6F EE 77 2D 4F
00F0 | 77 9E E7 AC 1F 72 D2 71 76 FA BE E4 94 6F 48 3B
0100 | F7 23 0D A6 7A 84 22 1D 6A 89 83 44 46 AC 75 43
0110 | 97 56 BD 1C 97 A4 1D 95 EA 48 6F 75 17 87 DB 52
0120 | BC 90 49 F3 5C 98 1F 40 36 17 86 91 96 6F 0A 16</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
<table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE000100B79279F22787A4096E04D75F</code> <code>C65E107788E0F733D0A28A0AE0807ED1</code> <code>58C7C63111DC9F66B71F59D056C0103A</code> <code>48617BE80BF020E8B8A803219C795DC9</code> <code>DC30423829D0DC647215083482E888A5</code> <code>2D259546FE5CF301E87D1C9F31C2A05F</code> <code>7D9F63BECA6CE440DD41C476D8FC372F</code> <code>C0F39604385CD9063D61F55AEE119AB5</code> <code>1EF3A1C9D31152C5043B4123D4E56C12</code> <code>0B8F171A7F9A419C6E75C06C3129B577</code> <code>DBF5C2337A9F03EF045163E1EF32C102</code> <code>1E580DBA94E63501792D5372A6B89F54</code> <code>59CF5A80797F7EF5FEC9445AADD8EE69</code> <code>77372337B150813E4B4310610900F06D</code> <code>7BED8D18CF50846DCDEA44F2D3716D62</code> <code>ACB1B8D0D06501600D90F6F9682668B7</code><br> <code>EF64C0CB</code></td>
<td><code>FE000100141DA0AC0D32A6491542B552</code> <code>0675902F9F8281DFF31DB7E45FD7C218</code> <code>AC6FF82E718CC126DB9952B937750563</code> <code>83C32A1E81A410F61E763D7072F04106</code> <code>BD8342A8D0978A1992303C2927DB2106</code> <code>F76D6761302FB5D1F15B3D57E927A441</code> <code>14C2815FA740AF2E248505F7FF5712A1</code> <code>6BD9DB68245A1496F40528F6C0DA376F</code> <code>5FF4A5071560BF504906E84555C9E7E4</code> <code>66F8DCB1888E11F5C817D54FF4E81FAA</code> <code>DC6673C4B9EC5373F80A91FC845011FD</code> <code>38ABDBF33C8FE10060120261BFD9676F</code> <code>EE772D4F779EE7AC1F72D27176FABEE4</code> <code>946F483BF7230DA67A84221D6A898344</code> <code>46AC75439756BD1C97A41D95EA486F75</code> <code>1787DB52BC9049F35C981F4036178691</code><br> <code>966F0A16</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F
<!-- end client_DH_inner_data -->
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
<!-- start client_DH_inner_data_input -->
<pre><code>data = 54B64366C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F20000000000000000FE000100B79279F22787A4096E04D75FC65E107788E0F733D0A28A0AE0807ED158C7C63111DC9F66B71F59D056C0103A48617BE80BF020E8B8A803219C795DC9DC30423829D0DC647215083482E888A52D259546FE5CF301E87D1C9F31C2A05F7D9F63BECA6CE440DD41C476D8FC372FC0F39604385CD9063D61F55AEE119AB51EF3A1C9D31152C5043B4123D4E56C120B8F171A7F9A419C6E75C06C3129B577DBF5C2337A9F03EF045163E1EF32C1021E580DBA94E63501792D5372A6B89F5459CF5A80797F7EF5FEC9445AADD8EE6977372337B150813E4B4310610900F06D7BED8D18CF50846DCDEA44F2D3716D62ACB1B8D0D06501600D90F6F9682668B7EF64C0CB
padding = B364699FF2A3C12B91A23F76
tmp_aes_key = 1C0F164CA2D4D7649EA8E7E71D3E57E07B12A42C559E803D2BE4B7AD7815F40A
tmp_aes_iv = C1BECE401B0BF7D064A43FF2F1BFEB3A6CE92CB730DC95BE537B3FA824DB666D</code></pre>
<pre><code>data = 54B64366594F64406FE5940D08C186CEA328CFB8FCC682D49FEFC82AA4B08F37AA9D24390000000000000000FE000100141DA0AC0D32A6491542B5520675902F9F8281DFF31DB7E45FD7C218AC6FF82E718CC126DB9952B93775056383C32A1E81A410F61E763D7072F04106BD8342A8D0978A1992303C2927DB2106F76D6761302FB5D1F15B3D57E927A44114C2815FA740AF2E248505F7FF5712A16BD9DB68245A1496F40528F6C0DA376F5FF4A5071560BF504906E84555C9E7E466F8DCB1888E11F5C817D54FF4E81FAADC6673C4B9EC5373F80A91FC845011FD38ABDBF33C8FE10060120261BFD9676FEE772D4F779EE7AC1F72D27176FABEE4946F483BF7230DA67A84221D6A89834446AC75439756BD1C97A41D95EA486F751787DB52BC9049F35C981F4036178691966F0A16
padding = 1D7193945BE758F5935F4B13
tmp_aes_key = 8C6A747D8344EEEF66F475E0647C84D91AFADA51BD116E0C5D609543803E0546
tmp_aes_iv = BF342C37B1E3FB36406B6C51A0D5A90FEE68596273490937AC274295BAA2CB19</code></pre>
<!-- end client_DH_inner_data_input -->
<p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p>
<!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = 28A54EB0FAED1AEAD8B916708BFC1EBFADA5759427D9ECD7205687485E960B3A379C1CAAD2AE808AF39D2DF86D3D33363CBF1C04101824961D506BF4E40261641287F3FC268348DF6F1FD8C22C42AA770414E0B7CE28171B8A533E6DE7F47B1DDA02C4C88DA03BD055E6AE9A7F6810DC94713E66F6D0D794CBF3CF0A0433867318BE08608FE59B825E4DB7A6C84FDF3144EA28AE0BB178846A3071C90A085B81B29D9CBD79A43A3FC852FF1655F267351E1924B174012C909BFC05A8F04E3812F6949D0C7B99F062BCD9A8FAA9B9B23DCE01ECB581285BAEAA09D042B5DED4FA284957128502729B930347994E53AE0FAEDC94222FD2BD8CF4F04EE715BD929E4037B072E8CC10837007FC15360F1FE3E06DBEEED4DFCB649E007541602F2303C1DC3081EA141CA2E925C611253DEBF796BC8C082C198B63E5970FC9F2D8B6A6566419DB6471139FC173DAFDFA05EA5A</code></pre>
<pre><code>encrypted_data = 604826B2E061533085D0313FC1AC1E7968ECCE47BD6A1F46DA31E530AB272C955B81D6FF9676330F37CCAEDAA2BCD52877B34A9C0029DB601FCA549544D1D84EE79D0E20A470D1F0C1AB752861CFF1AD55634D064E4E51A7AB7DD69A404D4F6E051E14E231A9D67DED6950065AAD36B472FA63207800441621A5CAC73D116AB816FD0EE33E621E4C7C233CD6AD8290EB8DC8ABCE0CA08DBC013F0F05F0464BA21E9CDE7D53DA9A98E73FE7C33C77F296A6CDBCBAB4205C183D106DD6BC2044D89D2CABA9D0227CC531A97A3C9A8CA76456B9475A2FD612B6A7EAB965F0DAA8B79D3E0EAFC96B2A6F4B54B4C80E433B28417C8C77ACE6B8D0C21A045066755C31F012260152C278F7AB9C0649CCDF14420188432651341E3A93383F4E0F25E42414CAD0187F961D892524180AA3EFC6C3FBEAF0D23AEECC754765DAA2FD9D3CA2CCD7D4CF964CD756CBC81E2D3937BF28</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 2C 86 0B 00 52 C4 B0 66
0010 | 78 01 00 00 1F 5F 04 F5 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 FE 50 01 00 28 A5 4E B0
0040 | FA ED 1A EA D8 B9 16 70 8B FC 1E BF AD A5 75 94
0050 | 27 D9 EC D7 20 56 87 48 5E 96 0B 3A 37 9C 1C AA
0060 | D2 AE 80 8A F3 9D 2D F8 6D 3D 33 36 3C BF 1C 04
0070 | 10 18 24 96 1D 50 6B F4 E4 02 61 64 12 87 F3 FC
0080 | 26 83 48 DF 6F 1F D8 C2 2C 42 AA 77 04 14 E0 B7
0090 | CE 28 17 1B 8A 53 3E 6D E7 F4 7B 1D DA 02 C4 C8
00A0 | 8D A0 3B D0 55 E6 AE 9A 7F 68 10 DC 94 71 3E 66
00B0 | F6 D0 D7 94 CB F3 CF 0A 04 33 86 73 18 BE 08 60
00C0 | 8F E5 9B 82 5E 4D B7 A6 C8 4F DF 31 44 EA 28 AE
00D0 | 0B B1 78 84 6A 30 71 C9 0A 08 5B 81 B2 9D 9C BD
00E0 | 79 A4 3A 3F C8 52 FF 16 55 F2 67 35 1E 19 24 B1
00F0 | 74 01 2C 90 9B FC 05 A8 F0 4E 38 12 F6 94 9D 0C
0100 | 7B 99 F0 62 BC D9 A8 FA A9 B9 B2 3D CE 01 EC B5
0110 | 81 28 5B AE AA 09 D0 42 B5 DE D4 FA 28 49 57 12
0120 | 85 02 72 9B 93 03 47 99 4E 53 AE 0F AE DC 94 22
0130 | 2F D2 BD 8C F4 F0 4E E7 15 BD 92 9E 40 37 B0 72
0140 | E8 CC 10 83 70 07 FC 15 36 0F 1F E3 E0 6D BE EE
0150 | D4 DF CB 64 9E 00 75 41 60 2F 23 03 C1 DC 30 81
0160 | EA 14 1C A2 E9 25 C6 11 25 3D EB F7 96 BC 8C 08
0170 | 2C 19 8B 63 E5 97 0F C9 F2 D8 B6 A6 56 64 19 DB
0180 | 64 71 13 9F C1 73 DA FD FA 05 EA 5A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 1C D2 09 00 94 27 B1 66
0010 | 78 01 00 00 1F 5F 04 F5 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8 FC C6 82 D4 9F EF C8 2A
0030 | A4 B0 8F 37 AA 9D 24 39 FE 50 01 00 60 48 26 B2
0040 | E0 61 53 30 85 D0 31 3F C1 AC 1E 79 68 EC CE 47
0050 | BD 6A 1F 46 DA 31 E5 30 AB 27 2C 95 5B 81 D6 FF
0060 | 96 76 33 0F 37 CC AE DA A2 BC D5 28 77 B3 4A 9C
0070 | 00 29 DB 60 1F CA 54 95 44 D1 D8 4E E7 9D 0E 20
0080 | A4 70 D1 F0 C1 AB 75 28 61 CF F1 AD 55 63 4D 06
0090 | 4E 4E 51 A7 AB 7D D6 9A 40 4D 4F 6E 05 1E 14 E2
00A0 | 31 A9 D6 7D ED 69 50 06 5A AD 36 B4 72 FA 63 20
00B0 | 78 00 44 16 21 A5 CA C7 3D 11 6A B8 16 FD 0E E3
00C0 | 3E 62 1E 4C 7C 23 3C D6 AD 82 90 EB 8D C8 AB CE
00D0 | 0C A0 8D BC 01 3F 0F 05 F0 46 4B A2 1E 9C DE 7D
00E0 | 53 DA 9A 98 E7 3F E7 C3 3C 77 F2 96 A6 CD BC BA
00F0 | B4 20 5C 18 3D 10 6D D6 BC 20 44 D8 9D 2C AB A9
0100 | D0 22 7C C5 31 A9 7A 3C 9A 8C A7 64 56 B9 47 5A
0110 | 2F D6 12 B6 A7 EA B9 65 F0 DA A8 B7 9D 3E 0E AF
0120 | C9 6B 2A 6F 4B 54 B4 C8 0E 43 3B 28 41 7C 8C 77
0130 | AC E6 B8 D0 C2 1A 04 50 66 75 5C 31 F0 12 26 01
0140 | 52 C2 78 F7 AB 9C 06 49 CC DF 14 42 01 88 43 26
0150 | 51 34 1E 3A 93 38 3F 4E 0F 25 E4 24 14 CA D0 18
0160 | 7F 96 1D 89 25 24 18 0A A3 EF C6 C3 FB EA F0 D2
0170 | 3A EE CC 75 47 65 DA A2 FD 9D 3C A2 CC D7 D4 CF
0180 | 96 4C D7 56 CB C8 1E 2D 39 37 BF 28</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>2C860B0052C4B066</code></td>
<td><code>1CD209009427B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010028A54EB0FAED1AEAD8B91670</code> <code>8BFC1EBFADA5759427D9ECD720568748</code> <code>5E960B3A379C1CAAD2AE808AF39D2DF8</code> <code>6D3D33363CBF1C04101824961D506BF4</code> <code>E40261641287F3FC268348DF6F1FD8C2</code> <code>2C42AA770414E0B7CE28171B8A533E6D</code> <code>E7F47B1DDA02C4C88DA03BD055E6AE9A</code> <code>7F6810DC94713E66F6D0D794CBF3CF0A</code> <code>0433867318BE08608FE59B825E4DB7A6</code> <code>C84FDF3144EA28AE0BB178846A3071C9</code> <code>0A085B81B29D9CBD79A43A3FC852FF16</code> <code>55F267351E1924B174012C909BFC05A8</code> <code>F04E3812F6949D0C7B99F062BCD9A8FA</code> <code>A9B9B23DCE01ECB581285BAEAA09D042</code> <code>B5DED4FA284957128502729B93034799</code> <code>4E53AE0FAEDC94222FD2BD8CF4F04EE7</code> <code>15BD929E4037B072E8CC10837007FC15</code> <code>360F1FE3E06DBEEED4DFCB649E007541</code> <code>602F2303C1DC3081EA141CA2E925C611</code> <code>253DEBF796BC8C082C198B63E5970FC9</code> <code>F2D8B6A6566419DB6471139FC173DAFD</code><br> <code>FA05EA5A</code></td>
<td><code>FE500100604826B2E061533085D0313F</code> <code>C1AC1E7968ECCE47BD6A1F46DA31E530</code> <code>AB272C955B81D6FF9676330F37CCAEDA</code> <code>A2BCD52877B34A9C0029DB601FCA5495</code> <code>44D1D84EE79D0E20A470D1F0C1AB7528</code> <code>61CFF1AD55634D064E4E51A7AB7DD69A</code> <code>404D4F6E051E14E231A9D67DED695006</code> <code>5AAD36B472FA63207800441621A5CAC7</code> <code>3D116AB816FD0EE33E621E4C7C233CD6</code> <code>AD8290EB8DC8ABCE0CA08DBC013F0F05</code> <code>F0464BA21E9CDE7D53DA9A98E73FE7C3</code> <code>3C77F296A6CDBCBAB4205C183D106DD6</code> <code>BC2044D89D2CABA9D0227CC531A97A3C</code> <code>9A8CA76456B9475A2FD612B6A7EAB965</code> <code>F0DAA8B79D3E0EAFC96B2A6F4B54B4C8</code> <code>0E433B28417C8C77ACE6B8D0C21A0450</code> <code>66755C31F012260152C278F7AB9C0649</code> <code>CCDF14420188432651341E3A93383F4E</code> <code>0F25E42414CAD0187F961D892524180A</code> <code>A3EFC6C3FBEAF0D23AEECC754765DAA2</code> <code>FD9D3CA2CCD7D4CF964CD756CBC81E2D</code><br> <code>3937BF28</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr>
</tbody>
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key -->
<pre><code>auth_key = 7E3BE38D6F53C929F49DFC9380019156E6A14B4B78FE3623A679293053C398DE663B12D21D97E36C0BA9EF57A91FE511D2F42865436A85B743E4A4AC1116485E2541903A31824EAD9D563D5C7AF20939B4EE684489DCE6E9175001CCA4A67D784715BD3053258213206F6EFC7DABD0F0C869452314F394E5B346C1808389C1D5447B25BD2F2DB2BDA3AA28DBC46CD2B6E2A4D78C05A59FD849B8BEBE416B056FEE71D77100EA083B8156B94DF8FDFB8FD4602F04414423BE11B7572D0CE23160080DC81526777815035FC2D1D72E5C6464DB737FAF8B83BB91E4AB1FF125EF26611437AA86A97268B798B25B0779CD9490A71A86965105BFE2AE099868301357</code></pre>
<pre><code>auth_key = B209E947C3F8DE7CFCEBE083EBA231E4B8453682890DA74604EA1A12EAA3A170CEEAEC96C085F95384F69B4BA590CE18FD6DC316CC5BDFBA4213A1DFB44B8503D5EF2E0CD125D43C8B4D59B9E0B4FD08644EB298408BD28B5E4CF08DCDF1E9DAA4B469C350C08B1E49D0596C2DEF94D4CA0869ECA15811EB4AD499F24FCC62C2C5A8F620537EB11595BC01BD9FCED41B541E9CFC6648E838DB7971FB55739AC53E2F601398A3385AFB445FE431C355D4C30BCA0C5D6CAB643E040FED4D485A9F6A52032BF3A114265F6DD85C0F8525F28FB490B9145F04301895E8BCE1F97413ECA4CCE3F65EAF64AE4FFF16AC998AD30EB57FD2C56775D9920B67D256664B38</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 44 D9 0F 53 C4 B0 66
0010 | 38 00 00 00 34 F7 CB 3B C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 E7 3B 0A 2A 3E 6A 2B 63
0040 | 08 E8 2A BC D1 66 E1 23</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 97 45 95 27 B1 66
0010 | 38 00 00 00 34 F7 CB 3B 59 4F 64 40 6F E5 94 0D
0020 | 08 C1 86 CE A3 28 CF B8 FC C6 82 D4 9F EF C8 2A
0030 | A4 B0 8F 37 AA 9D 24 39 14 38 8F D1 5A EA 69 F3
0040 | 29 09 74 4A 87 66 1C FC</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,7 +817,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0144D90F53C4B066</code></td>
<td><code>019C97459527B166</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td><code>594F64406FE5940D08C186CEA328CFB8</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td><code>FCC682D49FEFC82AA4B08F37AA9D2439</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>E73B0A2A3E6A2B6308E82ABCD166E123</code></td>
<td><code>14388FD15AEA69F32909744A87661CFC</code></td>
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
</tr>
</tbody>

View file

@ -305,7 +305,7 @@
</tr>
<tr>
<td><a href="/constructor/updateChannel">updateChannel</a></td>
<td>A new channel or supergroup is available, or info about an existing channel has changed and must be refeteched.</td>
<td>Channel/supergroup (<a href="/constructor/channel">channel</a> and/or <a href="/constructor/channelFull">channelFull</a>) information was updated.<br><br>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/channel">channel</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.<br><br>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/channelFull">channelFull</a>) must be invalidated for <code>channel_id</code> when receiving this update.</td>
</tr>
<tr>
<td><a href="/constructor/updateNewChannelMessage">updateNewChannelMessage</a></td>
@ -541,7 +541,7 @@
</tr>
<tr>
<td><a href="/constructor/updateChat">updateChat</a></td>
<td>A new chat is available</td>
<td>Chat (<a href="/constructor/chat">chat</a> and/or <a href="/constructor/chatFull">chatFull</a>) information was updated.<br><br>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/chat">chat</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.<br><br>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/chatFull">chatFull</a>) must be invalidated for <code>chat_id</code> when receiving this update.</td>
</tr>
<tr>
<td><a href="/constructor/updateGroupCallParticipants">updateGroupCallParticipants</a></td>
@ -641,7 +641,7 @@
</tr>
<tr>
<td><a href="/constructor/updateUser">updateUser</a></td>
<td>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated, it must be refetched using <a href="/method/users.getFullUser">users.getFullUser</a>.</td>
<td>User (<a href="/constructor/user">user</a> and/or <a href="/constructor/userFull">userFull</a>) information was updated.<br><br>This update can only be received through getDifference or in <a href="/constructor/updates">updates</a>/<a href="/constructor/updatesCombined">updatesCombined</a> constructors, so it will <strong>always</strong> come bundled with the updated <a href="/constructor/user">user</a>, that should be applied <a href="/api/peers">as usual »</a>, <strong>without</strong> re-fetching the info manually.<br><br>However, full peer information will not come bundled in updates, so the full peer cache (<a href="/constructor/userFull">userFull</a>) must be invalidated for <code>user_id</code> when receiving this update.</td>
</tr>
<tr>
<td><a href="/constructor/updateAutoSaveSettings">updateAutoSaveSettings</a></td>