Update content of files

This commit is contained in:
GitHub Action 2023-11-23 17:56:28 +00:00
parent 78facd9468
commit 5eb06872f0
11 changed files with 268 additions and 268 deletions

View file

@ -5,11 +5,11 @@
<title>Sponsored messages</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Related TL schema:
sponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes…">
sponsoredWebPage#3db8ec63 flags:# url:string site_name:string photo:flags.0?Photo = SponsoredWebPage;…">
<meta property="og:title" content="Sponsored messages">
<meta property="og:image" content="">
<meta property="og:description" content="Related TL schema:
sponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes…">
sponsoredWebPage#3db8ec63 flags:# url:string site_name:string photo:flags.0?Photo = SponsoredWebPage;…">
<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">
@ -45,13 +45,17 @@ sponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags
<h1 id="dev_page_title">Sponsored messages</h1>
<div id="dev_page_content"><p>Related TL schema:</p>
<pre><code><a href='/constructor/sponsoredMessage'>sponsoredMessage</a>#daafff6b flags:<a href='/type/%23'>#</a> recommended:flags.5?<a href='/constructor/true'>true</a> show_peer_photo:flags.6?<a href='/constructor/true'>true</a> random_id:<a href='/type/bytes'>bytes</a> from_id:flags.3?<a href='/type/Peer'>Peer</a> chat_invite:flags.4?<a href='/type/ChatInvite'>ChatInvite</a> chat_invite_hash:flags.4?<a href='/type/string'>string</a> channel_post:flags.2?<a href='/type/int'>int</a> start_param:flags.0?<a href='/type/string'>string</a> webpage:flags.9?<a href='/type/SponsoredWebPage'>SponsoredWebPage</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; sponsor_info:flags.7?<a href='/type/string'>string</a> additional_info:flags.8?<a href='/type/string'>string</a> = <a href='/type/SponsoredMessage'>SponsoredMessage</a>;
<pre><code><a href='/constructor/sponsoredWebPage'>sponsoredWebPage</a>#3db8ec63 flags:<a href='/type/%23'>#</a> url:<a href='/type/string'>string</a> site_name:<a href='/type/string'>string</a> photo:flags.0?<a href='/type/Photo'>Photo</a> = <a href='/type/SponsoredWebPage'>SponsoredWebPage</a>;
<a href='/constructor/sponsoredMessage'>sponsoredMessage</a>#daafff6b flags:<a href='/type/%23'>#</a> recommended:flags.5?<a href='/constructor/true'>true</a> show_peer_photo:flags.6?<a href='/constructor/true'>true</a> random_id:<a href='/type/bytes'>bytes</a> from_id:flags.3?<a href='/type/Peer'>Peer</a> chat_invite:flags.4?<a href='/type/ChatInvite'>ChatInvite</a> chat_invite_hash:flags.4?<a href='/type/string'>string</a> channel_post:flags.2?<a href='/type/int'>int</a> start_param:flags.0?<a href='/type/string'>string</a> webpage:flags.9?<a href='/type/SponsoredWebPage'>SponsoredWebPage</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; sponsor_info:flags.7?<a href='/type/string'>string</a> additional_info:flags.8?<a href='/type/string'>string</a> = <a href='/type/SponsoredMessage'>SponsoredMessage</a>;
<a href='/constructor/messages.sponsoredMessages'>messages.sponsoredMessages</a>#c9ee1d87 flags:<a href='/type/%23'>#</a> posts_between:flags.0?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/SponsoredMessage'>SponsoredMessage</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/messages.SponsoredMessages'>messages.SponsoredMessages</a>;
---functions---
<a href='/method/channels.getSponsoredMessages'>channels.getSponsoredMessages</a>#ec210fbf channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.SponsoredMessages'>messages.SponsoredMessages</a>;
<a href='/method/channels.viewSponsoredMessage'>channels.viewSponsoredMessage</a>#beaedb94 channel:<a href='/type/InputChannel'>InputChannel</a> random_id:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<a href='/method/channels.viewSponsoredMessage'>channels.viewSponsoredMessage</a>#beaedb94 channel:<a href='/type/InputChannel'>InputChannel</a> random_id:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/channels.clickSponsoredMessage'>channels.clickSponsoredMessage</a>#18afbc93 channel:<a href='/type/InputChannel'>InputChannel</a> random_id:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<h4><a class="anchor" href="#getting-sponsored-messages" id="getting-sponsored-messages" name="getting-sponsored-messages"><i class="anchor-icon"></i></a>Getting sponsored messages</h4>
<p>Each time the user opens a channel, <code>channels.getSponsoredMessages</code> must be called to receive <a href="https://promote.telegram.org">sponsored messages</a> available for this channel. The result must be cached for <strong>5 minutes</strong>.</p>
<blockquote>
@ -66,9 +70,18 @@ sponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags
</ul>
<p>The message should be marked as "Recommended" instead of "Sponsored" if the <code>recommended</code> flag is set. </p>
<p>If the <code>show_peer_photo</code> flag is set, a profile photo bubble should be displayed for this message, like for messages sent in groups. The photo shown in the bubble is obtained either from the peer contained in <code>from_id</code>, or from <code>chat_invite</code>. </p>
<p>If the <code>webpage</code> flag is set, an instant view webpage preview must also be shown for the specified website.</p>
<p>If the <code>sponsor_info</code> or <code>additional_info</code> flags are set, an additional "Sponsor info" menu item must be present in the message context menu (the menu that pops up when clicking on a button), that when clicked, displays the contents of the flags. </p>
<h4><a class="anchor" href="#counting-sponsored-message-views" id="counting-sponsored-message-views" name="counting-sponsored-message-views"><i class="anchor-icon"></i></a>Counting sponsored message views</h4>
<p>Once the entire text is shown on the screen (excluding the button), <code>channels.viewSponsoredMessage</code> must be called with the <code>random_id</code> of this sponsored message.</p>
<p>Once the entire text is shown on the screen (excluding the button), <a href="/method/channels.viewSponsoredMessage">channels.viewSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<h4><a class="anchor" href="#clicking-on-sponsored-messages" id="clicking-on-sponsored-messages" name="clicking-on-sponsored-messages"><i class="anchor-icon"></i></a>Clicking on sponsored messages</h4>
<p>If the user either:</p>
<ul>
<li>Clicks on a link in the sponsored message</li>
<li>Opens a sponsored chat or a sponsored website via the associated button</li>
<li>Opens the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message</li>
</ul>
<p><a href="/method/channels.clickSponsoredMessage">channels.clickSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<h4><a class="anchor" href="#testing-sponsored-messages" id="testing-sponsored-messages" name="testing-sponsored-messages"><i class="anchor-icon"></i></a>Testing sponsored messages</h4>
<p>For the channel <a href="https://t.me/SecretAdTestChannel">https://t.me/SecretAdTestChannel</a> the system will <strong>always</strong> return a sponsored message: promoting either a channel, a particular message in a channel, or a bot with a start parameter.</p>
<hr>

View file

@ -94,7 +94,7 @@
<tr>
<td><strong>stories_preload</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether to preload <a href="/api/stories">stories</a>; in particular, the first <a href="/constructor/documentAttributeVideo">documentAttributeVideo</a>.<code>preload_prefix_size</code> bytes of story videos should be preloaded.</td>
</tr>
<tr>
<td><strong>photo_size_max</strong></td>
@ -129,7 +129,12 @@
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/AutoDownloadSettings">AutoDownloadSettings</a></p></div>
<p><a href="/type/AutoDownloadSettings">AutoDownloadSettings</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="#stories" id="stories" name="stories"><i class="anchor-icon"></i></a><a href="/api/stories">Stories</a></h4>
<p>Telegram users and channels can easily post and view stories through the API.</p>
<h4><a class="anchor" href="#documentattributevideo" id="documentattributevideo" name="documentattributevideo"><i class="anchor-icon"></i></a><a href="/constructor/documentAttributeVideo">documentAttributeVideo</a></h4>
<p>Defines a video</p></div>
</div>

View file

@ -84,7 +84,7 @@
<tr>
<td><strong>nosound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether the specified document is a video file with no audio tracks (a GIF animation (even as MPEG4), for example)</td>
</tr>
<tr>
<td><strong>duration</strong></td>
@ -104,12 +104,15 @@
<tr>
<td><strong>preload_prefix_size</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/int">int</a></td>
<td> </td>
<td>Number of bytes to preload when preloading videos (particularly <a href="/api/stories">video stories</a>).</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/DocumentAttribute">DocumentAttribute</a></p></div>
<p><a href="/type/DocumentAttribute">DocumentAttribute</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="#stories" id="stories" name="stories"><i class="anchor-icon"></i></a><a href="/api/stories">Stories</a></h4>
<p>Telegram users and channels can easily post and view stories through the API.</p></div>
</div>

View file

@ -79,17 +79,20 @@
<tr>
<td><strong>keep_archived_unmuted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether unmuted chats will be kept in the Archive chat list when they get a new message.</td>
</tr>
<tr>
<td><strong>keep_archived_folders</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether unmuted chats that are always included or pinned in a <a href="/api/folders">folder</a>, will be kept in the Archive chat list when they get a new message. Ignored if <code>keep_archived_unmuted</code> is set.</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/GlobalPrivacySettings">GlobalPrivacySettings</a></p></div>
<p><a href="/type/GlobalPrivacySettings">GlobalPrivacySettings</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="#folders" id="folders" name="folders"><i class="anchor-icon"></i></a><a href="/api/folders">Folders</a></h4>
<p>Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.</p></div>
</div>

View file

@ -89,22 +89,22 @@
<tr>
<td><strong>sound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/NotificationSound">NotificationSound</a></td>
<td>Name of an audio file for notification</td>
<td>Identifier of an audio file to play for notifications.</td>
</tr>
<tr>
<td><strong>stories_muted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/Bool">Bool</a></td>
<td> </td>
<td>Whether story notifications should be disabled.</td>
</tr>
<tr>
<td><strong>stories_hide_sender</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.7?<a href="/type/Bool">Bool</a></td>
<td> </td>
<td>Whether the sender name should be displayed in story notifications.</td>
</tr>
<tr>
<td><strong>stories_sound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.8?<a href="/type/NotificationSound">NotificationSound</a></td>
<td> </td>
<td>Identifier of an audio file to play for story notifications.</td>
</tr>
</tbody>
</table>

