Update content of files

This commit is contained in:
GitHub Action 2024-08-05 12:09:47 +00:00
parent c9f4978564
commit 725a166cef
27 changed files with 331 additions and 246 deletions

View file

@ -87,7 +87,7 @@
<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).</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>
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>
<h4><a class="anchor" href="#schema-changes" id="schema-changes" name="schema-changes"><i class="anchor-icon"></i></a>Schema changes</h4>
<h5><a class="anchor" href="#new-methods" id="new-methods" name="new-methods"><i class="anchor-icon"></i></a>New Methods</h5>

View file

@ -88,7 +88,7 @@ for id in ids:
hash = hash ^ (hash &lt;&lt; 35)
hash = hash ^ (hash &gt;&gt; 4)
hash = hash + id</code></pre>
<p>In some cases, if the result container already has a <code>hash</code> field, that <strong>must</strong> be used instead, as the server-side generation algorithm will be different from the one specified above. </p>
<p>In some cases, if the result container already has a <code>hash</code> field, that can be used instead. </p>
<p>When the client passes a correct value, the API will return one of <code>*NotModified</code> constructors, e.g. <a href="/constructor/messages.messagesNotModified">messages.messagesNotModified</a> instead of the actual results.</p>
<h3><a class="anchor" href="#example-methods" id="example-methods" name="example-methods"><i class="anchor-icon"></i></a>Example methods</h3>
<ul>

View file

@ -98,6 +98,7 @@ This info will be contained in <a href="/constructor/userFull">userFull</a>.<cod
<p>Note that the opening hours specified by the user must be appropriately validated and transformed before invoking the method, as specified <a href="/api/business#opening-hours">here »</a>.</p>
<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="#helpgettimezoneslist" id="helpgettimezoneslist" name="helpgettimezoneslist"><i class="anchor-icon"></i></a><a href="/method/help.getTimezonesList">help.getTimezonesList</a></h4>
<p>Returns timezone information that may be used elsewhere in the API, such as to set <a href="/api/business#opening-hours">Telegram Business opening hours »</a>.</p>
<h4><a class="anchor" href="#timezone" id="timezone" name="timezone"><i class="anchor-icon"></i></a><a href="/constructor/timezone">timezone</a></h4>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>channel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Channel/supergroup info">
<meta property="description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights See here » for an implementation of the logic to use when updating the local user peer database.">
<meta property="og:title" content="channel">
<meta property="og:image" content="">
<meta property="og:description" content="Channel/supergroup info">
<meta property="og:description" content="Channel/supergroup info When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version: - title - megagroup - color - photo - username - usernames - has_geo - noforwards - emoji_status - has_link - slow_mode_enabled - scam - fake - gigagroup - forum - level - restricted - restriction_reason - join_to_send - join_request - is_verified - default_banned_rights See here » for an implementation of the logic to use when updating the local user peer database.">
<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">
@ -43,13 +43,13 @@
<h1 id="dev_page_title">channel</h1>
<div id="dev_page_content"><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>
<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>photo</code></li>
<li><code>username</code></li>
<li><code>usernames</code></li>
<li><code>has_geo</code></li>
@ -196,7 +196,7 @@
<tr>
<td><strong>forum</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.30?<a href="/constructor/true">true</a></td>
<td>Whether this supergroup is a <a href="/api/forum">forum</a> <br>Changes to this flag should invalidate the local <a href="/constructor/channelFull">channelFull</a> cache for this channel/supergroup ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
<td>Whether this supergroup is a <a href="/api/forum">forum</a>. <br>Changes to this flag should invalidate the local <a href="/constructor/channelFull">channelFull</a> cache for this channel/supergroup ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>flags2</strong></td>
@ -301,19 +301,24 @@
<tr>
<td><strong>level</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.10?<a href="/type/int">int</a></td>
<td><a href="/api/boost">Boost level</a> <br>Changes to this flag should invalidate the local <a href="/constructor/channelFull">channelFull</a> cache for this channel/supergroup ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
<td><a href="/api/boost">Boost level</a>. <br>Changes to this flag should invalidate the local <a href="/constructor/channelFull">channelFull</a> cache for this channel/supergroup ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/Chat">Chat</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="#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="#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>
<h4><a class="anchor" href="#min-constructors" id="min-constructors" name="min-constructors"><i class="anchor-icon"></i></a><a href="/api/min">Min constructors</a></h4>
<p>In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.</p>
<h4><a class="anchor" href="#channels-supergroups-gigagroups-and-basic-groups" id="channels-supergroups-gigagroups-and-basic-groups" name="channels-supergroups-gigagroups-and-basic-groups"><i class="anchor-icon"></i></a><a href="/api/channel">Channels, supergroups, gigagroups and basic groups</a></h4>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</p>
<h4><a class="anchor" href="#discussion-groups" id="discussion-groups" name="discussion-groups"><i class="anchor-icon"></i></a><a href="/api/discussion">Discussion groups</a></h4>
<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="#channels-supergroups-gigagroups-and-basic-groups" id="channels-supergroups-gigagroups-and-basic-groups" name="channels-supergroups-gigagroups-and-basic-groups"><i class="anchor-icon"></i></a><a href="/api/channel">Channels, supergroups, gigagroups and basic groups</a></h4>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</p>
<h4><a class="anchor" href="#channelstogglejointosend" id="channelstogglejointosend" name="channelstogglejointosend"><i class="anchor-icon"></i></a><a href="/method/channels.toggleJoinToSend">channels.toggleJoinToSend</a></h4>
<p>Set whether all users <a href="/api/discussion#requiring-users-to-join-the-group">should join a discussion group in order to comment on a post »</a></p>
<h4><a class="anchor" href="#invites" id="invites" name="invites"><i class="anchor-icon"></i></a><a href="/api/invites">Invites</a></h4>
@ -326,8 +331,6 @@
<p>Telegram users and channels can easily post and view stories through the API.</p>
<h4><a class="anchor" href="#channelsgetchannels" id="channelsgetchannels" name="channelsgetchannels"><i class="anchor-icon"></i></a><a href="/method/channels.getChannels">channels.getChannels</a></h4>
<p>Get info about <a href="/api/channel">channels/supergroups</a></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>
<h4><a class="anchor" href="#admin-banned-default-rights" id="admin-banned-default-rights" name="admin-banned-default-rights"><i class="anchor-icon"></i></a><a href="/api/rights">Admin, banned, default rights</a></h4>
<p>How to handle admin permissions, granular bans and global permissions in channels, groups and supergroups.</p>
<h4><a class="anchor" href="#accent-colors" id="accent-colors" name="accent-colors"><i class="anchor-icon"></i></a><a href="/api/colors">Accent colors</a></h4>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>channelFull</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Full info about a channel, supergroup or gigagroup.">
<meta property="description" content="Full info about a channel, supergroup or gigagroup. When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<meta property="og:title" content="channelFull">
<meta property="og:image" content="">
<meta property="og:description" content="Full info about a channel, supergroup or gigagroup.">
<meta property="og:description" content="Full info about a channel, supergroup or gigagroup. When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<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">
@ -43,6 +43,7 @@
<h1 id="dev_page_title">channelFull</h1>
<div id="dev_page_content"><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>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -424,7 +425,9 @@
<h4><a class="anchor" href="#custom-emojis" id="custom-emojis" name="custom-emojis"><i class="anchor-icon"></i></a><a href="/api/custom-emoji">Custom emojis</a></h4>
<p>Telegram allows including animated and static custom emojis inside of messages.</p>
<h4><a class="anchor" href="#channelssetemojistickers" id="channelssetemojistickers" name="channelssetemojistickers"><i class="anchor-icon"></i></a><a href="/method/channels.setEmojiStickers">channels.setEmojiStickers</a></h4>
<p>Set a <a href="/api/custom-emoji">custom emoji stickerset</a> for supergroups. Only usable after reaching at least the <a href="/api/boost">boost level »</a> specified in the <a href="/api/config#group-emoji-stickers-level-min"><code>group_emoji_stickers_level_min</code> »</a> config parameter.</p></div>
<p>Set a <a href="/api/custom-emoji">custom emoji stickerset</a> for supergroups. Only usable after reaching at least the <a href="/api/boost">boost level »</a> specified in the <a href="/api/config#group-emoji-stickers-level-min"><code>group_emoji_stickers_level_min</code> »</a> config parameter.</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>chat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Info about a group">
<meta property="description" content="Info about a group. When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). See here » for an implementation of the logic to use when updating the local user peer database.">
<meta property="og:title" content="chat">
<meta property="og:image" content="">
<meta property="og:description" content="Info about a group">
<meta property="og:description" content="Info about a group. When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor). See here » for an implementation of the logic to use when updating the local user peer database.">
<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,7 +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/chat" >chat</a></li></ul></div>
<h1 id="dev_page_title">chat</h1>
<div id="dev_page_content"><p>Info about a group</p>
<div id="dev_page_content"><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>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>chatFull</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Full info about a basic group.">
<meta property="description" content="Full info about a basic group. When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<meta property="og:title" content="chatFull">
<meta property="og:image" content="">
<meta property="og:description" content="Full info about a basic group.">
<meta property="og:description" content="Full info about a basic group. When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<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">
@ -43,6 +43,7 @@
<h1 id="dev_page_title">chatFull</h1>
<div id="dev_page_content"><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>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -193,7 +194,9 @@
<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>
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</p>
<h4><a class="anchor" href="#channels-supergroups-gigagroups-and-basic-groups" id="channels-supergroups-gigagroups-and-basic-groups" name="channels-supergroups-gigagroups-and-basic-groups"><i class="anchor-icon"></i></a><a href="/api/channel">Channels, supergroups, gigagroups and basic groups</a></h4>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</p></div>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</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

@ -115,6 +115,7 @@ The exact read date of messages might still be unavailable for other reasons, se
To set <a href="/constructor/userFull">userFull</a>.<code>read_dates_private</code> for ourselves invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.hide_read_marks</code> flag.</p>
<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="#usersgetispremiumrequiredtocontact" id="usersgetispremiumrequiredtocontact" name="usersgetispremiumrequiredtocontact"><i class="anchor-icon"></i></a><a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a></h4>
<p>Check whether we can write to the specified user (this method can only be called by non-<a href="/api/premium">Premium</a> users), see <a href="/api/privacy#require-premium-for-new-non-contact-users">here »</a> for more info on the full flow.</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>

View file

@ -82,7 +82,34 @@
<p><a href="/type/InputChannel">InputChannel</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></div>
<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></div>
</div>

View file

@ -82,7 +82,34 @@
<p><a href="/type/InputPeer">InputPeer</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></div>
<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></div>
</div>

View file

@ -281,6 +281,7 @@
<p>Telegram Premium users can grant their favorite channels and supergroups additional features like the ability to post stories by giving them boosts.</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="#saved-messages" id="saved-messages" name="saved-messages"><i class="anchor-icon"></i></a><a href="/api/saved-messages">Saved messages</a></h4>
<p>The Saved Messages chat allows users to bookmark messages and media: it's a personal cloud storage for any messages or media you may want to send or forward there.</p>
<h4><a class="anchor" href="#inputpeerself" id="inputpeerself" name="inputpeerself"><i class="anchor-icon"></i></a><a href="/constructor/inputPeerSelf">inputPeerSelf</a></h4>

