Update content of files

This commit is contained in:
GitHub Action 2023-12-14 22:58:46 +00:00
parent 729650faa8
commit e882bc4281
9 changed files with 252 additions and 282 deletions

View file

@ -68,14 +68,14 @@
<li>Added <a href="/constructor/updateChannelViewForumAsMessages">updateChannelViewForumAsMessages</a> - </li>
<li>Added <a href="/constructor/messageActionGiveawayResults">messageActionGiveawayResults</a> - </li>
<li>Added <a href="/constructor/updatePeerWallpaper">updatePeerWallpaper</a> - </li>
<li>Added <a href="/constructor/storyFwdHeader">storyFwdHeader</a> - </li>
<li>Added <a href="/constructor/storyFwdHeader">storyFwdHeader</a> - Contains info about the original poster of a reposted story.</li>
<li>Added <a href="/constructor/postInteractionCountersMessage">postInteractionCountersMessage</a> - </li>
<li>Added <a href="/constructor/postInteractionCountersStory">postInteractionCountersStory</a> - </li>
<li>Added <a href="/constructor/stats.storyStats">stats.storyStats</a> - Contains <a href="/api/stats">statistics</a> about a <a href="/api/stories">story</a>.</li>
<li>Added <a href="/constructor/publicForwardMessage">publicForwardMessage</a> - Contains info about a forward of a <a href="/api/stories">story</a> as a message.</li>
<li>Added <a href="/constructor/publicForwardStory">publicForwardStory</a> - Contains info about a forward of a <a href="/api/stories">story</a> as a repost by a public channel.</li>
<li>Added <a href="/constructor/stats.publicForwards">stats.publicForwards</a> - Contains info about the forwards of a <a href="/api/stories">story</a> as a message to public chats and reposts by public channels.</li>
<li>Added <a href="/constructor/peerColor">peerColor</a> - </li>
<li>Added <a href="/constructor/peerColor">peerColor</a> - Represents a <a href="/api/colors">color palette »</a>.</li>
<li>Added <a href="/constructor/help.peerColorSet">help.peerColorSet</a> - Represents a <a href="/api/colors">color palette that can be used in message accents »</a>.</li>
<li>Added <a href="/constructor/help.peerColorProfileSet">help.peerColorProfileSet</a> - Represents a <a href="/api/colors">color palette that can be used in profile pages »</a>.</li>
<li>Added <a href="/constructor/help.peerColorOption">help.peerColorOption</a> - Contains info about a <a href="/api/colors">color palette »</a>.</li>

View file

@ -210,6 +210,17 @@ When the stories of a user are marked as hidden, the <code>stories_hidden</code>
<a href='/method/messages.sendMessage'>messages.sendMessage</a>#280d096f flags:<a href='/type/%23'>#</a> no_webpage:flags.1?<a href='/constructor/true'>true</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>You may reply to stories posted by users by using <a href="/method/messages.sendMessage">messages.sendMessage</a>, <a href="/method/messages.sendMedia">messages.sendMedia</a> or any other method used to send messages, passing an <a href="/constructor/inputReplyToStory">inputReplyToStory</a> to <code>reply_to</code>, with the ID of the user that posted the story (which must also be the destination <code>peer</code> of the message) and the story ID. </p>
<h3><a class="anchor" href="#reposting-stories" id="reposting-stories" name="reposting-stories"><i class="anchor-icon"></i></a>Reposting stories</h3>
<pre><code><a href='/constructor/storyFwdHeader'>storyFwdHeader</a>#b826e150 flags:<a href='/type/%23'>#</a> modified:flags.3?<a href='/constructor/true'>true</a> from:flags.0?<a href='/type/Peer'>Peer</a> from_name:flags.1?<a href='/type/string'>string</a> story_id:flags.2?<a href='/type/int'>int</a> = <a href='/type/StoryFwdHeader'>StoryFwdHeader</a>;
<a href='/constructor/storyItem'>storyItem</a>#af6365a1 flags:<a href='/type/%23'>#</a> pinned:flags.5?<a href='/constructor/true'>true</a> public:flags.7?<a href='/constructor/true'>true</a> close_friends:flags.8?<a href='/constructor/true'>true</a> min:flags.9?<a href='/constructor/true'>true</a> noforwards:flags.10?<a href='/constructor/true'>true</a> edited:flags.11?<a href='/constructor/true'>true</a> contacts:flags.12?<a href='/constructor/true'>true</a> selected_contacts:flags.13?<a href='/constructor/true'>true</a> out:flags.16?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> date:<a href='/type/int'>int</a> fwd_from:flags.17?<a href='/type/StoryFwdHeader'>StoryFwdHeader</a> expire_date:<a href='/type/int'>int</a> caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; media:<a href='/type/MessageMedia'>MessageMedia</a> media_areas:flags.14?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; privacy:flags.2?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; views:flags.3?<a href='/type/StoryViews'>StoryViews</a> sent_reaction:flags.15?<a href='/type/Reaction'>Reaction</a> = <a href='/type/StoryItem'>StoryItem</a>;
---functions---
<a href='/method/stories.sendStory'>stories.sendStory</a>#e4e6694b flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> noforwards:flags.4?<a href='/constructor/true'>true</a> fwd_modified:flags.7?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> media_areas:flags.5?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MediaArea'>MediaArea</a>&gt; caption:flags.0?<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; privacy_rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; random_id:<a href='/type/long'>long</a> period:flags.3?<a href='/type/int'>int</a> fwd_from_id:flags.6?<a href='/type/InputPeer'>InputPeer</a> fwd_from_story:flags.6?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Stories may be reposted by using <a href="/method/stories.sendStory">stories.sendStory</a>, populating the <code>fwd_from_story</code> field with the original story ID and the <code>fwd_from_id</code> with the peer that posted the original story. </p>
<p>The user may modify the story (for example by overlaying a round video reaction on top of the media); either way, the modified or the original media must be passed to the <code>media</code> field as usual, and the <code>fwd_modified</code> flag must be set if the media was modified. </p>
<p>Reposted stories will have the <a href="/constructor/storyItem">storyItem</a> set and populated with a <a href="/constructor/storyFwdHeader">storyFwdHeader</a> constructor, containing info about the original story.</p>
<h3><a class="anchor" href="#reporting-stories" id="reporting-stories" name="reporting-stories"><i class="anchor-icon"></i></a>Reporting stories</h3>
<pre><code><a href='/constructor/inputReportReasonSpam'>inputReportReasonSpam</a>#58dbcab8 = <a href='/type/ReportReason'>ReportReason</a>;
<a href='/constructor/inputReportReasonViolence'>inputReportReasonViolence</a>#1e22c78d = <a href='/type/ReportReason'>ReportReason</a>;

View file

@ -4,32 +4,10 @@
<meta charset="utf-8">
<title>peerColor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
color
flags.0?int
 
background_emoji_id
flags.1?long…">
<meta property="description" content="Represents a color palette ».">
<meta property="og:title" content="peerColor">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
color
flags.0?int
 
background_emoji_id
flags.1?long…">
<meta property="og:description" content="Represents a color palette ».">
<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">
@ -64,7 +42,8 @@ flags.1?long…">
<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/peerColor" >peerColor</a></li></ul></div>
<h1 id="dev_page_title">peerColor</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Represents a <a href="/api/colors">color palette »</a>.</p>
<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 167 <b class="caret"></b></a>
@ -95,17 +74,22 @@ flags.1?long…">
<tr>
<td><strong>color</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/int">int</a></td>
<td> </td>
<td><a href="/api/colors">Color palette ID, see here »</a> for more info.</td>
</tr>
<tr>
<td><strong>background_emoji_id</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/long">long</a></td>
<td> </td>
<td><a href="/api/custom-emoji">Custom emoji ID</a> used to generate the pattern.</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/PeerColor">PeerColor</a></p></div>
<p><a href="/type/PeerColor">PeerColor</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="#accent-colors" id="accent-colors" name="accent-colors"><i class="anchor-icon"></i></a><a href="/api/colors">Accent colors</a></h4>
<p>Telegram users and channels can change the accent color and background pattern of their profile page and their messages!</p>
<h4><a class="anchor" href="#custom-emojis" id="custom-emojis" name="custom-emojis"><i class="anchor-icon"></i></a><a href="/api/custom-emoji">Custom emojis</a></h4>
<p>Telegram allows including animated and static custom emojis inside of messages.</p></div>
</div>

View file

@ -4,36 +4,10 @@
<meta charset="utf-8">
<title>storyFwdHeader</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
modified
flags.3?true
 
from
flags.0?Peer
 
from_name…">
<meta property="description" content="Contains info about the original poster of a reposted story.">
<meta property="og:title" content="storyFwdHeader">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
modified
flags.3?true
 
from
flags.0?Peer
 
from_name…">
<meta property="og:description" content="Contains info about the original poster of a reposted story.">
<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">
@ -68,7 +42,8 @@ from_name…">
<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/storyFwdHeader" >storyFwdHeader</a></li></ul></div>
<h1 id="dev_page_title">storyFwdHeader</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Contains info about the original poster of a reposted story.</p>
<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 167 <b class="caret"></b></a>
@ -99,22 +74,22 @@ from_name…">
<tr>
<td><strong>modified</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 story media was modified before reposting it (for example by overlaying a round video with a reaction).</td>
</tr>
<tr>
<td><strong>from</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/Peer">Peer</a></td>
<td> </td>
<td>Peer that originally posted the story; will be empty for stories forwarded from a user with forwards privacy enabled, in which case <code>from_name</code> will be set, instead.</td>
</tr>
<tr>
<td><strong>from_name</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/string">string</a></td>
<td> </td>
<td>Will be set for stories forwarded from a user with forwards privacy enabled, in which case <code>from</code> will also be empty.</td>
</tr>
<tr>
<td><strong>story_id</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>, contains the story ID</td>
</tr>
</tbody>
</table>

View file