View file

@ -104,27 +104,27 @@
<tr>
<td><strong>stories_muted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/Bool">Bool</a></td>
<td> </td>
<td>Whether story notifications should be disabled.</td>
</tr>
<tr>
<td><strong>stories_hide_sender</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.7?<a href="/type/Bool">Bool</a></td>
<td> </td>
<td>Whether the sender name should be displayed in story notifications.</td>
</tr>
<tr>
<td><strong>stories_ios_sound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.8?<a href="/type/NotificationSound">NotificationSound</a></td>
<td> </td>
<td>Sound for story notifications on the official iOS application</td>
</tr>
<tr>
<td><strong>stories_android_sound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.9?<a href="/type/NotificationSound">NotificationSound</a></td>
<td> </td>
<td>Sound for story notifications on the official Android application</td>
</tr>
<tr>
<td><strong>stories_other_sound</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.10?<a href="/type/NotificationSound">NotificationSound</a></td>
<td> </td>
<td>Sound for story notifications on other applications</td>
</tr>
</tbody>
</table>

View file

@ -114,7 +114,7 @@
<tr>
<td><strong>webpage</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.9?<a href="/type/SponsoredWebPage">SponsoredWebPage</a></td>
<td> </td>
<td>Sponsored website</td>
</tr>
<tr>
<td><strong>message</strong></td>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>updateMessagePollVote</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="A specific user has voted in a poll">
<meta property="description" content="A specific peer has voted in a poll">
<meta property="og:title" content="updateMessagePollVote">
<meta property="og:image" content="">
<meta property="og:description" content="A specific user has voted in a poll">
<meta property="og:description" content="A specific peer has voted in a poll">
<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,7 @@
<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/updateMessagePollVote" >updateMessagePollVote</a></li></ul></div>
<h1 id="dev_page_title">updateMessagePollVote</h1>
<div id="dev_page_content"><p>A specific user has voted in a poll</p>
<div id="dev_page_content"><p>A specific peer has voted in a poll</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -74,7 +74,7 @@
<tr>
<td><strong>peer</strong></td>
<td style="text-align: center;"><a href="/type/Peer">Peer</a></td>
<td> </td>
<td>The peer that voted in the poll</td>
</tr>
<tr>
<td><strong>options</strong></td>

View file

@ -4,40 +4,10 @@
<meta charset="utf-8">
<title>channels.clickSponsoredMessage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
channel
InputChannel
 
random_id
bytes
 
Result
Bool
Possible errors
Code
Type
Description…">
<meta property="description" content="Informs the server that the user has either: - Clicked on a link in the sponsored message - Has opened a sponsored chat or a sponsored website via the associated button - Has opened the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message">
<meta property="og:title" content="channels.clickSponsoredMessage">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
channel
InputChannel
 
random_id
bytes
 
