Update content of files

This commit is contained in:
GitHub Action 2024-08-05 12:44:15 +00:00
parent ef4d622530
commit 45622fbeaf
3 changed files with 216 additions and 217 deletions

View file

@ -127,15 +127,18 @@
<p>Some global privacy settings can also be fetched and modified using <a href="/method/account.getGlobalPrivacySettings">account.getGlobalPrivacySettings</a> and <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>. </p>
<p>Global privacy settings are represented by the <a href="/constructor/globalPrivacySettings">globalPrivacySettings</a> constructor, please see the <a href="/constructor/globalPrivacySettings">constructor page</a> for a full description of all settings.</p>
<h4><a class="anchor" href="#require-premium-for-new-non-contact-users" id="require-premium-for-new-non-contact-users" name="require-premium-for-new-non-contact-users"><i class="anchor-icon"></i></a>Require Premium for new non-contact users</h4>
<pre><code><a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
<pre><code><a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.0?<a href='/type/long'>long</a> first_name:flags.1?<a href='/type/string'>string</a> last_name:flags.2?<a href='/type/string'>string</a> username:flags.3?<a href='/type/string'>string</a> phone:flags.4?<a href='/type/string'>string</a> photo:flags.5?<a href='/type/UserProfilePhoto'>UserProfilePhoto</a> status:flags.6?<a href='/type/UserStatus'>UserStatus</a> bot_info_version:flags.14?<a href='/type/int'>int</a> restriction_reason:flags.18?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; bot_inline_placeholder:flags.19?<a href='/type/string'>string</a> lang_code:flags.22?<a href='/type/string'>string</a> emoji_status:flags.30?<a href='/type/EmojiStatus'>EmojiStatus</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Username'>Username</a>&gt; stories_max_id:flags2.5?<a href='/type/int'>int</a> color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.9?<a href='/type/PeerColor'>PeerColor</a> bot_active_users:flags2.12?<a href='/type/int'>int</a> = <a href='/type/User'>User</a>;
<a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
---functions---
<a href='/method/users.getIsPremiumRequiredToContact'>users.getIsPremiumRequiredToContact</a>#a622aa10 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Bool'>Bool</a>&gt;;</code></pre>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code>, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private.</p>
<p>To easily check whether we can write to a user with this flag enabled, if we haven't yet cached all the required information (for example we don't have the <a href="/constructor/userFull">userFull</a> or history of all users while displaying the chat list in the sharing UI) this method may be invoked, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.</p>
<p>This list may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that this method should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p></div>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/user">user</a>.<code>contact_require_premium</code> for other users, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. </p>
<p>Note that all the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if <a href="/constructor/user">user</a>.<code>contact_require_premium</code> flag is set for a user (i.e. a mutual contact will have this flag set even if we can still write to them, and so on...); to avoid doing these extra checks if we haven't yet cached all the required information (for example while displaying the chat list in the sharing UI) the <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> method may be invoked instead, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user.<br>
Alternatively, the <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code> flag contains the same (fully checked, i.e. it's not just a copy of <a href="/constructor/user">user</a>.<code>contact_require_premium</code>) info returned by <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a>.</p>
<p>This information may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</p></div>
</div>

View file

@ -301,14 +301,10 @@
<p>Telegram apps support generating, sharing and synchronizing chat backgrounds.</p>
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p>
<h4><a class="anchor" href="#user" id="user" name="user"><i class="anchor-icon"></i></a><a href="/constructor/user">user</a></h4>
<p>Indicates info about a certain user.</p>
<p>Unless specified otherwise, 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/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="#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="#accountsetglobalprivacysettings" id="accountsetglobalprivacysettings" name="accountsetglobalprivacysettings"><i class="anchor-icon"></i></a><a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a></h4>
<p>Set global privacy settings</p>
<h4><a class="anchor" href="#privacy" id="privacy" name="privacy"><i class="anchor-icon"></i></a><a href="/api/privacy">Privacy</a></h4>
<p>Telegram allows users to specify granular privacy settings, choosing which users can or can't interact with them in certain ways.</p>
<h4><a class="anchor" href="#messagesgetoutboxreaddate" id="messagesgetoutboxreaddate" name="messagesgetoutboxreaddate"><i class="anchor-icon"></i></a><a href="/method/messages.getOutboxReadDate">messages.getOutboxReadDate</a></h4>
<p>Get the exact read date of one of our messages, sent to a private chat with another user.</p>
<p>Can be only done for private outgoing messages not older than <a href="/api/config#pm-read-date-expire-period">appConfig.pm_read_date_expire_period »</a>.</p>

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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 08 C0 03 00 51 C4 B0 66
0010 | 14 00 00 00 F1 8E 7E BE C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C</code></pre>
<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>54510100D7BDB066</code></td>
<td><code>08C0030051C4B066</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>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</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 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
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 FC F2 5F 51 C4 B0 66
0010 | 90 00 00 00 63 24 16 05 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 08 11 CD ED 18 20 2E B6
0040 | F9 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
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>01443C26D7BDB066</code></td>
<td><code>01FCF25F51C4B066</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>8C000000</code> (140 in decimal)</td>
<td><code>90000000</code> (144 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08259EB469B0C8C8D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2710802391754131667</td>
<td><code>0811CDED18202EB6F9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1282942156745389817</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 = 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>
<pre><code>pq = 1282942156745389817</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1282942156745389817 = 1062853151 * 1207073767</code></p>
<pre><code>p = 1062853151
q = 1207073767</code></pre>
<!-- 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 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
<pre><code>0000 | 95 5F F5 A9 08 11 CD ED 18 20 2E B6 F9 00 00 00
0010 | 04 3F 59 DA 1F 00 00 00 04 47 F2 7B E7 00 00 00
0020 | C0 71 76 9B 1F CB C3 B7 02 96 59 4F 9D 52 E6 0C
0030 | FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F E6 8B 80 F2
0040 | 24 DB 66 6D 6D 71 11 39 29 30 81 04 85 B3 0A 5C
0050 | 6F 3C D8 1D 6D D4 62 8D 7E 37 E5 ED BB 49 AB 09
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 = 1901674367</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08259EB469B0C8C8D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2710802391754131667</td>
<td><code>0811CDED18202EB6F9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1282942156745389817</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>0454F720AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1425481901</td>
<td><code>043F59DA1F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1062853151</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>0471593F7F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1901674367</td>
<td><code>0447F27BE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1207073767</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>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>5D743D5D77D90CF07FB4DC23BE68AACC</code> <code>EF9C9A659A082E19A425CF2FE5D9D342</code></td>
<td><code>24DB666D6D7111392930810485B30A5C</code> <code>6F3CD81D6DD4628D7E37E5EDBB49AB09</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1901674367</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 = 955FF5A908259EB469B0C8C8D30000000454F720AD0000000471593F7F0000006436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E5D743D5D77D90CF07FB4DC23BE68AACCEF9C9A659A082E19A425CF2FE5D9D34202000000
random_padding_bytes = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04A5D0FA81E1DB54C3AFDA9341677BCE54F386130E95799BFD9503C85CD8FF1CBDE4DD15022BF58CC32BF46E674E12C4119AB09B4BE0D939AC7E344763E801366</code></pre>
<pre><code>data = 955FF5A90811CDED18202EB6F9000000043F59DA1F0000000447F27BE7000000C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F224DB666D6D7111392930810485B30A5C6F3CD81D6DD4628D7E37E5EDBB49AB0902000000
random_padding_bytes = F3F1A64A88DF69321C6B0801DCDBCBD3FD82B86728F3182F99B0D241166ED12A867C04AA552D3A7BD18454CCF4BC0D8695BCC10BF7F1619E0F6761B159195A9BD28E468DF8E01BB5271306FC46529D7E30D870065073808201AEA7DD</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 = 067DC65EE22FF766C73BB612CCD0453F9D1871F52984D681A3D04726FD32548D3C2E58C0931A628C47E51DF547A022A5780123785F15E20723EBBF398DEAADEE1A7E4270CC29C0C0BD4BC7EE8283C6D49681B7AB00E83DA68D72C70B812BF8A004864C73EECD24CDE96DC912EA50CB5A30CDB2E1A98758E4AEEA03F586F38AFC4EDC0292085F1C5251F3F56A6D6B57D79FFA1C1E61B334EECEF30BA819110F6D89801EED7DDD0ECDCD0535E305776512EF7321B630DBE7EC8350107A500E708C9E2027C5B731632014532FB17E5C3217C2EF7D46D71EB366AE925AA0C725EA7E0FDB2D362F5F916D9C8514B9EF72A6FF233683D8F9459AE9B2D56F62331363B7</code></pre>
<pre><code>encrypted_data = 41059822C147A6C8EEB3B7CB01204CD7D9DD4485089B96757FADF1786C7064A0CBDB1D6A4182EC57B9F8CC5BD50ABA6BD06C5726910408EAD3D5D18D0A9EF800020F5841C3F4E14733E5E7EFB878938B0FD037505829546989E3F97FB24540709758E7FB182AAB73F05052C922D6516E2C17707EFC9725D69E69BD70DA73DBB099FD576731CF8377E7FD85D53156DDA908FCB7B5D6E11C9755F04DA2BBEE0A7A742148058D21E1F00DBB344982DD3A1E2B1A86283258B19A88077BC9AD93E962459E031826588A1B9E9153B381EDE160C825549FE6562DF21BB0893DDAEA355A02167DAC055C43EFCB6EBD689DCAE1BF3266C6BD1E12F5B283F47781F03421B1</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 68 34 0C 00 51 C4 B0 66
0010 | 40 01 00 00 BE E4 12 D7 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 04 3F 59 DA 1F 00 00 00
0040 | 04 47 F2 7B E7 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 41 05 98 22 C1 47 A6 C8 EE B3 B7 CB
0060 | 01 20 4C D7 D9 DD 44 85 08 9B 96 75 7F AD F1 78
0070 | 6C 70 64 A0 CB DB 1D 6A 41 82 EC 57 B9 F8 CC 5B
0080 | D5 0A BA 6B D0 6C 57 26 91 04 08 EA D3 D5 D1 8D
0090 | 0A 9E F8 00 02 0F 58 41 C3 F4 E1 47 33 E5 E7 EF
00A0 | B8 78 93 8B 0F D0 37 50 58 29 54 69 89 E3 F9 7F
00B0 | B2 45 40 70 97 58 E7 FB 18 2A AB 73 F0 50 52 C9
00C0 | 22 D6 51 6E 2C 17 70 7E FC 97 25 D6 9E 69 BD 70
00D0 | DA 73 DB B0 99 FD 57 67 31 CF 83 77 E7 FD 85 D5
00E0 | 31 56 DD A9 08 FC B7 B5 D6 E1 1C 97 55 F0 4D A2
00F0 | BB EE 0A 7A 74 21 48 05 8D 21 E1 F0 0D BB 34 49
0100 | 82 DD 3A 1E 2B 1A 86 28 32 58 B1 9A 88 07 7B C9
0110 | AD 93 E9 62 45 9E 03 18 26 58 8A 1B 9E 91 53 B3
0120 | 81 ED E1 60 C8 25 54 9F E6 56 2D F2 1B B0 89 3D
0130 | DA EA 35 5A 02 16 7D AC 05 5C 43 EF CB 6E BD 68
0140 | 9D CA E1 BF 32 66 C6 BD 1E 12 F5 B2 83 F4 77 81
0150 | F0 34 21 B1</code></pre>
<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 = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>E8D00C00D7BDB066</code></td>
<td><code>68340C0051C4B066</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 = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>0454F720AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1425481901</td>
<td><code>043F59DA1F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1062853151</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>0471593F7F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1901674367</td>
<td><code>0447F27BE7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1207073767</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 = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<tr>
<td>encrypted_data</td>
<td>80, 260</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><code>FE00010041059822C147A6C8EEB3B7CB</code> <code>01204CD7D9DD4485089B96757FADF178</code> <code>6C7064A0CBDB1D6A4182EC57B9F8CC5B</code> <code>D50ABA6BD06C5726910408EAD3D5D18D</code> <code>0A9EF800020F5841C3F4E14733E5E7EF</code> <code>B878938B0FD037505829546989E3F97F</code> <code>B24540709758E7FB182AAB73F05052C9</code> <code>22D6516E2C17707EFC9725D69E69BD70</code> <code>DA73DBB099FD576731CF8377E7FD85D5</code> <code>3156DDA908FCB7B5D6E11C9755F04DA2</code> <code>BBEE0A7A742148058D21E1F00DBB3449</code> <code>82DD3A1E2B1A86283258B19A88077BC9</code> <code>AD93E962459E031826588A1B9E9153B3</code> <code>81EDE160C825549FE6562DF21BB0893D</code> <code>DAEA355A02167DAC055C43EFCB6EBD68</code> <code>9DCAE1BF3266C6BD1E12F5B283F47781</code><br> <code>F03421B1</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 F2 35 52 C4 B0 66
0010 | D0 02 00 00 5C 07 E8 D0 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 FE 50 02 00 3E FB F4 11
0040 | C4 C0 93 47 57 EC DD B4 C0 00 D7 D6 41 CA 91 58
0050 | 3E 64 2F 45 89 CE 4B 0E BE F1 69 14 38 BC 79 73
0060 | 03 40 40 86 22 48 83 2C 19 33 4F AA 62 5A FF 40
0070 | 66 44 D2 8B 1C 77 C4 64 A4 24 1A 43 12 6D CF 13
0080 | D1 29 4A F2 C7 2A 2F BC C0 3E 9A 3B 8A 8B 46 61
0090 | 67 48 B6 87 2D 69 71 F0 2F 6D 37 1F A4 B6 F5 E1
00A0 | 38 19 73 C3 99 67 8F 14 69 AB 05 F3 97 28 19 27
00B0 | F3 86 93 E4 38 1F 64 52 0F 48 45 99 B1 C8 A2 CB
00C0 | 70 5F AE 3C C2 15 8B F1 E6 0A 7C 59 B3 44 BD 15
00D0 | AC 5F A7 55 6F AA C2 B2 61 E4 31 BA 23 C6 1B F4
00E0 | DD 11 7F 40 DD DA 22 5A 81 2A BA 33 B8 26 10 FA
00F0 | AD E9 69 7E 79 74 38 D8 C3 21 13 EE 43 E4 08 6D
0100 | 0A 46 15 09 6C 96 80 58 A7 4E 07 98 69 16 B1 77
0110 | 5D 82 C4 5C 54 94 B7 20 7A 04 14 E6 46 12 0D E3
0120 | CA 25 E1 23 5F 63 D4 EB 27 42 49 3B 7E 96 09 45
0130 | 33 72 E6 47 D2 54 50 13 7C CA 55 98 53 FC B6 6B
0140 | 93 89 82 03 6D 2C BB 9C 05 7C CB 14 26 27 AC AB
0150 | 41 52 64 B3 73 6E 21 50 84 75 B3 75 45 FC 31 43
0160 | 75 7E E8 8A 9B 5C 73 36 87 7F E9 A7 D5 43 10 D2
0170 | 7A 44 85 C2 1D 35 C5 5F 50 88 B1 58 19 6F FD B4
0180 | 54 70 DD 8C 21 8E 2F B9 16 A8 3F 3E EE 39 96 46
0190 | C8 F3 42 EF D1 9B FF 83 BE C0 D4 11 84 5B EB 39
01A0 | 7A A3 3D EF 75 21 C5 3D AA F1 6E BE 8F EC E0 78
01B0 | CE EE B9 0D 37 27 0D 01 81 81 BB 7E 19 3D 9C E7
01C0 | 0A 98 C2 5A 14 47 C9 22 65 EC 91 69 7F BF 7D 1E
01D0 | 0C 82 B2 87 84 3C D9 EA 3E A4 62 75 F0 D3 BC D2
01E0 | 32 94 FE 43 39 48 B8 78 04 1D 77 65 2E 15 0E 3E
01F0 | 70 B6 8B D5 27 21 62 F6 1B 61 49 02 42 F9 71 6B
0200 | CA A4 E3 E3 7C 0F D3 41 A6 1A AE C2 DD 3B 03 44
0210 | 0D 75 D7 07 20 6F 51 D5 CA 83 C9 44 1D 2F 3A F7
0220 | C6 AB 43 51 51 EA D9 38 F7 C6 D1 BE E9 86 E1 F3
0230 | 28 17 0E 7B 94 97 E7 F2 04 BD F0 D6 92 4A D3 F0
0240 | 79 0F BA 77 0A 03 D7 6B B6 31 9A 30 F7 54 F0 EB
0250 | B3 F8 60 58 C6 06 D2 D5 59 07 31 DD 79 9E 74 65
0260 | 59 90 4B CE 60 99 0B 63 08 0D 2C F3 75 00 87 28
0270 | D9 D0 E3 83 75 CF F1 BC 3C 22 FB 84 58 17 75 C3
0280 | 6B F2 6B 66 17 5E 56 34 2D 88 F7 6C</code></pre>
<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 = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01BCDDE5D7BDB066</code></td>
<td><code>01F4F23552C4B066</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>C4020000</code> (708 in decimal)</td>
<td><code>D0020000</code> (720 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</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><code>FE5002003EFBF411C4C0934757ECDDB4</code> <code>C000D7D641CA91583E642F4589CE4B0E</code> <code>BEF1691438BC7973034040862248832C</code> <code>19334FAA625AFF406644D28B1C77C464</code> <code>A4241A43126DCF13D1294AF2C72A2FBC</code> <code>C03E9A3B8A8B46616748B6872D6971F0</code> <code>2F6D371FA4B6F5E1381973C399678F14</code> <code>69AB05F397281927F38693E4381F6452</code> <code>0F484599B1C8A2CB705FAE3CC2158BF1</code> <code>E60A7C59B344BD15AC5FA7556FAAC2B2</code> <code>61E431BA23C61BF4DD117F40DDDA225A</code> <code>812ABA33B82610FAADE9697E797438D8</code> <code>C32113EE43E4086D0A4615096C968058</code> <code>A74E07986916B1775D82C45C5494B720</code> <code>7A0414E646120DE3CA25E1235F63D4EB</code> <code>2742493B7E9609453372E647D2545013</code> <code>7CCA559853FCB66B938982036D2CBB9C</code> <code>057CCB142627ACAB415264B3736E2150</code> <code>8475B37545FC3143757EE88A9B5C7336</code> <code>877FE9A7D54310D27A4485C21D35C55F</code> <code>5088B158196FFDB45470DD8C218E2FB9</code> <code>16A83F3EEE399646C8F342EFD19BFF83</code> <code>BEC0D411845BEB397AA33DEF7521C53D</code> <code>AAF16EBE8FECE078CEEEB90D37270D01</code> <code>8181BB7E193D9CE70A98C25A1447C922</code> <code>65EC91697FBF7D1E0C82B287843CD9EA</code> <code>3EA46275F0D3BCD23294FE433948B878</code> <code>041D77652E150E3E70B68BD5272162F6</code> <code>1B61490242F9716BCAA4E3E37C0FD341</code> <code>A61AAEC2DD3B03440D75D707206F51D5</code> <code>CA83C9441D2F3AF7C6AB435151EAD938</code> <code>F7C6D1BEE986E1F328170E7B9497E7F2</code> <code>04BDF0D6924AD3F0790FBA770A03D76B</code> <code>B6319A30F754F0EBB3F86058C606D2D5</code> <code>590731DD799E746559904BCE60990B63</code> <code>080D2CF375008728D9D0E38375CFF1BC</code> <code>3C22FB84581775C36BF26B66175E5634</code><br> <code>2D88F76C</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 53E5E19EAE74E5E5675F9D9FC5C719B2AF04E5D9048BBB029A0DA1F04
<!-- 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 = DFBE8A186DA731F83E7E6C3D283FA6E5A1E7DF06A982E2954D0C096C48803B685F5FC184F779EA05372FD7CE65132455CE8433F574EFC87DDFE44AF18169A6A03CAE6F81A3027C8AAC4A7E8BF68D074188EB27453277B4231E3CB308ABBD95013DA85A77A4BAB44551D76D74C45840F29ABAF90B6253C3141374313E3F18316C5694B3538FE7AE4D4FE32B533F248C91E7603645A66D7955434A4F1BA1D9D495F1EC9C57AB6D73367BDD819F65C60418D6442DFA75FFB1E392BA85A4DE3697DE7952A24E846F77E4FA2D65F2C48DC69F128BE3907D2A451B4A7D52C4AC5A6B1B1236B485E04477ADCDA493B0C954AFA4BBE001645E139DFAD45261B28904FB4C1763DBF04E6FC36B39D98A0C4A0691962A930263C02B3BCE7723BF30E0E3324727DBBC6E873A273C8C8D8E6AEA6E1F1E219A89F23F82BE685672B4A52006D539A231C6BD5E7FEDFC2A07DB7A163E2D512816F1310EC4DC19D4A189D53DE96D0BEA8072BA122EE74736E3C13691021B0EB342E86D53818ABC29E5C8F34DCA80970A1F6C3E171E4F141BEFD20CA2861F3ABF34930E7F03C6BD6EEC5A7A72481E7A598534BB0CD9D8B9D401EF78FDB1EF11E5913C98FEC5BD635983D24014E0D0D083B9A7EBD0D3290FD9CF9D51DAC3F818C2D28DCA554DF930D5627C6F4FD8B61D4EAFD00C7953CF14F7B566A5EC68E60038E26FC9C905320DC99A652B760FF86D6286E460B4970DC67E1F476452B577584CF7B61639410F5A81F47F87D6DB6306A4365719A5B794A32275674EBBAC2C5AF14F16E86E9B8B9439DA1409FFE9891900FDB96DC7F15F56CD605649D48A6C1E
tmp_aes_key = 03A51C1208C2965474261CFEAC6EDD6E079FF78249AF9751278EA1CB2C481B6A
tmp_aes_iv = 9781C3B0387027BE778491F24180DB6DAA5DCB15815BD673DE585CD05D743D5D</code></pre>
<pre><code>encrypted_answer = 3EFBF411C4C0934757ECDDB4C000D7D641CA91583E642F4589CE4B0EBEF1691438BC7973034040862248832C19334FAA625AFF406644D28B1C77C464A4241A43126DCF13D1294AF2C72A2FBCC03E9A3B8A8B46616748B6872D6971F02F6D371FA4B6F5E1381973C399678F1469AB05F397281927F38693E4381F64520F484599B1C8A2CB705FAE3CC2158BF1E60A7C59B344BD15AC5FA7556FAAC2B261E431BA23C61BF4DD117F40DDDA225A812ABA33B82610FAADE9697E797438D8C32113EE43E4086D0A4615096C968058A74E07986916B1775D82C45C5494B7207A0414E646120DE3CA25E1235F63D4EB2742493B7E9609453372E647D25450137CCA559853FCB66B938982036D2CBB9C057CCB142627ACAB415264B3736E21508475B37545FC3143757EE88A9B5C7336877FE9A7D54310D27A4485C21D35C55F5088B158196FFDB45470DD8C218E2FB916A83F3EEE399646C8F342EFD19BFF83BEC0D411845BEB397AA33DEF7521C53DAAF16EBE8FECE078CEEEB90D37270D018181BB7E193D9CE70A98C25A1447C92265EC91697FBF7D1E0C82B287843CD9EA3EA46275F0D3BCD23294FE433948B878041D77652E150E3E70B68BD5272162F61B61490242F9716BCAA4E3E37C0FD341A61AAEC2DD3B03440D75D707206F51D5CA83C9441D2F3AF7C6AB435151EAD938F7C6D1BEE986E1F328170E7B9497E7F204BDF0D6924AD3F0790FBA770A03D76BB6319A30F754F0EBB3F86058C606D2D5590731DD799E746559904BCE60990B63080D2CF375008728D9D0E38375CFF1BC3C22FB84581775C36BF26B66175E56342D88F76C
tmp_aes_key = 1C0F164CA2D4D7649EA8E7E71D3E57E07B12A42C559E803D2BE4B7AD7815F40A
tmp_aes_iv = C1BECE401B0BF7D064A43FF2F1BFEB3A6CE92CB730DC95BE537B3FA824DB666D</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 2A1F1B8D6E127687705F67F02AFFA1186DD0C3C5BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B964C4EDE476745F625B69D15CCA0FD827E0AF126BB65536600EBE1D31949935D63BC07C00B324A7F01A7AA69AF8707322226B5EAC51CBD2DC4CBFE038454416BCE7F9C35A6999BA3EB0B5CED2D31E8ED90E555C22DB770423DA3BC42A75E6E7173FA90F9ABC7FA771FB6C57D0DA16F0FD1FD56617D3C556DDB1512BC1808CB44FF63D302CD26F4EEA199A7A7AA049945514DFCC236309DCE6C6B40BE2F272A29339054AD17C0CB45A18C9D41622D44C2309DFB9784BD221D8041C49AEBE05E44161BFE5FADF1930E34E53737597E3251E6064A305636593D7D30998E2E433F46A4CD770B663ACBBAC0D13D358041B561B77FFF23CFBC3959DEEB11891B3FC43D7BDB0667DE8BDDB24652807
answer = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B964C4EDE476745F625B69D15CCA0FD827E0AF126BB65536600EBE1D31949935D63BC07C00B324A7F01A7AA69AF8707322226B5EAC51CBD2DC4CBFE038454416BCE7F9C35A6999BA3EB0B5CED2D31E8ED90E555C22DB770423DA3BC42A75E6E7173FA90F9ABC7FA771FB6C57D0DA16F0FD1FD56617D3C556DDB1512BC1808CB44FF63D302CD26F4EEA199A7A7AA049945514DFCC236309DCE6C6B40BE2F272A29339054AD17C0CB45A18C9D41622D44C2309DFB9784BD221D8041C49AEBE05E44161BFE5FADF1930E34E53737597E3251E6064A305636593D7D30998E2E433F46A4CD770B663ACBBAC0D13D358041B561B77FFF23CFBC3959DEEB11891B3FC43D7BDB0667DE8BDDB24652807</code></pre>
<pre><code>answer_with_hash = 0E8F91C9FE26FE594A413BD9367C77A5058BD8F1BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010021B70FF38A9F2A3CCDD828C64539BA07C16E088AC09690E9C7AF62ADEE33C013495AE4CCDBE15FC6A6C54A0A94B1A9074502F6E120A5BE5FE4DBC30BBD5F290992CEC047D911075FFA259DB67B168D5D194250C6A402D5123971EE7097B4551813997DA8E0310F3049A7B03DCB6416FB858DD2B4516A2D40CAE5064F5E3E7D623933BF1C79BFFC0A37A990784F1D5CA60BBB36DFBA19BEABB4EFD092F48C3E35853AB7EFD9C71CFB0377749337D5212FEA0B3D8C76C522973245891A2916931722F2259559CEAC0AC0D58C7BB439F237AFEEBA5901AA521E2844315F19D4D604786AFC1714FCAB3F86768D6D671BD4283293848658CF3A39C3E13471168E0B1E52C4B0669C7B308A78E27683
answer = BA0D89B5C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010021B70FF38A9F2A3CCDD828C64539BA07C16E088AC09690E9C7AF62ADEE33C013495AE4CCDBE15FC6A6C54A0A94B1A9074502F6E120A5BE5FE4DBC30BBD5F290992CEC047D911075FFA259DB67B168D5D194250C6A402D5123971EE7097B4551813997DA8E0310F3049A7B03DCB6416FB858DD2B4516A2D40CAE5064F5E3E7D623933BF1C79BFFC0A37A990784F1D5CA60BBB36DFBA19BEABB4EFD092F48C3E35853AB7EFD9C71CFB0377749337D5212FEA0B3D8C76C522973245891A2916931722F2259559CEAC0AC0D58C7BB439F237AFEEBA5901AA521E2844315F19D4D604786AFC1714FCAB3F86768D6D671BD4283293848658CF3A39C3E13471168E0B1E52C4B0669C7B308A78E27683</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 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
<pre><code>0000 | BA 0D 89 B5 C0 71 76 9B 1F CB C3 B7 02 96 59 4F
0010 | 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F
0020 | E6 8B 80 F2 03 00 00 00 FE 00 01 00 C7 1C AE B9
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 = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
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 | 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>
0130 | 21 B7 0F F3 8A 9F 2A 3C CD D8 28 C6 45 39 BA 07
0140 | C1 6E 08 8A C0 96 90 E9 C7 AF 62 AD EE 33 C0 13
0150 | 49 5A E4 CC DB E1 5F C6 A6 C5 4A 0A 94 B1 A9 07
0160 | 45 02 F6 E1 20 A5 BE 5F E4 DB C3 0B BD 5F 29 09
0170 | 92 CE C0 47 D9 11 07 5F FA 25 9D B6 7B 16 8D 5D
0180 | 19 42 50 C6 A4 02 D5 12 39 71 EE 70 97 B4 55 18
0190 | 13 99 7D A8 E0 31 0F 30 49 A7 B0 3D CB 64 16 FB
01A0 | 85 8D D2 B4 51 6A 2D 40 CA E5 06 4F 5E 3E 7D 62
01B0 | 39 33 BF 1C 79 BF FC 0A 37 A9 90 78 4F 1D 5C A6
01C0 | 0B BB 36 DF BA 19 BE AB B4 EF D0 92 F4 8C 3E 35
01D0 | 85 3A B7 EF D9 C7 1C FB 03 77 74 93 37 D5 21 2F
01E0 | EA 0B 3D 8C 76 C5 22 97 32 45 89 1A 29 16 93 17
01F0 | 22 F2 25 95 59 CE AC 0A C0 D5 8C 7B B4 39 F2 37
0200 | AF EE BA 59 01 AA 52 1E 28 44 31 5F 19 D4 D6 04
0210 | 78 6A FC 17 14 FC AB 3F 86 76 8D 6D 67 1B D4 28
0220 | 32 93 84 86 58 CF 3A 39 C3 E1 34 71 16 8E 0B 1E
0230 | 52 C4 B0 66</code></pre>
<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 = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
<tr>
<td>g_a</td>
<td>300, 260</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>FE00010021B70FF38A9F2A3CCDD828C6</code> <code>4539BA07C16E088AC09690E9C7AF62AD</code> <code>EE33C013495AE4CCDBE15FC6A6C54A0A</code> <code>94B1A9074502F6E120A5BE5FE4DBC30B</code> <code>BD5F290992CEC047D911075FFA259DB6</code> <code>7B168D5D194250C6A402D5123971EE70</code> <code>97B4551813997DA8E0310F3049A7B03D</code> <code>CB6416FB858DD2B4516A2D40CAE5064F</code> <code>5E3E7D623933BF1C79BFFC0A37A99078</code> <code>4F1D5CA60BBB36DFBA19BEABB4EFD092</code> <code>F48C3E35853AB7EFD9C71CFB03777493</code> <code>37D5212FEA0B3D8C76C522973245891A</code> <code>2916931722F2259559CEAC0AC0D58C7B</code> <code>B439F237AFEEBA5901AA521E2844315F</code> <code>19D4D604786AFC1714FCAB3F86768D6D</code> <code>671BD4283293848658CF3A39C3E13471</code><br> <code>168E0B1E</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>D7BDB066</code> (1722858967 in decimal)</td>
<td><code>52C4B066</code> (1722860626 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
<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 = D854AC6C95D1625563B247B94A88773790020A7E2A16B1BC0ABBB57A672FEF830620B3820114B7D2EC1410AD85C9B654D362407CE8C75613084A76C80569150E5CF75CCA5D6E60AD693CDAF760E183C92BB0343304E0E62AECF4ECCA7373A66F952EA9EDBFE325CC47760736C3C0C60197B98B3A55099D04254CD5BB96A1F16587FCEB55AFC73034E481FCF598A49F95ED145E442FBB3960AB0F53FBBB1A98935C84670FC604460E59DE6905389214399EB5DBFCA523ED696456445A9ABC83F08251F793BBDFA77A15BA604FE320AA167C78D960995777F0D12E1604E03C664CE5129D997456091B435C91A6F2F5D300798910676C92763A8F30810176A261B0</code></pre>
<pre><code>b = 51220E7EDC04CEF18D889264586AB10364478035A19BFB702E3C55165DE25689281B7BEF7B00409F1AFA693C46CF50E56017E9EF840620A00A3146292A92417731DBD931869598534A3D8E1AC7381B405C93839FAD470195F2EC60D7529782A3D0D4C964AC5C13A5855BBEA0CB786135AAFAAFAC15B3B0AFC08DFD3FE29F4FC295FE0E22DCA14A5BD45071FB8F76212CE4C14B3C1FC199D6C5CF625BB539C3249E0E895F65247CA8418B44B090520F218FC6A90A4CD21EEAE7635C95C8B5412BA516A22DD19C853946EF8A6752A21475632B21FD925B09C526970D8C82E60B5410E7656DBD4DEA3D50D55007BC3BEAADFAC66E6A89C34397D06A2D1FA176148F</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 = B6D4BB172A706C233B64C7EDB24531D8FA3BF3A082AD7B1B8A5F1F825CE228A8E0C55533379B32F25AE1AF88E52BE3463C58550024D6CD3349B6645BE2262574C1C7155AF21FDC69D04E8F096C873FF12B35207AFE2FA533A057848869206F3BB0AEAB4EF7767455177A55F0EB28853E3D7A6D50106B6258307F55F5D1A3AEFF85487E73839EDFF5D1775E3D28239C6627F36233C1F701A8878F5EE52D91D46F878EAAE219EC54F5E913B4527B643CBFF643E16FAD38BD896EDAC9794DAF1EB95FB8CA1133FDA1821B17F163E92DC4A82380886AF4C5BFDCDDC1B5966A8EA03DDBA02FBAF27ECB21184A150F6BFA52DFB0D58CD798C7FFCEDE0F42AC64D4BE7F</code></pre>
<pre><code>g_b = B79279F22787A4096E04D75FC65E107788E0F733D0A28A0AE0807ED158C7C63111DC9F66B71F59D056C0103A48617BE80BF020E8B8A803219C795DC9DC30423829D0DC647215083482E888A52D259546FE5CF301E87D1C9F31C2A05F7D9F63BECA6CE440DD41C476D8FC372FC0F39604385CD9063D61F55AEE119AB51EF3A1C9D31152C5043B4123D4E56C120B8F171A7F9A419C6E75C06C3129B577DBF5C2337A9F03EF045163E1EF32C1021E580DBA94E63501792D5372A6B89F5459CF5A80797F7EF5FEC9445AADD8EE6977372337B150813E4B4310610900F06D7BED8D18CF50846DCDEA44F2D3716D62ACB1B8D0D06501600D90F6F9682668B7EF64C0CB</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 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>
<pre><code>0000 | 54 B6 43 66 C0 71 76 9B 1F CB C3 B7 02 96 59 4F
0010 | 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B 4B F7 DA 5F
0020 | E6 8B 80 F2 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | B7 92 79 F2 27 87 A4 09 6E 04 D7 5F C6 5E 10 77
0040 | 88 E0 F7 33 D0 A2 8A 0A E0 80 7E D1 58 C7 C6 31
0050 | 11 DC 9F 66 B7 1F 59 D0 56 C0 10 3A 48 61 7B E8
0060 | 0B F0 20 E8 B8 A8 03 21 9C 79 5D C9 DC 30 42 38
0070 | 29 D0 DC 64 72 15 08 34 82 E8 88 A5 2D 25 95 46
0080 | FE 5C F3 01 E8 7D 1C 9F 31 C2 A0 5F 7D 9F 63 BE
0090 | CA 6C E4 40 DD 41 C4 76 D8 FC 37 2F C0 F3 96 04
00A0 | 38 5C D9 06 3D 61 F5 5A EE 11 9A B5 1E F3 A1 C9
00B0 | D3 11 52 C5 04 3B 41 23 D4 E5 6C 12 0B 8F 17 1A
00C0 | 7F 9A 41 9C 6E 75 C0 6C 31 29 B5 77 DB F5 C2 33
00D0 | 7A 9F 03 EF 04 51 63 E1 EF 32 C1 02 1E 58 0D BA
00E0 | 94 E6 35 01 79 2D 53 72 A6 B8 9F 54 59 CF 5A 80
00F0 | 79 7F 7E F5 FE C9 44 5A AD D8 EE 69 77 37 23 37
0100 | B1 50 81 3E 4B 43 10 61 09 00 F0 6D 7B ED 8D 18
0110 | CF 50 84 6D CD EA 44 F2 D3 71 6D 62 AC B1 B8 D0
0120 | D0 65 01 60 0D 90 F6 F9 68 26 68 B7 EF 64 C0 CB</code></pre>
<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 = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</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><code>FE000100B79279F22787A4096E04D75F</code> <code>C65E107788E0F733D0A28A0AE0807ED1</code> <code>58C7C63111DC9F66B71F59D056C0103A</code> <code>48617BE80BF020E8B8A803219C795DC9</code> <code>DC30423829D0DC647215083482E888A5</code> <code>2D259546FE5CF301E87D1C9F31C2A05F</code> <code>7D9F63BECA6CE440DD41C476D8FC372F</code> <code>C0F39604385CD9063D61F55AEE119AB5</code> <code>1EF3A1C9D31152C5043B4123D4E56C12</code> <code>0B8F171A7F9A419C6E75C06C3129B577</code> <code>DBF5C2337A9F03EF045163E1EF32C102</code> <code>1E580DBA94E63501792D5372A6B89F54</code> <code>59CF5A80797F7EF5FEC9445AADD8EE69</code> <code>77372337B150813E4B4310610900F06D</code> <code>7BED8D18CF50846DCDEA44F2D3716D62</code> <code>ACB1B8D0D06501600D90F6F9682668B7</code><br> <code>EF64C0CB</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B56436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2
<!-- 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 = 54B643666436308BB0C8AE58733604FC48D0A0BAED2B40DA18155CE244254039D7919B2E0000000000000000FE000100B6D4BB172A706C233B64C7EDB24531D8FA3BF3A082AD7B1B8A5F1F825CE228A8E0C55533379B32F25AE1AF88E52BE3463C58550024D6CD3349B6645BE2262574C1C7155AF21FDC69D04E8F096C873FF12B35207AFE2FA533A057848869206F3BB0AEAB4EF7767455177A55F0EB28853E3D7A6D50106B6258307F55F5D1A3AEFF85487E73839EDFF5D1775E3D28239C6627F36233C1F701A8878F5EE52D91D46F878EAAE219EC54F5E913B4527B643CBFF643E16FAD38BD896EDAC9794DAF1EB95FB8CA1133FDA1821B17F163E92DC4A82380886AF4C5BFDCDDC1B5966A8EA03DDBA02FBAF27ECB21184A150F6BFA52DFB0D58CD798C7FFCEDE0F42AC64D4BE7F
padding = CBF50C1AA24F2F9BE4EF5E14
tmp_aes_key = 03A51C1208C2965474261CFEAC6EDD6E079FF78249AF9751278EA1CB2C481B6A
tmp_aes_iv = 9781C3B0387027BE778491F24180DB6DAA5DCB15815BD673DE585CD05D743D5D</code></pre>
<pre><code>data = 54B64366C071769B1FCBC3B70296594F9D52E60CFFD1AFC14CE8141B4BF7DA5FE68B80F20000000000000000FE000100B79279F22787A4096E04D75FC65E107788E0F733D0A28A0AE0807ED158C7C63111DC9F66B71F59D056C0103A48617BE80BF020E8B8A803219C795DC9DC30423829D0DC647215083482E888A52D259546FE5CF301E87D1C9F31C2A05F7D9F63BECA6CE440DD41C476D8FC372FC0F39604385CD9063D61F55AEE119AB51EF3A1C9D31152C5043B4123D4E56C120B8F171A7F9A419C6E75C06C3129B577DBF5C2337A9F03EF045163E1EF32C1021E580DBA94E63501792D5372A6B89F5459CF5A80797F7EF5FEC9445AADD8EE6977372337B150813E4B4310610900F06D7BED8D18CF50846DCDEA44F2D3716D62ACB1B8D0D06501600D90F6F9682668B7EF64C0CB
padding = B364699FF2A3C12B91A23F76
tmp_aes_key = 1C0F164CA2D4D7649EA8E7E71D3E57E07B12A42C559E803D2BE4B7AD7815F40A
tmp_aes_iv = C1BECE401B0BF7D064A43FF2F1BFEB3A6CE92CB730DC95BE537B3FA824DB666D</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 = 60D6E6FFA47DF5A111DF2A563F2C275223F33AFD5B9A5C5695AA94F3C84F38909E60FF40546716A5940F0EB620B0E8A1B23A45E5E9E304B51DA151350C8659C86355093CD60305C73934516C4AE741BB620EC2F18E5AA0D74055323B81FFFE389FF06E172A4D88106F81FE1EFF3CE57D3EF86CC1FDF9E18F3EA1B6BFA3B5164906A1F554FF12E8411C349218443CAD0E4D34304DA8FE2B706E144F00A750BB9560A2A4640C3275F69BCE26759AE30F2DE5213D40BE0B7AA342721531A07AF9A70B1DF68E7CF206535C6D0FA4562C3EC2396460D630978E5311BD075A027B58161BC2723F1AEC06D41F0BE06C7213A2EF6AA8E7CCED9FA70696ED5FF9BBBA821252FB1CAD8B00AED6EDFA89E61623B644FB2CCA6FF8B539CE1C022E5E2938B62F29794FB6EB37BC56F1A6E721FF80791DB84B98F6417A3FCEDC84A101BF51B665D05D9E0FB31599D0D8826A87DAB218E8</code></pre>
<pre><code>encrypted_data = 28A54EB0FAED1AEAD8B916708BFC1EBFADA5759427D9ECD7205687485E960B3A379C1CAAD2AE808AF39D2DF86D3D33363CBF1C04101824961D506BF4E40261641287F3FC268348DF6F1FD8C22C42AA770414E0B7CE28171B8A533E6DE7F47B1DDA02C4C88DA03BD055E6AE9A7F6810DC94713E66F6D0D794CBF3CF0A0433867318BE08608FE59B825E4DB7A6C84FDF3144EA28AE0BB178846A3071C90A085B81B29D9CBD79A43A3FC852FF1655F267351E1924B174012C909BFC05A8F04E3812F6949D0C7B99F062BCD9A8FAA9B9B23DCE01ECB581285BAEAA09D042B5DED4FA284957128502729B930347994E53AE0FAEDC94222FD2BD8CF4F04EE715BD929E4037B072E8CC10837007FC15360F1FE3E06DBEEED4DFCB649E007541602F2303C1DC3081EA141CA2E925C611253DEBF796BC8C082C198B63E5970FC9F2D8B6A6566419DB6471139FC173DAFDFA05EA5A</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 2C 86 0B 00 52 C4 B0 66
0010 | 78 01 00 00 1F 5F 04 F5 C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 FE 50 01 00 28 A5 4E B0
0040 | FA ED 1A EA D8 B9 16 70 8B FC 1E BF AD A5 75 94
0050 | 27 D9 EC D7 20 56 87 48 5E 96 0B 3A 37 9C 1C AA
0060 | D2 AE 80 8A F3 9D 2D F8 6D 3D 33 36 3C BF 1C 04
0070 | 10 18 24 96 1D 50 6B F4 E4 02 61 64 12 87 F3 FC
0080 | 26 83 48 DF 6F 1F D8 C2 2C 42 AA 77 04 14 E0 B7
0090 | CE 28 17 1B 8A 53 3E 6D E7 F4 7B 1D DA 02 C4 C8
00A0 | 8D A0 3B D0 55 E6 AE 9A 7F 68 10 DC 94 71 3E 66
00B0 | F6 D0 D7 94 CB F3 CF 0A 04 33 86 73 18 BE 08 60
00C0 | 8F E5 9B 82 5E 4D B7 A6 C8 4F DF 31 44 EA 28 AE
00D0 | 0B B1 78 84 6A 30 71 C9 0A 08 5B 81 B2 9D 9C BD
00E0 | 79 A4 3A 3F C8 52 FF 16 55 F2 67 35 1E 19 24 B1
00F0 | 74 01 2C 90 9B FC 05 A8 F0 4E 38 12 F6 94 9D 0C
0100 | 7B 99 F0 62 BC D9 A8 FA A9 B9 B2 3D CE 01 EC B5
0110 | 81 28 5B AE AA 09 D0 42 B5 DE D4 FA 28 49 57 12
0120 | 85 02 72 9B 93 03 47 99 4E 53 AE 0F AE DC 94 22
0130 | 2F D2 BD 8C F4 F0 4E E7 15 BD 92 9E 40 37 B0 72
0140 | E8 CC 10 83 70 07 FC 15 36 0F 1F E3 E0 6D BE EE
0150 | D4 DF CB 64 9E 00 75 41 60 2F 23 03 C1 DC 30 81
0160 | EA 14 1C A2 E9 25 C6 11 25 3D EB F7 96 BC 8C 08
0170 | 2C 19 8B 63 E5 97 0F C9 F2 D8 B6 A6 56 64 19 DB
0180 | 64 71 13 9F C1 73 DA FD FA 05 EA 5A</code></pre>
<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>B4200D00D8BDB066</code></td>
<td><code>2C860B0052C4B066</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>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</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><code>FE50010028A54EB0FAED1AEAD8B91670</code> <code>8BFC1EBFADA5759427D9ECD720568748</code> <code>5E960B3A379C1CAAD2AE808AF39D2DF8</code> <code>6D3D33363CBF1C04101824961D506BF4</code> <code>E40261641287F3FC268348DF6F1FD8C2</code> <code>2C42AA770414E0B7CE28171B8A533E6D</code> <code>E7F47B1DDA02C4C88DA03BD055E6AE9A</code> <code>7F6810DC94713E66F6D0D794CBF3CF0A</code> <code>0433867318BE08608FE59B825E4DB7A6</code> <code>C84FDF3144EA28AE0BB178846A3071C9</code> <code>0A085B81B29D9CBD79A43A3FC852FF16</code> <code>55F267351E1924B174012C909BFC05A8</code> <code>F04E3812F6949D0C7B99F062BCD9A8FA</code> <code>A9B9B23DCE01ECB581285BAEAA09D042</code> <code>B5DED4FA284957128502729B93034799</code> <code>4E53AE0FAEDC94222FD2BD8CF4F04EE7</code> <code>15BD929E4037B072E8CC10837007FC15</code> <code>360F1FE3E06DBEEED4DFCB649E007541</code> <code>602F2303C1DC3081EA141CA2E925C611</code> <code>253DEBF796BC8C082C198B63E5970FC9</code> <code>F2D8B6A6566419DB6471139FC173DAFD</code><br> <code>FA05EA5A</code></td>
<td>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 = 664FDEFF27B2EA281B654E335FAD98CA741B291EAC2147D46A33E13854187C47D1FCA5EFDF00E578EBF8ED7B56AF06092A434513C7E6864AE3170EB0E9B645FCBF20721D51E2802E5C141C136A49EFD871C8B32C9A4C4DCA889CB786C207B1ECE4D49437B41664093425E15E07DB8BABF1E9921F50992A3D42BDC6EF524F01115F07A8597BFCB3ED003FDF19FFC897C89089B5D3505692385F677A7E460A98709FBF92999C0C0253B529AD7105266768616D1EF89A4738B6821DF07F1D3405DA563F1B87198CBA1E9A8693AA78F4299C6E2720DF8A929989A27A778E354AA37ACFD70A04BD706121FBF3537FB36174ABFF39C6ABEEF0163973275DC30ADFAEC1</code></pre>
<pre><code>auth_key = 7E3BE38D6F53C929F49DFC9380019156E6A14B4B78FE3623A679293053C398DE663B12D21D97E36C0BA9EF57A91FE511D2F42865436A85B743E4A4AC1116485E2541903A31824EAD9D563D5C7AF20939B4EE684489DCE6E9175001CCA4A67D784715BD3053258213206F6EFC7DABD0F0C869452314F394E5B346C1808389C1D5447B25BD2F2DB2BDA3AA28DBC46CD2B6E2A4D78C05A59FD849B8BEBE416B056FEE71D77100EA083B8156B94DF8FDFB8FD4602F04414423BE11B7572D0CE23160080DC81526777815035FC2D1D72E5C6464DB737FAF8B83BB91E4AB1FF125EF26611437AA86A97268B798B25B0779CD9490A71A86965105BFE2AE099868301357</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 44 D9 0F 53 C4 B0 66
0010 | 38 00 00 00 34 F7 CB 3B C0 71 76 9B 1F CB C3 B7
0020 | 02 96 59 4F 9D 52 E6 0C FF D1 AF C1 4C E8 14 1B
0030 | 4B F7 DA 5F E6 8B 80 F2 E7 3B 0A 2A 3E 6A 2B 63
0040 | 08 E8 2A BC D1 66 E1 23</code></pre>
<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>0158B4E1D8BDB066</code></td>
<td><code>0144D90F53C4B066</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>64000000</code> (100 in decimal)</td>
<td><code>38000000</code> (56 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>6436308BB0C8AE58733604FC48D0A0BA</code></td>
<td><code>C071769B1FCBC3B70296594F9D52E60C</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2B40DA18155CE244254039D7919B2E</code></td>
<td><code>FFD1AFC14CE8141B4BF7DA5FE68B80F2</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>55A004E79659426FB484D9961327CCE8</code></td>
<td><code>E73B0A2A3E6A2B6308E82ABCD166E123</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>