View file

@ -87,6 +87,7 @@ This setting only affects the current account, and is synced to other logged in
<p>Invoking this method will update the value of the <code>view_forum_as_messages</code> flag of <a href="/constructor/channelFull">channelFull</a> or <a href="/constructor/dialog">dialog</a> and emit an <a href="/constructor/updateChannelViewForumAsMessages">updateChannelViewForumAsMessages</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="#dialog" id="dialog" name="dialog"><i class="anchor-icon"></i></a><a href="/constructor/dialog">dialog</a></h4>
<p>Chat</p>
<h4><a class="anchor" href="#updatechannelviewforumasmessages" id="updatechannelviewforumasmessages" name="updatechannelviewforumasmessages"><i class="anchor-icon"></i></a><a href="/constructor/updateChannelViewForumAsMessages">updateChannelViewForumAsMessages</a></h4>

View file

@ -82,6 +82,7 @@
<p>See <a href="https://github.com/tdlib/td/blob/cb164927417f22811c74cd8678ed4a5ab7cb80ba/td/telegram/UserManager.cpp#L2267">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="#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>

View file

@ -92,7 +92,8 @@
<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="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4>
<p>Extended user info</p></div>
<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></div>
</div>

View file

@ -91,12 +91,12 @@
<tr>
<td><strong>deleted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.13?<a href="/constructor/true">true</a></td>
<td>Whether the account of this user was deleted. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td>
<td>Whether the account of this user was deleted. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>bot</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/constructor/true">true</a></td>
<td>Is this user a bot? <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td>
<td>Is this user a bot? <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>bot_chat_history</strong></td>
@ -156,7 +156,7 @@
<tr>
<td><strong>premium</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.28?<a href="/constructor/true">true</a></td>
<td>Whether this user is a Telegram Premium user <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID. <br>Changes to this flag if the <code>self</code> flag is set should also trigger the following calls, to refresh the respective caches: <br>- The <a href="/method/help.getConfig">help.getConfig</a> cache <br>- The <a href="/method/messages.getTopReactions">messages.getTopReactions</a> cache if the <code>bot</code> flag is <strong>not</strong> set</td>
<td>Whether this user is a Telegram Premium user <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here »</a> for more info. <br>Changes to this flag if the <code>self</code> flag is set should also trigger the following calls, to refresh the respective caches: <br>- The <a href="/method/help.getConfig">help.getConfig</a> cache <br>- The <a href="/method/messages.getTopReactions">messages.getTopReactions</a> cache if the <code>bot</code> flag is <strong>not</strong> set</td>
</tr>
<tr>
<td><strong>attach_menu_enabled</strong></td>
@ -246,7 +246,7 @@
<tr>
<td><strong>bot_info_version</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/type/int">int</a></td>
<td>Version of the <a href="/constructor/userFull">bot_info field in userFull</a>, incremented every time it changes. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td>
<td>Version of the <a href="/constructor/userFull">bot_info field in userFull</a>, incremented every time it changes. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here »</a> for more info.</td>
</tr>
<tr>
<td><strong>restriction_reason</strong></td>
@ -302,6 +302,7 @@
<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>
<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="#min-constructors" id="min-constructors" name="min-constructors"><i class="anchor-icon"></i></a><a href="/api/min">Min constructors</a></h4>
<p>In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.</p>
<h4><a class="anchor" href="#bot-attachment-menu-and-side-menu-entries" id="bot-attachment-menu-and-side-menu-entries" name="bot-attachment-menu-and-side-menu-entries"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Bot attachment menu and side menu entries</a></h4>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>userFull</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Extended user info">
<meta property="description" content="Extended user info When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<meta property="og:title" content="userFull">
<meta property="og:image" content="">
<meta property="og:description" content="Extended user info">
<meta property="og:description" content="Extended user info When updating the local peer database », all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren&#39;t set in the new constructor).">
<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">
@ -43,6 +43,7 @@
<h1 id="dev_page_title">userFull</h1>
<div id="dev_page_content"><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>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -325,7 +326,9 @@ To set <a href="/constructor/userFull">userFull</a>.<code>read_dates_private</co
<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="#channels-supergroups-gigagroups-and-basic-groups" id="channels-supergroups-gigagroups-and-basic-groups" name="channels-supergroups-gigagroups-and-basic-groups"><i class="anchor-icon"></i></a><a href="/api/channel">Channels, supergroups, gigagroups and basic groups</a></h4>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</p></div>
<p>How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.</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

@ -117,7 +117,8 @@ This info will be contained in <a href="/constructor/userFull">userFull</a>.<cod
<h4><a class="anchor" href="#business" id="business" name="business"><i class="anchor-icon"></i></a><a href="/api/business">Business</a></h4>
<p>Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.</p>
<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></div>
<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></div>
</div>

View file

@ -111,6 +111,7 @@
<p>Telegram allows creating forums with multiple distinct topics.</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="#dialog" id="dialog" name="dialog"><i class="anchor-icon"></i></a><a href="/constructor/dialog">dialog</a></h4>
<p>Chat</p>
<h4><a class="anchor" href="#updatechannelviewforumasmessages" id="updatechannelviewforumasmessages" name="updatechannelviewforumasmessages"><i class="anchor-icon"></i></a><a href="/constructor/updateChannelViewForumAsMessages">updateChannelViewForumAsMessages</a></h4>

View file

@ -86,6 +86,7 @@
<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="#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="#client-configuration" id="client-configuration" name="client-configuration"><i class="anchor-icon"></i></a><a href="/api/config">Client configuration</a></h4>
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</p></div>

View file

@ -143,7 +143,10 @@
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#bots-can-use-this-method" id="bots-can-use-this-method" name="bots-can-use-this-method"><i class="anchor-icon"></i></a>Bots can use this method</h3></div>
<h3><a class="anchor" href="#bots-can-use-this-method" id="bots-can-use-this-method" name="bots-can-use-this-method"><i class="anchor-icon"></i></a>Bots can use this method</h3>
<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="#deep-links" id="deep-links" name="deep-links"><i class="anchor-icon"></i></a><a href="/api/links">Deep links</a></h4>
<p>Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.</p></div>
</div>

View file

@ -103,7 +103,10 @@
<td>The provided language pack is invalid.</td>
</tr>
</tbody>
</table></div>
</table>
<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="#deep-links" id="deep-links" name="deep-links"><i class="anchor-icon"></i></a><a href="/api/links">Deep links</a></h4>
<p>Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.</p></div>
</div>

View file

@ -133,6 +133,7 @@ To set <a href="/constructor/userFull">userFull</a>.<code>read_dates_private</co
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</p>
<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="#globalprivacysettings" id="globalprivacysettings" name="globalprivacysettings"><i class="anchor-icon"></i></a><a href="/constructor/globalPrivacySettings">globalPrivacySettings</a></h4>
<p>Global privacy settings</p>
<h4><a class="anchor" href="#accountsetglobalprivacysettings" id="accountsetglobalprivacysettings" name="accountsetglobalprivacysettings"><i class="anchor-icon"></i></a><a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a></h4>

View file

@ -144,8 +144,6 @@
<p>Query an inline bot</p>
<h4><a class="anchor" href="#bot-attachment-menu-and-side-menu-entries" id="bot-attachment-menu-and-side-menu-entries" name="bot-attachment-menu-and-side-menu-entries"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Bot attachment menu and side menu entries</a></h4>
<p>Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile web apps.</p>
<h4><a class="anchor" href="#deep-links" id="deep-links" name="deep-links"><i class="anchor-icon"></i></a><a href="/api/links">Deep links</a></h4>
<p>Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.</p>
<h4><a class="anchor" href="#mini-apps-on-telegram" id="mini-apps-on-telegram" name="mini-apps-on-telegram"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Mini Apps on Telegram</a></h4>
<p>Bots can offer users interactive HTML5 web apps to completely replace any website.</p></div>

View file