@ -129,7 +129,7 @@
<tr>
<td><strong>fwd_from</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.17?<a href="/type/StoryFwdHeader">StoryFwdHeader</a></td>
<td> </td>
<td>For <a href="/api/stories#reposting-stories">reposted stories »</a>, contains info about the original story.</td>
</tr>
<tr>
<td><strong>expire_date</strong></td>
@ -180,10 +180,10 @@
<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="#storiesgetstoriesbyid" id="storiesgetstoriesbyid" name="storiesgetstoriesbyid"><i class="anchor-icon"></i></a><a href="/method/stories.getStoriesByID">stories.getStoriesByID</a></h4>
<p>Obtain full info about a set of <a href="/api/stories">stories</a> by their IDs.</p>
<h4><a class="anchor" href="#styled-text-with-message-entities" id="styled-text-with-message-entities" name="styled-text-with-message-entities"><i class="anchor-icon"></i></a><a href="/api/entities">Styled text with message entities</a></h4>
<p>How to create styled text with message entities</p>
<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>
<p>Telegram users and channels can easily post and view stories through the API.</p>
<h4><a class="anchor" href="#styled-text-with-message-entities" id="styled-text-with-message-entities" name="styled-text-with-message-entities"><i class="anchor-icon"></i></a><a href="/api/entities">Styled text with message entities</a></h4>
<p>How to create styled text with message entities</p></div>
</div>

View file