Result
Bool
Possible errors
Code
Type
Description…">
<meta property="og:description" content="Informs the server that the user has either: - Clicked on a link in the sponsored message - Has opened a sponsored chat or a sponsored website via the associated button - Has opened the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message">
<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">
@ -72,7 +42,13 @@ Description…">
<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="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/channels.clickSponsoredMessage" >channels.clickSponsoredMessage</a></li></ul></div>
<h1 id="dev_page_title">channels.clickSponsoredMessage</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Informs the server that the user has either:</p>
<ul>
<li>Clicked on a link in the sponsored message</li>
<li>Has opened a sponsored chat or a sponsored website via the associated button</li>
<li>Has opened the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message</li>
</ul>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 164 <b class="caret"></b></a>
@ -101,12 +77,12 @@ Description…">
<tr>
<td><strong>channel</strong></td>
<td style="text-align: center;"><a href="/type/InputChannel">InputChannel</a></td>
<td> </td>
<td>Channel where the sponsored message was posted</td>
</tr>
<tr>
<td><strong>random_id</strong></td>
<td style="text-align: center;"><a href="/type/bytes">bytes</a></td>
<td> </td>
<td>Message ID</td>
</tr>
</tbody>
</table>

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 A4 76 09 00 2B 80 5E 65
0010 | 14 00 00 00 F1 8E 7E BE B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 54 37 03 00 E8 8D 5F 65
0010 | 14 00 00 00 F1 8E 7E BE 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7</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>A47609002B805E65</code></td>
<td><code>54370300E88D5F65</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>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,10 +104,10 @@
<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 88 74 87 2B 80 5E 65
0010 | 74 00 00 00 63 24 16 05 B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1
0030 | C6 97 0B 97 BE 0B 75 79 08 1F 3C DD F3 F5 5F F2
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 48 43 B9 E8 8D 5F 65
0010 | A8 00 00 00 63 24 16 05 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72
0030 | 16 DF 03 C6 A7 69 1B 17 08 1D 80 70 F5 A6 BF 12
0040 | AF 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>
@ -132,13 +132,13 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>018874872B805E65</code></td>
<td><code>014843B9E88D5F65</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>74000000</code> (116 in decimal)</td>
<td><code>A8000000</code> (168 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081F3CDDF3F55FF2AF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2250917953641902767</td>
<td><code>081D8070F5A6BF12AF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2125823224485712559</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 = 2250917953641902767</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2250917953641902767 = 1475963039 * 1525050353</code></p>
<pre><code>p = 1475963039
q = 1525050353</code></pre>
<pre><code>pq = 2125823224485712559</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2125823224485712559 = 1183354919 * 1796437561</code></p>
<pre><code>p = 1183354919
q = 1796437561</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 1F 3C DD F3 F5 5F F2 AF 00 00 00
0010 | 04 57 F9 68 9F 00 00 00 04 5A E6 6B F1 00 00 00
0020 | B9 77 20 53 8F F9 BE 7C 1C 0F 2D 85 09 9F E2 B2
0030 | B9 F1 49 F4 F7 59 81 C1 C6 97 0B 97 BE 0B 75 79
0040 | 1C A4 07 E6 67 EE 73 15 DC 50 68 74 45 55 AC 33
0050 | EE D3 35 45 5F 79 14 9A 13 34 B5 F5 65 84 5B EF
<pre><code>0000 | 95 5F F5 A9 08 1D 80 70 F5 A6 BF 12 AF 00 00 00
0010 | 04 46 88 90 27 00 00 00 04 6B 13 76 39 00 00 00
0020 | 42 15 54 56 11 32 BA CA F3 AF 34 0A 8B 83 39 C7
0030 | B3 5F 24 C3 B6 55 D7 72 16 DF 03 C6 A7 69 1B 17
0040 | 9F 28 86 38 6C 28 AD 10 5F C0 98 D8 20 DB A2 95
0050 | 33 67 BA ED A6 08 A4 19 D9 03 AC D4 22 7A 1A C4
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 = 1525050353</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081F3CDDF3F55FF2AF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2250917953641902767</td>
<td><code>081D8070F5A6BF12AF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2125823224485712559</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>0457F9689F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1475963039</td>
<td><code>0446889027000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1183354919</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>045AE66BF1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1525050353</td>
<td><code>046B137639000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1796437561</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>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>1CA407E667EE7315DC5068744555AC33</code> <code>EED335455F79149A1334B5F565845BEF</code></td>
<td><code>9F2886386C28AD105FC098D820DBA295</code> <code>3367BAEDA608A419D903ACD4227A1AC4</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1525050353</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 = 955FF5A9081F3CDDF3F55FF2AF0000000457F9689F000000045AE66BF1000000B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B75791CA407E667EE7315DC5068744555AC33EED335455F79149A1334B5F565845BEF02000000
random_padding_bytes = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF7689021475BEC462A9C82B5D3B057977305DE7300B840598F59AE5EC7EA1345C6187BF8B3988DAE77E834FCC8286ABE4E0C4054F4649CBDEE9364ACD8EEFE9DD1</code></pre>
<pre><code>data = 955FF5A9081D8070F5A6BF12AF0000000446889027000000046B137639000000421554561132BACAF3AF340A8B8339C7B35F24C3B655D77216DF03C6A7691B179F2886386C28AD105FC098D820DBA2953367BAEDA608A419D903ACD4227A1AC402000000
random_padding_bytes = 85E9DE2656389BB200E36DDE721493952C5FCE2A82A1E693D886428FEE5D9C85D6ABF807D6C4B2C9CA6170F7A91D1357502C7612E137A1D1FB8805B3089676531FA1A9F2D0CF500AE0553CB1BDE4FA8F45497374DA62FE80AC527C32</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 = 41DAD62847B39899E5614117FB1DBDFD1B3553B41165FB4E87FD5CBC4AD720542AE387B8E61471A867701DE9381B4893478A6E35420ED7502412083F49F05B92150DFB2B593CE346B3EB9927A55D7C4448C48810BDC71A5FDD63024D18013B66A14C35B23B748508EA04C2F2F23EC64A3EA0B2428E017774C24E031B4E612FD281AB68E9A80F3D2C44B5AD768FDF3DB6D756E7D90BF4C7EBFF1D9B3D40A6137980B75EB017D0ABA59459E6B0126E3F25055B0DE4F1A1043C573D4710160BFA549837668DF4B1BB8C50E67BEF4084AD4CCABFD76D6DC61FE43D8C386530293FD6E257E415695CDC40738BC634784EFEDA8913426904E142F157F418DF162679B0</code></pre>
<pre><code>encrypted_data = 3556F16DAED5EC360C17FBE90CD044BBA07A3153A031EA7CC6048E45060C07EDBE4DA11B48A94A00B4C99FBF91E7776C9371BB88D6C16B4B8E853853564C2AA475D6472856BFD0E1B8AB8A670524E01E1311F985318FDAAA54BE7B4A3715268E6C5C1BB5C3939EE1066F32C6417D413D7CF026E492BB26BF460A13E757BFF8560C6E1AAB4F99BBBAD8E00B62885417B400552B8AE28635A100614D6C89ECE97BCA021348B09D6FB96C10E03D35F52A7780A36E77C04EC06F45A9146BE739B4CF418FA32AEE778F5E69A8C26F0B1ADB78E597A01A67801DCF6821D6DCDF722A1E86BC026EE0BBEB3F1C9BAF98B232ABF96F7BD55A542A7A7A5CDD9B7516E91FC0</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 6C F9 0A 00 2B 80 5E 65
0010 | 40 01 00 00 BE E4 12 D7 B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1
0030 | C6 97 0B 97 BE 0B 75 79 04 57 F9 68 9F 00 00 00
0040 | 04 5A E6 6B F1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 41 DA D6 28 47 B3 98 99 E5 61 41 17
0060 | FB 1D BD FD 1B 35 53 B4 11 65 FB 4E 87 FD 5C BC
0070 | 4A D7 20 54 2A E3 87 B8 E6 14 71 A8 67 70 1D E9
0080 | 38 1B 48 93 47 8A 6E 35 42 0E D7 50 24 12 08 3F
0090 | 49 F0 5B 92 15 0D FB 2B 59 3C E3 46 B3 EB 99 27
00A0 | A5 5D 7C 44 48 C4 88 10 BD C7 1A 5F DD 63 02 4D
00B0 | 18 01 3B 66 A1 4C 35 B2 3B 74 85 08 EA 04 C2 F2
00C0 | F2 3E C6 4A 3E A0 B2 42 8E 01 77 74 C2 4E 03 1B
00D0 | 4E 61 2F D2 81 AB 68 E9 A8 0F 3D 2C 44 B5 AD 76
00E0 | 8F DF 3D B6 D7 56 E7 D9 0B F4 C7 EB FF 1D 9B 3D
00F0 | 40 A6 13 79 80 B7 5E B0 17 D0 AB A5 94 59 E6 B0
0100 | 12 6E 3F 25 05 5B 0D E4 F1 A1 04 3C 57 3D 47 10
0110 | 16 0B FA 54 98 37 66 8D F4 B1 BB 8C 50 E6 7B EF
0120 | 40 84 AD 4C CA BF D7 6D 6D C6 1F E4 3D 8C 38 65
0130 | 30 29 3F D6 E2 57 E4 15 69 5C DC 40 73 8B C6 34
0140 | 78 4E FE DA 89 13 42 69 04 E1 42 F1 57 F4 18 DF
0150 | 16 26 79 B0</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 E0 0E 05 00 E8 8D 5F 65
0010 | 40 01 00 00 BE E4 12 D7 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72
0030 | 16 DF 03 C6 A7 69 1B 17 04 46 88 90 27 00 00 00
0040 | 04 6B 13 76 39 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 35 56 F1 6D AE D5 EC 36 0C 17 FB E9
0060 | 0C D0 44 BB A0 7A 31 53 A0 31 EA 7C C6 04 8E 45
0070 | 06 0C 07 ED BE 4D A1 1B 48 A9 4A 00 B4 C9 9F BF
0080 | 91 E7 77 6C 93 71 BB 88 D6 C1 6B 4B 8E 85 38 53
0090 | 56 4C 2A A4 75 D6 47 28 56 BF D0 E1 B8 AB 8A 67
00A0 | 05 24 E0 1E 13 11 F9 85 31 8F DA AA 54 BE 7B 4A
00B0 | 37 15 26 8E 6C 5C 1B B5 C3 93 9E E1 06 6F 32 C6
00C0 | 41 7D 41 3D 7C F0 26 E4 92 BB 26 BF 46 0A 13 E7
00D0 | 57 BF F8 56 0C 6E 1A AB 4F 99 BB BA D8 E0 0B 62
00E0 | 88 54 17 B4 00 55 2B 8A E2 86 35 A1 00 61 4D 6C
00F0 | 89 EC E9 7B CA 02 13 48 B0 9D 6F B9 6C 10 E0 3D
0100 | 35 F5 2A 77 80 A3 6E 77 C0 4E C0 6F 45 A9 14 6B
0110 | E7 39 B4 CF 41 8F A3 2A EE 77 8F 5E 69 A8 C2 6F
0120 | 0B 1A DB 78 E5 97 A0 1A 67 80 1D CF 68 21 D6 DC
0130 | DF 72 2A 1E 86 BC 02 6E E0 BB EB 3F 1C 9B AF 98
0140 | B2 32 AB F9 6F 7B D5 5A 54 2A 7A 7A 5C DD 9B 75
0150 | 16 E9 1F C0</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 = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>6CF90A002B805E65</code></td>
<td><code>E00E0500E88D5F65</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 = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>0457F9689F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1475963039</td>
<td><code>0446889027000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1183354919</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>045AE66BF1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1525050353</td>
<td><code>046B137639000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1796437561</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 = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010041DAD62847B39899E5614117</code> <code>FB1DBDFD1B3553B41165FB4E87FD5CBC</code> <code>4AD720542AE387B8E61471A867701DE9</code> <code>381B4893478A6E35420ED7502412083F</code> <code>49F05B92150DFB2B593CE346B3EB9927</code> <code>A55D7C4448C48810BDC71A5FDD63024D</code> <code>18013B66A14C35B23B748508EA04C2F2</code> <code>F23EC64A3EA0B2428E017774C24E031B</code> <code>4E612FD281AB68E9A80F3D2C44B5AD76</code> <code>8FDF3DB6D756E7D90BF4C7EBFF1D9B3D</code> <code>40A6137980B75EB017D0ABA59459E6B0</code> <code>126E3F25055B0DE4F1A1043C573D4710</code> <code>160BFA549837668DF4B1BB8C50E67BEF</code> <code>4084AD4CCABFD76D6DC61FE43D8C3865</code> <code>30293FD6E257E415695CDC40738BC634</code> <code>784EFEDA8913426904E142F157F418DF</code><br> <code>162679B0</code></td>
<td><code>FE0001003556F16DAED5EC360C17FBE9</code> <code>0CD044BBA07A3153A031EA7CC6048E45</code> <code>060C07EDBE4DA11B48A94A00B4C99FBF</code> <code>91E7776C9371BB88D6C16B4B8E853853</code> <code>564C2AA475D6472856BFD0E1B8AB8A67</code> <code>0524E01E1311F985318FDAAA54BE7B4A</code> <code>3715268E6C5C1BB5C3939EE1066F32C6</code> <code>417D413D7CF026E492BB26BF460A13E7</code> <code>57BFF8560C6E1AAB4F99BBBAD8E00B62</code> <code>885417B400552B8AE28635A100614D6C</code> <code>89ECE97BCA021348B09D6FB96C10E03D</code> <code>35F52A7780A36E77C04EC06F45A9146B</code> <code>E739B4CF418FA32AEE778F5E69A8C26F</code> <code>0B1ADB78E597A01A67801DCF6821D6DC</code> <code>DF722A1E86BC026EE0BBEB3F1C9BAF98</code> <code>B232ABF96F7BD55A542A7A7A5CDD9B75</code><br> <code>16E91FC0</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<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 6C BC 21 2C 80 5E 65
0010 | E8 02 00 00 5C 07 E8 D0 B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1
0030 | C6 97 0B 97 BE 0B 75 79 FE 50 02 00 19 A9 47 72
0040 | D9 DF 71 D9 84 8C DC 10 AE 1C 1F 8A 82 E4 05 B0
0050 | 2C 4A 9C 80 06 7F 9C D2 64 E6 E8 2C 18 56 EC DE
0060 | 45 C2 81 15 E5 F8 7C FD C2 FC 19 32 40 A1 CD D2
0070 | 7D 0C FB 7A 46 67 58 2D 4C 17 FC 68 EF BE 09 4C
0080 | 1C 55 BD 09 FE 7E 86 E1 4E 33 0E 56 76 DC 88 A9
0090 | 1A 0C 40 1C 12 DC 97 A8 EF 8B 55 DE 00 66 00 4E
00A0 | B0 A6 95 E7 52 60 63 46 C4 3E 90 B6 94 21 BE 21
00B0 | C3 44 72 58 68 6C 21 DB 3A 8B 70 55 C9 BB E5 F3
00C0 | 04 83 05 9A F4 91 72 D1 BF 9E C1 AB 19 30 3A FD
00D0 | 9F E0 64 EE A9 A3 4C EA 9A 65 1B FE 2A A4 6F 0C
00E0 | 8F B7 8C 60 18 68 52 10 A2 00 A5 B3 50 C5 34 51
00F0 | 4D 00 F0 F6 AE A9 F3 A8 65 73 69 9B 80 CE 59 92
0100 | CD 5F 53 07 22 F3 5F A2 B2 55 1C CF B9 E6 F3 21
0110 | EE F4 6D FF 68 E5 10 A8 35 85 F3 04 DF 62 06 8B
0120 | 34 B5 CA B0 74 39 F8 5E 00 55 B5 BB 96 B9 E3 E5
0130 | A8 F5 1B 5C 12 84 C4 2D EC C5 FF 39 13 6D 74 90
0140 | 1A 4B 8A 29 4B 8F B7 1C 01 47 CD E0 7A 1F 10 E6
0150 | 1F DD B2 1B 7F 88 78 AB AF D6 AF 70 C0 2E 55 EF
0160 | 01 DF 46 C4 3A BA 72 E7 04 61 1E 35 B6 3B 8D 30
0170 | 87 B2 1D 04 F6 D8 36 45 2D 30 7A 64 B8 99 68 A1
0180 | E6 A6 7A 0E 3E 21 7D 61 ED 5B 5B B0 94 6D 5E 72
0190 | BE F7 73 BA 84 0A 77 FE F6 29 CD 2C 0C 47 02 15
01A0 | 77 1F EE 3B 21 A2 31 EB 50 9E 0A 93 B6 54 97 A4
01B0 | CF 16 4C CE 51 9B A2 35 7C A0 8D 61 60 F2 F0 B2
01C0 | 1F B8 71 53 EB 8F 00 D2 54 E7 D5 EF 50 37 4D 07
01D0 | 16 94 28 B6 E7 95 B6 94 FB 16 FF 7F 53 AE 0A F5
01E0 | DC E7 0E 0C 30 76 E2 52 62 F2 1B C8 38 9D 02 72
01F0 | 2B 05 13 C8 8E 3F C8 5B 75 3F 20 7F 12 B5 EB 98
0200 | 79 FC C3 EF F5 85 B3 91 57 7B 57 38 72 97 49 DD
0210 | 99 22 09 13 7A 5E 1F 0D C5 D7 B1 F1 33 C3 3B C8
0220 | BD DD E1 5E DD 41 BB 71 BE 72 E5 89 CA 84 AB E7
0230 | 9C DA A5 5A EA F5 66 FC 24 8B 81 6C 1F 6F 5D FA
0240 | 40 CA 09 3D F3 05 A6 CA 20 7B FD 88 A9 81 1F 77
0250 | 77 86 6C C2 85 82 25 3E A5 FE D7 C0 AE 77 B5 53
0260 | 43 36 EB 3E 13 F2 4C BE 88 6C 35 54 F5 6D 38 A3
0270 | 9A 71 1A 98 96 D5 7B 56 55 16 E5 59 87 0F 26 8C
0280 | 21 D0 84 F1 26 C8 64 21 2D 9C 73 A8</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A8 D8 53 E9 8D 5F 65
0010 | EC 02 00 00 5C 07 E8 D0 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72
0030 | 16 DF 03 C6 A7 69 1B 17 FE 50 02 00 D8 92 96 CA
0040 | 11 F3 06 4D F5 00 9B 34 6D A8 A8 BD E4 87 13 6C
0050 | 55 71 7C BE CB 56 19 F8 B4 20 22 21 EA 0A A9 E9
0060 | 4A A6 CF AB 38 CF 64 77 67 6D AF 68 C2 5C B6 DA
0070 | BD B7 37 1B E5 BD F0 EF 79 D1 0E D9 DD AB C8 3C
0080 | D7 D4 DC 92 F0 3C F7 1F 2B C9 46 A0 E0 13 0A 6A
0090 | B6 E2 DC DA 02 95 52 B5 E3 DE 3F 73 39 59 FB A5
00A0 | 5E 0B 96 1D 69 9E 7A 36 86 95 65 30 15 17 EF 89
00B0 | AF 39 4E D8 88 73 A0 20 4C E3 D3 E6 EA AD BE C1
00C0 | 8F B2 B7 A8 E3 89 5D D6 04 8C E3 EE E1 A4 A6 1E
00D0 | FD E1 6F 11 D0 19 72 A4 60 CE 8B 0E 11 21 24 DC
00E0 | 06 3D 8B 9B 7A 2F 96 70 55 B7 37 F2 39 D9 07 19
00F0 | B9 BF 13 E3 87 FD 76 92 64 B8 8F E4 A7 08 CE FD
0100 | E4 E0 FE C9 4C B7 24 2E E0 D3 DC EA FD 4D 5B 0C
0110 | A1 BD C1 73 E3 D1 31 2F B6 61 6C E1 5E 92 07 29
0120 | 3A 42 5F 95 58 1A E0 67 58 EF 7F 3D 29 B2 DC 44
0130 | 7F C1 2B 44 10 8E D5 20 09 C8 58 92 D7 FC FE 12
0140 | 23 3C D8 46 07 3B 9C FE 1E E3 D7 86 D2 EB B5 57
0150 | 3D 0F 01 27 0D 82 8C 6A 5B E8 99 07 AF 91 44 6D
0160 | 6D 22 C2 E5 0C 5B 8A 51 6B E2 90 05 2C 6F AC 9B
0170 | 41 1F D7 A1 8D A3 3B 36 DB 16 A4 86 33 B7 03 CC
0180 | 0C 6E 14 9A 56 5B EF 63 56 51 F8 2E 8A 61 19 BE
0190 | 7E 97 60 0B 40 AA 35 F7 2A 5E 34 B6 79 E6 2F 79
01A0 | 25 56 B3 89 C8 AC 3C B5 B8 CE 8A 49 52 88 69 10
01B0 | 0B 85 C1 70 F0 BF 8E 3A EE 64 4D 71 58 83 FA 08
01C0 | C2 13 36 AF 7F DC 79 22 85 81 9F 81 77 E1 78 90
01D0 | 1D 7C 58 83 87 8B 22 B1 A3 FD FE AD C8 37 7D 82
01E0 | F5 4C 21 30 3D A4 72 E0 C9 F4 44 9E 07 D7 A3 A2
01F0 | AE F4 6C 9F D0 12 91 88 0C C7 16 25 04 AA 8F A4
0200 | 21 B9 33 E0 36 35 71 B7 0B D7 62 86 33 F7 2B F8
0210 | 73 55 FF 44 45 CE 55 5D 85 2B C2 7C 3E 02 EB A5
0220 | EC BF 2A 2E 6E D6 C6 2C 71 DB 89 7C BD 42 29 90
0230 | 01 2A 30 4F 20 A6 A6 D1 69 6F 96 0E 31 A8 0B A8
0240 | 3F 34 1A FF B1 15 C9 E1 E2 25 48 F2 DC EC C4 2D
0250 | 18 7A 76 4E 43 0C AC 9F FE CB 95 47 3E 20 66 8B
0260 | 1B 22 E2 4D C2 7B 25 01 38 6B BD 1A 7F 8F 50 F7
0270 | 73 5D 66 AB 78 01 E0 F3 5C BD 8B F0 23 B2 87 99
0280 | 59 5A 17 8A 64 6B D1 7C 75 7F E4 6D</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 = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>016CBC212C805E65</code></td>
<td><code>01A8D853E98D5F65</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>E8020000</code> (744 in decimal)</td>
<td><code>EC020000</code> (748 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE50020019A94772D9DF71D9848CDC10</code> <code>AE1C1F8A82E405B02C4A9C80067F9CD2</code> <code>64E6E82C1856ECDE45C28115E5F87CFD</code> <code>C2FC193240A1CDD27D0CFB7A4667582D</code> <code>4C17FC68EFBE094C1C55BD09FE7E86E1</code> <code>4E330E5676DC88A91A0C401C12DC97A8</code> <code>EF8B55DE0066004EB0A695E752606346</code> <code>C43E90B69421BE21C3447258686C21DB</code> <code>3A8B7055C9BBE5F30483059AF49172D1</code> <code>BF9EC1AB19303AFD9FE064EEA9A34CEA</code> <code>9A651BFE2AA46F0C8FB78C6018685210</code> <code>A200A5B350C534514D00F0F6AEA9F3A8</code> <code>6573699B80CE5992CD5F530722F35FA2</code> <code>B2551CCFB9E6F321EEF46DFF68E510A8</code> <code>3585F304DF62068B34B5CAB07439F85E</code> <code>0055B5BB96B9E3E5A8F51B5C1284C42D</code> <code>ECC5FF39136D74901A4B8A294B8FB71C</code> <code>0147CDE07A1F10E61FDDB21B7F8878AB</code> <code>AFD6AF70C02E55EF01DF46C43ABA72E7</code> <code>04611E35B63B8D3087B21D04F6D83645</code> <code>2D307A64B89968A1E6A67A0E3E217D61</code> <code>ED5B5BB0946D5E72BEF773BA840A77FE</code> <code>F629CD2C0C470215771FEE3B21A231EB</code> <code>509E0A93B65497A4CF164CCE519BA235</code> <code>7CA08D6160F2F0B21FB87153EB8F00D2</code> <code>54E7D5EF50374D07169428B6E795B694</code> <code>FB16FF7F53AE0AF5DCE70E0C3076E252</code> <code>62F21BC8389D02722B0513C88E3FC85B</code> <code>753F207F12B5EB9879FCC3EFF585B391</code> <code>577B5738729749DD992209137A5E1F0D</code> <code>C5D7B1F133C33BC8BDDDE15EDD41BB71</code> <code>BE72E589CA84ABE79CDAA55AEAF566FC</code> <code>248B816C1F6F5DFA40CA093DF305A6CA</code> <code>207BFD88A9811F7777866CC28582253E</code> <code>A5FED7C0AE77B5534336EB3E13F24CBE</code> <code>886C3554F56D38A39A711A9896D57B56</code> <code>5516E559870F268C21D084F126C86421</code><br> <code>2D9C73A8</code></td>
<td><code>FE500200D89296CA11F3064DF5009B34</code> <code>6DA8A8BDE487136C55717CBECB5619F8</code> <code>B4202221EA0AA9E94AA6CFAB38CF6477</code> <code>676DAF68C25CB6DABDB7371BE5BDF0EF</code> <code>79D10ED9DDABC83CD7D4DC92F03CF71F</code> <code>2BC946A0E0130A6AB6E2DCDA029552B5</code> <code>E3DE3F733959FBA55E0B961D699E7A36</code> <code>869565301517EF89AF394ED88873A020</code> <code>4CE3D3E6EAADBEC18FB2B7A8E3895DD6</code> <code>048CE3EEE1A4A61EFDE16F11D01972A4</code> <code>60CE8B0E112124DC063D8B9B7A2F9670</code> <code>55B737F239D90719B9BF13E387FD7692</code> <code>64B88FE4A708CEFDE4E0FEC94CB7242E</code> <code>E0D3DCEAFD4D5B0CA1BDC173E3D1312F</code> <code>B6616CE15E9207293A425F95581AE067</code> <code>58EF7F3D29B2DC447FC12B44108ED520</code> <code>09C85892D7FCFE12233CD846073B9CFE</code> <code>1EE3D786D2EBB5573D0F01270D828C6A</code> <code>5BE89907AF91446D6D22C2E50C5B8A51</code> <code>6BE290052C6FAC9B411FD7A18DA33B36</code> <code>DB16A48633B703CC0C6E149A565BEF63</code> <code>5651F82E8A6119BE7E97600B40AA35F7</code> <code>2A5E34B679E62F792556B389C8AC3CB5</code> <code>B8CE8A49528869100B85C170F0BF8E3A</code> <code>EE644D715883FA08C21336AF7FDC7922</code> <code>85819F8177E178901D7C5883878B22B1</code> <code>A3FDFEADC8377D82F54C21303DA472E0</code> <code>C9F4449E07D7A3A2AEF46C9FD0129188</code> <code>0CC7162504AA8FA421B933E0363571B7</code> <code>0BD7628633F72BF87355FF4445CE555D</code> <code>852BC27C3E02EBA5ECBF2A2E6ED6C62C</code> <code>71DB897CBD422990012A304F20A6A6D1</code> <code>696F960E31A80BA83F341AFFB115C9E1</code> <code>E22548F2DCECC42D187A764E430CAC9F</code> <code>FECB95473E20668B1B22E24DC27B2501</code> <code>386BBD1A7F8F50F7735D66AB7801E0F3</code> <code>5CBD8BF023B28799595A178A646BD17C</code><br> <code>757FE46D</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 5BB8B2F6F15C2FCD6BDEF289F6EB65EC90BFA6C48C185F5D609B0FF76
<!-- 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 = 19A94772D9DF71D9848CDC10AE1C1F8A82E405B02C4A9C80067F9CD264E6E82C1856ECDE45C28115E5F87CFDC2FC193240A1CDD27D0CFB7A4667582D4C17FC68EFBE094C1C55BD09FE7E86E14E330E5676DC88A91A0C401C12DC97A8EF8B55DE0066004EB0A695E752606346C43E90B69421BE21C3447258686C21DB3A8B7055C9BBE5F30483059AF49172D1BF9EC1AB19303AFD9FE064EEA9A34CEA9A651BFE2AA46F0C8FB78C6018685210A200A5B350C534514D00F0F6AEA9F3A86573699B80CE5992CD5F530722F35FA2B2551CCFB9E6F321EEF46DFF68E510A83585F304DF62068B34B5CAB07439F85E0055B5BB96B9E3E5A8F51B5C1284C42DECC5FF39136D74901A4B8A294B8FB71C0147CDE07A1F10E61FDDB21B7F8878ABAFD6AF70C02E55EF01DF46C43ABA72E704611E35B63B8D3087B21D04F6D836452D307A64B89968A1E6A67A0E3E217D61ED5B5BB0946D5E72BEF773BA840A77FEF629CD2C0C470215771FEE3B21A231EB509E0A93B65497A4CF164CCE519BA2357CA08D6160F2F0B21FB87153EB8F00D254E7D5EF50374D07169428B6E795B694FB16FF7F53AE0AF5DCE70E0C3076E25262F21BC8389D02722B0513C88E3FC85B753F207F12B5EB9879FCC3EFF585B391577B5738729749DD992209137A5E1F0DC5D7B1F133C33BC8BDDDE15EDD41BB71BE72E589CA84ABE79CDAA55AEAF566FC248B816C1F6F5DFA40CA093DF305A6CA207BFD88A9811F7777866CC28582253EA5FED7C0AE77B5534336EB3E13F24CBE886C3554F56D38A39A711A9896D57B565516E559870F268C21D084F126C864212D9C73A8
tmp_aes_key = AA8882764BC26DFE930BE3FB9AA4E2184C5765AA0AA9595FF95C3E95A2284393
tmp_aes_iv = F6EA80B37B880959A2DAD4F084F26E88853A15B5BBC5F1FAC00383C91CA407E6</code></pre>
<pre><code>encrypted_answer = D89296CA11F3064DF5009B346DA8A8BDE487136C55717CBECB5619F8B4202221EA0AA9E94AA6CFAB38CF6477676DAF68C25CB6DABDB7371BE5BDF0EF79D10ED9DDABC83CD7D4DC92F03CF71F2BC946A0E0130A6AB6E2DCDA029552B5E3DE3F733959FBA55E0B961D699E7A36869565301517EF89AF394ED88873A0204CE3D3E6EAADBEC18FB2B7A8E3895DD6048CE3EEE1A4A61EFDE16F11D01972A460CE8B0E112124DC063D8B9B7A2F967055B737F239D90719B9BF13E387FD769264B88FE4A708CEFDE4E0FEC94CB7242EE0D3DCEAFD4D5B0CA1BDC173E3D1312FB6616CE15E9207293A425F95581AE06758EF7F3D29B2DC447FC12B44108ED52009C85892D7FCFE12233CD846073B9CFE1EE3D786D2EBB5573D0F01270D828C6A5BE89907AF91446D6D22C2E50C5B8A516BE290052C6FAC9B411FD7A18DA33B36DB16A48633B703CC0C6E149A565BEF635651F82E8A6119BE7E97600B40AA35F72A5E34B679E62F792556B389C8AC3CB5B8CE8A49528869100B85C170F0BF8E3AEE644D715883FA08C21336AF7FDC792285819F8177E178901D7C5883878B22B1A3FDFEADC8377D82F54C21303DA472E0C9F4449E07D7A3A2AEF46C9FD01291880CC7162504AA8FA421B933E0363571B70BD7628633F72BF87355FF4445CE555D852BC27C3E02EBA5ECBF2A2E6ED6C62C71DB897CBD422990012A304F20A6A6D1696F960E31A80BA83F341AFFB115C9E1E22548F2DCECC42D187A764E430CAC9FFECB95473E20668B1B22E24DC27B2501386BBD1A7F8F50F7735D66AB7801E0F35CBD8BF023B28799595A178A646BD17C757FE46D
tmp_aes_key = 162FB726AB8FEF45B1DCA7DCC00ACECCDEFB62C0B6210E15D8063ED42B80FD4A
tmp_aes_iv = 32132DB36A6E6398FF5B583EFD3FB86A009030F6DEF4E181DD9E8F779F288638</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 32998DCF6AF6467851C4C9A73FE906A83024D162BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008E277E51724573843F071F72D2ACAE8B5BCACD92CDEF10EBC446DBF6D6A2035AB7B9222DE61BBAF79960672300C4D4DCC2538A6490F0FBB861902124922A8F0B9A32CAD60010187048FBC5D5D53C858C4EF7BB24E65985B836D3A66A6462FD4EA04110D58E52468DD0C4CAFB92D8730F41DBC154FF965DBA85E22605225C5A17F1679E3C4E3DAF63EBF91DC2D65D340FC64F76A391E5C5A4AAE0A0BB3445521CCA868F5BDCDF8C42547684F4DF318564572D57FFA83E165C14B465527BA45C0109FD0F3720C0B0B3FE5907B3F74FD989FA0071D2E9327FA3961020854683A98E2B88F8F3112CA74E8834D4ADB0FDAADD8FBEF1057DC03D68E05C0338614725122C805E651DAAA8B0951CE4BD
answer = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008E277E51724573843F071F72D2ACAE8B5BCACD92CDEF10EBC446DBF6D6A2035AB7B9222DE61BBAF79960672300C4D4DCC2538A6490F0FBB861902124922A8F0B9A32CAD60010187048FBC5D5D53C858C4EF7BB24E65985B836D3A66A6462FD4EA04110D58E52468DD0C4CAFB92D8730F41DBC154FF965DBA85E22605225C5A17F1679E3C4E3DAF63EBF91DC2D65D340FC64F76A391E5C5A4AAE0A0BB3445521CCA868F5BDCDF8C42547684F4DF318564572D57FFA83E165C14B465527BA45C0109FD0F3720C0B0B3FE5907B3F74FD989FA0071D2E9327FA3961020854683A98E2B88F8F3112CA74E8834D4ADB0FDAADD8FBEF1057DC03D68E05C0338614725122C805E651DAAA8B0951CE4BD</code></pre>
<pre><code>answer_with_hash = 7489F46549FB4CFDF65B327005742029FECA9692BA0D89B5421554561132BACAF3AF340A8B8339C7B35F24C3B655D77216DF03C6A7691B1703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100180BC02AC43F20B237E4444C04BE32842390E3F7D52AFC906C03363531DF09592E77912D66DFD76D3D59565923ED77339CBBD3AFB28D2B91891148C5A1CD5A70B9979B7F0AC842633CBF2C2CFAE70DC8008B0FB120014495137CC6FD5C9C66C1175ED43F60586F1EE0AF4E5CFB00E527CE614A81081CCE842416BDBE408AC097BB0B7F8DDBDC047BA0D6F65CAAB64BA3F30FB389965482BA168C2094BF434A7F3E1113E44569C571A02C5B0A0552505C71374584295F4751161AFED6659F410EC80FB5228A2237390D92B8EA89FD63E8D50904FEA75D2A2BC3B0AA58F9C0D3496CA17D2FA90F145F2B9E321F09D1D1B4AD578371D22CA0B5C7D8B6D56543E460E98D5F65816661CB7FEEB14B
answer = BA0D89B5421554561132BACAF3AF340A8B8339C7B35F24C3B655D77216DF03C6A7691B1703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100180BC02AC43F20B237E4444C04BE32842390E3F7D52AFC906C03363531DF09592E77912D66DFD76D3D59565923ED77339CBBD3AFB28D2B91891148C5A1CD5A70B9979B7F0AC842633CBF2C2CFAE70DC8008B0FB120014495137CC6FD5C9C66C1175ED43F60586F1EE0AF4E5CFB00E527CE614A81081CCE842416BDBE408AC097BB0B7F8DDBDC047BA0D6F65CAAB64BA3F30FB389965482BA168C2094BF434A7F3E1113E44569C571A02C5B0A0552505C71374584295F4751161AFED6659F410EC80FB5228A2237390D92B8EA89FD63E8D50904FEA75D2A2BC3B0AA58F9C0D3496CA17D2FA90F145F2B9E321F09D1D1B4AD578371D22CA0B5C7D8B6D56543E460E98D5F65816661CB7FEEB14B</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 B9 77 20 53 8F F9 BE 7C 1C 0F 2D 85
0010 | 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1 C6 97 0B 97
0020 | BE 0B 75 79 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 42 15 54 56 11 32 BA CA F3 AF 34 0A
0010 | 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72 16 DF 03 C6
0020 | A7 69 1B 17 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 = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
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 | 8E 27 7E 51 72 45 73 84 3F 07 1F 72 D2 AC AE 8B
0140 | 5B CA CD 92 CD EF 10 EB C4 46 DB F6 D6 A2 03 5A
0150 | B7 B9 22 2D E6 1B BA F7 99 60 67 23 00 C4 D4 DC
0160 | C2 53 8A 64 90 F0 FB B8 61 90 21 24 92 2A 8F 0B
0170 | 9A 32 CA D6 00 10 18 70 48 FB C5 D5 D5 3C 85 8C
0180 | 4E F7 BB 24 E6 59 85 B8 36 D3 A6 6A 64 62 FD 4E
0190 | A0 41 10 D5 8E 52 46 8D D0 C4 CA FB 92 D8 73 0F
01A0 | 41 DB C1 54 FF 96 5D BA 85 E2 26 05 22 5C 5A 17
01B0 | F1 67 9E 3C 4E 3D AF 63 EB F9 1D C2 D6 5D 34 0F
01C0 | C6 4F 76 A3 91 E5 C5 A4 AA E0 A0 BB 34 45 52 1C
01D0 | CA 86 8F 5B DC DF 8C 42 54 76 84 F4 DF 31 85 64
01E0 | 57 2D 57 FF A8 3E 16 5C 14 B4 65 52 7B A4 5C 01
01F0 | 09 FD 0F 37 20 C0 B0 B3 FE 59 07 B3 F7 4F D9 89
0200 | FA 00 71 D2 E9 32 7F A3 96 10 20 85 46 83 A9 8E
0210 | 2B 88 F8 F3 11 2C A7 4E 88 34 D4 AD B0 FD AA DD
0220 | 8F BE F1 05 7D C0 3D 68 E0 5C 03 38 61 47 25 12
0230 | 2C 80 5E 65</code></pre>
0130 | 18 0B C0 2A C4 3F 20 B2 37 E4 44 4C 04 BE 32 84
0140 | 23 90 E3 F7 D5 2A FC 90 6C 03 36 35 31 DF 09 59
0150 | 2E 77 91 2D 66 DF D7 6D 3D 59 56 59 23 ED 77 33
0160 | 9C BB D3 AF B2 8D 2B 91 89 11 48 C5 A1 CD 5A 70
0170 | B9 97 9B 7F 0A C8 42 63 3C BF 2C 2C FA E7 0D C8
0180 | 00 8B 0F B1 20 01 44 95 13 7C C6 FD 5C 9C 66 C1
0190 | 17 5E D4 3F 60 58 6F 1E E0 AF 4E 5C FB 00 E5 27
01A0 | CE 61 4A 81 08 1C CE 84 24 16 BD BE 40 8A C0 97
01B0 | BB 0B 7F 8D DB DC 04 7B A0 D6 F6 5C AA B6 4B A3
01C0 | F3 0F B3 89 96 54 82 BA 16 8C 20 94 BF 43 4A 7F
01D0 | 3E 11 13 E4 45 69 C5 71 A0 2C 5B 0A 05 52 50 5C
01E0 | 71 37 45 84 29 5F 47 51 16 1A FE D6 65 9F 41 0E
01F0 | C8 0F B5 22 8A 22 37 39 0D 92 B8 EA 89 FD 63 E8
0200 | D5 09 04 FE A7 5D 2A 2B C3 B0 AA 58 F9 C0 D3 49
0210 | 6C A1 7D 2F A9 0F 14 5F 2B 9E 32 1F 09 D1 D1 B4
0220 | AD 57 83 71 D2 2C A0 B5 C7 D8 B6 D5 65 43 E4 60
0230 | E9 8D 5F 65</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 = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001008E277E51724573843F071F72</code> <code>D2ACAE8B5BCACD92CDEF10EBC446DBF6</code> <code>D6A2035AB7B9222DE61BBAF799606723</code> <code>00C4D4DCC2538A6490F0FBB861902124</code> <code>922A8F0B9A32CAD60010187048FBC5D5</code> <code>D53C858C4EF7BB24E65985B836D3A66A</code> <code>6462FD4EA04110D58E52468DD0C4CAFB</code> <code>92D8730F41DBC154FF965DBA85E22605</code> <code>225C5A17F1679E3C4E3DAF63EBF91DC2</code> <code>D65D340FC64F76A391E5C5A4AAE0A0BB</code> <code>3445521CCA868F5BDCDF8C42547684F4</code> <code>DF318564572D57FFA83E165C14B46552</code> <code>7BA45C0109FD0F3720C0B0B3FE5907B3</code> <code>F74FD989FA0071D2E9327FA396102085</code> <code>4683A98E2B88F8F3112CA74E8834D4AD</code> <code>B0FDAADD8FBEF1057DC03D68E05C0338</code><br> <code>61472512</code></td>
<td><code>FE000100180BC02AC43F20B237E4444C</code> <code>04BE32842390E3F7D52AFC906C033635</code> <code>31DF09592E77912D66DFD76D3D595659</code> <code>23ED77339CBBD3AFB28D2B91891148C5</code> <code>A1CD5A70B9979B7F0AC842633CBF2C2C</code> <code>FAE70DC8008B0FB120014495137CC6FD</code> <code>5C9C66C1175ED43F60586F1EE0AF4E5C</code> <code>FB00E527CE614A81081CCE842416BDBE</code> <code>408AC097BB0B7F8DDBDC047BA0D6F65C</code> <code>AAB64BA3F30FB389965482BA168C2094</code> <code>BF434A7F3E1113E44569C571A02C5B0A</code> <code>0552505C71374584295F4751161AFED6</code> <code>659F410EC80FB5228A2237390D92B8EA</code> <code>89FD63E8D50904FEA75D2A2BC3B0AA58</code> <code>F9C0D3496CA17D2FA90F145F2B9E321F</code> <code>09D1D1B4AD578371D22CA0B5C7D8B6D5</code><br> <code>6543E460</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>2C805E65</code> (1700692012 in decimal)</td>
<td><code>E98D5F65</code> (1700761065 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
<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 = 87DA6F6F3B4A7E0410514BD4842AEEDCE3CCD5D48F1DEDCF9FE4B40D26C54B801DA831774F7AAEABAFF900F17316615D91C80CED7EF7AD6B1EC6BF1D3DE93171C4CDE593B6F3FC56FD55DA1D446CB56F9C0842097DA51DFAF605B7D1694FC8AF1BAD75E6C14D10F557EE08A7B2976D6F2550B3A6F57C12A37EB7A623A465D283976FE30DC5ACBB0DE415996A0806130BBED0513647B03DDEEC52D7AFAC236416AF62E98C5774DE1845E16C1238BC09711A323C57A5B19671095B9C327022A760A156913735B39AD8D181DDB527F56DD97B59AABB1BDBCE6A8DC57222D3811C70E7CE84B32B1B729F52A3CD27CFE994734FE0559BC54A8042EADF70C418296BCB</code></pre>
<pre><code>b = AA1D92BAD27603BE7565F8366ECBE6C30C40DC0D155B4EAA221F2E7E4A062FEB423A460C35977B51F3CFED6E9F9967EAAFE87834ED0FC5E578AD919F11FE5A4059C8768F4D5270C046B2403059E77FE50B837D06B987923C69A39DFB176D9140A5EB5F417D2DCCA98B5DE3225DD875A451CE0B1138FB3785E21B3C980C75D0615F42A732E2CF9D6ED5633D70ECAD89A15DE8EE1FFB1D9E68D098CA72482CD7B51EBFAC07E100CC3A601121AB669BDF47FF56332D4A8557D14EE5A4A7F1F2CE7B51584F96C85682039524F747F862DE8A419595B51E7119E59E1431782315457AEBFE8BD5013952FDEB65D18391F9B40E644C376760E2FAE7BBA9EADF9E32575F</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 = B845C908C2DD4A0A4D8DBB9636A32956ED87ACEBE67F864A5AC9E10F3D38F536A5F6C9BE77EF95A5E306D37C770ECC4551E8738E1F2CBBD4230139F21B143484C4EAEFB1B93120335461F34FE7BCDF38D4E481E025B2D626557B7AEBBE40275A1C05753AFADEF12F7851D06509F6282F3FD1EA225B5AA24A953FFAC11A26967DD3235C359465F0994539D19CD76EB5554D650A6B739C04E805963517877487E580FA3AD1BC38EF84A2EAAA5D057C89B19F6B26E39452BF0D2AB11D68FB16DA6D1DF9F485DC977F25A9FE974B25C9F875FD532E249307E29FB8A05A239A2B31DD8AE2B1C2D0E0625DEA4E60E006FE83C3C3454B463B38903A8F2F13A297C7080C</code></pre>
<pre><code>g_b = C0C2779D7F456486DD6EC4DEE52DECC9B7E165FF077239AD757881405F7DCB9E8583F768D3886D2033B6279A7EBC2DF1AF55705D5A1F9B9B07B1221E4FFDFD0CD2DA5FCB6314C9CE223E4472036FF4006A8FF6F82D4656F9C65E48385B7D72265B0D41EFC5C7FF7DFE27C506CF3C6C94479E0B97573DCD6A1EF77ED339EC6E251EC4DDDC933161118B40FA55B37CCF2E8D14C6CF10BC7D62B512FBED1FABBF3D247186C533D400543A52496CC0498B677A489D6E41FEC12C69D3E0CC2D3DDBB4FA52E41F920780595CCC574E2076C2B209F79A549FB2671B6260D728140440B3A7F1939C33FCD62C287C0810165AC3DF971CDDB6928F86B20C7CA57EDB578A</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 B9 77 20 53 8F F9 BE 7C 1C 0F 2D 85
0010 | 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1 C6 97 0B 97
0020 | BE 0B 75 79 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | B8 45 C9 08 C2 DD 4A 0A 4D 8D BB 96 36 A3 29 56
0040 | ED 87 AC EB E6 7F 86 4A 5A C9 E1 0F 3D 38 F5 36
0050 | A5 F6 C9 BE 77 EF 95 A5 E3 06 D3 7C 77 0E CC 45
0060 | 51 E8 73 8E 1F 2C BB D4 23 01 39 F2 1B 14 34 84
0070 | C4 EA EF B1 B9 31 20 33 54 61 F3 4F E7 BC DF 38
0080 | D4 E4 81 E0 25 B2 D6 26 55 7B 7A EB BE 40 27 5A
0090 | 1C 05 75 3A FA DE F1 2F 78 51 D0 65 09 F6 28 2F
00A0 | 3F D1 EA 22 5B 5A A2 4A 95 3F FA C1 1A 26 96 7D
00B0 | D3 23 5C 35 94 65 F0 99 45 39 D1 9C D7 6E B5 55
00C0 | 4D 65 0A 6B 73 9C 04 E8 05 96 35 17 87 74 87 E5
00D0 | 80 FA 3A D1 BC 38 EF 84 A2 EA AA 5D 05 7C 89 B1
00E0 | 9F 6B 26 E3 94 52 BF 0D 2A B1 1D 68 FB 16 DA 6D
00F0 | 1D F9 F4 85 DC 97 7F 25 A9 FE 97 4B 25 C9 F8 75
0100 | FD 53 2E 24 93 07 E2 9F B8 A0 5A 23 9A 2B 31 DD
0110 | 8A E2 B1 C2 D0 E0 62 5D EA 4E 60 E0 06 FE 83 C3
0120 | C3 45 4B 46 3B 38 90 3A 8F 2F 13 A2 97 C7 08 0C</code></pre>
<pre><code>0000 | 54 B6 43 66 42 15 54 56 11 32 BA CA F3 AF 34 0A
0010 | 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72 16 DF 03 C6
0020 | A7 69 1B 17 00 00 00 00 00 00 00 00 FE FF 00 00
0030 | C0 C2 77 9D 7F 45 64 86 DD 6E C4 DE E5 2D EC C9
0040 | B7 E1 65 FF 07 72 39 AD 75 78 81 40 5F 7D CB 9E
0050 | 85 83 F7 68 D3 88 6D 20 33 B6 27 9A 7E BC 2D F1
0060 | AF 55 70 5D 5A 1F 9B 9B 07 B1 22 1E 4F FD FD 0C
0070 | D2 DA 5F CB 63 14 C9 CE 22 3E 44 72 03 6F F4 00
0080 | 6A 8F F6 F8 2D 46 56 F9 C6 5E 48 38 5B 7D 72 26
0090 | 5B 0D 41 EF C5 C7 FF 7D FE 27 C5 06 CF 3C 6C 94
00A0 | 47 9E 0B 97 57 3D CD 6A 1E F7 7E D3 39 EC 6E 25
00B0 | 1E C4 DD DC 93 31 61 11 8B 40 FA 55 B3 7C CF 2E
00C0 | 8D 14 C6 CF 10 BC 7D 62 B5 12 FB ED 1F AB BF 3D
00D0 | 24 71 86 C5 33 D4 00 54 3A 52 49 6C C0 49 8B 67
00E0 | 7A 48 9D 6E 41 FE C1 2C 69 D3 E0 CC 2D 3D DB B4
00F0 | FA 52 E4 1F 92 07 80 59 5C CC 57 4E 20 76 C2 B2
0100 | 09 F7 9A 54 9F B2 67 1B 62 60 D7 28 14 04 40 B3
0110 | A7 F1 93 9C 33 FC D6 2C 28 7C 08 10 16 5A C3 DF
0120 | 97 1C DD B6 92 8F 86 B2 0C 7C A5 7E DB 57 8A 00</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 = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE000100B845C908C2DD4A0A4D8DBB96</code> <code>36A32956ED87ACEBE67F864A5AC9E10F</code> <code>3D38F536A5F6C9BE77EF95A5E306D37C</code> <code>770ECC4551E8738E1F2CBBD4230139F2</code> <code>1B143484C4EAEFB1B93120335461F34F</code> <code>E7BCDF38D4E481E025B2D626557B7AEB</code> <code>BE40275A1C05753AFADEF12F7851D065</code> <code>09F6282F3FD1EA225B5AA24A953FFAC1</code> <code>1A26967DD3235C359465F0994539D19C</code> <code>D76EB5554D650A6B739C04E805963517</code> <code>877487E580FA3AD1BC38EF84A2EAAA5D</code> <code>057C89B19F6B26E39452BF0D2AB11D68</code> <code>FB16DA6D1DF9F485DC977F25A9FE974B</code> <code>25C9F875FD532E249307E29FB8A05A23</code> <code>9A2B31DD8AE2B1C2D0E0625DEA4E60E0</code> <code>06FE83C3C3454B463B38903A8F2F13A2</code><br> <code>97C7080C</code></td>
<td><code>FEFF0000C0C2779D7F456486DD6EC4DE</code> <code>E52DECC9B7E165FF077239AD75788140</code> <code>5F7DCB9E8583F768D3886D2033B6279A</code> <code>7EBC2DF1AF55705D5A1F9B9B07B1221E</code> <code>4FFDFD0CD2DA5FCB6314C9CE223E4472</code> <code>036FF4006A8FF6F82D4656F9C65E4838</code> <code>5B7D72265B0D41EFC5C7FF7DFE27C506</code> <code>CF3C6C94479E0B97573DCD6A1EF77ED3</code> <code>39EC6E251EC4DDDC933161118B40FA55</code> <code>B37CCF2E8D14C6CF10BC7D62B512FBED</code> <code>1FABBF3D247186C533D400543A52496C</code> <code>C0498B677A489D6E41FEC12C69D3E0CC</code> <code>2D3DDBB4FA52E41F920780595CCC574E</code> <code>2076C2B209F79A549FB2671B6260D728</code> <code>140440B3A7F1939C33FCD62C287C0810</code> <code>165AC3DF971CDDB6928F86B20C7CA57E</code><br> <code>DB578A00</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 = BA0D89B5B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B757
<!-- 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 = 54B64366B97720538FF9BE7C1C0F2D85099FE2B2B9F149F4F75981C1C6970B97BE0B75790000000000000000FE000100B845C908C2DD4A0A4D8DBB9636A32956ED87ACEBE67F864A5AC9E10F3D38F536A5F6C9BE77EF95A5E306D37C770ECC4551E8738E1F2CBBD4230139F21B143484C4EAEFB1B93120335461F34FE7BCDF38D4E481E025B2D626557B7AEBBE40275A1C05753AFADEF12F7851D06509F6282F3FD1EA225B5AA24A953FFAC11A26967DD3235C359465F0994539D19CD76EB5554D650A6B739C04E805963517877487E580FA3AD1BC38EF84A2EAAA5D057C89B19F6B26E39452BF0D2AB11D68FB16DA6D1DF9F485DC977F25A9FE974B25C9F875FD532E249307E29FB8A05A239A2B31DD8AE2B1C2D0E0625DEA4E60E006FE83C3C3454B463B38903A8F2F13A297C7080C
padding = 35BCD6E492AA8C344652AD3F
tmp_aes_key = AA8882764BC26DFE930BE3FB9AA4E2184C5765AA0AA9595FF95C3E95A2284393
tmp_aes_iv = F6EA80B37B880959A2DAD4F084F26E88853A15B5BBC5F1FAC00383C91CA407E6</code></pre>
<pre><code>data = 54B64366421554561132BACAF3AF340A8B8339C7B35F24C3B655D77216DF03C6A7691B170000000000000000FEFF0000C0C2779D7F456486DD6EC4DEE52DECC9B7E165FF077239AD757881405F7DCB9E8583F768D3886D2033B6279A7EBC2DF1AF55705D5A1F9B9B07B1221E4FFDFD0CD2DA5FCB6314C9CE223E4472036FF4006A8FF6F82D4656F9C65E48385B7D72265B0D41EFC5C7FF7DFE27C506CF3C6C94479E0B97573DCD6A1EF77ED339EC6E251EC4DDDC933161118B40FA55B37CCF2E8D14C6CF10BC7D62B512FBED1FABBF3D247186C533D400543A52496CC0498B677A489D6E41FEC12C69D3E0CC2D3DDBB4FA52E41F920780595CCC574E2076C2B209F79A549FB2671B6260D728140440B3A7F1939C33FCD62C287C0810165AC3DF971CDDB6928F86B20C7CA57EDB578A00
padding = FB7A77388CCA857E52B79D7E
tmp_aes_key = 162FB726AB8FEF45B1DCA7DCC00ACECCDEFB62C0B6210E15D8063ED42B80FD4A
tmp_aes_iv = 32132DB36A6E6398FF5B583EFD3FB86A009030F6DEF4E181DD9E8F779F288638</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 = 14BBD880C1BCA4F77973155171EDE459AB79622D0D8C94650735263F5A4C0CA5D53B67FFB09582FEB8560D68883847758F87CFB8688644530B9E5E2714E8516733FAC4D9519ACF9A2ACCFE84E28D3570E0BF876D2F4B8FEE1E8CADA5971A51D8D4072272625F5D0B620BACEDF75206226D67806554A04388C6FDE44C082707F18FF649A9410BE0E3026ED9819982F445CD13AB8FB1AA1AFC83E843C9BB7D1ECB49FDB2536BD68EB7AC236105EFDF7FF22CADFBC4388F267129ED57F45781FBFE70CC128F64A8ABB468D25D9ADEA3A06DB11BE49606B8B43BCFCF871D5C5751F43F051605E39519371101967F6F772D4EDB9CA06A14FBB8807AFF5AAB0A36CD13299BFACF02B8503664511059C919B8D590F51749787415B1A26A28869B351FED9F59F7D6E0F45DD884962E3EF7817F9F59E96EED43DD38D82727E63894288CD20175371B0AE49F96C71326C84ED6A305</code></pre>
<pre><code>encrypted_data = 934BE6E9DB7F6551DA393AB34278EF60CB8779450221882921966F76355D75E64D26C1F88703BAD19FACAFB84B5C26DEFE4DB0E1B61CA0F2DF76D02A591F73A51175DC8F7191A0CFD55C2F0E24AEA62278668EC5EFA0BABB0DBE42693AACD96F4F24461962B0F1CD1F885AACAA6FCF29DD0F22B77D137C6349D8AC8FBEAA3671CE64D2D27D76B25BD4C15EE2AFFA60443F6DDD38BB2134332BEAABD09BB1206F30EE14ACA8489AA0CB7A8BC2AE3391A63048912A9E04C653F9B28CEB8FD70381D6C10650CD19EC5C8E5893A7A7FA8E136AFD031747D2E6B74121744C9F7CA65568E527B66D2BAE30CD1C92368DEC7D9C911A3E797B83157DA2645518EF2810015A11D5406758909613B75B1E94E1A2DA677BDFC3373B871AB6988B6BCBD56D21037CEE5C0E1D356FB5655F288576D962A5F7BFBD242B994B8E5277EC735B6D6BB8BF2598447F17A07E33990CE1E3D1A1</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 50 74 01 00 2C 80 5E 65
0010 | 78 01 00 00 1F 5F 04 F5 B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1
0030 | C6 97 0B 97 BE 0B 75 79 FE 50 01 00 14 BB D8 80
0040 | C1 BC A4 F7 79 73 15 51 71 ED E4 59 AB 79 62 2D
0050 | 0D 8C 94 65 07 35 26 3F 5A 4C 0C A5 D5 3B 67 FF
0060 | B0 95 82 FE B8 56 0D 68 88 38 47 75 8F 87 CF B8
0070 | 68 86 44 53 0B 9E 5E 27 14 E8 51 67 33 FA C4 D9
0080 | 51 9A CF 9A 2A CC FE 84 E2 8D 35 70 E0 BF 87 6D
0090 | 2F 4B 8F EE 1E 8C AD A5 97 1A 51 D8 D4 07 22 72
00A0 | 62 5F 5D 0B 62 0B AC ED F7 52 06 22 6D 67 80 65
00B0 | 54 A0 43 88 C6 FD E4 4C 08 27 07 F1 8F F6 49 A9
00C0 | 41 0B E0 E3 02 6E D9 81 99 82 F4 45 CD 13 AB 8F
00D0 | B1 AA 1A FC 83 E8 43 C9 BB 7D 1E CB 49 FD B2 53
00E0 | 6B D6 8E B7 AC 23 61 05 EF DF 7F F2 2C AD FB C4
00F0 | 38 8F 26 71 29 ED 57 F4 57 81 FB FE 70 CC 12 8F
0100 | 64 A8 AB B4 68 D2 5D 9A DE A3 A0 6D B1 1B E4 96
0110 | 06 B8 B4 3B CF CF 87 1D 5C 57 51 F4 3F 05 16 05
0120 | E3 95 19 37 11 01 96 7F 6F 77 2D 4E DB 9C A0 6A
0130 | 14 FB B8 80 7A FF 5A AB 0A 36 CD 13 29 9B FA CF
0140 | 02 B8 50 36 64 51 10 59 C9 19 B8 D5 90 F5 17 49
0150 | 78 74 15 B1 A2 6A 28 86 9B 35 1F ED 9F 59 F7 D6
0160 | E0 F4 5D D8 84 96 2E 3E F7 81 7F 9F 59 E9 6E ED
0170 | 43 DD 38 D8 27 27 E6 38 94 28 8C D2 01 75 37 1B
0180 | 0A E4 9F 96 C7 13 26 C8 4E D6 A3 05</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 A8 BD 05 00 E9 8D 5F 65
0010 | 78 01 00 00 1F 5F 04 F5 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72
0030 | 16 DF 03 C6 A7 69 1B 17 FE 50 01 00 93 4B E6 E9
0040 | DB 7F 65 51 DA 39 3A B3 42 78 EF 60 CB 87 79 45
0050 | 02 21 88 29 21 96 6F 76 35 5D 75 E6 4D 26 C1 F8
0060 | 87 03 BA D1 9F AC AF B8 4B 5C 26 DE FE 4D B0 E1
0070 | B6 1C A0 F2 DF 76 D0 2A 59 1F 73 A5 11 75 DC 8F
0080 | 71 91 A0 CF D5 5C 2F 0E 24 AE A6 22 78 66 8E C5
0090 | EF A0 BA BB 0D BE 42 69 3A AC D9 6F 4F 24 46 19
00A0 | 62 B0 F1 CD 1F 88 5A AC AA 6F CF 29 DD 0F 22 B7
00B0 | 7D 13 7C 63 49 D8 AC 8F BE AA 36 71 CE 64 D2 D2
00C0 | 7D 76 B2 5B D4 C1 5E E2 AF FA 60 44 3F 6D DD 38
00D0 | BB 21 34 33 2B EA AB D0 9B B1 20 6F 30 EE 14 AC
00E0 | A8 48 9A A0 CB 7A 8B C2 AE 33 91 A6 30 48 91 2A
00F0 | 9E 04 C6 53 F9 B2 8C EB 8F D7 03 81 D6 C1 06 50
0100 | CD 19 EC 5C 8E 58 93 A7 A7 FA 8E 13 6A FD 03 17
0110 | 47 D2 E6 B7 41 21 74 4C 9F 7C A6 55 68 E5 27 B6
0120 | 6D 2B AE 30 CD 1C 92 36 8D EC 7D 9C 91 1A 3E 79
0130 | 7B 83 15 7D A2 64 55 18 EF 28 10 01 5A 11 D5 40
0140 | 67 58 90 96 13 B7 5B 1E 94 E1 A2 DA 67 7B DF C3
0150 | 37 3B 87 1A B6 98 8B 6B CB D5 6D 21 03 7C EE 5C
0160 | 0E 1D 35 6F B5 65 5F 28 85 76 D9 62 A5 F7 BF BD
0170 | 24 2B 99 4B 8E 52 77 EC 73 5B 6D 6B B8 BF 25 98
0180 | 44 7F 17 A0 7E 33 99 0C E1 E3 D1 A1</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>507401002C805E65</code></td>
<td><code>A8BD0500E98D5F65</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>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010014BBD880C1BCA4F779731551</code> <code>71EDE459AB79622D0D8C94650735263F</code> <code>5A4C0CA5D53B67FFB09582FEB8560D68</code> <code>883847758F87CFB8688644530B9E5E27</code> <code>14E8516733FAC4D9519ACF9A2ACCFE84</code> <code>E28D3570E0BF876D2F4B8FEE1E8CADA5</code> <code>971A51D8D4072272625F5D0B620BACED</code> <code>F75206226D67806554A04388C6FDE44C</code> <code>082707F18FF649A9410BE0E3026ED981</code> <code>9982F445CD13AB8FB1AA1AFC83E843C9</code> <code>BB7D1ECB49FDB2536BD68EB7AC236105</code> <code>EFDF7FF22CADFBC4388F267129ED57F4</code> <code>5781FBFE70CC128F64A8ABB468D25D9A</code> <code>DEA3A06DB11BE49606B8B43BCFCF871D</code> <code>5C5751F43F051605E39519371101967F</code> <code>6F772D4EDB9CA06A14FBB8807AFF5AAB</code> <code>0A36CD13299BFACF02B8503664511059</code> <code>C919B8D590F51749787415B1A26A2886</code> <code>9B351FED9F59F7D6E0F45DD884962E3E</code> <code>F7817F9F59E96EED43DD38D82727E638</code> <code>94288CD20175371B0AE49F96C71326C8</code><br> <code>4ED6A305</code></td>
<td><code>FE500100934BE6E9DB7F6551DA393AB3</code> <code>4278EF60CB8779450221882921966F76</code> <code>355D75E64D26C1F88703BAD19FACAFB8</code> <code>4B5C26DEFE4DB0E1B61CA0F2DF76D02A</code> <code>591F73A51175DC8F7191A0CFD55C2F0E</code> <code>24AEA62278668EC5EFA0BABB0DBE4269</code> <code>3AACD96F4F24461962B0F1CD1F885AAC</code> <code>AA6FCF29DD0F22B77D137C6349D8AC8F</code> <code>BEAA3671CE64D2D27D76B25BD4C15EE2</code> <code>AFFA60443F6DDD38BB2134332BEAABD0</code> <code>9BB1206F30EE14ACA8489AA0CB7A8BC2</code> <code>AE3391A63048912A9E04C653F9B28CEB</code> <code>8FD70381D6C10650CD19EC5C8E5893A7</code> <code>A7FA8E136AFD031747D2E6B74121744C</code> <code>9F7CA65568E527B66D2BAE30CD1C9236</code> <code>8DEC7D9C911A3E797B83157DA2645518</code> <code>EF2810015A11D5406758909613B75B1E</code> <code>94E1A2DA677BDFC3373B871AB6988B6B</code> <code>CBD56D21037CEE5C0E1D356FB5655F28</code> <code>8576D962A5F7BFBD242B994B8E5277EC</code> <code>735B6D6BB8BF2598447F17A07E33990C</code><br> <code>E1E3D1A1</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 = 683DD344B42333A5133E63D191F6D221FEFF3F9D42FB37D04AAEFB110C0154E48961C5E8B29AA81395A3C1EB22F0B4A4E3645AEC999BEF182B0AB22E306B9943D7B224E62C5B312E3EFA944B1FE9447B09D514D1E5728C9AA720446A39ECE1916A5938C14A92332616168FC5F7AEBBD3F1708BA740F481F246FBA323EFF851D4319A9CDF176E516FB122184C821212B723F6FF6ECC6BD0CF46305110E11657FEF8CE0B98A2D9031C9AF734FA08F06D2B7CB0792F819BB4F6B176C10C9663527647D6291313CAF2F74F8C6B4E468DF0FD52A7A625B412E43021AECC44B8493384EFA18137D438CA65FD3CDE8861E5F8EF49398A2F9DF0270E5AEA0A053AF9C88A</code></pre>
<pre><code>auth_key = A0D00939EF00E4D93E94F572C2266C4693646EC1A0FADE668C6A6C2BE26ECD4445700D4A32EE3C727EF5CC2E25B43A84A75342960801816C70EE797C62B205828D56FC2DB2DAF3BAD0397D064D8189523034FF2D905741C6C5EC2F029F9107F1CCEE5B0DCD25BC8F943F9C41252777ABA39BFD74294474FF42D19C42000380F2876707B1C8D6E856247B05EAA0F34028FECD59EE6B2F93A2381E2715454F0DB83EB6B4D71973A25924FECD2D4120342922F8AFD842CB1DB7D0424ECB20CB0DDE23AB4931F89BA2C4612E4B6780810EE05821635F9E2302A5C504DB38448D9B4A4259A0D7E47606B9C575687A59A0795FB8EA3C8976FC83E706EEA58CE7B51C63</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 E0 C6 78 2C 80 5E 65
0010 | 80 00 00 00 34 F7 CB 3B B9 77 20 53 8F F9 BE 7C
0020 | 1C 0F 2D 85 09 9F E2 B2 B9 F1 49 F4 F7 59 81 C1
0030 | C6 97 0B 97 BE 0B 75 79 32 E5 26 89 0C 8A 31 E2
0040 | 38 DA BA FF BE 43 C9 29</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B4 B8 A9 E9 8D 5F 65
0010 | 50 00 00 00 34 F7 CB 3B 42 15 54 56 11 32 BA CA
0020 | F3 AF 34 0A 8B 83 39 C7 B3 5F 24 C3 B6 55 D7 72
0030 | 16 DF 03 C6 A7 69 1B 17 3C F1 5F DD 06 8D 80 26
0040 | 1F 7D 98 5A 09 BC 4F 48</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>01E0C6782C805E65</code></td>
<td><code>01B4B8A9E98D5F65</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>80000000</code> (128 in decimal)</td>
<td><code>50000000</code> (80 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>B97720538FF9BE7C1C0F2D85099FE2B2</code></td>
<td><code>421554561132BACAF3AF340A8B8339C7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B9F149F4F75981C1C6970B97BE0B7579</code></td>
<td><code>B35F24C3B655D77216DF03C6A7691B17</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>32E526890C8A31E238DABAFFBE43C929</code></td>
<td><code>3CF15FDD068D80261F7D985A09BC4F48</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

@ -471,7 +471,7 @@
</tr>
<tr>
<td><a href="/constructor/updateMessagePollVote">updateMessagePollVote</a></td>
<td>A specific user has voted in a poll</td>
<td>A specific peer has voted in a poll</td>
</tr>
<tr>
<td><a href="/constructor/updateDialogFilter">updateDialogFilter</a></td>