@ -130,8 +130,10 @@
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</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="#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="#message-reactions" id="message-reactions" name="message-reactions"><i class="anchor-icon"></i></a><a href="/api/reactions">Message reactions</a></h4>
<p>Telegram allows users to react on any message using specific emojis, triggering cute lottie animations.</p></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 58 86 0D 00 57 C2 AF 66
0010 | 14 00 00 00 F1 8E 7E BE 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 54 51 01 00 D7 BD B0 66
0010 | 14 00 00 00 F1 8E 7E BE 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA</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>58860D0057C2AF66</code></td>
<td><code>54510100D7BDB066</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>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</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 B8 09 7C 57 C2 AF 66
0010 | 54 00 00 00 63 24 16 05 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E
0030 | 9B 13 1B 62 6D CD 43 14 08 1E CA 00 88 61 80 8B
0040 | D1 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 44 3C 26 D7 BD B0 66
0010 | 8C 00 00 00 63 24 16 05 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2
0030 | 44 25 40 39 D7 91 9B 2E 08 25 9E B4 69 B0 C8 C8
0040 | D3 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>01B8097C57C2AF66</code></td>
<td><code>01443C26D7BDB066</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>54000000</code> (84 in decimal)</td>
<td><code>8C000000</code> (140 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081ECA008861808BD1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2218586352184757201</td>
<td><code>08259EB469B0C8C8D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2710802391754131667</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 = 2218586352184757201</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2218586352184757201 = 1308465869 * 1695563029</code></p>
<pre><code>p = 1308465869
q = 1695563029</code></pre>
<pre><code>pq = 2710802391754131667</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2710802391754131667 = 1425481901 * 1901674367</code></p>
<pre><code>p = 1425481901
q = 1901674367</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 1E CA 00 88 61 80 8B D1 00 00 00
0010 | 04 4D FD 9A CD 00 00 00 04 65 10 3D 15 00 00 00
0020 | 11 B9 C2 84 50 81 17 76 D4 24 CA 45 CD D0 38 74
0030 | 46 0A 42 F7 E8 9B 5F 4E 9B 13 1B 62 6D CD 43 14
0040 | D1 44 94 66 E7 24 4E D4 A1 94 E6 6E FB 19 20 AC
0050 | B7 8B 50 A6 DA 5C 66 E4 D9 CF 9B 47 25 63 E9 A1
<pre><code>0000 | 95 5F F5 A9 08 25 9E B4 69 B0 C8 C8 D3 00 00 00
0010 | 04 54 F7 20 AD 00 00 00 04 71 59 3F 7F 00 00 00
0020 | 64 36 30 8B B0 C8 AE 58 73 36 04 FC 48 D0 A0 BA
0030 | ED 2B 40 DA 18 15 5C E2 44 25 40 39 D7 91 9B 2E
0040 | 5D 74 3D 5D 77 D9 0C F0 7F B4 DC 23 BE 68 AA CC
0050 | EF 9C 9A 65 9A 08 2E 19 A4 25 CF 2F E5 D9 D3 42
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 = 1695563029</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081ECA008861808BD1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2218586352184757201</td>
<td><code>08259EB469B0C8C8D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2710802391754131667</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>044DFD9ACD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1308465869</td>
<td><code>0454F720AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1425481901</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>0465103D15000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1695563029</td>
<td><code>0471593F7F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1901674367</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>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>D1449466E7244ED4A194E66EFB1920AC</code> <code>B78B50A6DA5C66E4D9CF9B472563E9A1</code></td>
<td><code>5D743D5D77D90CF07FB4DC23BE68AACC</code> <code>EF9C9A659A082E19A425CF2FE5D9D342</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1695563029</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 = 955FF5A9081ECA008861808BD1000000044DFD9ACD0000000465103D1500000011B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD4314D1449466E7244ED4A194E66EFB1920ACB78B50A6DA5C66E4D9CF9B472563E9A102000000
random_padding_bytes = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F99253AB267EE4BC2B0E8C9CE3A3AADC03C6B56BF0D11AB702FA7DDAA012F216FD61FAEC30D3A8BA03F970B9AB7882AF1A5F6AD457E38DA4C08E13D8C61A66F1A41A</code></pre>
<pre><code>data = 955FF5A908259EB469B0C8C8D30000000454F720AD0000000471593F7F0000006436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E5D743D5D77D90CF07FB4DC23BE68AACCEF9C9A659A082E19A425CF2FE5D9D34202000000
random_padding_bytes = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04A5D0FA81E1DB54C3AFDA9341677BCE54F386130E95799BFD9503C85CD8FF1CBDE4DD15022BF58CC32BF46E674E12C4119AB09B4BE0D939AC7E344763E801366</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 = 66B4C08174C9A630BFE83A625C4C34EF67D5B3096E5CBE9CD09447676A7E3F4A6C194889A89CE4EE1C801A8823C25EE9AFAA339DB24726E7B6BF65D9C86064BF2AD687CE883C7FCAED4C3A2B378E99799DE7A9170E1A3B58EA403A3F597132C2F33073A411AF733568B7E1B0F8AC66121725AE8355FA43CB63E05D6D710132F4336EB8A0CE40792D13FBACB7E87F3E887453FF422301D2B4EAAF007D9BE739B920C20F485551136ACDA6C943583A158C62DEE5AECBDFCC3F88F705EB1F350193ACE8E007AF33275A0489BF1FFF8422BE9B9315AC79160166F9CFE96C971AB74FED0CDAC515FC7CBB1598EBEBCECF7E6500106C5BE4FFB9E2CEA0E4E651A6AD52</code></pre>
<pre><code>encrypted_data = 067DC65EE22FF766C73BB612CCD0453F9D1871F52984D681A3D04726FD32548D3C2E58C0931A628C47E51DF547A022A5780123785F15E20723EBBF398DEAADEE1A7E4270CC29C0C0BD4BC7EE8283C6D49681B7AB00E83DA68D72C70B812BF8A004864C73EECD24CDE96DC912EA50CB5A30CDB2E1A98758E4AEEA03F586F38AFC4EDC0292085F1C5251F3F56A6D6B57D79FFA1C1E61B334EECEF30BA819110F6D89801EED7DDD0ECDCD0535E305776512EF7321B630DBE7EC8350107A500E708C9E2027C5B731632014532FB17E5C3217C2EF7D46D71EB366AE925AA0C725EA7E0FDB2D362F5F916D9C8514B9EF72A6FF233683D8F9459AE9B2D56F62331363B7</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 5C 86 0D 00 57 C2 AF 66
0010 | 40 01 00 00 BE E4 12 D7 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E
0030 | 9B 13 1B 62 6D CD 43 14 04 4D FD 9A CD 00 00 00
0040 | 04 65 10 3D 15 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 66 B4 C0 81 74 C9 A6 30 BF E8 3A 62
0060 | 5C 4C 34 EF 67 D5 B3 09 6E 5C BE 9C D0 94 47 67
0070 | 6A 7E 3F 4A 6C 19 48 89 A8 9C E4 EE 1C 80 1A 88
0080 | 23 C2 5E E9 AF AA 33 9D B2 47 26 E7 B6 BF 65 D9
0090 | C8 60 64 BF 2A D6 87 CE 88 3C 7F CA ED 4C 3A 2B
00A0 | 37 8E 99 79 9D E7 A9 17 0E 1A 3B 58 EA 40 3A 3F
00B0 | 59 71 32 C2 F3 30 73 A4 11 AF 73 35 68 B7 E1 B0
00C0 | F8 AC 66 12 17 25 AE 83 55 FA 43 CB 63 E0 5D 6D
00D0 | 71 01 32 F4 33 6E B8 A0 CE 40 79 2D 13 FB AC B7
00E0 | E8 7F 3E 88 74 53 FF 42 23 01 D2 B4 EA AF 00 7D
00F0 | 9B E7 39 B9 20 C2 0F 48 55 51 13 6A CD A6 C9 43
0100 | 58 3A 15 8C 62 DE E5 AE CB DF CC 3F 88 F7 05 EB
0110 | 1F 35 01 93 AC E8 E0 07 AF 33 27 5A 04 89 BF 1F
0120 | FF 84 22 BE 9B 93 15 AC 79 16 01 66 F9 CF E9 6C
0130 | 97 1A B7 4F ED 0C DA C5 15 FC 7C BB 15 98 EB EB
0140 | CE CF 7E 65 00 10 6C 5B E4 FF B9 E2 CE A0 E4 E6
0150 | 51 A6 AD 52</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 D0 0C 00 D7 BD B0 66
0010 | 40 01 00 00 BE E4 12 D7 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2
0030 | 44 25 40 39 D7 91 9B 2E 04 54 F7 20 AD 00 00 00
0040 | 04 71 59 3F 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 06 7D C6 5E E2 2F F7 66 C7 3B B6 12
0060 | CC D0 45 3F 9D 18 71 F5 29 84 D6 81 A3 D0 47 26
0070 | FD 32 54 8D 3C 2E 58 C0 93 1A 62 8C 47 E5 1D F5
0080 | 47 A0 22 A5 78 01 23 78 5F 15 E2 07 23 EB BF 39
0090 | 8D EA AD EE 1A 7E 42 70 CC 29 C0 C0 BD 4B C7 EE
00A0 | 82 83 C6 D4 96 81 B7 AB 00 E8 3D A6 8D 72 C7 0B
00B0 | 81 2B F8 A0 04 86 4C 73 EE CD 24 CD E9 6D C9 12
00C0 | EA 50 CB 5A 30 CD B2 E1 A9 87 58 E4 AE EA 03 F5
00D0 | 86 F3 8A FC 4E DC 02 92 08 5F 1C 52 51 F3 F5 6A
00E0 | 6D 6B 57 D7 9F FA 1C 1E 61 B3 34 EE CE F3 0B A8
00F0 | 19 11 0F 6D 89 80 1E ED 7D DD 0E CD CD 05 35 E3
0100 | 05 77 65 12 EF 73 21 B6 30 DB E7 EC 83 50 10 7A
0110 | 50 0E 70 8C 9E 20 27 C5 B7 31 63 20 14 53 2F B1
0120 | 7E 5C 32 17 C2 EF 7D 46 D7 1E B3 66 AE 92 5A A0
0130 | C7 25 EA 7E 0F DB 2D 36 2F 5F 91 6D 9C 85 14 B9
0140 | EF 72 A6 FF 23 36 83 D8 F9 45 9A E9 B2 D5 6F 62
0150 | 33 13 63 B7</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 = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>5C860D0057C2AF66</code></td>
<td><code>E8D00C00D7BDB066</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 = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044DFD9ACD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1308465869</td>
<td><code>0454F720AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1425481901</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>0465103D15000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1695563029</td>
<td><code>0471593F7F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1901674367</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 = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010066B4C08174C9A630BFE83A62</code> <code>5C4C34EF67D5B3096E5CBE9CD0944767</code> <code>6A7E3F4A6C194889A89CE4EE1C801A88</code> <code>23C25EE9AFAA339DB24726E7B6BF65D9</code> <code>C86064BF2AD687CE883C7FCAED4C3A2B</code> <code>378E99799DE7A9170E1A3B58EA403A3F</code> <code>597132C2F33073A411AF733568B7E1B0</code> <code>F8AC66121725AE8355FA43CB63E05D6D</code> <code>710132F4336EB8A0CE40792D13FBACB7</code> <code>E87F3E887453FF422301D2B4EAAF007D</code> <code>9BE739B920C20F485551136ACDA6C943</code> <code>583A158C62DEE5AECBDFCC3F88F705EB</code> <code>1F350193ACE8E007AF33275A0489BF1F</code> <code>FF8422BE9B9315AC79160166F9CFE96C</code> <code>971AB74FED0CDAC515FC7CBB1598EBEB</code> <code>CECF7E6500106C5BE4FFB9E2CEA0E4E6</code><br> <code>51A6AD52</code></td>
<td><code>FE000100067DC65EE22FF766C73BB612</code> <code>CCD0453F9D1871F52984D681A3D04726</code> <code>FD32548D3C2E58C0931A628C47E51DF5</code> <code>47A022A5780123785F15E20723EBBF39</code> <code>8DEAADEE1A7E4270CC29C0C0BD4BC7EE</code> <code>8283C6D49681B7AB00E83DA68D72C70B</code> <code>812BF8A004864C73EECD24CDE96DC912</code> <code>EA50CB5A30CDB2E1A98758E4AEEA03F5</code> <code>86F38AFC4EDC0292085F1C5251F3F56A</code> <code>6D6B57D79FFA1C1E61B334EECEF30BA8</code> <code>19110F6D89801EED7DDD0ECDCD0535E3</code> <code>05776512EF7321B630DBE7EC8350107A</code> <code>500E708C9E2027C5B731632014532FB1</code> <code>7E5C3217C2EF7D46D71EB366AE925AA0</code> <code>C725EA7E0FDB2D362F5F916D9C8514B9</code> <code>EF72A6FF233683D8F9459AE9B2D56F62</code><br> <code>331363B7</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<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 B8 1D 3E 58 C2 AF 66
0010 | F0 02 00 00 5C 07 E8 D0 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E
0030 | 9B 13 1B 62 6D CD 43 14 FE 50 02 00 EE BE 28 88
0040 | 0E AC F2 EB 57 DC E9 60 8F 51 DE 85 62 5E 9B 0A
0050 | FA B8 E0 BA 26 8F 29 E7 38 94 32 79 A8 15 73 84
0060 | ED A1 01 D2 4E 6B 2C 98 01 26 E2 60 F9 FF B6 02
0070 | 3B CB 27 18 20 0F BD 1F 78 A1 65 32 79 AD 19 C6
0080 | 2B CB 98 83 B2 EB 3B 13 BC A8 71 67 95 4D 70 54
0090 | AD EA 5A B9 36 D2 89 94 EC A1 4F AE 6E BF 21 B6
00A0 | 8E 73 78 08 59 29 74 F2 E3 EA EE 7D 5A ED 69 39
00B0 | C1 02 F1 6D C6 66 6F 51 79 32 93 0E F8 2A DD 90
00C0 | 48 45 D8 BB EB B8 F7 3A AC 3B 00 B3 81 5C AA 19
00D0 | C9 6A C7 C0 29 8E E0 CE BB FB B8 1C 06 6F 62 C6
00E0 | 03 0D AC 62 59 A7 E9 6D 9E 9C AF 50 D1 8A F2 37
00F0 | 21 56 77 D2 97 17 23 10 AA F5 62 CA 1C 50 BA 92
0100 | B1 7B B7 DD 61 4D 78 56 51 C2 7C B1 93 BC AD 7B
0110 | DA DC A3 71 29 28 9D C4 5F 3D D1 76 8F 18 9F 48
0120 | 7C 0D EB 8F 0D 72 EE F2 BC DF D2 38 C6 77 60 D1
0130 | A8 3B 4A 2D 2A D7 7A 36 40 73 5B B6 15 92 EF 46
0140 | 51 47 F2 E6 B7 0D EA 1C E3 68 6F CC 26 12 47 AC
0150 | 5D 9D F7 9F D2 E8 91 8D 04 C5 B6 5F 9C A9 70 D4
0160 | EB 55 E1 D5 BD 45 F9 9C 60 13 AC 5B 50 0E 3D C4
0170 | 6A 2C F8 DA 3D 99 03 24 D2 61 57 D1 8F 18 76 92
0180 | 31 21 3E E3 48 D8 91 59 E3 09 36 81 AC D6 A0 1E
0190 | 6D 23 04 C2 93 87 D0 1B E9 58 31 9D 85 21 95 74
01A0 | AF A3 EE B9 A3 AB EB 8E 73 61 65 93 75 57 35 BC
01B0 | 6E DB 81 49 EC 30 AC C5 37 37 3D 21 87 8A 6F 09
01C0 | 3E BA FA C5 2B 26 44 60 FF 1A 96 7E 37 A6 76 DC
01D0 | E8 44 CB 64 11 B5 B2 09 36 F0 4D 07 3D 04 6F 07
01E0 | 03 E1 3E FE 8A 99 60 53 20 61 50 85 D7 BF 77 A7
01F0 | 97 30 D3 45 0A 7A 83 3B E6 4D 05 14 35 34 F7 7F
0200 | 12 DF 8F 0E BF 68 9C 8C C8 27 15 02 13 C5 00 45
0210 | 35 01 0E 72 30 44 49 2D 5F 43 22 67 39 24 3D 62
0220 | 13 12 15 1E 90 C1 84 16 C0 14 05 5E BE A0 B9 96
0230 | 46 F4 E7 FB 07 6F 02 37 12 A1 64 8D 1B 72 99 9D
0240 | A7 36 79 C6 5A F6 87 C0 DC 31 BD A7 66 25 E2 08
0250 | AE 96 E3 5A 82 7F 2E 7B 4B 89 1D BE 2F 3C BE 45
0260 | EA 02 EC 9C 8C B2 5C 09 81 4E 9F FD 3A C8 12 10
0270 | 7D B8 75 21 FB 07 C2 B8 29 53 E2 4A F4 CC 5E C1
0280 | 3F 94 58 C2 D1 9D 44 0F 2D 76 D6 6B</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC DD E5 D7 BD B0 66
0010 | C4 02 00 00 5C 07 E8 D0 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2
0030 | 44 25 40 39 D7 91 9B 2E FE 50 02 00 DF BE 8A 18
0040 | 6D A7 31 F8 3E 7E 6C 3D 28 3F A6 E5 A1 E7 DF 06
0050 | A9 82 E2 95 4D 0C 09 6C 48 80 3B 68 5F 5F C1 84
0060 | F7 79 EA 05 37 2F D7 CE 65 13 24 55 CE 84 33 F5
0070 | 74 EF C8 7D DF E4 4A F1 81 69 A6 A0 3C AE 6F 81
0080 | A3 02 7C 8A AC 4A 7E 8B F6 8D 07 41 88 EB 27 45
0090 | 32 77 B4 23 1E 3C B3 08 AB BD 95 01 3D A8 5A 77
00A0 | A4 BA B4 45 51 D7 6D 74 C4 58 40 F2 9A BA F9 0B
00B0 | 62 53 C3 14 13 74 31 3E 3F 18 31 6C 56 94 B3 53
00C0 | 8F E7 AE 4D 4F E3 2B 53 3F 24 8C 91 E7 60 36 45
00D0 | A6 6D 79 55 43 4A 4F 1B A1 D9 D4 95 F1 EC 9C 57
00E0 | AB 6D 73 36 7B DD 81 9F 65 C6 04 18 D6 44 2D FA
00F0 | 75 FF B1 E3 92 BA 85 A4 DE 36 97 DE 79 52 A2 4E
0100 | 84 6F 77 E4 FA 2D 65 F2 C4 8D C6 9F 12 8B E3 90
0110 | 7D 2A 45 1B 4A 7D 52 C4 AC 5A 6B 1B 12 36 B4 85
0120 | E0 44 77 AD CD A4 93 B0 C9 54 AF A4 BB E0 01 64
0130 | 5E 13 9D FA D4 52 61 B2 89 04 FB 4C 17 63 DB F0
0140 | 4E 6F C3 6B 39 D9 8A 0C 4A 06 91 96 2A 93 02 63
0150 | C0 2B 3B CE 77 23 BF 30 E0 E3 32 47 27 DB BC 6E
0160 | 87 3A 27 3C 8C 8D 8E 6A EA 6E 1F 1E 21 9A 89 F2
0170 | 3F 82 BE 68 56 72 B4 A5 20 06 D5 39 A2 31 C6 BD
0180 | 5E 7F ED FC 2A 07 DB 7A 16 3E 2D 51 28 16 F1 31
0190 | 0E C4 DC 19 D4 A1 89 D5 3D E9 6D 0B EA 80 72 BA
01A0 | 12 2E E7 47 36 E3 C1 36 91 02 1B 0E B3 42 E8 6D
01B0 | 53 81 8A BC 29 E5 C8 F3 4D CA 80 97 0A 1F 6C 3E
01C0 | 17 1E 4F 14 1B EF D2 0C A2 86 1F 3A BF 34 93 0E
01D0 | 7F 03 C6 BD 6E EC 5A 7A 72 48 1E 7A 59 85 34 BB
01E0 | 0C D9 D8 B9 D4 01 EF 78 FD B1 EF 11 E5 91 3C 98
01F0 | FE C5 BD 63 59 83 D2 40 14 E0 D0 D0 83 B9 A7 EB
0200 | D0 D3 29 0F D9 CF 9D 51 DA C3 F8 18 C2 D2 8D CA
0210 | 55 4D F9 30 D5 62 7C 6F 4F D8 B6 1D 4E AF D0 0C
0220 | 79 53 CF 14 F7 B5 66 A5 EC 68 E6 00 38 E2 6F C9
0230 | C9 05 32 0D C9 9A 65 2B 76 0F F8 6D 62 86 E4 60
0240 | B4 97 0D C6 7E 1F 47 64 52 B5 77 58 4C F7 B6 16
0250 | 39 41 0F 5A 81 F4 7F 87 D6 DB 63 06 A4 36 57 19
0260 | A5 B7 94 A3 22 75 67 4E BB AC 2C 5A F1 4F 16 E8
0270 | 6E 9B 8B 94 39 DA 14 09 FF E9 89 19 00 FD B9 6D
0280 | C7 F1 5F 56 CD 60 56 49 D4 8A 6C 1E</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 = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01B81D3E58C2AF66</code></td>
<td><code>01BCDDE5D7BDB066</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>F0020000</code> (752 in decimal)</td>
<td><code>C4020000</code> (708 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200EEBE28880EACF2EB57DCE960</code> <code>8F51DE85625E9B0AFAB8E0BA268F29E7</code> <code>38943279A8157384EDA101D24E6B2C98</code> <code>0126E260F9FFB6023BCB2718200FBD1F</code> <code>78A1653279AD19C62BCB9883B2EB3B13</code> <code>BCA87167954D7054ADEA5AB936D28994</code> <code>ECA14FAE6EBF21B68E737808592974F2</code> <code>E3EAEE7D5AED6939C102F16DC6666F51</code> <code>7932930EF82ADD904845D8BBEBB8F73A</code> <code>AC3B00B3815CAA19C96AC7C0298EE0CE</code> <code>BBFBB81C066F62C6030DAC6259A7E96D</code> <code>9E9CAF50D18AF237215677D297172310</code> <code>AAF562CA1C50BA92B17BB7DD614D7856</code> <code>51C27CB193BCAD7BDADCA37129289DC4</code> <code>5F3DD1768F189F487C0DEB8F0D72EEF2</code> <code>BCDFD238C67760D1A83B4A2D2AD77A36</code> <code>40735BB61592EF465147F2E6B70DEA1C</code> <code>E3686FCC261247AC5D9DF79FD2E8918D</code> <code>04C5B65F9CA970D4EB55E1D5BD45F99C</code> <code>6013AC5B500E3DC46A2CF8DA3D990324</code> <code>D26157D18F18769231213EE348D89159</code> <code>E3093681ACD6A01E6D2304C29387D01B</code> <code>E958319D85219574AFA3EEB9A3ABEB8E</code> <code>73616593755735BC6EDB8149EC30ACC5</code> <code>37373D21878A6F093EBAFAC52B264460</code> <code>FF1A967E37A676DCE844CB6411B5B209</code> <code>36F04D073D046F0703E13EFE8A996053</code> <code>20615085D7BF77A79730D3450A7A833B</code> <code>E64D05143534F77F12DF8F0EBF689C8C</code> <code>C827150213C5004535010E723044492D</code> <code>5F43226739243D621312151E90C18416</code> <code>C014055EBEA0B99646F4E7FB076F0237</code> <code>12A1648D1B72999DA73679C65AF687C0</code> <code>DC31BDA76625E208AE96E35A827F2E7B</code> <code>4B891DBE2F3CBE45EA02EC9C8CB25C09</code> <code>814E9FFD3AC812107DB87521FB07C2B8</code> <code>2953E24AF4CC5EC13F9458C2D19D440F</code><br> <code>2D76D66B</code></td>
<td><code>FE500200DFBE8A186DA731F83E7E6C3D</code> <code>283FA6E5A1E7DF06A982E2954D0C096C</code> <code>48803B685F5FC184F779EA05372FD7CE</code> <code>65132455CE8433F574EFC87DDFE44AF1</code> <code>8169A6A03CAE6F81A3027C8AAC4A7E8B</code> <code>F68D074188EB27453277B4231E3CB308</code> <code>ABBD95013DA85A77A4BAB44551D76D74</code> <code>C45840F29ABAF90B6253C3141374313E</code> <code>3F18316C5694B3538FE7AE4D4FE32B53</code> <code>3F248C91E7603645A66D7955434A4F1B</code> <code>A1D9D495F1EC9C57AB6D73367BDD819F</code> <code>65C60418D6442DFA75FFB1E392BA85A4</code> <code>DE3697DE7952A24E846F77E4FA2D65F2</code> <code>C48DC69F128BE3907D2A451B4A7D52C4</code> <code>AC5A6B1B1236B485E04477ADCDA493B0</code> <code>C954AFA4BBE001645E139DFAD45261B2</code> <code>8904FB4C1763DBF04E6FC36B39D98A0C</code> <code>4A0691962A930263C02B3BCE7723BF30</code> <code>E0E3324727DBBC6E873A273C8C8D8E6A</code> <code>EA6E1F1E219A89F23F82BE685672B4A5</code> <code>2006D539A231C6BD5E7FEDFC2A07DB7A</code> <code>163E2D512816F1310EC4DC19D4A189D5</code> <code>3DE96D0BEA8072BA122EE74736E3C136</code> <code>91021B0EB342E86D53818ABC29E5C8F3</code> <code>4DCA80970A1F6C3E171E4F141BEFD20C</code> <code>A2861F3ABF34930E7F03C6BD6EEC5A7A</code> <code>72481E7A598534BB0CD9D8B9D401EF78</code> <code>FDB1EF11E5913C98FEC5BD635983D240</code> <code>14E0D0D083B9A7EBD0D3290FD9CF9D51</code> <code>DAC3F818C2D28DCA554DF930D5627C6F</code> <code>4FD8B61D4EAFD00C7953CF14F7B566A5</code> <code>EC68E60038E26FC9C905320DC99A652B</code> <code>760FF86D6286E460B4970DC67E1F4764</code> <code>52B577584CF7B61639410F5A81F47F87</code> <code>D6DB6306A4365719A5B794A32275674E</code> <code>BBAC2C5AF14F16E86E9B8B9439DA1409</code> <code>FFE9891900FDB96DC7F15F56CD605649</code><br> <code>D48A6C1E</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = D928E03E2D182003FDD073198CAFC5C9FF4FF398D108A82863F2F9925
<!-- 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 = EEBE28880EACF2EB57DCE9608F51DE85625E9B0AFAB8E0BA268F29E738943279A8157384EDA101D24E6B2C980126E260F9FFB6023BCB2718200FBD1F78A1653279AD19C62BCB9883B2EB3B13BCA87167954D7054ADEA5AB936D28994ECA14FAE6EBF21B68E737808592974F2E3EAEE7D5AED6939C102F16DC6666F517932930EF82ADD904845D8BBEBB8F73AAC3B00B3815CAA19C96AC7C0298EE0CEBBFBB81C066F62C6030DAC6259A7E96D9E9CAF50D18AF237215677D297172310AAF562CA1C50BA92B17BB7DD614D785651C27CB193BCAD7BDADCA37129289DC45F3DD1768F189F487C0DEB8F0D72EEF2BCDFD238C67760D1A83B4A2D2AD77A3640735BB61592EF465147F2E6B70DEA1CE3686FCC261247AC5D9DF79FD2E8918D04C5B65F9CA970D4EB55E1D5BD45F99C6013AC5B500E3DC46A2CF8DA3D990324D26157D18F18769231213EE348D89159E3093681ACD6A01E6D2304C29387D01BE958319D85219574AFA3EEB9A3ABEB8E73616593755735BC6EDB8149EC30ACC537373D21878A6F093EBAFAC52B264460FF1A967E37A676DCE844CB6411B5B20936F04D073D046F0703E13EFE8A99605320615085D7BF77A79730D3450A7A833BE64D05143534F77F12DF8F0EBF689C8CC827150213C5004535010E723044492D5F43226739243D621312151E90C18416C014055EBEA0B99646F4E7FB076F023712A1648D1B72999DA73679C65AF687C0DC31BDA76625E208AE96E35A827F2E7B4B891DBE2F3CBE45EA02EC9C8CB25C09814E9FFD3AC812107DB87521FB07C2B82953E24AF4CC5EC13F9458C2D19D440F2D76D66B
tmp_aes_key = 1A1FED6F7BFBAF3F9F937DB0FADB2AE244441F2AA4B79FE561E76C94CCD0CC9A
tmp_aes_iv = DC2BB68E57BB645A96CF81879767AFC8AF52883C3B1971F7B5B3A0E5D1449466</code></pre>
<pre><code>encrypted_answer = DFBE8A186DA731F83E7E6C3D283FA6E5A1E7DF06A982E2954D0C096C48803B685F5FC184F779EA05372FD7CE65132455CE8433F574EFC87DDFE44AF18169A6A03CAE6F81A3027C8AAC4A7E8BF68D074188EB27453277B4231E3CB308ABBD95013DA85A77A4BAB44551D76D74C45840F29ABAF90B6253C3141374313E3F18316C5694B3538FE7AE4D4FE32B533F248C91E7603645A66D7955434A4F1BA1D9D495F1EC9C57AB6D73367BDD819F65C60418D6442DFA75FFB1E392BA85A4DE3697DE7952A24E846F77E4FA2D65F2C48DC69F128BE3907D2A451B4A7D52C4AC5A6B1B1236B485E04477ADCDA493B0C954AFA4BBE001645E139DFAD45261B28904FB4C1763DBF04E6FC36B39D98A0C4A0691962A930263C02B3BCE7723BF30E0E3324727DBBC6E873A273C8C8D8E6AEA6E1F1E219A89F23F82BE685672B4A52006D539A231C6BD5E7FEDFC2A07DB7A163E2D512816F1310EC4DC19D4A189D53DE96D0BEA8072BA122EE74736E3C13691021B0EB342E86D53818ABC29E5C8F34DCA80970A1F6C3E171E4F141BEFD20CA2861F3ABF34930E7F03C6BD6EEC5A7A72481E7A598534BB0CD9D8B9D401EF78FDB1EF11E5913C98FEC5BD635983D24014E0D0D083B9A7EBD0D3290FD9CF9D51DAC3F818C2D28DCA554DF930D5627C6F4FD8B61D4EAFD00C7953CF14F7B566A5EC68E60038E26FC9C905320DC99A652B760FF86D6286E460B4970DC67E1F476452B577584CF7B61639410F5A81F47F87D6DB6306A4365719A5B794A32275674EBBAC2C5AF14F16E86E9B8B9439DA1409FFE9891900FDB96DC7F15F56CD605649D48A6C1E
tmp_aes_key = 03A51C1208C2965474261CFEAC6EDD6E079FF78249AF9751278EA1CB2C481B6A
tmp_aes_iv = 9781C3B0387027BE778491F24180DB6DAA5DCB15815BD673DE585CD05D743D5D</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = B475F96199BF36A3B95731308F7DC78B7B7C6988BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003BD926F73D68817843BFC4963D3B97C0CACFC97C270F89E781C71F19E4C46FF8D52D5CF329BADEC610B27A80641E4D9E05CE8A04ACC5A1818DF53222A59931D182D87CEC135B53D3A2E6989B65B6DA1B258662D01054CF4BE2EFD19B85D9856D5A2C763AF0126883063A23D21C90A9434E7B6C0DA56033E6BB2DFE83A6E3D6BC018FEF853C2685AA4872BFC0C93BC4438D096C4A8E6A7DB880DAB669EC56A947B9C2782BAEA78F580FE97DB88B18CBEF0FB0BD4DFFAA074B7B86A99CF12E2E7716B03443D9BAB7D2B9AE1543AC158DEE559EC4C961BF9562791020F6E137E827E0D57372D97E3240844B6E592877DD31BC81B0A5F356564A5A5832F6285D52E058C2AF66E970BF0B9F3B0E20
answer = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003BD926F73D68817843BFC4963D3B97C0CACFC97C270F89E781C71F19E4C46FF8D52D5CF329BADEC610B27A80641E4D9E05CE8A04ACC5A1818DF53222A59931D182D87CEC135B53D3A2E6989B65B6DA1B258662D01054CF4BE2EFD19B85D9856D5A2C763AF0126883063A23D21C90A9434E7B6C0DA56033E6BB2DFE83A6E3D6BC018FEF853C2685AA4872BFC0C93BC4438D096C4A8E6A7DB880DAB669EC56A947B9C2782BAEA78F580FE97DB88B18CBEF0FB0BD4DFFAA074B7B86A99CF12E2E7716B03443D9BAB7D2B9AE1543AC158DEE559EC4C961BF9562791020F6E137E827E0D57372D97E3240844B6E592877DD31BC81B0A5F356564A5A5832F6285D52E058C2AF66E970BF0B9F3B0E20</code></pre>
<pre><code>answer_with_hash = 2A1F1B8D6E127687705F67F02AFFA1186DD0C3C5BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B964C4EDE476745F625B69D15CCA0FD827E0AF126BB65536600EBE1D31949935D63BC07C00B324A7F01A7AA69AF8707322226B5EAC51CBD2DC4CBFE038454416BCE7F9C35A6999BA3EB0B5CED2D31E8ED90E555C22DB770423DA3BC42A75E6E7173FA90F9ABC7FA771FB6C57D0DA16F0FD1FD56617D3C556DDB1512BC1808CB44FF63D302CD26F4EEA199A7A7AA049945514DFCC236309DCE6C6B40BE2F272A29339054AD17C0CB45A18C9D41622D44C2309DFB9784BD221D8041C49AEBE05E44161BFE5FADF1930E34E53737597E3251E6064A305636593D7D30998E2E433F46A4CD770B663ACBBAC0D13D358041B561B77FFF23CFBC3959DEEB11891B3FC43D7BDB0667DE8BDDB24652807
answer = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B964C4EDE476745F625B69D15CCA0FD827E0AF126BB65536600EBE1D31949935D63BC07C00B324A7F01A7AA69AF8707322226B5EAC51CBD2DC4CBFE038454416BCE7F9C35A6999BA3EB0B5CED2D31E8ED90E555C22DB770423DA3BC42A75E6E7173FA90F9ABC7FA771FB6C57D0DA16F0FD1FD56617D3C556DDB1512BC1808CB44FF63D302CD26F4EEA199A7A7AA049945514DFCC236309DCE6C6B40BE2F272A29339054AD17C0CB45A18C9D41622D44C2309DFB9784BD221D8041C49AEBE05E44161BFE5FADF1930E34E53737597E3251E6064A305636593D7D30998E2E433F46A4CD770B663ACBBAC0D13D358041B561B77FFF23CFBC3959DEEB11891B3FC43D7BDB0667DE8BDDB24652807</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 11 B9 C2 84 50 81 17 76 D4 24 CA 45
0010 | CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E 9B 13 1B 62
0020 | 6D CD 43 14 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 64 36 30 8B B0 C8 AE 58 73 36 04 FC
0010 | 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2 44 25 40 39
0020 | D7 91 9B 2E 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 = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
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 | 3B D9 26 F7 3D 68 81 78 43 BF C4 96 3D 3B 97 C0
0140 | CA CF C9 7C 27 0F 89 E7 81 C7 1F 19 E4 C4 6F F8
0150 | D5 2D 5C F3 29 BA DE C6 10 B2 7A 80 64 1E 4D 9E
0160 | 05 CE 8A 04 AC C5 A1 81 8D F5 32 22 A5 99 31 D1
0170 | 82 D8 7C EC 13 5B 53 D3 A2 E6 98 9B 65 B6 DA 1B
0180 | 25 86 62 D0 10 54 CF 4B E2 EF D1 9B 85 D9 85 6D
0190 | 5A 2C 76 3A F0 12 68 83 06 3A 23 D2 1C 90 A9 43
01A0 | 4E 7B 6C 0D A5 60 33 E6 BB 2D FE 83 A6 E3 D6 BC
01B0 | 01 8F EF 85 3C 26 85 AA 48 72 BF C0 C9 3B C4 43
01C0 | 8D 09 6C 4A 8E 6A 7D B8 80 DA B6 69 EC 56 A9 47
01D0 | B9 C2 78 2B AE A7 8F 58 0F E9 7D B8 8B 18 CB EF
01E0 | 0F B0 BD 4D FF AA 07 4B 7B 86 A9 9C F1 2E 2E 77
01F0 | 16 B0 34 43 D9 BA B7 D2 B9 AE 15 43 AC 15 8D EE
0200 | 55 9E C4 C9 61 BF 95 62 79 10 20 F6 E1 37 E8 27
0210 | E0 D5 73 72 D9 7E 32 40 84 4B 6E 59 28 77 DD 31
0220 | BC 81 B0 A5 F3 56 56 4A 5A 58 32 F6 28 5D 52 E0
0230 | 58 C2 AF 66</code></pre>
0130 | B9 64 C4 ED E4 76 74 5F 62 5B 69 D1 5C CA 0F D8
0140 | 27 E0 AF 12 6B B6 55 36 60 0E BE 1D 31 94 99 35
0150 | D6 3B C0 7C 00 B3 24 A7 F0 1A 7A A6 9A F8 70 73
0160 | 22 22 6B 5E AC 51 CB D2 DC 4C BF E0 38 45 44 16
0170 | BC E7 F9 C3 5A 69 99 BA 3E B0 B5 CE D2 D3 1E 8E
0180 | D9 0E 55 5C 22 DB 77 04 23 DA 3B C4 2A 75 E6 E7
0190 | 17 3F A9 0F 9A BC 7F A7 71 FB 6C 57 D0 DA 16 F0
01A0 | FD 1F D5 66 17 D3 C5 56 DD B1 51 2B C1 80 8C B4
01B0 | 4F F6 3D 30 2C D2 6F 4E EA 19 9A 7A 7A A0 49 94
01C0 | 55 14 DF CC 23 63 09 DC E6 C6 B4 0B E2 F2 72 A2
01D0 | 93 39 05 4A D1 7C 0C B4 5A 18 C9 D4 16 22 D4 4C
01E0 | 23 09 DF B9 78 4B D2 21 D8 04 1C 49 AE BE 05 E4
01F0 | 41 61 BF E5 FA DF 19 30 E3 4E 53 73 75 97 E3 25
0200 | 1E 60 64 A3 05 63 65 93 D7 D3 09 98 E2 E4 33 F4
0210 | 6A 4C D7 70 B6 63 AC BB AC 0D 13 D3 58 04 1B 56
0220 | 1B 77 FF F2 3C FB C3 95 9D EE B1 18 91 B3 FC 43
0230 | D7 BD B0 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 = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001003BD926F73D68817843BFC496</code> <code>3D3B97C0CACFC97C270F89E781C71F19</code> <code>E4C46FF8D52D5CF329BADEC610B27A80</code> <code>641E4D9E05CE8A04ACC5A1818DF53222</code> <code>A59931D182D87CEC135B53D3A2E6989B</code> <code>65B6DA1B258662D01054CF4BE2EFD19B</code> <code>85D9856D5A2C763AF0126883063A23D2</code> <code>1C90A9434E7B6C0DA56033E6BB2DFE83</code> <code>A6E3D6BC018FEF853C2685AA4872BFC0</code> <code>C93BC4438D096C4A8E6A7DB880DAB669</code> <code>EC56A947B9C2782BAEA78F580FE97DB8</code> <code>8B18CBEF0FB0BD4DFFAA074B7B86A99C</code> <code>F12E2E7716B03443D9BAB7D2B9AE1543</code> <code>AC158DEE559EC4C961BF9562791020F6</code> <code>E137E827E0D57372D97E3240844B6E59</code> <code>2877DD31BC81B0A5F356564A5A5832F6</code><br> <code>285D52E0</code></td>
<td><code>FE000100B964C4EDE476745F625B69D1</code> <code>5CCA0FD827E0AF126BB65536600EBE1D</code> <code>31949935D63BC07C00B324A7F01A7AA6</code> <code>9AF8707322226B5EAC51CBD2DC4CBFE0</code> <code>38454416BCE7F9C35A6999BA3EB0B5CE</code> <code>D2D31E8ED90E555C22DB770423DA3BC4</code> <code>2A75E6E7173FA90F9ABC7FA771FB6C57</code> <code>D0DA16F0FD1FD56617D3C556DDB1512B</code> <code>C1808CB44FF63D302CD26F4EEA199A7A</code> <code>7AA049945514DFCC236309DCE6C6B40B</code> <code>E2F272A29339054AD17C0CB45A18C9D4</code> <code>1622D44C2309DFB9784BD221D8041C49</code> <code>AEBE05E44161BFE5FADF1930E34E5373</code> <code>7597E3251E6064A305636593D7D30998</code> <code>E2E433F46A4CD770B663ACBBAC0D13D3</code> <code>58041B561B77FFF23CFBC3959DEEB118</code><br> <code>91B3FC43</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>58C2AF66</code> (1722794584 in decimal)</td>
<td><code>D7BDB066</code> (1722858967 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
<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 = F28C0CCF5F5938919943588FADD6370D14E58BC4FF7CF896091C68F4C201ED022F7E0056611EA0A29E7953333B56DB1BF033F51905479825BB2F8353C35A4024202779479FDE54C341344F71B3729026BCD33DD044405F0C38E04F36737305E98209E432E3DD00EC0D5EA8DA3885BAD711BCBFE50EF93B8B71C2DD37627DDE47FF1AD06330F43CB5BC93F287B5E570A54B356460CCA6365543FD73324A7863CDA2C6EF5D06A88C1ECA211075AEAB4B5DC4D2C037442B558CAEA10008DC583C559D114DA2DD7D6ED583FA93764947B0B14E8D8BAD4EDE77CA1FCCE5DA7170CB67AC9F080FFE7B33732BBA68A6230AD1E504506E47CEECC4BAB8EC45478F06D247</code></pre>
<pre><code>b = D854AC6C95D1625563B247B94A88773790020A7E2A16B1BC0ABBB57A672FEF830620B3820114B7D2EC1410AD85C9B654D362407CE8C75613084A76C80569150E5CF75CCA5D6E60AD693CDAF760E183C92BB0343304E0E62AECF4ECCA7373A66F952EA9EDBFE325CC47760736C3C0C60197B98B3A55099D04254CD5BB96A1F16587FCEB55AFC73034E481FCF598A49F95ED145E442FBB3960AB0F53FBBB1A98935C84670FC604460E59DE6905389214399EB5DBFCA523ED696456445A9ABC83F08251F793BBDFA77A15BA604FE320AA167C78D960995777F0D12E1604E03C664CE5129D997456091B435C91A6F2F5D300798910676C92763A8F30810176A261B0</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 = 1DF4FC94AADE7F83CA2A60697350FB28BD0C574CC4FB74264A4C435D5C2011AC914839A95FE8451DBE8E3201F904465D99E72B0D072E4BE4D1461452B3521ADED3E957ECABA6252FFBA6FC72F7838AF3B2CE79FABC4E9F8943A6FB848A86818107D4E15720B3059ABDF3D1E594B14F9329ADA57A898E2818FB8974B81D6AABC22E3AFECA6224329C4EA74754063502098161D57D5A364FF643585A0F1B0BAAEDDFD69388740AF5D0DB8D735256955EBC1BAAE4CF1CF14EAB5E801280A0996BA62B6496D040689C86FD0B61FB2C35DE6061A8BE27073F26B865837DC3C224C7DB42BF1ACE8E4E883FAFF8770B1F3A09AF485071BC06B12AFD6B6F57989A3B3582</code></pre>
<pre><code>g_b = B6D4BB172A706C233B64C7EDB24531D8FA3BF3A082AD7B1B8A5F1F825CE228A8E0C55533379B32F25AE1AF88E52BE3463C58550024D6CD3349B6645BE2262574C1C7155AF21FDC69D04E8F096C873FF12B35207AFE2FA533A057848869206F3BB0AEAB4EF7767455177A55F0EB28853E3D7A6D50106B6258307F55F5D1A3AEFF85487E73839EDFF5D1775E3D28239C6627F36233C1F701A8878F5EE52D91D46F878EAAE219EC54F5E913B4527B643CBFF643E16FAD38BD896EDAC9794DAF1EB95FB8CA1133FDA1821B17F163E92DC4A82380886AF4C5BFDCDDC1B5966A8EA03DDBA02FBAF27ECB21184A150F6BFA52DFB0D58CD798C7FFCEDE0F42AC64D4BE7F</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 11 B9 C2 84 50 81 17 76 D4 24 CA 45
0010 | CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E 9B 13 1B 62
0020 | 6D CD 43 14 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 1D F4 FC 94 AA DE 7F 83 CA 2A 60 69 73 50 FB 28
0040 | BD 0C 57 4C C4 FB 74 26 4A 4C 43 5D 5C 20 11 AC
0050 | 91 48 39 A9 5F E8 45 1D BE 8E 32 01 F9 04 46 5D
0060 | 99 E7 2B 0D 07 2E 4B E4 D1 46 14 52 B3 52 1A DE
0070 | D3 E9 57 EC AB A6 25 2F FB A6 FC 72 F7 83 8A F3
0080 | B2 CE 79 FA BC 4E 9F 89 43 A6 FB 84 8A 86 81 81
0090 | 07 D4 E1 57 20 B3 05 9A BD F3 D1 E5 94 B1 4F 93
00A0 | 29 AD A5 7A 89 8E 28 18 FB 89 74 B8 1D 6A AB C2
00B0 | 2E 3A FE CA 62 24 32 9C 4E A7 47 54 06 35 02 09
00C0 | 81 61 D5 7D 5A 36 4F F6 43 58 5A 0F 1B 0B AA ED
00D0 | DF D6 93 88 74 0A F5 D0 DB 8D 73 52 56 95 5E BC
00E0 | 1B AA E4 CF 1C F1 4E AB 5E 80 12 80 A0 99 6B A6
00F0 | 2B 64 96 D0 40 68 9C 86 FD 0B 61 FB 2C 35 DE 60
0100 | 61 A8 BE 27 07 3F 26 B8 65 83 7D C3 C2 24 C7 DB
0110 | 42 BF 1A CE 8E 4E 88 3F AF F8 77 0B 1F 3A 09 AF
0120 | 48 50 71 BC 06 B1 2A FD 6B 6F 57 98 9A 3B 35 82</code></pre>
<pre><code>0000 | 54 B6 43 66 64 36 30 8B B0 C8 AE 58 73 36 04 FC
0010 | 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2 44 25 40 39
0020 | D7 91 9B 2E 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | B6 D4 BB 17 2A 70 6C 23 3B 64 C7 ED B2 45 31 D8
0040 | FA 3B F3 A0 82 AD 7B 1B 8A 5F 1F 82 5C E2 28 A8
0050 | E0 C5 55 33 37 9B 32 F2 5A E1 AF 88 E5 2B E3 46
0060 | 3C 58 55 00 24 D6 CD 33 49 B6 64 5B E2 26 25 74
0070 | C1 C7 15 5A F2 1F DC 69 D0 4E 8F 09 6C 87 3F F1
0080 | 2B 35 20 7A FE 2F A5 33 A0 57 84 88 69 20 6F 3B
0090 | B0 AE AB 4E F7 76 74 55 17 7A 55 F0 EB 28 85 3E
00A0 | 3D 7A 6D 50 10 6B 62 58 30 7F 55 F5 D1 A3 AE FF
00B0 | 85 48 7E 73 83 9E DF F5 D1 77 5E 3D 28 23 9C 66
00C0 | 27 F3 62 33 C1 F7 01 A8 87 8F 5E E5 2D 91 D4 6F
00D0 | 87 8E AA E2 19 EC 54 F5 E9 13 B4 52 7B 64 3C BF
00E0 | F6 43 E1 6F AD 38 BD 89 6E DA C9 79 4D AF 1E B9
00F0 | 5F B8 CA 11 33 FD A1 82 1B 17 F1 63 E9 2D C4 A8
0100 | 23 80 88 6A F4 C5 BF DC DD C1 B5 96 6A 8E A0 3D
0110 | DB A0 2F BA F2 7E CB 21 18 4A 15 0F 6B FA 52 DF
0120 | B0 D5 8C D7 98 C7 FF CE DE 0F 42 AC 64 D4 BE 7F</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 = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001001DF4FC94AADE7F83CA2A6069</code> <code>7350FB28BD0C574CC4FB74264A4C435D</code> <code>5C2011AC914839A95FE8451DBE8E3201</code> <code>F904465D99E72B0D072E4BE4D1461452</code> <code>B3521ADED3E957ECABA6252FFBA6FC72</code> <code>F7838AF3B2CE79FABC4E9F8943A6FB84</code> <code>8A86818107D4E15720B3059ABDF3D1E5</code> <code>94B14F9329ADA57A898E2818FB8974B8</code> <code>1D6AABC22E3AFECA6224329C4EA74754</code> <code>063502098161D57D5A364FF643585A0F</code> <code>1B0BAAEDDFD69388740AF5D0DB8D7352</code> <code>56955EBC1BAAE4CF1CF14EAB5E801280</code> <code>A0996BA62B6496D040689C86FD0B61FB</code> <code>2C35DE6061A8BE27073F26B865837DC3</code> <code>C224C7DB42BF1ACE8E4E883FAFF8770B</code> <code>1F3A09AF485071BC06B12AFD6B6F5798</code><br> <code>9A3B3582</code></td>
<td><code>FE000100B6D4BB172A706C233B64C7ED</code> <code>B24531D8FA3BF3A082AD7B1B8A5F1F82</code> <code>5CE228A8E0C55533379B32F25AE1AF88</code> <code>E52BE3463C58550024D6CD3349B6645B</code> <code>E2262574C1C7155AF21FDC69D04E8F09</code> <code>6C873FF12B35207AFE2FA533A0578488</code> <code>69206F3BB0AEAB4EF7767455177A55F0</code> <code>EB28853E3D7A6D50106B6258307F55F5</code> <code>D1A3AEFF85487E73839EDFF5D1775E3D</code> <code>28239C6627F36233C1F701A8878F5EE5</code> <code>2D91D46F878EAAE219EC54F5E913B452</code> <code>7B643CBFF643E16FAD38BD896EDAC979</code> <code>4DAF1EB95FB8CA1133FDA1821B17F163</code> <code>E92DC4A82380886AF4C5BFDCDDC1B596</code> <code>6A8EA03DDBA02FBAF27ECB21184A150F</code> <code>6BFA52DFB0D58CD798C7FFCEDE0F42AC</code><br> <code>64D4BE7F</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 = BA0D89B511B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD431
<!-- 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 = 54B6436611B9C28450811776D424CA45CDD03874460A42F7E89B5F4E9B131B626DCD43140000000000000000FE0001001DF4FC94AADE7F83CA2A60697350FB28BD0C574CC4FB74264A4C435D5C2011AC914839A95FE8451DBE8E3201F904465D99E72B0D072E4BE4D1461452B3521ADED3E957ECABA6252FFBA6FC72F7838AF3B2CE79FABC4E9F8943A6FB848A86818107D4E15720B3059ABDF3D1E594B14F9329ADA57A898E2818FB8974B81D6AABC22E3AFECA6224329C4EA74754063502098161D57D5A364FF643585A0F1B0BAAEDDFD69388740AF5D0DB8D735256955EBC1BAAE4CF1CF14EAB5E801280A0996BA62B6496D040689C86FD0B61FB2C35DE6061A8BE27073F26B865837DC3C224C7DB42BF1ACE8E4E883FAFF8770B1F3A09AF485071BC06B12AFD6B6F57989A3B3582
padding = E9C4D2B19A570E24FA7B42EF
tmp_aes_key = 1A1FED6F7BFBAF3F9F937DB0FADB2AE244441F2AA4B79FE561E76C94CCD0CC9A
tmp_aes_iv = DC2BB68E57BB645A96CF81879767AFC8AF52883C3B1971F7B5B3A0E5D1449466</code></pre>
<pre><code>data = 54B643666436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E0000000000000000FE000100B6D4BB172A706C233B64C7EDB24531D8FA3BF3A082AD7B1B8A5F1F825CE228A8E0C55533379B32F25AE1AF88E52BE3463C58550024D6CD3349B6645BE2262574C1C7155AF21FDC69D04E8F096C873FF12B35207AFE2FA533A057848869206F3BB0AEAB4EF7767455177A55F0EB28853E3D7A6D50106B6258307F55F5D1A3AEFF85487E73839EDFF5D1775E3D28239C6627F36233C1F701A8878F5EE52D91D46F878EAAE219EC54F5E913B4527B643CBFF643E16FAD38BD896EDAC9794DAF1EB95FB8CA1133FDA1821B17F163E92DC4A82380886AF4C5BFDCDDC1B5966A8EA03DDBA02FBAF27ECB21184A150F6BFA52DFB0D58CD798C7FFCEDE0F42AC64D4BE7F
padding = CBF50C1AA24F2F9BE4EF5E14
tmp_aes_key = 03A51C1208C2965474261CFEAC6EDD6E079FF78249AF9751278EA1CB2C481B6A
tmp_aes_iv = 9781C3B0387027BE778491F24180DB6DAA5DCB15815BD673DE585CD05D743D5D</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 = C9B1B0550BC9E68CD811FCFBA555E4C457342DF4F81D14F1C8DD8385AE71AB272594173139DA637AE60E834F45ED18C8B1269B81387A22F1BA015E7A63A403E22FB5DA641D6116B8945ADF0DC5AADC86370E4A7CBE65208FFDB4F84A806FEB290E72D671D58FD7635CF86DE5ABA024DDFC84E7B28456E20D73B8F7BAA1C868E1F6EF3F1B592392E0B364BE3400786CCD9D7955EFD970732B22375C246CFB419D3E5684A1BC926E9787A4027690919793794D2501052D017143495443312BA12AC75B2992A76A165E38D008CF38BFF491FA383D384BC4FFC7DD274ED904A68DBD4B23CD4F1C78238BBC429C420AA0AA3A3B3AAA3C41E75125987CEDC5741DB76E95C5D2BB2F62AD79F97CC2EB7A6130EF6A1264B1E8270E22AA6EAE72B4EDCAC0422E40402D67ECF5445585462D49B70F47725E2CC7857055487675062C343A2463E3C26042C1F74DC57B5D40F043F960</code></pre>
<pre><code>encrypted_data = 60D6E6FFA47DF5A111DF2A563F2C275223F33AFD5B9A5C5695AA94F3C84F38909E60FF40546716A5940F0EB620B0E8A1B23A45E5E9E304B51DA151350C8659C86355093CD60305C73934516C4AE741BB620EC2F18E5AA0D74055323B81FFFE389FF06E172A4D88106F81FE1EFF3CE57D3EF86CC1FDF9E18F3EA1B6BFA3B5164906A1F554FF12E8411C349218443CAD0E4D34304DA8FE2B706E144F00A750BB9560A2A4640C3275F69BCE26759AE30F2DE5213D40BE0B7AA342721531A07AF9A70B1DF68E7CF206535C6D0FA4562C3EC2396460D630978E5311BD075A027B58161BC2723F1AEC06D41F0BE06C7213A2EF6AA8E7CCED9FA70696ED5FF9BBBA821252FB1CAD8B00AED6EDFA89E61623B644FB2CCA6FF8B539CE1C022E5E2938B62F29794FB6EB37BC56F1A6E721FF80791DB84B98F6417A3FCEDC84A101BF51B665D05D9E0FB31599D0D8826A87DAB218E8</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 B4 8B 0C 00 58 C2 AF 66
0010 | 78 01 00 00 1F 5F 04 F5 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E
0030 | 9B 13 1B 62 6D CD 43 14 FE 50 01 00 C9 B1 B0 55
0040 | 0B C9 E6 8C D8 11 FC FB A5 55 E4 C4 57 34 2D F4
0050 | F8 1D 14 F1 C8 DD 83 85 AE 71 AB 27 25 94 17 31
0060 | 39 DA 63 7A E6 0E 83 4F 45 ED 18 C8 B1 26 9B 81
0070 | 38 7A 22 F1 BA 01 5E 7A 63 A4 03 E2 2F B5 DA 64
0080 | 1D 61 16 B8 94 5A DF 0D C5 AA DC 86 37 0E 4A 7C
0090 | BE 65 20 8F FD B4 F8 4A 80 6F EB 29 0E 72 D6 71
00A0 | D5 8F D7 63 5C F8 6D E5 AB A0 24 DD FC 84 E7 B2
00B0 | 84 56 E2 0D 73 B8 F7 BA A1 C8 68 E1 F6 EF 3F 1B
00C0 | 59 23 92 E0 B3 64 BE 34 00 78 6C CD 9D 79 55 EF
00D0 | D9 70 73 2B 22 37 5C 24 6C FB 41 9D 3E 56 84 A1
00E0 | BC 92 6E 97 87 A4 02 76 90 91 97 93 79 4D 25 01
00F0 | 05 2D 01 71 43 49 54 43 31 2B A1 2A C7 5B 29 92
0100 | A7 6A 16 5E 38 D0 08 CF 38 BF F4 91 FA 38 3D 38
0110 | 4B C4 FF C7 DD 27 4E D9 04 A6 8D BD 4B 23 CD 4F
0120 | 1C 78 23 8B BC 42 9C 42 0A A0 AA 3A 3B 3A AA 3C
0130 | 41 E7 51 25 98 7C ED C5 74 1D B7 6E 95 C5 D2 BB
0140 | 2F 62 AD 79 F9 7C C2 EB 7A 61 30 EF 6A 12 64 B1
0150 | E8 27 0E 22 AA 6E AE 72 B4 ED CA C0 42 2E 40 40
0160 | 2D 67 EC F5 44 55 85 46 2D 49 B7 0F 47 72 5E 2C
0170 | C7 85 70 55 48 76 75 06 2C 34 3A 24 63 E3 C2 60
0180 | 42 C1 F7 4D C5 7B 5D 40 F0 43 F9 60</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B4 20 0D 00 D8 BD B0 66
0010 | 78 01 00 00 1F 5F 04 F5 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2
0030 | 44 25 40 39 D7 91 9B 2E FE 50 01 00 60 D6 E6 FF
0040 | A4 7D F5 A1 11 DF 2A 56 3F 2C 27 52 23 F3 3A FD
0050 | 5B 9A 5C 56 95 AA 94 F3 C8 4F 38 90 9E 60 FF 40
0060 | 54 67 16 A5 94 0F 0E B6 20 B0 E8 A1 B2 3A 45 E5
0070 | E9 E3 04 B5 1D A1 51 35 0C 86 59 C8 63 55 09 3C
0080 | D6 03 05 C7 39 34 51 6C 4A E7 41 BB 62 0E C2 F1
0090 | 8E 5A A0 D7 40 55 32 3B 81 FF FE 38 9F F0 6E 17
00A0 | 2A 4D 88 10 6F 81 FE 1E FF 3C E5 7D 3E F8 6C C1
00B0 | FD F9 E1 8F 3E A1 B6 BF A3 B5 16 49 06 A1 F5 54
00C0 | FF 12 E8 41 1C 34 92 18 44 3C AD 0E 4D 34 30 4D
00D0 | A8 FE 2B 70 6E 14 4F 00 A7 50 BB 95 60 A2 A4 64
00E0 | 0C 32 75 F6 9B CE 26 75 9A E3 0F 2D E5 21 3D 40
00F0 | BE 0B 7A A3 42 72 15 31 A0 7A F9 A7 0B 1D F6 8E
0100 | 7C F2 06 53 5C 6D 0F A4 56 2C 3E C2 39 64 60 D6
0110 | 30 97 8E 53 11 BD 07 5A 02 7B 58 16 1B C2 72 3F
0120 | 1A EC 06 D4 1F 0B E0 6C 72 13 A2 EF 6A A8 E7 CC
0130 | ED 9F A7 06 96 ED 5F F9 BB BA 82 12 52 FB 1C AD
0140 | 8B 00 AE D6 ED FA 89 E6 16 23 B6 44 FB 2C CA 6F
0150 | F8 B5 39 CE 1C 02 2E 5E 29 38 B6 2F 29 79 4F B6
0160 | EB 37 BC 56 F1 A6 E7 21 FF 80 79 1D B8 4B 98 F6
0170 | 41 7A 3F CE DC 84 A1 01 BF 51 B6 65 D0 5D 9E 0F
0180 | B3 15 99 D0 D8 82 6A 87 DA B2 18 E8</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>B48B0C0058C2AF66</code></td>
<td><code>B4200D00D8BDB066</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>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100C9B1B0550BC9E68CD811FCFB</code> <code>A555E4C457342DF4F81D14F1C8DD8385</code> <code>AE71AB272594173139DA637AE60E834F</code> <code>45ED18C8B1269B81387A22F1BA015E7A</code> <code>63A403E22FB5DA641D6116B8945ADF0D</code> <code>C5AADC86370E4A7CBE65208FFDB4F84A</code> <code>806FEB290E72D671D58FD7635CF86DE5</code> <code>ABA024DDFC84E7B28456E20D73B8F7BA</code> <code>A1C868E1F6EF3F1B592392E0B364BE34</code> <code>00786CCD9D7955EFD970732B22375C24</code> <code>6CFB419D3E5684A1BC926E9787A40276</code> <code>90919793794D2501052D017143495443</code> <code>312BA12AC75B2992A76A165E38D008CF</code> <code>38BFF491FA383D384BC4FFC7DD274ED9</code> <code>04A68DBD4B23CD4F1C78238BBC429C42</code> <code>0AA0AA3A3B3AAA3C41E75125987CEDC5</code> <code>741DB76E95C5D2BB2F62AD79F97CC2EB</code> <code>7A6130EF6A1264B1E8270E22AA6EAE72</code> <code>B4EDCAC0422E40402D67ECF544558546</code> <code>2D49B70F47725E2CC785705548767506</code> <code>2C343A2463E3C26042C1F74DC57B5D40</code><br> <code>F043F960</code></td>
<td><code>FE50010060D6E6FFA47DF5A111DF2A56</code> <code>3F2C275223F33AFD5B9A5C5695AA94F3</code> <code>C84F38909E60FF40546716A5940F0EB6</code> <code>20B0E8A1B23A45E5E9E304B51DA15135</code> <code>0C8659C86355093CD60305C73934516C</code> <code>4AE741BB620EC2F18E5AA0D74055323B</code> <code>81FFFE389FF06E172A4D88106F81FE1E</code> <code>FF3CE57D3EF86CC1FDF9E18F3EA1B6BF</code> <code>A3B5164906A1F554FF12E8411C349218</code> <code>443CAD0E4D34304DA8FE2B706E144F00</code> <code>A750BB9560A2A4640C3275F69BCE2675</code> <code>9AE30F2DE5213D40BE0B7AA342721531</code> <code>A07AF9A70B1DF68E7CF206535C6D0FA4</code> <code>562C3EC2396460D630978E5311BD075A</code> <code>027B58161BC2723F1AEC06D41F0BE06C</code> <code>7213A2EF6AA8E7CCED9FA70696ED5FF9</code> <code>BBBA821252FB1CAD8B00AED6EDFA89E6</code> <code>1623B644FB2CCA6FF8B539CE1C022E5E</code> <code>2938B62F29794FB6EB37BC56F1A6E721</code> <code>FF80791DB84B98F6417A3FCEDC84A101</code> <code>BF51B665D05D9E0FB31599D0D8826A87</code><br> <code>DAB218E8</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 = 1CFDBEA303AB6C8180759A13C41F300315A8B30C8558D9A6CB96E872015B01295F19FF164E3DA25D813B88A0C80C8171E69FEA06863BEE5BFA2096ABB411BF845D3BF4BF73C8F5387C73ADC8D5123F5182F578ACA9CA0A86D1A133287AF40EFF2EC0D1BC0A376ADA222888D5D6AAF870FDE65849D0FFC13336E43DF1194F62D6BBAA5361AB85B3DDC04EE6E63C33954E5A39B1A550FD1E747E11DCB4C54CE074395BDA6FF5882DE6E367DFC851FC5721B64E8BC0B0BE2951B7FB32A0EC3A2D91832688E913C8EDA1F3788918426A46CD3AEA2347AE9CEA089BFBA4E7FEF56FB09FD99CB8298BDEDC8193E446E9900C6CC0D13D4561A03BB2F3777C6F38C7E9AF</code></pre>
<pre><code>auth_key = 664FDEFF27B2EA281B654E335FAD98CA741B291EAC2147D46A33E13854187C47D1FCA5EFDF00E578EBF8ED7B56AF06092A434513C7E6864AE3170EB0E9B645FCBF20721D51E2802E5C141C136A49EFD871C8B32C9A4C4DCA889CB786C207B1ECE4D49437B41664093425E15E07DB8BABF1E9921F50992A3D42BDC6EF524F01115F07A8597BFCB3ED003FDF19FFC897C89089B5D3505692385F677A7E460A98709FBF92999C0C0253B529AD7105266768616D1EF89A4738B6821DF07F1D3405DA563F1B87198CBA1E9A8693AA78F4299C6E2720DF8A929989A27A778E354AA37ACFD70A04BD706121FBF3537FB36174ABFF39C6ABEEF0163973275DC30ADFAEC1</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 78 4C 3A 59 C2 AF 66
0010 | A8 00 00 00 34 F7 CB 3B 11 B9 C2 84 50 81 17 76
0020 | D4 24 CA 45 CD D0 38 74 46 0A 42 F7 E8 9B 5F 4E
0030 | 9B 13 1B 62 6D CD 43 14 DC F6 6C 4B A4 7E E9 B6
0040 | 19 A1 0F 79 1C 39 C8 E0</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 58 B4 E1 D8 BD B0 66
0010 | 64 00 00 00 34 F7 CB 3B 64 36 30 8B B0 C8 AE 58
0020 | 73 36 04 FC 48 D0 A0 BA ED 2B 40 DA 18 15 5C E2
0030 | 44 25 40 39 D7 91 9B 2E 55 A0 04 E7 96 59 42 6F
0040 | B4 84 D9 96 13 27 CC E8</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,13 +817,13 @@ 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>01784C3A59C2AF66</code></td>
<td><code>0158B4E1D8BDB066</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>A8000000</code> (168 in decimal)</td>
<td><code>64000000</code> (100 in decimal)</td>
<td>Message body length</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>11B9C28450811776D424CA45CDD03874</code></td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>460A42F7E89B5F4E9B131B626DCD4314</code></td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>DCF66C4BA47EE9B619A10F791C39C8E0</code></td>
<td><code>55A004E79659426FB484D9961327CCE8</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

@ -75,7 +75,7 @@
</tr>
<tr>
<td><a href="/constructor/chat">chat</a></td>
<td>Info about a group</td>
<td>Info about a group.<br><br>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).<br><br>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>.</td>
</tr>
<tr>
<td><a href="/constructor/chatForbidden">chatForbidden</a></td>
@ -83,7 +83,7 @@
</tr>
<tr>
<td><a href="/constructor/channel">channel</a></td>
<td>Channel/supergroup info</td>
<td>Channel/supergroup info<br><br>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).<br><br>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:<br><br>- <code>title</code><br>- <code>megagroup</code><br>- <code>color</code><br>- <code>photo</code><br>- <code>username</code><br>- <code>usernames</code><br>- <code>has_geo</code><br>- <code>noforwards</code><br>- <code>emoji_status</code><br>- <code>has_link</code><br>- <code>slow_mode_enabled</code><br>- <code>scam</code><br>- <code>fake</code><br>- <code>gigagroup</code><br>- <code>forum</code><br>- <code>level</code><br>- <code>restricted</code><br>- <code>restriction_reason</code><br>- <code>join_to_send</code><br>- <code>join_request</code><br>- <code>is_verified</code><br>- <code>default_banned_rights</code><br><br>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>.</td>
</tr>
<tr>
<td><a href="/constructor/channelForbidden">channelForbidden</a></td>

View file

@ -67,7 +67,7 @@
<tbody>
<tr>
<td><a href="/constructor/userFull">userFull</a></td>
<td>Extended user info</td>
<td>Extended user info<br><br>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).</td>
</tr>
</tbody>
</table></div>