@ -92,7 +92,7 @@
<tr>
<td><strong>fwd_modified</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.7?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Set this flag when reposting stories with <code>fwd_from_id</code>+<code>fwd_from_id</code>, if the <code>media</code> was modified before reposting.</td>
</tr>
<tr>
<td><strong>peer</strong></td>
@ -137,12 +137,12 @@
<tr>
<td><strong>fwd_from_id</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/InputPeer">InputPeer</a></td>
<td> </td>
<td>If set, indicates that this story is a repost of story with ID <code>fwd_from_story</code> posted by the peer in <code>fwd_from_id</code>.</td>
</tr>
<tr>
<td><strong>fwd_from_story</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/int">int</a></td>
<td> </td>
<td>If set, indicates that this story is a repost of story with ID <code>fwd_from_story</code> posted by the peer in <code>fwd_from_id</code>.</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 E8 F0 0D 00 77 12 7B 65
0010 | 14 00 00 00 F1 8E 7E BE B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 BC E9 0E 00 70 87 7B 65
0010 | 14 00 00 00 F1 8E 7E BE 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77</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>E8F00D0077127B65</code></td>
<td><code>BCE90E0070877B65</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>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</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 5C 90 BC 77 12 7B 65
0010 | 6C 00 00 00 63 24 16 05 B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39 4D 54 EA 31 25 42 43 08
0030 | 9E 77 01 9C 06 A5 29 F0 08 28 64 C6 51 3F EA 5E
0040 | 97 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 08 DD 83 70 87 7B 65
0010 | 70 00 00 00 63 24 16 05 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77 21 63 DE 11 E0 8D 2D 57
0030 | A8 BF 45 B5 09 21 F8 F9 08 21 84 3C 19 01 A8 7C
0040 | 41 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>015C90BC77127B65</code></td>
<td><code>0108DD8370877B65</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>6C000000</code> (108 in decimal)</td>
<td><code>70000000</code> (112 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>082864C6513FEA5E97000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2910669311455157911</td>
<td><code>0821843C1901A87C41000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2415121378277096513</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 = 2910669311455157911</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2910669311455157911 = 1652536009 * 1761334879</code></p>
<pre><code>p = 1652536009
q = 1761334879</code></pre>
<pre><code>pq = 2415121378277096513</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2415121378277096513 = 1407495223 * 1715900231</code></p>
<pre><code>p = 1407495223
q = 1715900231</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 28 64 C6 51 3F EA 5E 97 00 00 00
0010 | 04 62 7F B2 C9 00 00 00 04 68 FB D6 5F 00 00 00
0020 | B8 F9 ED 7E FD ED 7E E9 3F AD BE 6C 51 43 F6 39
0030 | 4D 54 EA 31 25 42 43 08 9E 77 01 9C 06 A5 29 F0
0040 | 04 95 A8 C6 99 65 6E 8E 1E 82 D7 58 79 73 AD AB
0050 | 51 95 4C 4F 99 2B 0B 23 CB FE 10 B1 E6 DA 5E B7
<pre><code>0000 | 95 5F F5 A9 08 21 84 3C 19 01 A8 7C 41 00 00 00
0010 | 04 53 E4 AC 37 00 00 00 04 66 46 8F 47 00 00 00
0020 | 48 18 19 9E 5C 2C 90 29 E8 89 4B 0B D5 DC 68 77
0030 | 21 63 DE 11 E0 8D 2D 57 A8 BF 45 B5 09 21 F8 F9
0040 | 40 8B 78 A5 3C 89 B6 79 C2 21 EB AA C7 9F 11 58
0050 | CE C5 16 05 E9 AB A5 68 18 D0 8E 2C AD 7E C4 3E
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 = 1761334879</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>082864C6513FEA5E97000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2910669311455157911</td>
<td><code>0821843C1901A87C41000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2415121378277096513</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>04627FB2C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1652536009</td>
<td><code>0453E4AC37000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1407495223</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>0468FBD65F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1761334879</td>
<td><code>0466468F47000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1715900231</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>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>0495A8C699656E8E1E82D7587973ADAB</code> <code>51954C4F992B0B23CBFE10B1E6DA5EB7</code></td>
<td><code>408B78A53C89B679C221EBAAC79F1158</code> <code>CEC51605E9ABA56818D08E2CAD7EC43E</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1761334879</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 = 955FF5A9082864C6513FEA5E9700000004627FB2C90000000468FBD65F000000B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F00495A8C699656E8E1E82D7587973ADAB51954C4F992B0B23CBFE10B1E6DA5EB702000000
random_padding_bytes = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F313689285293E6ABD665227D7D7F6DF9747964AFFD8BFE7FB449BEB40C4F3A60DB0391F8A542A103F940229C410AE127DE75A755E2D1F78D2015B7B4BFBB3E8C5</code></pre>
<pre><code>data = 955FF5A90821843C1901A87C410000000453E4AC370000000466468F470000004818199E5C2C9029E8894B0BD5DC68772163DE11E08D2D57A8BF45B50921F8F9408B78A53C89B679C221EBAAC79F1158CEC51605E9ABA56818D08E2CAD7EC43E02000000
random_padding_bytes = FC7FE25DCA34F6F776A62D270F12B49390B74D47CB5D762700D0EB0B1CFF80FAA086F815EB3A17D08A4D97CC4C254462C3E3178B174CA396D36894233C02854A516189341FA6E5A6CD17E341F7110F1534373DC251209E3D3E35F9BD</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 = 8CA8796C05681B04A1E690D8B70EB945B564654412521387042FCBD4D640184295D621CA9DBBB3B87A5CA2344C6C64D26C4F2652AE6C734227B966FFB030EADF791D0043E98CD9074414C3EC5E8C2E14CB40236B9A0B7533207BD76B0C967969B338C47A7931336B9D1E00B544FA1609AE240817B02922336DC0822A8329761A4F5D65ACFECE79C1379D98F45C346D07CC3F0C785B2A3A04815669B7B1050F98D96476E99637348C66022D079FDE1E40DE34B9588780530610FF5EF0360C260C8C043FEE9708CC5AE5D8F4982F063192424C3B525FEB3298F14E1CF81CD8BC90B95BF2BFDF62B21F29E086134D0ECC05FC4DCD7DF34C774472C32C82553082A0</code></pre>
<pre><code>encrypted_data = 360B4B89BD69432AEAD228B673E7588B601A3CB1181B4A3DC121020A50AEE9AC411912F33F6E3706A01F642CFEC900F65DBFC579C4D1DC8383EBED5A4C94F4814BEA615196A7607D283E52879437F4C9C6E4B7D9E203BB38DB07EAB2C170DB605C2825ADD7812CF97A7EB8E1A6C1EFBCBCA7349B524D16DB6773506A5521147FF791F52E4DE29846C9A12EAF6CC965B2B5221EA56E1CF5CE558ECEB777827EEDCF49C1083C19A2060CC5F7DAEC806E0BFC1EF4B9C3374A8ADE2802FB3CCDEE0426231B1D537389468AD1F53C93175EB112F1629880F71FFC1ED48BDF9EA219BC301279A0BC7BC9BC74237525A94C86B2E9B369B7D0D6EB7E4620E0D1738FBC27</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 EC F0 0D 00 77 12 7B 65
0010 | 40 01 00 00 BE E4 12 D7 B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39 4D 54 EA 31 25 42 43 08
0030 | 9E 77 01 9C 06 A5 29 F0 04 62 7F B2 C9 00 00 00
0040 | 04 68 FB D6 5F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 8C A8 79 6C 05 68 1B 04 A1 E6 90 D8
0060 | B7 0E B9 45 B5 64 65 44 12 52 13 87 04 2F CB D4
0070 | D6 40 18 42 95 D6 21 CA 9D BB B3 B8 7A 5C A2 34
0080 | 4C 6C 64 D2 6C 4F 26 52 AE 6C 73 42 27 B9 66 FF
0090 | B0 30 EA DF 79 1D 00 43 E9 8C D9 07 44 14 C3 EC
00A0 | 5E 8C 2E 14 CB 40 23 6B 9A 0B 75 33 20 7B D7 6B
00B0 | 0C 96 79 69 B3 38 C4 7A 79 31 33 6B 9D 1E 00 B5
00C0 | 44 FA 16 09 AE 24 08 17 B0 29 22 33 6D C0 82 2A
00D0 | 83 29 76 1A 4F 5D 65 AC FE CE 79 C1 37 9D 98 F4
00E0 | 5C 34 6D 07 CC 3F 0C 78 5B 2A 3A 04 81 56 69 B7
00F0 | B1 05 0F 98 D9 64 76 E9 96 37 34 8C 66 02 2D 07
0100 | 9F DE 1E 40 DE 34 B9 58 87 80 53 06 10 FF 5E F0
0110 | 36 0C 26 0C 8C 04 3F EE 97 08 CC 5A E5 D8 F4 98
0120 | 2F 06 31 92 42 4C 3B 52 5F EB 32 98 F1 4E 1C F8
0130 | 1C D8 BC 90 B9 5B F2 BF DF 62 B2 1F 29 E0 86 13
0140 | 4D 0E CC 05 FC 4D CD 7D F3 4C 77 44 72 C3 2C 82
0150 | 55 30 82 A0</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 E9 0E 00 70 87 7B 65
0010 | 40 01 00 00 BE E4 12 D7 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77 21 63 DE 11 E0 8D 2D 57
0030 | A8 BF 45 B5 09 21 F8 F9 04 53 E4 AC 37 00 00 00
0040 | 04 66 46 8F 47 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 36 0B 4B 89 BD 69 43 2A EA D2 28 B6
0060 | 73 E7 58 8B 60 1A 3C B1 18 1B 4A 3D C1 21 02 0A
0070 | 50 AE E9 AC 41 19 12 F3 3F 6E 37 06 A0 1F 64 2C
0080 | FE C9 00 F6 5D BF C5 79 C4 D1 DC 83 83 EB ED 5A
0090 | 4C 94 F4 81 4B EA 61 51 96 A7 60 7D 28 3E 52 87
00A0 | 94 37 F4 C9 C6 E4 B7 D9 E2 03 BB 38 DB 07 EA B2
00B0 | C1 70 DB 60 5C 28 25 AD D7 81 2C F9 7A 7E B8 E1
00C0 | A6 C1 EF BC BC A7 34 9B 52 4D 16 DB 67 73 50 6A
00D0 | 55 21 14 7F F7 91 F5 2E 4D E2 98 46 C9 A1 2E AF
00E0 | 6C C9 65 B2 B5 22 1E A5 6E 1C F5 CE 55 8E CE B7
00F0 | 77 82 7E ED CF 49 C1 08 3C 19 A2 06 0C C5 F7 DA
0100 | EC 80 6E 0B FC 1E F4 B9 C3 37 4A 8A DE 28 02 FB
0110 | 3C CD EE 04 26 23 1B 1D 53 73 89 46 8A D1 F5 3C
0120 | 93 17 5E B1 12 F1 62 98 80 F7 1F FC 1E D4 8B DF
0130 | 9E A2 19 BC 30 12 79 A0 BC 7B C9 BC 74 23 75 25
0140 | A9 4C 86 B2 E9 B3 69 B7 D0 D6 EB 7E 46 20 E0 D1
0150 | 73 8F BC 27</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 = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>ECF00D0077127B65</code></td>
<td><code>C0E90E0070877B65</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 = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>04627FB2C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1652536009</td>
<td><code>0453E4AC37000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1407495223</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>0468FBD65F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1761334879</td>
<td><code>0466468F47000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1715900231</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 = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001008CA8796C05681B04A1E690D8</code> <code>B70EB945B564654412521387042FCBD4</code> <code>D640184295D621CA9DBBB3B87A5CA234</code> <code>4C6C64D26C4F2652AE6C734227B966FF</code> <code>B030EADF791D0043E98CD9074414C3EC</code> <code>5E8C2E14CB40236B9A0B7533207BD76B</code> <code>0C967969B338C47A7931336B9D1E00B5</code> <code>44FA1609AE240817B02922336DC0822A</code> <code>8329761A4F5D65ACFECE79C1379D98F4</code> <code>5C346D07CC3F0C785B2A3A04815669B7</code> <code>B1050F98D96476E99637348C66022D07</code> <code>9FDE1E40DE34B9588780530610FF5EF0</code> <code>360C260C8C043FEE9708CC5AE5D8F498</code> <code>2F063192424C3B525FEB3298F14E1CF8</code> <code>1CD8BC90B95BF2BFDF62B21F29E08613</code> <code>4D0ECC05FC4DCD7DF34C774472C32C82</code><br> <code>553082A0</code></td>
<td><code>FE000100360B4B89BD69432AEAD228B6</code> <code>73E7588B601A3CB1181B4A3DC121020A</code> <code>50AEE9AC411912F33F6E3706A01F642C</code> <code>FEC900F65DBFC579C4D1DC8383EBED5A</code> <code>4C94F4814BEA615196A7607D283E5287</code> <code>9437F4C9C6E4B7D9E203BB38DB07EAB2</code> <code>C170DB605C2825ADD7812CF97A7EB8E1</code> <code>A6C1EFBCBCA7349B524D16DB6773506A</code> <code>5521147FF791F52E4DE29846C9A12EAF</code> <code>6CC965B2B5221EA56E1CF5CE558ECEB7</code> <code>77827EEDCF49C1083C19A2060CC5F7DA</code> <code>EC806E0BFC1EF4B9C3374A8ADE2802FB</code> <code>3CCDEE0426231B1D537389468AD1F53C</code> <code>93175EB112F1629880F71FFC1ED48BDF</code> <code>9EA219BC301279A0BC7BC9BC74237525</code> <code>A94C86B2E9B369B7D0D6EB7E4620E0D1</code><br> <code>738FBC27</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<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 38 CA 74 78 12 7B 65
0010 | 78 02 00 00 5C 07 E8 D0 B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39 4D 54 EA 31 25 42 43 08
0030 | 9E 77 01 9C 06 A5 29 F0 FE 50 02 00 EF 35 0C F0
0040 | A4 32 F0 37 F4 D2 83 5F DF F9 9B 0C F6 8C 82 16
0050 | BD 1F 40 7A 24 70 D4 68 97 D2 4E 19 A3 D7 B9 82
0060 | EE 08 BB 08 4D 1B 5F AC B2 8E 3B D9 C3 03 A8 B4
0070 | EE E8 0F 3F B1 FD AD A5 63 6C 02 B4 55 04 A9 65
0080 | AA 76 1A EC CE 3C 70 B4 12 76 64 5D 5C 0F CC 16
0090 | 15 E4 FC 46 2D 4A 0B 36 F0 C6 0E 8D 4F 5F 39 38
00A0 | A9 BE DA FF EB 5C BA DD A4 9F EE F2 0D 0F 8A 44
00B0 | 60 4E 4D 19 F3 AC 2C 00 F3 1C 2C B8 3D C7 01 61
00C0 | DB 0E 09 13 F6 B7 08 64 D1 C4 12 70 21 85 7A CF
00D0 | 7E FF FC 88 9F 6C B7 3D FF C2 38 6B 03 9E F3 F8
00E0 | 2A 35 47 9B E2 F8 C3 4F A1 66 39 E9 59 D1 3B BC
00F0 | F5 F0 6B 03 E6 E8 93 3C AF 66 0B FE 7F 7F AD D1
0100 | C7 65 B3 12 B8 CA DB 74 48 91 27 D7 7D BC E0 E8
0110 | E8 15 E9 DE 09 6F ED E0 BE 5D 57 8C 65 E0 20 14
0120 | 7C 15 37 32 E1 56 0B 55 D1 84 FE 71 BC 3F AE 52
0130 | 1F 65 2E 78 FB 13 2D 70 88 00 C2 3A 52 B3 19 26
0140 | A3 4C 72 E2 21 AC 9F 6B 01 36 70 26 83 59 15 28
0150 | 21 6E 78 D8 68 A4 21 4F F3 A8 9D 79 13 E0 9A 2C
0160 | FB 43 01 CA 14 93 13 32 FF 35 C5 ED D2 93 F1 B5
0170 | EA A3 28 CA 5D B7 FE 3F 3F 5D 9C 5D 1C 0A 0F B3
0180 | 0B 63 12 41 EB 15 DF D0 18 F6 44 C9 E8 CE 7F F7
0190 | 9A 5A DD 9E 34 15 13 B0 ED F8 9D 2D 0B 1E 8F 34
01A0 | 96 23 D5 E3 77 DC 1D F1 86 9D F2 70 87 0C 2E CF
01B0 | 17 69 BD B0 BA 63 1A 4D 31 04 80 35 CE FF 0A 45
01C0 | 50 7F AC DA CB 17 09 36 DD 2C 42 A8 1F FB A9 2D
01D0 | 4E C6 D0 E8 78 EA B5 20 08 25 67 25 3B C7 76 B8
01E0 | E2 1B F2 9C 38 93 82 17 92 C1 B5 74 C4 31 EA 1B
01F0 | FE 91 F3 9B E1 A7 B7 25 D5 BF 6F 2E F7 E3 F3 E0
0200 | 81 6C 7B CC CF F6 97 35 11 AD 68 CC 72 51 21 D9
0210 | 30 CC FB C5 E2 4E FC 9B 55 B8 43 9D 54 61 36 C4
0220 | C4 F1 50 29 38 58 74 A1 E7 D4 57 98 A7 62 81 9A
0230 | EE 49 20 66 44 41 39 88 B2 2F DE 28 48 D2 19 4C
0240 | B9 2F C9 67 C4 C8 DA 10 AD 71 82 65 92 6D 97 90
0250 | A8 D1 30 A4 84 D2 D7 17 3B 7E 84 B6 70 2B D6 01
0260 | 58 3E CB 63 98 02 2B F2 A9 1A 81 53 8B F7 BC 63
0270 | 89 BF 07 A7 F3 5D BC 68 2A F5 6E A4 1E A1 7B 6F
0280 | 81 4E 71 2A 9C 8B 45 49 E3 96 A1 31</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C0 0D 4C 71 87 7B 65
0010 | 7C 02 00 00 5C 07 E8 D0 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77 21 63 DE 11 E0 8D 2D 57
0030 | A8 BF 45 B5 09 21 F8 F9 FE 50 02 00 F0 D0 8A 47
0040 | 22 FF 05 36 FE 0D 0E 80 20 11 96 F1 1B 6D B2 DE
0050 | 79 7A 95 A0 B6 BE 47 BC 61 DE 85 5D AF 73 85 83
0060 | 35 29 20 FD 79 C6 49 61 41 29 CB 11 86 46 38 E7
0070 | CD 7C 81 E6 23 0B 96 B1 AF 97 9A 47 81 83 7A D9
0080 | 8A 03 CC 2A 06 38 C1 ED 76 4F 6B C8 46 0D 55 7E
0090 | 2C 07 B1 D7 E4 21 23 43 A0 7E 1E 2A B6 EA 56 1C
00A0 | 47 6C C4 A3 D2 BF 61 CD 1A 3E 40 18 2D AE B5 C4
00B0 | B6 BA B7 01 01 D6 D7 B2 F6 BF 27 F4 C2 F7 30 D6
00C0 | 94 0E E8 4D 10 4A 63 7C EA 1F 65 AE 2C 5C 43 2E
00D0 | F7 36 A2 1C 97 FF D6 61 D9 0B 82 56 10 DC 54 DB
00E0 | AC 19 E7 C2 76 F2 3D B2 F3 9E 88 9D E2 2D DF C4
00F0 | C5 D6 42 D8 E3 07 88 6C F3 B0 9A F0 0E 26 D9 39
0100 | 8A 40 4C 10 AF 42 22 F4 31 AC E2 28 EE 70 96 BE
0110 | 5E 5C 6B 1E 6C 82 89 7E D3 E0 94 FB CD 38 E6 95
0120 | D9 BA 71 5B 98 8A 76 E1 8B 02 A5 3C 6D 45 8E 3B
0130 | A1 8A 67 65 7E F2 26 B3 F6 6E 13 99 B0 93 F1 6C
0140 | CD 27 4A 86 C7 94 86 93 73 D6 C1 B9 07 9D E7 D1
0150 | 06 B0 75 D5 FD 9A 9B 81 B8 3D 63 9E 8F 75 37 40
0160 | 07 F0 21 3C 2B 19 02 95 B9 4D D8 90 6C BB 9A C4
0170 | C1 04 B9 9C F9 5B A9 55 64 FA EE 23 A0 A2 F6 3A
0180 | 01 E6 CD 5B 23 0B 59 B7 A2 9F AA 95 04 D8 38 0F
0190 | 50 D2 D9 C4 7A 97 1F 22 9A B0 8F C1 1C 41 2E 38
01A0 | ED A7 C0 09 53 31 5A 3F 07 4E 3C 92 37 CC EF BF
01B0 | 5B 0E 09 15 C2 15 41 DA B5 D5 DA 2C A2 0F 1F 32
01C0 | 02 DF 6E 8C D0 FB 73 83 C8 32 00 5A 3F A5 5A B3
01D0 | 0C B0 A3 E3 E6 5C 8C BF EF 6E A4 C1 EE 9F EE F0
01E0 | B3 DB F6 FA 61 33 21 58 86 4C 65 5A 00 EC CA F5
01F0 | 40 3D 71 AA 29 0D D7 09 CB AF D2 E8 E3 0B 98 A3
0200 | F6 A7 96 74 4F B9 F0 8A 97 A0 67 4F 3B A6 F3 81
0210 | 49 15 01 FA E7 E1 55 DB 22 28 F7 DB 00 C8 B9 7E
0220 | 70 34 C7 B8 78 C0 9C 52 E5 90 78 5B AE DF B3 05
0230 | 75 BA 43 B8 5F 9B 3D 17 15 C0 CC 58 85 80 AB 01
0240 | 30 B8 B1 9F 3B B5 96 5D 69 2B BE 51 E0 2F 36 71
0250 | 37 16 09 93 1B 11 DE EC 45 1B D9 D8 95 A5 BC CE
0260 | D7 AB 08 60 3F C0 A5 55 27 6B 77 38 62 77 B5 C9
0270 | 74 95 4C 43 D8 75 6A F9 6C 4F 93 84 C2 A4 1B A3
0280 | C7 E8 EB 07 D1 95 51 DA 87 FF 63 65</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 = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0138CA7478127B65</code></td>
<td><code>01C00D4C71877B65</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>78020000</code> (632 in decimal)</td>
<td><code>7C020000</code> (636 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200EF350CF0A432F037F4D2835F</code> <code>DFF99B0CF68C8216BD1F407A2470D468</code> <code>97D24E19A3D7B982EE08BB084D1B5FAC</code> <code>B28E3BD9C303A8B4EEE80F3FB1FDADA5</code> <code>636C02B45504A965AA761AECCE3C70B4</code> <code>1276645D5C0FCC1615E4FC462D4A0B36</code> <code>F0C60E8D4F5F3938A9BEDAFFEB5CBADD</code> <code>A49FEEF20D0F8A44604E4D19F3AC2C00</code> <code>F31C2CB83DC70161DB0E0913F6B70864</code> <code>D1C4127021857ACF7EFFFC889F6CB73D</code> <code>FFC2386B039EF3F82A35479BE2F8C34F</code> <code>A16639E959D13BBCF5F06B03E6E8933C</code> <code>AF660BFE7F7FADD1C765B312B8CADB74</code> <code>489127D77DBCE0E8E815E9DE096FEDE0</code> <code>BE5D578C65E020147C153732E1560B55</code> <code>D184FE71BC3FAE521F652E78FB132D70</code> <code>8800C23A52B31926A34C72E221AC9F6B</code> <code>0136702683591528216E78D868A4214F</code> <code>F3A89D7913E09A2CFB4301CA14931332</code> <code>FF35C5EDD293F1B5EAA328CA5DB7FE3F</code> <code>3F5D9C5D1C0A0FB30B631241EB15DFD0</code> <code>18F644C9E8CE7FF79A5ADD9E341513B0</code> <code>EDF89D2D0B1E8F349623D5E377DC1DF1</code> <code>869DF270870C2ECF1769BDB0BA631A4D</code> <code>31048035CEFF0A45507FACDACB170936</code> <code>DD2C42A81FFBA92D4EC6D0E878EAB520</code> <code>082567253BC776B8E21BF29C38938217</code> <code>92C1B574C431EA1BFE91F39BE1A7B725</code> <code>D5BF6F2EF7E3F3E0816C7BCCCFF69735</code> <code>11AD68CC725121D930CCFBC5E24EFC9B</code> <code>55B8439D546136C4C4F15029385874A1</code> <code>E7D45798A762819AEE49206644413988</code> <code>B22FDE2848D2194CB92FC967C4C8DA10</code> <code>AD718265926D9790A8D130A484D2D717</code> <code>3B7E84B6702BD601583ECB6398022BF2</code> <code>A91A81538BF7BC6389BF07A7F35DBC68</code> <code>2AF56EA41EA17B6F814E712A9C8B4549</code><br> <code>E396A131</code></td>
<td><code>FE500200F0D08A4722FF0536FE0D0E80</code> <code>201196F11B6DB2DE797A95A0B6BE47BC</code> <code>61DE855DAF738583352920FD79C64961</code> <code>4129CB11864638E7CD7C81E6230B96B1</code> <code>AF979A4781837AD98A03CC2A0638C1ED</code> <code>764F6BC8460D557E2C07B1D7E4212343</code> <code>A07E1E2AB6EA561C476CC4A3D2BF61CD</code> <code>1A3E40182DAEB5C4B6BAB70101D6D7B2</code> <code>F6BF27F4C2F730D6940EE84D104A637C</code> <code>EA1F65AE2C5C432EF736A21C97FFD661</code> <code>D90B825610DC54DBAC19E7C276F23DB2</code> <code>F39E889DE22DDFC4C5D642D8E307886C</code> <code>F3B09AF00E26D9398A404C10AF4222F4</code> <code>31ACE228EE7096BE5E5C6B1E6C82897E</code> <code>D3E094FBCD38E695D9BA715B988A76E1</code> <code>8B02A53C6D458E3BA18A67657EF226B3</code> <code>F66E1399B093F16CCD274A86C7948693</code> <code>73D6C1B9079DE7D106B075D5FD9A9B81</code> <code>B83D639E8F75374007F0213C2B190295</code> <code>B94DD8906CBB9AC4C104B99CF95BA955</code> <code>64FAEE23A0A2F63A01E6CD5B230B59B7</code> <code>A29FAA9504D8380F50D2D9C47A971F22</code> <code>9AB08FC11C412E38EDA7C00953315A3F</code> <code>074E3C9237CCEFBF5B0E0915C21541DA</code> <code>B5D5DA2CA20F1F3202DF6E8CD0FB7383</code> <code>C832005A3FA55AB30CB0A3E3E65C8CBF</code> <code>EF6EA4C1EE9FEEF0B3DBF6FA61332158</code> <code>864C655A00ECCAF5403D71AA290DD709</code> <code>CBAFD2E8E30B98A3F6A796744FB9F08A</code> <code>97A0674F3BA6F381491501FAE7E155DB</code> <code>2228F7DB00C8B97E7034C7B878C09C52</code> <code>E590785BAEDFB30575BA43B85F9B3D17</code> <code>15C0CC588580AB0130B8B19F3BB5965D</code> <code>692BBE51E02F3671371609931B11DEEC</code> <code>451BD9D895A5BCCED7AB08603FC0A555</code> <code>276B77386277B5C974954C43D8756AF9</code> <code>6C4F9384C2A41BA3C7E8EB07D19551DA</code><br> <code>87FF6365</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = B70F17797E40020F2084C997F2FBA831F3757D853C154951DBA3A9F31
<!-- 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 = EF350CF0A432F037F4D2835FDFF99B0CF68C8216BD1F407A2470D46897D24E19A3D7B982EE08BB084D1B5FACB28E3BD9C303A8B4EEE80F3FB1FDADA5636C02B45504A965AA761AECCE3C70B41276645D5C0FCC1615E4FC462D4A0B36F0C60E8D4F5F3938A9BEDAFFEB5CBADDA49FEEF20D0F8A44604E4D19F3AC2C00F31C2CB83DC70161DB0E0913F6B70864D1C4127021857ACF7EFFFC889F6CB73DFFC2386B039EF3F82A35479BE2F8C34FA16639E959D13BBCF5F06B03E6E8933CAF660BFE7F7FADD1C765B312B8CADB74489127D77DBCE0E8E815E9DE096FEDE0BE5D578C65E020147C153732E1560B55D184FE71BC3FAE521F652E78FB132D708800C23A52B31926A34C72E221AC9F6B0136702683591528216E78D868A4214FF3A89D7913E09A2CFB4301CA14931332FF35C5EDD293F1B5EAA328CA5DB7FE3F3F5D9C5D1C0A0FB30B631241EB15DFD018F644C9E8CE7FF79A5ADD9E341513B0EDF89D2D0B1E8F349623D5E377DC1DF1869DF270870C2ECF1769BDB0BA631A4D31048035CEFF0A45507FACDACB170936DD2C42A81FFBA92D4EC6D0E878EAB520082567253BC776B8E21BF29C3893821792C1B574C431EA1BFE91F39BE1A7B725D5BF6F2EF7E3F3E0816C7BCCCFF6973511AD68CC725121D930CCFBC5E24EFC9B55B8439D546136C4C4F15029385874A1E7D45798A762819AEE49206644413988B22FDE2848D2194CB92FC967C4C8DA10AD718265926D9790A8D130A484D2D7173B7E84B6702BD601583ECB6398022BF2A91A81538BF7BC6389BF07A7F35DBC682AF56EA41EA17B6F814E712A9C8B4549E396A131
tmp_aes_key = 5028FB57D07AD7AEA070D02B26E6BDE4AB80742328D35421B99A5D37ABE9C368
tmp_aes_iv = BF6F3CBFCFD7D76DF70B881BF7C1B98C341468E67EC78092191B35790495A8C6</code></pre>
<pre><code>encrypted_answer = F0D08A4722FF0536FE0D0E80201196F11B6DB2DE797A95A0B6BE47BC61DE855DAF738583352920FD79C649614129CB11864638E7CD7C81E6230B96B1AF979A4781837AD98A03CC2A0638C1ED764F6BC8460D557E2C07B1D7E4212343A07E1E2AB6EA561C476CC4A3D2BF61CD1A3E40182DAEB5C4B6BAB70101D6D7B2F6BF27F4C2F730D6940EE84D104A637CEA1F65AE2C5C432EF736A21C97FFD661D90B825610DC54DBAC19E7C276F23DB2F39E889DE22DDFC4C5D642D8E307886CF3B09AF00E26D9398A404C10AF4222F431ACE228EE7096BE5E5C6B1E6C82897ED3E094FBCD38E695D9BA715B988A76E18B02A53C6D458E3BA18A67657EF226B3F66E1399B093F16CCD274A86C794869373D6C1B9079DE7D106B075D5FD9A9B81B83D639E8F75374007F0213C2B190295B94DD8906CBB9AC4C104B99CF95BA95564FAEE23A0A2F63A01E6CD5B230B59B7A29FAA9504D8380F50D2D9C47A971F229AB08FC11C412E38EDA7C00953315A3F074E3C9237CCEFBF5B0E0915C21541DAB5D5DA2CA20F1F3202DF6E8CD0FB7383C832005A3FA55AB30CB0A3E3E65C8CBFEF6EA4C1EE9FEEF0B3DBF6FA61332158864C655A00ECCAF5403D71AA290DD709CBAFD2E8E30B98A3F6A796744FB9F08A97A0674F3BA6F381491501FAE7E155DB2228F7DB00C8B97E7034C7B878C09C52E590785BAEDFB30575BA43B85F9B3D1715C0CC588580AB0130B8B19F3BB5965D692BBE51E02F3671371609931B11DEEC451BD9D895A5BCCED7AB08603FC0A555276B77386277B5C974954C43D8756AF96C4F9384C2A41BA3C7E8EB07D19551DA87FF6365
tmp_aes_key = EFEE3DDE87871EE456FFE7D49BDDFC35B6A602DCD88104DE3B916E7B78D9B0C5
tmp_aes_iv = 78AA7B8D5CAF102BF3DBF0B6CD90720A6FDF35903B4A8448368D1587408B78A5</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 398932855BF3991F6550E2CA2D2814AD5B38B854BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100364CFD00A68FCCB95EA58EE4109BE9E30B132F37C0D88DB92059FDF77EDE753539085094B7D23F7E4A8A7603075FFFFD8FEFF0BFFB09CFCE9D977A8617006A669B2D6CA10BF6A753A57695D22165F15E95E8A1DD02452C956B350A52B87FB08A3093DE1068147D4103279F9EDB04C46E7C5ECC7F368CDC9856D40F4C910470ECA8EBBE71C03A6505FBD54655D4874E1F1A4100535A271DF64F7ED72ECDA7EEABA90A09D10FFF8F1B4CC2620C2D133D13ACF7B655A57E1D571F2998BD3D85977253F65AE1C3D11A56FDCE791170ED80B555D8DC0FB28FBFDEC5B31EF3AAAEEA246B620A68EE28A475C9753DDC5E2AA0D372A4E353C5BEE5A84D072E39D50F900B78127B65A06FF77399181DB2
answer = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100364CFD00A68FCCB95EA58EE4109BE9E30B132F37C0D88DB92059FDF77EDE753539085094B7D23F7E4A8A7603075FFFFD8FEFF0BFFB09CFCE9D977A8617006A669B2D6CA10BF6A753A57695D22165F15E95E8A1DD02452C956B350A52B87FB08A3093DE1068147D4103279F9EDB04C46E7C5ECC7F368CDC9856D40F4C910470ECA8EBBE71C03A6505FBD54655D4874E1F1A4100535A271DF64F7ED72ECDA7EEABA90A09D10FFF8F1B4CC2620C2D133D13ACF7B655A57E1D571F2998BD3D85977253F65AE1C3D11A56FDCE791170ED80B555D8DC0FB28FBFDEC5B31EF3AAAEEA246B620A68EE28A475C9753DDC5E2AA0D372A4E353C5BEE5A84D072E39D50F900B78127B65A06FF77399181DB2</code></pre>
<pre><code>answer_with_hash = F9BD98069687178F2F1C67C205DE9E858EE691FEBA0D89B54818199E5C2C9029E8894B0BD5DC68772163DE11E08D2D57A8BF45B50921F8F903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BEEA8F4FA6CD228E02ED03752538DD1B13AF61A1A38A281493D0239E2794D323CC95812974E782DFAA060B5D185FEBA4EA142759FC8EF4915D456D3C4085EE262E28027569FD5440D0D6108604454FC236A7141DEDF3AFFC9E6E3CFF43D9C9B56579E71BF3B5B2900D7CDBCE7F00EEC964218769737E1C6FE8036AB36F0FD5467E39EEE972AA4C246B265B76617F7D235C0BA43EE6149B4413F8F05E9D03AAF49F6A3F256F5B84AB5ECF210226F47BBFF1E47069BC1D296BF374811BFAE88AD65E9122EB7E8F503C17C4C0489A1A30B569F90EDAD26C318FDBA389E931F5182AEC21733FC8A664DC6231E9B8381306D34B0EF7EC1D1985DA1066B97FB8FEADF771877B65E0E1CD79A6DF0D6E
answer = BA0D89B54818199E5C2C9029E8894B0BD5DC68772163DE11E08D2D57A8BF45B50921F8F903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BEEA8F4FA6CD228E02ED03752538DD1B13AF61A1A38A281493D0239E2794D323CC95812974E782DFAA060B5D185FEBA4EA142759FC8EF4915D456D3C4085EE262E28027569FD5440D0D6108604454FC236A7141DEDF3AFFC9E6E3CFF43D9C9B56579E71BF3B5B2900D7CDBCE7F00EEC964218769737E1C6FE8036AB36F0FD5467E39EEE972AA4C246B265B76617F7D235C0BA43EE6149B4413F8F05E9D03AAF49F6A3F256F5B84AB5ECF210226F47BBFF1E47069BC1D296BF374811BFAE88AD65E9122EB7E8F503C17C4C0489A1A30B569F90EDAD26C318FDBA389E931F5182AEC21733FC8A664DC6231E9B8381306D34B0EF7EC1D1985DA1066B97FB8FEADF771877B65E0E1CD79A6DF0D6E</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 B8 F9 ED 7E FD ED 7E E9 3F AD BE 6C
0010 | 51 43 F6 39 4D 54 EA 31 25 42 43 08 9E 77 01 9C
0020 | 06 A5 29 F0 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 48 18 19 9E 5C 2C 90 29 E8 89 4B 0B
0010 | D5 DC 68 77 21 63 DE 11 E0 8D 2D 57 A8 BF 45 B5
0020 | 09 21 F8 F9 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 = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
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 | 36 4C FD 00 A6 8F CC B9 5E A5 8E E4 10 9B E9 E3
0140 | 0B 13 2F 37 C0 D8 8D B9 20 59 FD F7 7E DE 75 35
0150 | 39 08 50 94 B7 D2 3F 7E 4A 8A 76 03 07 5F FF FD
0160 | 8F EF F0 BF FB 09 CF CE 9D 97 7A 86 17 00 6A 66
0170 | 9B 2D 6C A1 0B F6 A7 53 A5 76 95 D2 21 65 F1 5E
0180 | 95 E8 A1 DD 02 45 2C 95 6B 35 0A 52 B8 7F B0 8A
0190 | 30 93 DE 10 68 14 7D 41 03 27 9F 9E DB 04 C4 6E
01A0 | 7C 5E CC 7F 36 8C DC 98 56 D4 0F 4C 91 04 70 EC
01B0 | A8 EB BE 71 C0 3A 65 05 FB D5 46 55 D4 87 4E 1F
01C0 | 1A 41 00 53 5A 27 1D F6 4F 7E D7 2E CD A7 EE AB
01D0 | A9 0A 09 D1 0F FF 8F 1B 4C C2 62 0C 2D 13 3D 13
01E0 | AC F7 B6 55 A5 7E 1D 57 1F 29 98 BD 3D 85 97 72
01F0 | 53 F6 5A E1 C3 D1 1A 56 FD CE 79 11 70 ED 80 B5
0200 | 55 D8 DC 0F B2 8F BF DE C5 B3 1E F3 AA AE EA 24
0210 | 6B 62 0A 68 EE 28 A4 75 C9 75 3D DC 5E 2A A0 D3
0220 | 72 A4 E3 53 C5 BE E5 A8 4D 07 2E 39 D5 0F 90 0B
0230 | 78 12 7B 65</code></pre>
0130 | BE EA 8F 4F A6 CD 22 8E 02 ED 03 75 25 38 DD 1B
0140 | 13 AF 61 A1 A3 8A 28 14 93 D0 23 9E 27 94 D3 23
0150 | CC 95 81 29 74 E7 82 DF AA 06 0B 5D 18 5F EB A4
0160 | EA 14 27 59 FC 8E F4 91 5D 45 6D 3C 40 85 EE 26
0170 | 2E 28 02 75 69 FD 54 40 D0 D6 10 86 04 45 4F C2
0180 | 36 A7 14 1D ED F3 AF FC 9E 6E 3C FF 43 D9 C9 B5
0190 | 65 79 E7 1B F3 B5 B2 90 0D 7C DB CE 7F 00 EE C9
01A0 | 64 21 87 69 73 7E 1C 6F E8 03 6A B3 6F 0F D5 46
01B0 | 7E 39 EE E9 72 AA 4C 24 6B 26 5B 76 61 7F 7D 23
01C0 | 5C 0B A4 3E E6 14 9B 44 13 F8 F0 5E 9D 03 AA F4
01D0 | 9F 6A 3F 25 6F 5B 84 AB 5E CF 21 02 26 F4 7B BF
01E0 | F1 E4 70 69 BC 1D 29 6B F3 74 81 1B FA E8 8A D6
01F0 | 5E 91 22 EB 7E 8F 50 3C 17 C4 C0 48 9A 1A 30 B5
0200 | 69 F9 0E DA D2 6C 31 8F DB A3 89 E9 31 F5 18 2A
0210 | EC 21 73 3F C8 A6 64 DC 62 31 E9 B8 38 13 06 D3
0220 | 4B 0E F7 EC 1D 19 85 DA 10 66 B9 7F B8 FE AD F7
0230 | 71 87 7B 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 = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE000100364CFD00A68FCCB95EA58EE4</code> <code>109BE9E30B132F37C0D88DB92059FDF7</code> <code>7EDE753539085094B7D23F7E4A8A7603</code> <code>075FFFFD8FEFF0BFFB09CFCE9D977A86</code> <code>17006A669B2D6CA10BF6A753A57695D2</code> <code>2165F15E95E8A1DD02452C956B350A52</code> <code>B87FB08A3093DE1068147D4103279F9E</code> <code>DB04C46E7C5ECC7F368CDC9856D40F4C</code> <code>910470ECA8EBBE71C03A6505FBD54655</code> <code>D4874E1F1A4100535A271DF64F7ED72E</code> <code>CDA7EEABA90A09D10FFF8F1B4CC2620C</code> <code>2D133D13ACF7B655A57E1D571F2998BD</code> <code>3D85977253F65AE1C3D11A56FDCE7911</code> <code>70ED80B555D8DC0FB28FBFDEC5B31EF3</code> <code>AAAEEA246B620A68EE28A475C9753DDC</code> <code>5E2AA0D372A4E353C5BEE5A84D072E39</code><br> <code>D50F900B</code></td>
<td><code>FE000100BEEA8F4FA6CD228E02ED0375</code> <code>2538DD1B13AF61A1A38A281493D0239E</code> <code>2794D323CC95812974E782DFAA060B5D</code> <code>185FEBA4EA142759FC8EF4915D456D3C</code> <code>4085EE262E28027569FD5440D0D61086</code> <code>04454FC236A7141DEDF3AFFC9E6E3CFF</code> <code>43D9C9B56579E71BF3B5B2900D7CDBCE</code> <code>7F00EEC964218769737E1C6FE8036AB3</code> <code>6F0FD5467E39EEE972AA4C246B265B76</code> <code>617F7D235C0BA43EE6149B4413F8F05E</code> <code>9D03AAF49F6A3F256F5B84AB5ECF2102</code> <code>26F47BBFF1E47069BC1D296BF374811B</code> <code>FAE88AD65E9122EB7E8F503C17C4C048</code> <code>9A1A30B569F90EDAD26C318FDBA389E9</code> <code>31F5182AEC21733FC8A664DC6231E9B8</code> <code>381306D34B0EF7EC1D1985DA1066B97F</code><br> <code>B8FEADF7</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>78127B65</code> (1702564472 in decimal)</td>
<td><code>71877B65</code> (1702594417 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
<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 = 6592B40C4B5CBC072AF9D33B1E85212567F9A478365D4CE4B83E75EF4CD633F892776FB80EE860D907655D736C1699C3C882DF67B89E10E6F065DBACEA07B8BB04B65B319013CFD72C3149130FD656300613119568AD5EE8CF4AFBF00DF5E7B7730B6C032A904FD7D0803B8CB0196E628EE617BDB44369D06EDF37C6E04FA12810B763BEC03D8FE00EE7BB69AA9EEF6102EBEFD3A9627A1F8B776A5204D8A9D31CDB208A9E980B52D131B3CC4F80200CEC138DA8A5C686237BC099838136AB75906645704597AE60D74376EB7BDE60731575A898BAC9097F556417103916C6DCEB2AEA7D4E6DF591D55DEB329B8B85332A045E2C4A3EE5646607CA349B2B3018</code></pre>
<pre><code>b = FD476005C83A2F611E443D33E6B624647F64D0C12E076CF16EFB55B909BBDEE4636D91C13C5BCA57BBEB4C8B5BA22ED412B1CD636E172DD6C763487A69FA48DE4D6E9E79053CF86FF737EDB80F1929E611FCF2DC721F4389B77E5D69CCFF9B6C44BB6EEC9A1F45BDC20B6070BAD4BDF8531F4AC8722B5C1FF7083D23E96926844509E8B8AB925CF57D259608D1F24604191DC45CDB76A27F57EE2BB122C9AB668A0448C703AF957B11E3872DA861A21776D40C4B702403AD0FED89F7B39EB8A102CF2BA909126A7AAB3CB72379C5B3DBFCB5302F0BFDF57C8833531CCFFBBEF19D1C4BE37CD63AADC32A50BAA0CE1604ECB1EED3F5BC48E59C00DA324451A8F8</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 = 8E56A8EF0B54797579B15BD7757DA0EFF06ED454F5A56DEFB703CA8B7721A5B7F19EC2BE6DA3CC423014F10B045ED5A772B8EFDA8AC8F6D40A2F64FC346E7F2DE9528BE18DE6D113E393C8319CA287DC3C19211CE1177D720B2049CCBAA8C945F672684896AB17BC7CBDDC8CFE62A4DB6D56EC42A0D0F4E776851A52C1EDC6347E93FF26E28EC7FB45E3FB5FF03D10DF418E146D36E62277768080D4E9C3056D40232A7F173A28EB289036E67FBDF6153BF2F866733856ABF19417E675F902F0C8F419A3A53328A633D1B9B0CF3C68F8E445B849EC4BF8EB98DAD6FFE08F2324FE1CBAB01AC3E7540A6B5DCC7CA8317E210F1C5B830C333E70F04FD5392EBDF2</code></pre>
<pre><code>g_b = 6B4CFDDF0D0E1FD06B16991EF8A85A2D1F4D3CED7D9E83A65A9FD0DA1CE34C7473A4B01F3213F643F1BD63199F776C6A14F73F304627C7724F18A7AE3687B9542288A6BAFD51C7F14459E46C311FB3B7E2E5CB3D7EB5B3DA0FA373B280C1557D4119A4F2C9EBC4AD229C6CDAE0D62A72AF2F5356D0AF8B1F427A487C7D5E7C23006910E3E9BEC75DED1C4C15FB16246FE1B02EBD5BCE620F0A68A7F0425D4E1D17E1CF86EF43A05E68D94C0F4C0B11EBC657953989D20AAB9571B5E113BEDD0B9C952DE481553C133D4CFDD84E4A027D54AF8728CF1824E153D17D1DAF08A8FB69C7929AF8DAE0A33F8371468D565142254850ACDEA2F4FF36BB1F7BBAD5CCF4</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 B8 F9 ED 7E FD ED 7E E9 3F AD BE 6C
0010 | 51 43 F6 39 4D 54 EA 31 25 42 43 08 9E 77 01 9C
0020 | 06 A5 29 F0 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 8E 56 A8 EF 0B 54 79 75 79 B1 5B D7 75 7D A0 EF
0040 | F0 6E D4 54 F5 A5 6D EF B7 03 CA 8B 77 21 A5 B7
0050 | F1 9E C2 BE 6D A3 CC 42 30 14 F1 0B 04 5E D5 A7
0060 | 72 B8 EF DA 8A C8 F6 D4 0A 2F 64 FC 34 6E 7F 2D
0070 | E9 52 8B E1 8D E6 D1 13 E3 93 C8 31 9C A2 87 DC
0080 | 3C 19 21 1C E1 17 7D 72 0B 20 49 CC BA A8 C9 45
0090 | F6 72 68 48 96 AB 17 BC 7C BD DC 8C FE 62 A4 DB
00A0 | 6D 56 EC 42 A0 D0 F4 E7 76 85 1A 52 C1 ED C6 34
00B0 | 7E 93 FF 26 E2 8E C7 FB 45 E3 FB 5F F0 3D 10 DF
00C0 | 41 8E 14 6D 36 E6 22 77 76 80 80 D4 E9 C3 05 6D
00D0 | 40 23 2A 7F 17 3A 28 EB 28 90 36 E6 7F BD F6 15
00E0 | 3B F2 F8 66 73 38 56 AB F1 94 17 E6 75 F9 02 F0
00F0 | C8 F4 19 A3 A5 33 28 A6 33 D1 B9 B0 CF 3C 68 F8
0100 | E4 45 B8 49 EC 4B F8 EB 98 DA D6 FF E0 8F 23 24
0110 | FE 1C BA B0 1A C3 E7 54 0A 6B 5D CC 7C A8 31 7E
0120 | 21 0F 1C 5B 83 0C 33 3E 70 F0 4F D5 39 2E BD F2</code></pre>
<pre><code>0000 | 54 B6 43 66 48 18 19 9E 5C 2C 90 29 E8 89 4B 0B
0010 | D5 DC 68 77 21 63 DE 11 E0 8D 2D 57 A8 BF 45 B5
0020 | 09 21 F8 F9 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 6B 4C FD DF 0D 0E 1F D0 6B 16 99 1E F8 A8 5A 2D
0040 | 1F 4D 3C ED 7D 9E 83 A6 5A 9F D0 DA 1C E3 4C 74
0050 | 73 A4 B0 1F 32 13 F6 43 F1 BD 63 19 9F 77 6C 6A
0060 | 14 F7 3F 30 46 27 C7 72 4F 18 A7 AE 36 87 B9 54
0070 | 22 88 A6 BA FD 51 C7 F1 44 59 E4 6C 31 1F B3 B7
0080 | E2 E5 CB 3D 7E B5 B3 DA 0F A3 73 B2 80 C1 55 7D
0090 | 41 19 A4 F2 C9 EB C4 AD 22 9C 6C DA E0 D6 2A 72
00A0 | AF 2F 53 56 D0 AF 8B 1F 42 7A 48 7C 7D 5E 7C 23
00B0 | 00 69 10 E3 E9 BE C7 5D ED 1C 4C 15 FB 16 24 6F
00C0 | E1 B0 2E BD 5B CE 62 0F 0A 68 A7 F0 42 5D 4E 1D
00D0 | 17 E1 CF 86 EF 43 A0 5E 68 D9 4C 0F 4C 0B 11 EB
00E0 | C6 57 95 39 89 D2 0A AB 95 71 B5 E1 13 BE DD 0B
00F0 | 9C 95 2D E4 81 55 3C 13 3D 4C FD D8 4E 4A 02 7D
0100 | 54 AF 87 28 CF 18 24 E1 53 D1 7D 1D AF 08 A8 FB
0110 | 69 C7 92 9A F8 DA E0 A3 3F 83 71 46 8D 56 51 42
0120 | 25 48 50 AC DE A2 F4 FF 36 BB 1F 7B BA D5 CC F4</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 = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001008E56A8EF0B54797579B15BD7</code> <code>757DA0EFF06ED454F5A56DEFB703CA8B</code> <code>7721A5B7F19EC2BE6DA3CC423014F10B</code> <code>045ED5A772B8EFDA8AC8F6D40A2F64FC</code> <code>346E7F2DE9528BE18DE6D113E393C831</code> <code>9CA287DC3C19211CE1177D720B2049CC</code> <code>BAA8C945F672684896AB17BC7CBDDC8C</code> <code>FE62A4DB6D56EC42A0D0F4E776851A52</code> <code>C1EDC6347E93FF26E28EC7FB45E3FB5F</code> <code>F03D10DF418E146D36E62277768080D4</code> <code>E9C3056D40232A7F173A28EB289036E6</code> <code>7FBDF6153BF2F866733856ABF19417E6</code> <code>75F902F0C8F419A3A53328A633D1B9B0</code> <code>CF3C68F8E445B849EC4BF8EB98DAD6FF</code> <code>E08F2324FE1CBAB01AC3E7540A6B5DCC</code> <code>7CA8317E210F1C5B830C333E70F04FD5</code><br> <code>392EBDF2</code></td>
<td><code>FE0001006B4CFDDF0D0E1FD06B16991E</code> <code>F8A85A2D1F4D3CED7D9E83A65A9FD0DA</code> <code>1CE34C7473A4B01F3213F643F1BD6319</code> <code>9F776C6A14F73F304627C7724F18A7AE</code> <code>3687B9542288A6BAFD51C7F14459E46C</code> <code>311FB3B7E2E5CB3D7EB5B3DA0FA373B2</code> <code>80C1557D4119A4F2C9EBC4AD229C6CDA</code> <code>E0D62A72AF2F5356D0AF8B1F427A487C</code> <code>7D5E7C23006910E3E9BEC75DED1C4C15</code> <code>FB16246FE1B02EBD5BCE620F0A68A7F0</code> <code>425D4E1D17E1CF86EF43A05E68D94C0F</code> <code>4C0B11EBC657953989D20AAB9571B5E1</code> <code>13BEDD0B9C952DE481553C133D4CFDD8</code> <code>4E4A027D54AF8728CF1824E153D17D1D</code> <code>AF08A8FB69C7929AF8DAE0A33F837146</code> <code>8D565142254850ACDEA2F4FF36BB1F7B</code><br> <code>BAD5CCF4</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 = BA0D89B5B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F
<!-- 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 = 54B64366B8F9ED7EFDED7EE93FADBE6C5143F6394D54EA31254243089E77019C06A529F00000000000000000FE0001008E56A8EF0B54797579B15BD7757DA0EFF06ED454F5A56DEFB703CA8B7721A5B7F19EC2BE6DA3CC423014F10B045ED5A772B8EFDA8AC8F6D40A2F64FC346E7F2DE9528BE18DE6D113E393C8319CA287DC3C19211CE1177D720B2049CCBAA8C945F672684896AB17BC7CBDDC8CFE62A4DB6D56EC42A0D0F4E776851A52C1EDC6347E93FF26E28EC7FB45E3FB5FF03D10DF418E146D36E62277768080D4E9C3056D40232A7F173A28EB289036E67FBDF6153BF2F866733856ABF19417E675F902F0C8F419A3A53328A633D1B9B0CF3C68F8E445B849EC4BF8EB98DAD6FFE08F2324FE1CBAB01AC3E7540A6B5DCC7CA8317E210F1C5B830C333E70F04FD5392EBDF2
padding = 40CDB07914884091266F1ABF
tmp_aes_key = 5028FB57D07AD7AEA070D02B26E6BDE4AB80742328D35421B99A5D37ABE9C368
tmp_aes_iv = BF6F3CBFCFD7D76DF70B881BF7C1B98C341468E67EC78092191B35790495A8C6</code></pre>
<pre><code>data = 54B643664818199E5C2C9029E8894B0BD5DC68772163DE11E08D2D57A8BF45B50921F8F90000000000000000FE0001006B4CFDDF0D0E1FD06B16991EF8A85A2D1F4D3CED7D9E83A65A9FD0DA1CE34C7473A4B01F3213F643F1BD63199F776C6A14F73F304627C7724F18A7AE3687B9542288A6BAFD51C7F14459E46C311FB3B7E2E5CB3D7EB5B3DA0FA373B280C1557D4119A4F2C9EBC4AD229C6CDAE0D62A72AF2F5356D0AF8B1F427A487C7D5E7C23006910E3E9BEC75DED1C4C15FB16246FE1B02EBD5BCE620F0A68A7F0425D4E1D17E1CF86EF43A05E68D94C0F4C0B11EBC657953989D20AAB9571B5E113BEDD0B9C952DE481553C133D4CFDD84E4A027D54AF8728CF1824E153D17D1DAF08A8FB69C7929AF8DAE0A33F8371468D565142254850ACDEA2F4FF36BB1F7BBAD5CCF4
padding = 7F32A4D59B81B5D712AC5517
tmp_aes_key = EFEE3DDE87871EE456FFE7D49BDDFC35B6A602DCD88104DE3B916E7B78D9B0C5
tmp_aes_iv = 78AA7B8D5CAF102BF3DBF0B6CD90720A6FDF35903B4A8448368D1587408B78A5</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 = 976CD8BB0F4C15CE6F4600F97BE02EFBE7EFB169AAD735836FB91F978A86EE7AC31D6C2DF542ECFE71778FFADD675964E4C77E8B881E3A69BB15F93B290B3580E63E0833592290FEA95356D0364A4B274711E8E811EA34F3598EEAE1C03004C5C180E05AD9FD786A1FCB8E9F6A50135AB6CD1E333FC473CE83D2B8BE780FC957CBF12EE897B024335E03F6F16B9228FB238C850D629FD4202998F32BDFF9FC02A960F804666D52A9DF3362E12AB73C8098E7DBEA4E3D8E45E5F2080D87E7B2E9BBF7999291D9E1BF023940C5A7DEDBD7D2A3D0FBDC4EAC40069FD982537D2818EA316D51108E8B352406E29F26147DE357B087BDC3633FF2D81E0894551969A6F9F2FE6D3E082FB95C61E10914194F298B0319F72B1747C0C670CC92460BB4A932BD1A97DF3EE135393905674E97A85692ECC46C2CD0F80D080DC8E6CC50BB3A9BCEEDC4FBFB86D7C2EBD78D7DCCE4FB</code></pre>
<pre><code>encrypted_data = 49E40621EE5D525449EB79599EE5567F19A7DAF16C5391E199B92A269A2600E19A187637874B9128A5F7A18BF9BFC4560D84CD1F592D599608DBD40E161BE0580F3B1753B123F7D777D798EEA7EF75B79BD9BE36956D7B7A8831FB9B02A5E68EF259FCC16F3A8034A4E1AB1F7239C9A905BEB960813714FC9C3B6F5DE03D876E7F004515D9DF7FD99AB2142BC0C84545D5AC90E1519E32494C6E60F9D97DD02625B2700F6B1253856055AEEB6AA40007D6DA4BFB37A657D2ABEAF4B57433EDB992ED9014DDDA1CBA2AB7CF2A7F08A39AFD213E1CBC9FBD79F039CF36FF95F57DC301E116C93A87B2FF5806E6D472BC508E25566B6C6F0D6279CA5249613DAD6E16E1AD92F42F15E785B319C8CEEF67C60D659415A4529689DA00BBFA3A2F0612434D27FE013C81CC03D140330FA8DA0740D22C1745E20D2FD32750D5E7CD1606110C1131A250B9FEA42866E5E39E7687</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 70 96 01 00 78 12 7B 65
0010 | 78 01 00 00 1F 5F 04 F5 B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39 4D 54 EA 31 25 42 43 08
0030 | 9E 77 01 9C 06 A5 29 F0 FE 50 01 00 97 6C D8 BB
0040 | 0F 4C 15 CE 6F 46 00 F9 7B E0 2E FB E7 EF B1 69
0050 | AA D7 35 83 6F B9 1F 97 8A 86 EE 7A C3 1D 6C 2D
0060 | F5 42 EC FE 71 77 8F FA DD 67 59 64 E4 C7 7E 8B
0070 | 88 1E 3A 69 BB 15 F9 3B 29 0B 35 80 E6 3E 08 33
0080 | 59 22 90 FE A9 53 56 D0 36 4A 4B 27 47 11 E8 E8
0090 | 11 EA 34 F3 59 8E EA E1 C0 30 04 C5 C1 80 E0 5A
00A0 | D9 FD 78 6A 1F CB 8E 9F 6A 50 13 5A B6 CD 1E 33
00B0 | 3F C4 73 CE 83 D2 B8 BE 78 0F C9 57 CB F1 2E E8
00C0 | 97 B0 24 33 5E 03 F6 F1 6B 92 28 FB 23 8C 85 0D
00D0 | 62 9F D4 20 29 98 F3 2B DF F9 FC 02 A9 60 F8 04
00E0 | 66 6D 52 A9 DF 33 62 E1 2A B7 3C 80 98 E7 DB EA
00F0 | 4E 3D 8E 45 E5 F2 08 0D 87 E7 B2 E9 BB F7 99 92
0100 | 91 D9 E1 BF 02 39 40 C5 A7 DE DB D7 D2 A3 D0 FB
0110 | DC 4E AC 40 06 9F D9 82 53 7D 28 18 EA 31 6D 51
0120 | 10 8E 8B 35 24 06 E2 9F 26 14 7D E3 57 B0 87 BD
0130 | C3 63 3F F2 D8 1E 08 94 55 19 69 A6 F9 F2 FE 6D
0140 | 3E 08 2F B9 5C 61 E1 09 14 19 4F 29 8B 03 19 F7
0150 | 2B 17 47 C0 C6 70 CC 92 46 0B B4 A9 32 BD 1A 97
0160 | DF 3E E1 35 39 39 05 67 4E 97 A8 56 92 EC C4 6C
0170 | 2C D0 F8 0D 08 0D C8 E6 CC 50 BB 3A 9B CE ED C4
0180 | FB FB 86 D7 C2 EB D7 8D 7D CC E4 FB</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 60 11 0F 00 71 87 7B 65
0010 | 78 01 00 00 1F 5F 04 F5 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77 21 63 DE 11 E0 8D 2D 57
0030 | A8 BF 45 B5 09 21 F8 F9 FE 50 01 00 49 E4 06 21
0040 | EE 5D 52 54 49 EB 79 59 9E E5 56 7F 19 A7 DA F1
0050 | 6C 53 91 E1 99 B9 2A 26 9A 26 00 E1 9A 18 76 37
0060 | 87 4B 91 28 A5 F7 A1 8B F9 BF C4 56 0D 84 CD 1F
0070 | 59 2D 59 96 08 DB D4 0E 16 1B E0 58 0F 3B 17 53
0080 | B1 23 F7 D7 77 D7 98 EE A7 EF 75 B7 9B D9 BE 36
0090 | 95 6D 7B 7A 88 31 FB 9B 02 A5 E6 8E F2 59 FC C1
00A0 | 6F 3A 80 34 A4 E1 AB 1F 72 39 C9 A9 05 BE B9 60
00B0 | 81 37 14 FC 9C 3B 6F 5D E0 3D 87 6E 7F 00 45 15
00C0 | D9 DF 7F D9 9A B2 14 2B C0 C8 45 45 D5 AC 90 E1
00D0 | 51 9E 32 49 4C 6E 60 F9 D9 7D D0 26 25 B2 70 0F
00E0 | 6B 12 53 85 60 55 AE EB 6A A4 00 07 D6 DA 4B FB
00F0 | 37 A6 57 D2 AB EA F4 B5 74 33 ED B9 92 ED 90 14
0100 | DD DA 1C BA 2A B7 CF 2A 7F 08 A3 9A FD 21 3E 1C
0110 | BC 9F BD 79 F0 39 CF 36 FF 95 F5 7D C3 01 E1 16
0120 | C9 3A 87 B2 FF 58 06 E6 D4 72 BC 50 8E 25 56 6B
0130 | 6C 6F 0D 62 79 CA 52 49 61 3D AD 6E 16 E1 AD 92
0140 | F4 2F 15 E7 85 B3 19 C8 CE EF 67 C6 0D 65 94 15
0150 | A4 52 96 89 DA 00 BB FA 3A 2F 06 12 43 4D 27 FE
0160 | 01 3C 81 CC 03 D1 40 33 0F A8 DA 07 40 D2 2C 17
0170 | 45 E2 0D 2F D3 27 50 D5 E7 CD 16 06 11 0C 11 31
0180 | A2 50 B9 FE A4 28 66 E5 E3 9E 76 87</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>7096010078127B65</code></td>
<td><code>60110F0071877B65</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>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100976CD8BB0F4C15CE6F4600F9</code> <code>7BE02EFBE7EFB169AAD735836FB91F97</code> <code>8A86EE7AC31D6C2DF542ECFE71778FFA</code> <code>DD675964E4C77E8B881E3A69BB15F93B</code> <code>290B3580E63E0833592290FEA95356D0</code> <code>364A4B274711E8E811EA34F3598EEAE1</code> <code>C03004C5C180E05AD9FD786A1FCB8E9F</code> <code>6A50135AB6CD1E333FC473CE83D2B8BE</code> <code>780FC957CBF12EE897B024335E03F6F1</code> <code>6B9228FB238C850D629FD4202998F32B</code> <code>DFF9FC02A960F804666D52A9DF3362E1</code> <code>2AB73C8098E7DBEA4E3D8E45E5F2080D</code> <code>87E7B2E9BBF7999291D9E1BF023940C5</code> <code>A7DEDBD7D2A3D0FBDC4EAC40069FD982</code> <code>537D2818EA316D51108E8B352406E29F</code> <code>26147DE357B087BDC3633FF2D81E0894</code> <code>551969A6F9F2FE6D3E082FB95C61E109</code> <code>14194F298B0319F72B1747C0C670CC92</code> <code>460BB4A932BD1A97DF3EE13539390567</code> <code>4E97A85692ECC46C2CD0F80D080DC8E6</code> <code>CC50BB3A9BCEEDC4FBFB86D7C2EBD78D</code><br> <code>7DCCE4FB</code></td>
<td><code>FE50010049E40621EE5D525449EB7959</code> <code>9EE5567F19A7DAF16C5391E199B92A26</code> <code>9A2600E19A187637874B9128A5F7A18B</code> <code>F9BFC4560D84CD1F592D599608DBD40E</code> <code>161BE0580F3B1753B123F7D777D798EE</code> <code>A7EF75B79BD9BE36956D7B7A8831FB9B</code> <code>02A5E68EF259FCC16F3A8034A4E1AB1F</code> <code>7239C9A905BEB960813714FC9C3B6F5D</code> <code>E03D876E7F004515D9DF7FD99AB2142B</code> <code>C0C84545D5AC90E1519E32494C6E60F9</code> <code>D97DD02625B2700F6B1253856055AEEB</code> <code>6AA40007D6DA4BFB37A657D2ABEAF4B5</code> <code>7433EDB992ED9014DDDA1CBA2AB7CF2A</code> <code>7F08A39AFD213E1CBC9FBD79F039CF36</code> <code>FF95F57DC301E116C93A87B2FF5806E6</code> <code>D472BC508E25566B6C6F0D6279CA5249</code> <code>613DAD6E16E1AD92F42F15E785B319C8</code> <code>CEEF67C60D659415A4529689DA00BBFA</code> <code>3A2F0612434D27FE013C81CC03D14033</code> <code>0FA8DA0740D22C1745E20D2FD32750D5</code> <code>E7CD1606110C1131A250B9FEA42866E5</code><br> <code>E39E7687</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 = 823B5A4889770D05C445DFEED1D61CB2CF11F2C0642DA7794CED72BD10D2F8C0E0D6B09EE6A70DC7EAA6487908FAA91959CFDE476ADA6A4301656EA75B19A3204F6B4EC407C8CEC9F4B4EBCE941F133EC6786A74741062A6FFEC3E4DE642A3EE9F02AC306ACABBC3B62350A43097783D055941CB1128373BA6577C136A0D6FBC7976BFC4248438980CF15B952DC397C5998D93A17B683F3943089ED82FC3B3B360ADCB186BAACC2BC5388450B9E15E8F76CD2CCD7CF4763E5DB80BA8EE6961BD310D684CFAC8999E94C8AE99BD1CFE2C009640010B975484CF2A327B1BEA53D93C37968B7EC1677B1189A54836D918E3B4010CEFE009C09EE9DB98C77FA8FD92</code></pre>
<pre><code>auth_key = BFF2E21820423265E03F1DA0234D96AB746C6C5630C3B44798C0313CEA1F4066A3789D40E1555DEBD559EF505F1F8FF6ACD0B532E3070B9FD49EE552541992B0C91E64EE41AD20146143711DB787566CFA46ED99E0FA2C3B93780F41FE73C2B5E89FEDCD43A3B879647CDB0E3D666A1AE9050FD8CFAE9ED16F61D3F8A9274C08EDA7D8255F3F76A0F70EA15EA12D06DA7E757B30C0F3CFD244AC6CB1D44DE29DA73CB32CB1FF8FC7CD5F707F010975A6E595F335D75D8E55CA029095E2A9EE29B2D0ED4D2B6A9D758C126AE130F39E854CE09F017B0C69B59B55231149762B55F69B00D2E1A0F3FF6CCD2FFA08D75BE83F2A69BDB6A731D2A25A162AA0769965</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 7C 3C BF 78 12 7B 65
0010 | 60 00 00 00 34 F7 CB 3B B8 F9 ED 7E FD ED 7E E9
0020 | 3F AD BE 6C 51 43 F6 39 4D 54 EA 31 25 42 43 08
0030 | 9E 77 01 9C 06 A5 29 F0 DF 20 1E 8B 93 39 C4 F6
0040 | 41 F8 AA 8E D8 E2 4B DB</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 48 26 16 72 87 7B 65
0010 | 44 00 00 00 34 F7 CB 3B 48 18 19 9E 5C 2C 90 29
0020 | E8 89 4B 0B D5 DC 68 77 21 63 DE 11 E0 8D 2D 57
0030 | A8 BF 45 B5 09 21 F8 F9 78 8D 89 FB D4 EC C6 A9
0040 | 66 3E A2 0F 01 88 7A D7</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>017C3CBF78127B65</code></td>
<td><code>0148261672877B65</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>60000000</code> (96 in decimal)</td>
<td><code>44000000</code> (68 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>B8F9ED7EFDED7EE93FADBE6C5143F639</code></td>
<td><code>4818199E5C2C9029E8894B0BD5DC6877</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>4D54EA31254243089E77019C06A529F0</code></td>
<td><code>2163DE11E08D2D57A8BF45B50921F8F9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>DF201E8B9339C4F641F8AA8ED8E24BDB</code></td>
<td><code>788D89FBD4ECC6A9663EA20F01887AD7</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

@ -8,14 +8,14 @@
Constructor
Description
peerColor
 ">
Represents a color palette ».">
<meta property="og:title" content="PeerColor">
<meta property="og:image" content="">
<meta property="og:description" content="Constructors
Constructor
Description
peerColor
 ">
Represents a color palette ».">
<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">
@ -74,7 +74,7 @@ peerColor
<tbody>
<tr>
<td><a href="/constructor/peerColor">peerColor</a></td>
<td> </td>
<td>Represents a <a href="/api/colors">color palette »</a>.</td>
</tr>
</tbody>
</table></div>

View file

@ -8,14 +8,14 @@
Constructor
Description
storyFwdHeader
 ">
Contains info about the original poster of a reposted story.">
<meta property="og:title" content="StoryFwdHeader">
<meta property="og:image" content="">
<meta property="og:description" content="Constructors
Constructor
Description
storyFwdHeader
 ">
Contains info about the original poster of a reposted story.">
<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">
@ -74,7 +74,7 @@ storyFwdHeader
<tbody>
<tr>
<td><a href="/constructor/storyFwdHeader">storyFwdHeader</a></td>
<td> </td>
<td>Contains info about the original poster of a reposted story.</td>
</tr>
</tbody>
</table></div>