Update content of files

This commit is contained in:
GitHub Action 2023-11-22 22:01:19 +00:00
parent 6b0aa85955
commit aa67b81287
6 changed files with 222 additions and 220 deletions

View file

@ -378,7 +378,7 @@
<li>Added <a href="/constructor/messagePeerVoteMultiple">messagePeerVoteMultiple</a> - How a peer voted in a multiple-choice poll</li>
<li>Added <a href="/constructor/inputPrivacyKeyAbout">inputPrivacyKeyAbout</a> - Whether people can see your bio</li>
<li>Added <a href="/constructor/privacyKeyAbout">privacyKeyAbout</a> - Whether people can see your bio</li>
<li>Added <a href="/constructor/sponsoredWebPage">sponsoredWebPage</a> - </li>
<li>Added <a href="/constructor/sponsoredWebPage">sponsoredWebPage</a> - Represents a sponsored website.</li>
</ul>
<h5><a class="anchor" href="#changed-constructors" id="changed-constructors" name="changed-constructors"><i class="anchor-icon"></i></a>Changed Constructors</h5>
<ul>

View file

@ -97,7 +97,7 @@ Note that if any of the conditions changes in the period between the call to <a
<li><code>expire</code>: Period after which the story is moved to <a href="#pinnedarchived-stories">archive</a> (and <a href="#pinnedarchived-stories">to the profile</a> if <code>pinned</code> is set), in seconds; must be one of <code>6 * 3600</code>, <code>12 * 3600</code>, <code>86400</code>, or <code>2 * 86400</code> for Telegram Premium users, and <code>86400</code> otherwise.</li>
<li><code>pinned</code>: Whether to also <a href="#pinned-stories">add the story to the profile</a> automatically upon expiration. If not set, the story will only be added to the <a href="#pinnedarchived-stories">archive</a>. </li>
</ul>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/constructor/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/constructor/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>). </p>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/method/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>). </p>
<p>Also, posting a story will emit an <a href="/constructor/updateStory">updateStory</a> both for us, and for our subscribers/contacts (even if they have <a href="#hiding-stories-of-other-users">hidden</a> our stories). </p>
<p>A story may also be edited using <a href="/method/stories.editStory">stories.editStory</a>. </p>
<h4><a class="anchor" href="#pinned-archived-stories" id="pinned-archived-stories" name="pinned-archived-stories"><i class="anchor-icon"></i></a>Pinned/archived stories</h4>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>updateStoryID</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="A story was successfully uploaded.">
<meta property="description" content="A story was successfully uploaded. Once a story is successfully uploaded, an updateStoryID will be returned, indicating the story ID (id) that was attributed to the story (like for messages, random_id indicates the random_id that was passed to stories.sendStory: this way, you can tell which story was assigned a specific id by checking which stories.sendStory call has the returned random_id).">
<meta property="og:title" content="updateStoryID">
<meta property="og:image" content="">
<meta property="og:description" content="A story was successfully uploaded.">
<meta property="og:description" content="A story was successfully uploaded. Once a story is successfully uploaded, an updateStoryID will be returned, indicating the story ID (id) that was attributed to the story (like for messages, random_id indicates the random_id that was passed to stories.sendStory: this way, you can tell which story was assigned a specific id by checking which stories.sendStory call has the returned random_id).">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -43,7 +43,7 @@
<h1 id="dev_page_title">updateStoryID</h1>
<div id="dev_page_content"><p>A story was successfully uploaded.</p>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/constructor/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/constructor/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</p>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/method/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -75,16 +75,18 @@
<tr>
<td><strong>random_id</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td>The <code>random_id</code> that was passed to <a href="/constructor/stories.sendStory">stories.sendStory</a>.</td>
<td>The <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</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/Update">Update</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#storiessendstory" id="storiessendstory" name="storiessendstory"><i class="anchor-icon"></i></a><a href="/method/stories.sendStory">stories.sendStory</a></h4>
<p>Uploads a <a href="/api/stories">Telegram Story</a>.</p>
<h4><a class="anchor" href="#updatestoryid" id="updatestoryid" name="updatestoryid"><i class="anchor-icon"></i></a><a href="/constructor/updateStoryID">updateStoryID</a></h4>
<p>A story was successfully uploaded.</p>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/constructor/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/constructor/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</p></div>
<p>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/method/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</p></div>
</div>

View file

@ -129,11 +129,6 @@
<td>You haven't joined this channel/supergroup.</td>
</tr>
<tr>
<td>400</td>
<td>FILE_REFERENCE_*</td>
<td>The file reference expired, it <a href="/api/file_reference">must be refreshed</a>.</td>
</tr>
<tr>
<td>406</td>
<td>FILEREF_UPGRADE_NEEDED</td>
<td>The client has to be updated in order to support <a href="/api/file_reference">file references</a>.</td>
@ -145,6 +140,11 @@
</tr>
<tr>
<td>400</td>
<td>FILE_REFERENCE_*</td>
<td>The file reference expired, it <a href="/api/file_reference">must be refreshed</a>.</td>
</tr>
<tr>
<td>400</td>
<td>FILE_REFERENCE_EXPIRED</td>
<td>File reference expired, it must be refetched as described in <a href="/api/file_reference">the documentation</a>.</td>
</tr>

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 1C 38 09 00 77 2F 55 65
0010 | 14 00 00 00 F1 8E 7E BE 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 34 E8 06 00 79 78 5E 65
0010 | 14 00 00 00 F1 8E 7E BE 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE</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>1C380900772F5565</code></td>
<td><code>34E8060079785E65</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>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</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 EC 39 27 77 2F 55 65
0010 | 84 00 00 00 63 24 16 05 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | 39 A6 A5 A4 4C 02 D5 01 08 0E 20 2E 1B F7 E4 D0
0040 | E1 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 D0 91 DC 79 78 5E 65
0010 | 94 00 00 00 63 24 16 05 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE 86 E3 AD 1A CB CC D1 93
0030 | E8 5F 59 80 B3 27 7A 00 08 22 02 C8 34 E1 53 4B
0040 | E3 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>01EC3927772F5565</code></td>
<td><code>01D091DC79785E65</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>84000000</code> (132 in decimal)</td>
<td><code>94000000</code> (148 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>080E202E1BF7E4D0E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1017864213443694817</td>
<td><code>082202C834E1534BE3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2450741276687158243</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -206,24 +206,24 @@
<p>Let's choose the only matching key, the one with fingerprint equal to <code>85FD64DE851D9DD0</code>.</p>
<!-- end fingerprints -->
<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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<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 = 1017864213443694817</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1017864213443694817 = 1001404913 * 1016436209</code></p>
<pre><code>p = 1001404913
q = 1016436209</code></pre>
<pre><code>pq = 2450741276687158243</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2450741276687158243 = 1480128193 * 1655762851</code></p>
<pre><code>p = 1480128193
q = 1655762851</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 0E 20 2E 1B F7 E4 D0 E1 00 00 00
0010 | 04 3B B0 39 F1 00 00 00 04 3C 95 95 F1 00 00 00
0020 | 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E F1 B7 45 6B
0030 | 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4 4C 02 D5 01
0040 | D2 99 14 0C 54 81 B8 DB C3 F0 00 65 1A E0 14 AF
0050 | E6 24 2C CA 50 6B DE 69 E7 81 62 68 FB 33 D4 12
<pre><code>0000 | 95 5F F5 A9 08 22 02 C8 34 E1 53 4B E3 00 00 00
0010 | 04 58 38 F6 C1 00 00 00 04 62 B0 EF A3 00 00 00
0020 | 9E D2 F5 84 EA 8D 6F A9 FB BC 0C 3C B6 87 53 EE
0030 | 86 E3 AD 1A CB CC D1 93 E8 5F 59 80 B3 27 7A 00
0040 | A3 CB A1 3D 34 D8 64 69 FB CC 3D E3 C4 A7 D4 22
0050 | 89 AE 34 44 7E 9A 10 B0 23 45 B0 60 A0 86 FC BF
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 = 1016436209</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>080E202E1BF7E4D0E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1017864213443694817</td>
<td><code>082202C834E1534BE3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2450741276687158243</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>043BB039F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001404913</td>
<td><code>045838F6C1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1480128193</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>043C9595F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1016436209</td>
<td><code>0462B0EFA3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1655762851</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>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>D299140C5481B8DBC3F000651AE014AF</code> <code>E6242CCA506BDE69E7816268FB33D412</code></td>
<td><code>A3CBA13D34D86469FBCC3DE3C4A7D422</code> <code>89AE34447E9A10B02345B060A086FCBF</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1016436209</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 = 955FF5A9080E202E1BF7E4D0E1000000043BB039F1000000043C9595F10000002E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D501D299140C5481B8DBC3F000651AE014AFE6242CCA506BDE69E7816268FB33D41202000000
random_padding_bytes = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139A5A02DF90B5F5F7BAA235BF79570D0C8621B252257CCCC42887DE397F83B42A653BBBB1182AE0AD93FCD9E0B8FCFCA49CFC3E077EDF9E82AE1DB2AD01ECC716</code></pre>
<pre><code>data = 955FF5A9082202C834E1534BE3000000045838F6C10000000462B0EFA30000009ED2F584EA8D6FA9FBBC0C3CB68753EE86E3AD1ACBCCD193E85F5980B3277A00A3CBA13D34D86469FBCC3DE3C4A7D42289AE34447E9A10B02345B060A086FCBF02000000
random_padding_bytes = 1142DD6B3DC4ADC50CC3B20931F03FAD2F58A5AC0EFD8724415D5D4CD3AADEC12AB77B68FA23AB6C4BD61593C56FC2CDC7500094189999DC0C3638922B46B07CFE65C2DCB2B99DAFD4F6DA6520119606CFA090FD3E7145B01676C39E</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 = 23ECB4204C6BE286A6DCA7DE73830B70209CB289052882E50682CC3F0BFAE7CCB92FA4E683A1FE06DF8CFA2A01BEA507DEE569A88A1CE8674DEABFE57125A66BC0CDD114DED3918D49C22B778704DBFA2AE73F7C52CB0B6989F0296601347F0659F337633BA09C8AA9CDB08F4162D61FD3B70A0E19316BFD919BEACBC39EFF7B0A80B8FECEEC345F82C637A0FB647A707007EE552F98577969BD0C1930F7010E344695FF0A51B4E6435172259159C7D2E128B14B3368E070006E30CF15AEFCF695E80F66E539AEFE48A74A9AEF17737F9C1437D1ED41A005F52C7ABBB955921639EF62AD3DA0B07AA38B88766290DB1FA2651DBC85EBD747AC363572BAB76AFA</code></pre>
<pre><code>encrypted_data = 3DF5BF94758DDF82CEDA146C9E09A2EEC36242D7B6A095FB4FE4266CB7CC6FFC6546FAE35E8D024485186D8D446F2B1590DC9A867C6A47D29177EEC49CEC419C964C8804CD3A8ED7B6F3B837AE9ACF9844EB3F5F23B13C423BF0F0D940F0BA472161E481186E9C28C6DBC10383DC95B72C9596415E8976192A9584A8FEF5A56BF186FF6A397235248AFB0990F1CA3C072FF28237AD3B73AC07E1720B8F9C8E70A71061EE7C06E3DEED3AD6844ECD2601E3EBBC19EB2B72F4B4CE16B68E8600166E89FF047933FA0627A168E8F99E899C5D3CB42E45268409AD121EF33378D0D8856B0BBA89824DAED93159E2480079A658CF4D431460FCA77F492A182508D9E0</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 20 38 09 00 77 2F 55 65
0010 | 40 01 00 00 BE E4 12 D7 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | 39 A6 A5 A4 4C 02 D5 01 04 3B B0 39 F1 00 00 00
0040 | 04 3C 95 95 F1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 23 EC B4 20 4C 6B E2 86 A6 DC A7 DE
0060 | 73 83 0B 70 20 9C B2 89 05 28 82 E5 06 82 CC 3F
0070 | 0B FA E7 CC B9 2F A4 E6 83 A1 FE 06 DF 8C FA 2A
0080 | 01 BE A5 07 DE E5 69 A8 8A 1C E8 67 4D EA BF E5
0090 | 71 25 A6 6B C0 CD D1 14 DE D3 91 8D 49 C2 2B 77
00A0 | 87 04 DB FA 2A E7 3F 7C 52 CB 0B 69 89 F0 29 66
00B0 | 01 34 7F 06 59 F3 37 63 3B A0 9C 8A A9 CD B0 8F
00C0 | 41 62 D6 1F D3 B7 0A 0E 19 31 6B FD 91 9B EA CB
00D0 | C3 9E FF 7B 0A 80 B8 FE CE EC 34 5F 82 C6 37 A0
00E0 | FB 64 7A 70 70 07 EE 55 2F 98 57 79 69 BD 0C 19
00F0 | 30 F7 01 0E 34 46 95 FF 0A 51 B4 E6 43 51 72 25
0100 | 91 59 C7 D2 E1 28 B1 4B 33 68 E0 70 00 6E 30 CF
0110 | 15 AE FC F6 95 E8 0F 66 E5 39 AE FE 48 A7 4A 9A
0120 | EF 17 73 7F 9C 14 37 D1 ED 41 A0 05 F5 2C 7A BB
0130 | B9 55 92 16 39 EF 62 AD 3D A0 B0 7A A3 8B 88 76
0140 | 62 90 DB 1F A2 65 1D BC 85 EB D7 47 AC 36 35 72
0150 | BA B7 6A FA</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 00 53 0A 00 79 78 5E 65
0010 | 40 01 00 00 BE E4 12 D7 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE 86 E3 AD 1A CB CC D1 93
0030 | E8 5F 59 80 B3 27 7A 00 04 58 38 F6 C1 00 00 00
0040 | 04 62 B0 EF A3 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 3D F5 BF 94 75 8D DF 82 CE DA 14 6C
0060 | 9E 09 A2 EE C3 62 42 D7 B6 A0 95 FB 4F E4 26 6C
0070 | B7 CC 6F FC 65 46 FA E3 5E 8D 02 44 85 18 6D 8D
0080 | 44 6F 2B 15 90 DC 9A 86 7C 6A 47 D2 91 77 EE C4
0090 | 9C EC 41 9C 96 4C 88 04 CD 3A 8E D7 B6 F3 B8 37
00A0 | AE 9A CF 98 44 EB 3F 5F 23 B1 3C 42 3B F0 F0 D9
00B0 | 40 F0 BA 47 21 61 E4 81 18 6E 9C 28 C6 DB C1 03
00C0 | 83 DC 95 B7 2C 95 96 41 5E 89 76 19 2A 95 84 A8
00D0 | FE F5 A5 6B F1 86 FF 6A 39 72 35 24 8A FB 09 90
00E0 | F1 CA 3C 07 2F F2 82 37 AD 3B 73 AC 07 E1 72 0B
00F0 | 8F 9C 8E 70 A7 10 61 EE 7C 06 E3 DE ED 3A D6 84
0100 | 4E CD 26 01 E3 EB BC 19 EB 2B 72 F4 B4 CE 16 B6
0110 | 8E 86 00 16 6E 89 FF 04 79 33 FA 06 27 A1 68 E8
0120 | F9 9E 89 9C 5D 3C B4 2E 45 26 84 09 AD 12 1E F3
0130 | 33 78 D0 D8 85 6B 0B BA 89 82 4D AE D9 31 59 E2
0140 | 48 00 79 A6 58 CF 4D 43 14 60 FC A7 7F 49 2A 18
0150 | 25 08 D9 E0</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 = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>20380900772F5565</code></td>
<td><code>00530A0079785E65</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 = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>043BB039F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001404913</td>
<td><code>045838F6C1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1480128193</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>043C9595F1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1016436209</td>
<td><code>0462B0EFA3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1655762851</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 = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010023ECB4204C6BE286A6DCA7DE</code> <code>73830B70209CB289052882E50682CC3F</code> <code>0BFAE7CCB92FA4E683A1FE06DF8CFA2A</code> <code>01BEA507DEE569A88A1CE8674DEABFE5</code> <code>7125A66BC0CDD114DED3918D49C22B77</code> <code>8704DBFA2AE73F7C52CB0B6989F02966</code> <code>01347F0659F337633BA09C8AA9CDB08F</code> <code>4162D61FD3B70A0E19316BFD919BEACB</code> <code>C39EFF7B0A80B8FECEEC345F82C637A0</code> <code>FB647A707007EE552F98577969BD0C19</code> <code>30F7010E344695FF0A51B4E643517225</code> <code>9159C7D2E128B14B3368E070006E30CF</code> <code>15AEFCF695E80F66E539AEFE48A74A9A</code> <code>EF17737F9C1437D1ED41A005F52C7ABB</code> <code>B955921639EF62AD3DA0B07AA38B8876</code> <code>6290DB1FA2651DBC85EBD747AC363572</code><br> <code>BAB76AFA</code></td>
<td><code>FE0001003DF5BF94758DDF82CEDA146C</code> <code>9E09A2EEC36242D7B6A095FB4FE4266C</code> <code>B7CC6FFC6546FAE35E8D024485186D8D</code> <code>446F2B1590DC9A867C6A47D29177EEC4</code> <code>9CEC419C964C8804CD3A8ED7B6F3B837</code> <code>AE9ACF9844EB3F5F23B13C423BF0F0D9</code> <code>40F0BA472161E481186E9C28C6DBC103</code> <code>83DC95B72C9596415E8976192A9584A8</code> <code>FEF5A56BF186FF6A397235248AFB0990</code> <code>F1CA3C072FF28237AD3B73AC07E1720B</code> <code>8F9C8E70A71061EE7C06E3DEED3AD684</code> <code>4ECD2601E3EBBC19EB2B72F4B4CE16B6</code> <code>8E8600166E89FF047933FA0627A168E8</code> <code>F99E899C5D3CB42E45268409AD121EF3</code> <code>3378D0D8856B0BBA89824DAED93159E2</code> <code>480079A658CF4D431460FCA77F492A18</code><br> <code>2508D9E0</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<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 9C 62 D9 77 2F 55 65
0010 | 8C 02 00 00 5C 07 E8 D0 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 02 00 1D 7E 4E 4D
0040 | 30 82 B4 0F D0 8B A8 CF 93 B4 37 64 7C E4 11 92
0050 | 5A 51 B9 C8 26 4A E6 A5 F4 CA A3 A0 1D 6C C1 90
0060 | A0 64 C4 C2 11 FD 0A 10 B7 FA ED BE 20 04 BF 59
0070 | F3 99 A3 48 16 6C 86 E6 C9 74 D0 B8 6B E5 4F 0A
0080 | 99 A6 93 3F 02 13 E5 1C EC 42 56 21 13 DB E8 4B
0090 | A1 B7 78 B9 FD 55 94 02 03 6B BF C2 5D 66 2E 18
00A0 | B2 CF 42 8A 9B 9A 5B 47 ED E6 F2 2F AB 31 93 90
00B0 | 74 0D 09 15 D1 FC 68 8E 10 5B AF 32 F6 F0 1B 92
00C0 | 7D D2 E0 A9 D7 B0 1E C6 57 83 36 77 D5 84 B4 73
00D0 | 27 08 EA BA 5F BC EB 34 5A DF 5B 1F E6 B9 A1 58
00E0 | F5 D7 76 D0 84 A3 AB 53 80 60 0C D5 20 1E DE 4C
00F0 | 9E D0 64 7E 1C 82 DF 55 0A B2 72 CD 96 D3 7D 33
0100 | 40 63 89 D8 B4 A1 14 45 41 87 C1 4F F8 2E 84 B3
0110 | 3A AC C6 13 D6 EF 50 E8 16 2E EB E0 A6 F2 61 3E
0120 | 48 7B 7A BD DF 44 C4 FB FF 3F 19 DE 95 BC 39 53
0130 | 42 F0 E9 CA 0D 91 7B D7 0D A3 4D AC 1B 52 0B C5
0140 | 68 EF 3F DB 1D 0B 6E 0D FB D1 C8 1C B1 FC 76 D0
0150 | 31 52 6F EA F4 E0 5F 02 92 4D 0E 00 2D E8 CC CC
0160 | A2 0B F9 DB 5E BC B2 05 21 D4 B6 CB 24 1A 3A 89
0170 | FC 79 62 4D 08 77 23 0B 18 98 AF 08 E0 07 79 6F
0180 | F7 75 62 74 DD 3C FC 16 93 3D B8 3E 1A B0 45 6A
0190 | E1 5B 1D 35 BC D5 19 20 9C E4 38 2D EF 96 8F E5
01A0 | D2 84 3A 02 DF 7D 61 11 23 45 17 51 1F 97 5F BD
01B0 | 0A 08 D7 05 86 37 8C 83 11 1B 69 75 8A 14 9B 1B
01C0 | 44 09 D7 93 6D DA 3C 4C 7A 63 C8 69 6C B9 D5 8D
01D0 | 9B E6 AB 6B 76 40 A2 B5 4F DA B6 FF 06 A6 AB C1
01E0 | AB ED F3 B3 D9 F3 43 D3 D9 87 D6 BA 57 C8 85 00
01F0 | 9E CA 3A BD 57 3F 7B DC 49 F4 B6 4E 69 73 1B B4
0200 | 5F 66 3C CB 64 26 35 F6 F3 E8 88 65 1F DA F5 9C
0210 | 51 6A 13 D3 8B 77 74 48 31 97 98 EC 9E 72 4F 9C
0220 | 5D D9 45 25 E6 E1 9A A0 49 55 FC 4C C3 9D 49 4B
0230 | A7 6A DF 4B 9D F8 A5 28 1E 9B C5 F2 9F 16 0C 74
0240 | B1 91 11 71 59 9E 68 31 5D 2A 51 6C 4A 73 46 41
0250 | 60 7C 2D 97 D6 F0 64 90 B2 5C 1C 67 1E 20 35 A9
0260 | B4 C1 A7 B5 94 69 3D 25 0E AC 4B 79 78 5D DA 64
0270 | 89 6E E6 36 3C E9 D5 F4 1B 4F 85 CE DB BD 6F CA
0280 | 42 92 99 F8 FB 9A 4B 72 4F 2D 15 F6</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 08 FD 92 7A 78 5E 65
0010 | EC 02 00 00 5C 07 E8 D0 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE 86 E3 AD 1A CB CC D1 93
0030 | E8 5F 59 80 B3 27 7A 00 FE 50 02 00 83 63 2B B8
0040 | C0 4A AE 42 82 1A 1B 00 22 81 B1 D6 DE FA C1 A1
0050 | 0D DC FE 59 2D 5D 9C 89 7D C8 7F CC 63 EF 95 87
0060 | F2 58 48 F5 CB 76 D2 50 64 5C 3A BE F7 F6 12 06
0070 | 34 97 BC A6 27 FC 94 A2 0E D4 8C 9F 39 BB 87 BE
0080 | A1 F0 BB C0 24 87 53 7C 67 78 3C 62 EC D4 64 E2
0090 | 4F B3 BF F3 6E 40 4D AA D3 81 3E A5 44 6F 03 45
00A0 | 4B 2B 11 5C 15 08 13 D5 5D 8D E1 16 2E 3B 4B 45
00B0 | 81 B7 06 E6 46 43 05 D5 60 C5 5F B4 9B A9 78 4C
00C0 | FA 34 FF 0A 36 EC 7B AF F8 0A 27 28 1C 04 4C 5E
00D0 | 10 12 BD 7D DD 8F 12 7A 1C EC EE 47 FE 38 25 65
00E0 | 8F 19 87 19 78 03 CF 8F BA 3D 3E 92 E4 49 81 C4
00F0 | 31 0C 96 F4 23 CD 7C 92 8C 60 8E 04 47 DA 30 A5
0100 | 09 6B 1E 12 38 44 E0 AE 73 8C 0A AC 35 24 8A 38
0110 | C6 FC B2 3C 0E D2 89 AC 65 0D 0E C3 8A E5 FF 21
0120 | 41 46 4C 74 00 93 D3 71 08 CA 43 A9 7C A7 92 33
0130 | 2C A3 1D AD 03 7C BE E3 7D D3 3E 8E DB 53 A5 5E
0140 | B1 BF E6 AB 1D 98 7F 40 E0 AB C7 BB DB 10 23 23
0150 | F8 40 00 F3 C9 DF 07 98 3D 42 F4 D3 DA 28 AB 46
0160 | AC 01 13 70 6C 8E EE B2 95 A7 90 85 67 19 46 01
0170 | FF F4 BC 86 4A D1 BC 40 12 8F 50 AE 18 8C 1B 38
0180 | 37 85 7B C8 BD 7E 56 E3 58 D8 33 A0 7A BF 42 C6
0190 | 63 A5 47 DC EB E5 51 06 9B A3 AD 8B D8 D1 EC FA
01A0 | 9A 1B 93 7E 01 BE 10 33 70 82 E5 04 F3 A5 EC 94
01B0 | 74 26 38 87 49 15 0D AD 76 A2 CD BA 44 41 3A 9C
01C0 | 8D 02 84 88 69 73 49 E1 BD 30 B5 F3 B3 89 6C A4
01D0 | E4 B5 96 D5 44 E9 F0 23 B6 D2 98 45 3E 2F F3 70
01E0 | ED CD EF 86 79 D0 84 F3 D4 A6 1A AA F2 09 C6 6A
01F0 | 73 BA 25 F6 40 E1 B9 EA 42 1E FE 71 C9 5A 5D 7F
0200 | 48 32 A5 96 8D 5E B8 D4 D2 ED 21 80 3D 09 06 4E
0210 | C8 77 50 39 37 66 BD 9E CB 89 A9 39 A3 32 46 37
0220 | 23 36 29 42 62 E7 7F AD 40 67 6B 7F 17 B1 4B D7
0230 | 2C 68 9E 43 AB 0F 4C F4 F9 ED 3A 95 1C 3D 38 DA
0240 | 6B 76 A8 61 31 1D 2E 1F F6 6E EF 5E 7E 63 A5 39
0250 | 33 FD 4E C4 6A 3C 4B 14 57 84 CA EE 37 3A 25 CD
0260 | 6A B8 2A AE BD 13 0F 9C 6D 50 2D EE 95 59 01 32
0270 | 7C 13 CE C8 35 0C 05 18 96 99 D5 7E BE 94 ED 7D
0280 | 6B A6 FB 93 8F 60 5A C9 B2 F3 54 D8</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 = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>019C62D9772F5565</code></td>
<td><code>0108FD927A785E65</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>8C020000</code> (652 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 = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE5002001D7E4E4D3082B40FD08BA8CF</code> <code>93B437647CE411925A51B9C8264AE6A5</code> <code>F4CAA3A01D6CC190A064C4C211FD0A10</code> <code>B7FAEDBE2004BF59F399A348166C86E6</code> <code>C974D0B86BE54F0A99A6933F0213E51C</code> <code>EC42562113DBE84BA1B778B9FD559402</code> <code>036BBFC25D662E18B2CF428A9B9A5B47</code> <code>EDE6F22FAB319390740D0915D1FC688E</code> <code>105BAF32F6F01B927DD2E0A9D7B01EC6</code> <code>57833677D584B4732708EABA5FBCEB34</code> <code>5ADF5B1FE6B9A158F5D776D084A3AB53</code> <code>80600CD5201EDE4C9ED0647E1C82DF55</code> <code>0AB272CD96D37D33406389D8B4A11445</code> <code>4187C14FF82E84B33AACC613D6EF50E8</code> <code>162EEBE0A6F2613E487B7ABDDF44C4FB</code> <code>FF3F19DE95BC395342F0E9CA0D917BD7</code> <code>0DA34DAC1B520BC568EF3FDB1D0B6E0D</code> <code>FBD1C81CB1FC76D031526FEAF4E05F02</code> <code>924D0E002DE8CCCCA20BF9DB5EBCB205</code> <code>21D4B6CB241A3A89FC79624D0877230B</code> <code>1898AF08E007796FF7756274DD3CFC16</code> <code>933DB83E1AB0456AE15B1D35BCD51920</code> <code>9CE4382DEF968FE5D2843A02DF7D6111</code> <code>234517511F975FBD0A08D70586378C83</code> <code>111B69758A149B1B4409D7936DDA3C4C</code> <code>7A63C8696CB9D58D9BE6AB6B7640A2B5</code> <code>4FDAB6FF06A6ABC1ABEDF3B3D9F343D3</code> <code>D987D6BA57C885009ECA3ABD573F7BDC</code> <code>49F4B64E69731BB45F663CCB642635F6</code> <code>F3E888651FDAF59C516A13D38B777448</code> <code>319798EC9E724F9C5DD94525E6E19AA0</code> <code>4955FC4CC39D494BA76ADF4B9DF8A528</code> <code>1E9BC5F29F160C74B1911171599E6831</code> <code>5D2A516C4A734641607C2D97D6F06490</code> <code>B25C1C671E2035A9B4C1A7B594693D25</code> <code>0EAC4B79785DDA64896EE6363CE9D5F4</code> <code>1B4F85CEDBBD6FCA429299F8FB9A4B72</code><br> <code>4F2D15F6</code></td>
<td><code>FE50020083632BB8C04AAE42821A1B00</code> <code>2281B1D6DEFAC1A10DDCFE592D5D9C89</code> <code>7DC87FCC63EF9587F25848F5CB76D250</code> <code>645C3ABEF7F612063497BCA627FC94A2</code> <code>0ED48C9F39BB87BEA1F0BBC02487537C</code> <code>67783C62ECD464E24FB3BFF36E404DAA</code> <code>D3813EA5446F03454B2B115C150813D5</code> <code>5D8DE1162E3B4B4581B706E6464305D5</code> <code>60C55FB49BA9784CFA34FF0A36EC7BAF</code> <code>F80A27281C044C5E1012BD7DDD8F127A</code> <code>1CECEE47FE3825658F1987197803CF8F</code> <code>BA3D3E92E44981C4310C96F423CD7C92</code> <code>8C608E0447DA30A5096B1E123844E0AE</code> <code>738C0AAC35248A38C6FCB23C0ED289AC</code> <code>650D0EC38AE5FF2141464C740093D371</code> <code>08CA43A97CA792332CA31DAD037CBEE3</code> <code>7DD33E8EDB53A55EB1BFE6AB1D987F40</code> <code>E0ABC7BBDB102323F84000F3C9DF0798</code> <code>3D42F4D3DA28AB46AC0113706C8EEEB2</code> <code>95A7908567194601FFF4BC864AD1BC40</code> <code>128F50AE188C1B3837857BC8BD7E56E3</code> <code>58D833A07ABF42C663A547DCEBE55106</code> <code>9BA3AD8BD8D1ECFA9A1B937E01BE1033</code> <code>7082E504F3A5EC947426388749150DAD</code> <code>76A2CDBA44413A9C8D028488697349E1</code> <code>BD30B5F3B3896CA4E4B596D544E9F023</code> <code>B6D298453E2FF370EDCDEF8679D084F3</code> <code>D4A61AAAF209C66A73BA25F640E1B9EA</code> <code>421EFE71C95A5D7F4832A5968D5EB8D4</code> <code>D2ED21803D09064EC87750393766BD9E</code> <code>CB89A939A33246372336294262E77FAD</code> <code>40676B7F17B14BD72C689E43AB0F4CF4</code> <code>F9ED3A951C3D38DA6B76A861311D2E1F</code> <code>F66EEF5E7E63A53933FD4EC46A3C4B14</code> <code>5784CAEE373A25CD6AB82AAEBD130F9C</code> <code>6D502DEE955901327C13CEC8350C0518</code> <code>9699D57EBE94ED7D6BA6FB938F605AC9</code><br> <code>B2F354D8</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139
<!-- 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 = 1D7E4E4D3082B40FD08BA8CF93B437647CE411925A51B9C8264AE6A5F4CAA3A01D6CC190A064C4C211FD0A10B7FAEDBE2004BF59F399A348166C86E6C974D0B86BE54F0A99A6933F0213E51CEC42562113DBE84BA1B778B9FD559402036BBFC25D662E18B2CF428A9B9A5B47EDE6F22FAB319390740D0915D1FC688E105BAF32F6F01B927DD2E0A9D7B01EC657833677D584B4732708EABA5FBCEB345ADF5B1FE6B9A158F5D776D084A3AB5380600CD5201EDE4C9ED0647E1C82DF550AB272CD96D37D33406389D8B4A114454187C14FF82E84B33AACC613D6EF50E8162EEBE0A6F2613E487B7ABDDF44C4FBFF3F19DE95BC395342F0E9CA0D917BD70DA34DAC1B520BC568EF3FDB1D0B6E0DFBD1C81CB1FC76D031526FEAF4E05F02924D0E002DE8CCCCA20BF9DB5EBCB20521D4B6CB241A3A89FC79624D0877230B1898AF08E007796FF7756274DD3CFC16933DB83E1AB0456AE15B1D35BCD519209CE4382DEF968FE5D2843A02DF7D6111234517511F975FBD0A08D70586378C83111B69758A149B1B4409D7936DDA3C4C7A63C8696CB9D58D9BE6AB6B7640A2B54FDAB6FF06A6ABC1ABEDF3B3D9F343D3D987D6BA57C885009ECA3ABD573F7BDC49F4B64E69731BB45F663CCB642635F6F3E888651FDAF59C516A13D38B777448319798EC9E724F9C5DD94525E6E19AA04955FC4CC39D494BA76ADF4B9DF8A5281E9BC5F29F160C74B1911171599E68315D2A516C4A734641607C2D97D6F06490B25C1C671E2035A9B4C1A7B594693D250EAC4B79785DDA64896EE6363CE9D5F41B4F85CEDBBD6FCA429299F8FB9A4B724F2D15F6
tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C</code></pre>
<pre><code>encrypted_answer = 83632BB8C04AAE42821A1B002281B1D6DEFAC1A10DDCFE592D5D9C897DC87FCC63EF9587F25848F5CB76D250645C3ABEF7F612063497BCA627FC94A20ED48C9F39BB87BEA1F0BBC02487537C67783C62ECD464E24FB3BFF36E404DAAD3813EA5446F03454B2B115C150813D55D8DE1162E3B4B4581B706E6464305D560C55FB49BA9784CFA34FF0A36EC7BAFF80A27281C044C5E1012BD7DDD8F127A1CECEE47FE3825658F1987197803CF8FBA3D3E92E44981C4310C96F423CD7C928C608E0447DA30A5096B1E123844E0AE738C0AAC35248A38C6FCB23C0ED289AC650D0EC38AE5FF2141464C740093D37108CA43A97CA792332CA31DAD037CBEE37DD33E8EDB53A55EB1BFE6AB1D987F40E0ABC7BBDB102323F84000F3C9DF07983D42F4D3DA28AB46AC0113706C8EEEB295A7908567194601FFF4BC864AD1BC40128F50AE188C1B3837857BC8BD7E56E358D833A07ABF42C663A547DCEBE551069BA3AD8BD8D1ECFA9A1B937E01BE10337082E504F3A5EC947426388749150DAD76A2CDBA44413A9C8D028488697349E1BD30B5F3B3896CA4E4B596D544E9F023B6D298453E2FF370EDCDEF8679D084F3D4A61AAAF209C66A73BA25F640E1B9EA421EFE71C95A5D7F4832A5968D5EB8D4D2ED21803D09064EC87750393766BD9ECB89A939A33246372336294262E77FAD40676B7F17B14BD72C689E43AB0F4CF4F9ED3A951C3D38DA6B76A861311D2E1FF66EEF5E7E63A53933FD4EC46A3C4B145784CAEE373A25CD6AB82AAEBD130F9C6D502DEE955901327C13CEC8350C05189699D57EBE94ED7D6BA6FB938F605AC9B2F354D8
tmp_aes_key = 99CCA58E7584C1EE1903081987F4183B912B1AE70BB654F456246DC0B30EF7BC
tmp_aes_iv = 116AD638FEE958A8C07EB2FF218C4F69AEB73C67B95A2D596BAC4C2CA3CBA13D</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 05533A31BBCBEFCEDC94220613DF0527C1379CAABA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB
answer = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB</code></pre>
<pre><code>answer_with_hash = A4E6837A9535664B7F4DFEE7AEB23B17B430319ABA0D89B59ED2F584EA8D6FA9FBBC0C3CB68753EE86E3AD1ACBCCD193E85F5980B3277A0003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004C398589774D1EE9C58C3B5D7971D0C1523ACD94534C83BE3415E324ED48EC51934F6AFA7AA13E5A063F5962CE16AF8CE2952B1C6CDFCCF6F7FDEEB5880DC8AA0832A3362C05318C1F6CCB11CE506DBA4C8D1D44BE78B949652CD93988899FF9448770E8E5F56F208E68B0FE339C65D93B37C3ABE1C8B02CFFF24674D30B1FB4D190B7B810884E94C761B166DB3A31440363B8EBCB8A177604AD57C362FC172F8990A1EBC5436EA56F149BCDC56320A7DC0C9DF5C347FED9285DCBF14B5CA0FE59F9D064BECC5EE25FEBB1D0FDC5D8A72BC4665CC068BFFF7FAE9838DF3B7F5C91F91EEC3886EC383443F2BFED145A651F20CEE50B007003EBD9E0D606D3D4EC7A785E65711F1E5835C05429
answer = BA0D89B59ED2F584EA8D6FA9FBBC0C3CB68753EE86E3AD1ACBCCD193E85F5980B3277A0003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004C398589774D1EE9C58C3B5D7971D0C1523ACD94534C83BE3415E324ED48EC51934F6AFA7AA13E5A063F5962CE16AF8CE2952B1C6CDFCCF6F7FDEEB5880DC8AA0832A3362C05318C1F6CCB11CE506DBA4C8D1D44BE78B949652CD93988899FF9448770E8E5F56F208E68B0FE339C65D93B37C3ABE1C8B02CFFF24674D30B1FB4D190B7B810884E94C761B166DB3A31440363B8EBCB8A177604AD57C362FC172F8990A1EBC5436EA56F149BCDC56320A7DC0C9DF5C347FED9285DCBF14B5CA0FE59F9D064BECC5EE25FEBB1D0FDC5D8A72BC4665CC068BFFF7FAE9838DF3B7F5C91F91EEC3886EC383443F2BFED145A651F20CEE50B007003EBD9E0D606D3D4EC7A785E65711F1E5835C05429</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 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
0020 | 4C 02 D5 01 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 9E D2 F5 84 EA 8D 6F A9 FB BC 0C 3C
0010 | B6 87 53 EE 86 E3 AD 1A CB CC D1 93 E8 5F 59 80
0020 | B3 27 7A 00 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 = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
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 | 63 EC DF AE B4 AC 2E 0D 2C 0D F4 6F 1C AC 03 41
0140 | 17 93 55 F0 58 B7 FC E3 9C 42 26 BB 97 72 1E 0A
0150 | 52 BC 30 23 C4 73 4B 42 09 A5 FB EB 6E 0A 39 32
0160 | 0E 63 47 36 E7 5F 89 86 1F CB 2E FF 73 C9 4C 97
0170 | AF 32 B0 8C 61 D5 8B 5A 28 55 F4 33 65 7F 77 44
0180 | E4 DB 6B 6E 66 44 BF 5B F5 17 93 80 D5 81 05 81
0190 | 92 31 53 F8 03 45 8C A0 14 61 59 B1 1D 89 B4 0D
01A0 | 54 F3 AB 5F 04 31 CA 53 3B DF E9 A5 F1 F7 D9 E3
01B0 | 5F 15 02 63 57 79 0A 29 5D 1D D4 A7 77 5A 53 DE
01C0 | CB E6 21 7A 12 3C A7 E5 20 72 94 09 B7 3A B3 0D
01D0 | C0 B7 17 BC 8D 35 B0 0D B6 E2 76 BD 61 84 86 A2
01E0 | 05 07 66 9F CD BA C1 0C 7B FD 10 EA 66 5B BA B8
01F0 | C3 FF 9F C4 08 CA 44 54 66 0D 05 46 D2 15 8E CD
0200 | 0C A9 46 FF E6 17 C6 66 07 A6 86 CF 50 3E 72 A9
0210 | 7C F2 2C 51 F7 52 73 CA AF 20 D2 B5 1F 08 8F 10
0220 | 01 3D 4E E6 51 C8 5D 43 35 07 70 FF DC AB D9 5A
0230 | 77 2F 55 65</code></pre>
0130 | 4C 39 85 89 77 4D 1E E9 C5 8C 3B 5D 79 71 D0 C1
0140 | 52 3A CD 94 53 4C 83 BE 34 15 E3 24 ED 48 EC 51
0150 | 93 4F 6A FA 7A A1 3E 5A 06 3F 59 62 CE 16 AF 8C
0160 | E2 95 2B 1C 6C DF CC F6 F7 FD EE B5 88 0D C8 AA
0170 | 08 32 A3 36 2C 05 31 8C 1F 6C CB 11 CE 50 6D BA
0180 | 4C 8D 1D 44 BE 78 B9 49 65 2C D9 39 88 89 9F F9
0190 | 44 87 70 E8 E5 F5 6F 20 8E 68 B0 FE 33 9C 65 D9
01A0 | 3B 37 C3 AB E1 C8 B0 2C FF F2 46 74 D3 0B 1F B4
01B0 | D1 90 B7 B8 10 88 4E 94 C7 61 B1 66 DB 3A 31 44
01C0 | 03 63 B8 EB CB 8A 17 76 04 AD 57 C3 62 FC 17 2F
01D0 | 89 90 A1 EB C5 43 6E A5 6F 14 9B CD C5 63 20 A7
01E0 | DC 0C 9D F5 C3 47 FE D9 28 5D CB F1 4B 5C A0 FE
01F0 | 59 F9 D0 64 BE CC 5E E2 5F EB B1 D0 FD C5 D8 A7
0200 | 2B C4 66 5C C0 68 BF FF 7F AE 98 38 DF 3B 7F 5C
0210 | 91 F9 1E EC 38 86 EC 38 34 43 F2 BF ED 14 5A 65
0220 | 1F 20 CE E5 0B 00 70 03 EB D9 E0 D6 06 D3 D4 EC
0230 | 7A 78 5E 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 = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010063ECDFAEB4AC2E0D2C0DF46F</code> <code>1CAC0341179355F058B7FCE39C4226BB</code> <code>97721E0A52BC3023C4734B4209A5FBEB</code> <code>6E0A39320E634736E75F89861FCB2EFF</code> <code>73C94C97AF32B08C61D58B5A2855F433</code> <code>657F7744E4DB6B6E6644BF5BF5179380</code> <code>D5810581923153F803458CA0146159B1</code> <code>1D89B40D54F3AB5F0431CA533BDFE9A5</code> <code>F1F7D9E35F15026357790A295D1DD4A7</code> <code>775A53DECBE6217A123CA7E520729409</code> <code>B73AB30DC0B717BC8D35B00DB6E276BD</code> <code>618486A20507669FCDBAC10C7BFD10EA</code> <code>665BBAB8C3FF9FC408CA4454660D0546</code> <code>D2158ECD0CA946FFE617C66607A686CF</code> <code>503E72A97CF22C51F75273CAAF20D2B5</code> <code>1F088F10013D4EE651C85D43350770FF</code><br> <code>DCABD95A</code></td>
<td><code>FE0001004C398589774D1EE9C58C3B5D</code> <code>7971D0C1523ACD94534C83BE3415E324</code> <code>ED48EC51934F6AFA7AA13E5A063F5962</code> <code>CE16AF8CE2952B1C6CDFCCF6F7FDEEB5</code> <code>880DC8AA0832A3362C05318C1F6CCB11</code> <code>CE506DBA4C8D1D44BE78B949652CD939</code> <code>88899FF9448770E8E5F56F208E68B0FE</code> <code>339C65D93B37C3ABE1C8B02CFFF24674</code> <code>D30B1FB4D190B7B810884E94C761B166</code> <code>DB3A31440363B8EBCB8A177604AD57C3</code> <code>62FC172F8990A1EBC5436EA56F149BCD</code> <code>C56320A7DC0C9DF5C347FED9285DCBF1</code> <code>4B5CA0FE59F9D064BECC5EE25FEBB1D0</code> <code>FDC5D8A72BC4665CC068BFFF7FAE9838</code> <code>DF3B7F5C91F91EEC3886EC383443F2BF</code> <code>ED145A651F20CEE50B007003EBD9E0D6</code><br> <code>06D3D4EC</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>772F5565</code> (1700081527 in decimal)</td>
<td><code>7A785E65</code> (1700690042 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
<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 = E6FB3B7B3A740733C365A0623A697FD0EF13458CD03A3E32BC9B91DE5B23C0E794CE0062630F12077BDFD16171FB4E907D3BB68C276590306DBBD270C49E937098E0E77ACD88756F646EDBB65E9F54347571A8FDED531CE9A547736A992CBD619B072075DBD643F12FB5DC322C668E48DF22DBCC1C7BE0721FCAE026FF0FE3C5851D64D6BB7D74AA860AC623DE25D60F2336242BC8A86E533ECC5C667DEBAF6EA08ECEB700397023F24C8B0C48654CE58C396B2C72FB0CABD93A9058812B7874B88466A1CA8FF89F727DF653B3D6713560F9DBC0FCE757400C8ABC26625E2FCDB254609CD230A6646242E252DD116466EF8A8324EFF4DA5365A11DAF410900C5</code></pre>
<pre><code>b = BFEB74412651EE4B6ACA63489ED6458293D8F260002B655851B882DCDFDB02CD65C8C016FB08A7070382C8E1D4FABD2455BC16E7C10AC968CEAB96FC16FFA25D9C58012DEE4548D1A512BBDEAFF66E0B8722623B16BC496CE4A31E6B4914BD491137FFEAE4994D6817BEDB5304CBF1F4424AE94AC9BC75791F58C6726B5D6C44EBEEDA4F1426DEF6DEAB1F251AA0516A833B0932C9914B29312BCA4F983F5DB83CABFC6F55469C6CB235139838A1FD73BD4B05A5FF1EA08CB5EF2B1907E30959EEBF53CB807F40B1736D334784F7D12D38763A5DE16AF904AF4883A1BF8D8E49B0EB09337B0CB3634389507B90E338DBE8EBB54D19902A7D14BD26BEB09E2EED</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 = 26B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4</code></pre>
<pre><code>g_b = 05DC721E4B0B65C253CB91862BAAE2058D48F664B2ABE26C98900B0FFDB1A459CF301AE12C324998C3D6F31069D2A8E6EB7ACF242E6749CBB954526D27BB59DEE0E889CEB673705AFAA01CDB05B52FC65AAC0E0C5E1D0187E46A792E0F6F6B23898E3197AA69590110988D8F4A6658DA64A3CE8300FEEF763888D6D6CD3088A94191FEC20A2960709A75FE7583B0E5AECC25192646792C30899F7B05AB4A0EADC9345343E46F5E10719806A51D36A8377D8902069FCEC02B952141734B7100294B1A8434D6060D8E10D326CA9DADB0E89352A26ABFCBD7DCB448182C45E781081B0526B0CBC66AFE2E66242C43CC5412E3C0F0157B9D6F0FEADDD5D822922007</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 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
0020 | 4C 02 D5 01 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 26 B5 65 8C 74 97 30 88 5A EF B3 95 6B 27 BA 6B
0040 | 24 B3 C5 0C 6C 7D 9C 98 6E CC 9D 71 F8 90 4E 9A
0050 | 79 01 8E C2 03 47 32 C8 D6 FA C1 FC 3F 01 AC 6D
0060 | C4 0F BB F5 EF 17 1D 21 CA CB 63 07 6F B7 13 12
0070 | AF B3 9C 73 B4 AF 3C FF 0D C6 D1 68 13 82 A9 2A
0080 | 88 25 31 66 FE 0E 20 16 2E 80 C7 45 D5 60 67 0C
0090 | 9B 1C 66 F8 85 C4 C8 13 73 76 C1 A4 88 2F E8 A4
00A0 | D6 BA A5 94 60 D8 6A E4 79 D1 E9 E3 DF 50 07 FC
00B0 | 1C B2 08 B0 B3 85 61 8D 28 DD D0 46 EF B2 1D 03
00C0 | A6 71 8A B9 F8 7D 71 68 08 4E F5 50 54 19 C0 0C
00D0 | F6 A4 A9 F3 96 8A 37 6A E9 9F 84 FB 48 A9 49 D8
00E0 | 21 AA 7E E3 04 4B DA 13 99 35 90 08 9F CA 46 DE
00F0 | F8 A4 2C C7 F3 B8 E0 62 A6 4C 4B 16 45 A1 B1 63
0100 | 33 A4 06 D3 45 77 2A BD FD B2 B7 6A 6E 5D 6C 2D
0110 | 4C EC 87 34 CD 47 35 9F 47 8F 90 CB BE 21 1A 11
0120 | F6 2A D7 34 55 63 7B 86 68 9B E4 76 05 CA A2 B4</code></pre>
<pre><code>0000 | 54 B6 43 66 9E D2 F5 84 EA 8D 6F A9 FB BC 0C 3C
0010 | B6 87 53 EE 86 E3 AD 1A CB CC D1 93 E8 5F 59 80
0020 | B3 27 7A 00 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 05 DC 72 1E 4B 0B 65 C2 53 CB 91 86 2B AA E2 05
0040 | 8D 48 F6 64 B2 AB E2 6C 98 90 0B 0F FD B1 A4 59
0050 | CF 30 1A E1 2C 32 49 98 C3 D6 F3 10 69 D2 A8 E6
0060 | EB 7A CF 24 2E 67 49 CB B9 54 52 6D 27 BB 59 DE
0070 | E0 E8 89 CE B6 73 70 5A FA A0 1C DB 05 B5 2F C6
0080 | 5A AC 0E 0C 5E 1D 01 87 E4 6A 79 2E 0F 6F 6B 23
0090 | 89 8E 31 97 AA 69 59 01 10 98 8D 8F 4A 66 58 DA
00A0 | 64 A3 CE 83 00 FE EF 76 38 88 D6 D6 CD 30 88 A9
00B0 | 41 91 FE C2 0A 29 60 70 9A 75 FE 75 83 B0 E5 AE
00C0 | CC 25 19 26 46 79 2C 30 89 9F 7B 05 AB 4A 0E AD
00D0 | C9 34 53 43 E4 6F 5E 10 71 98 06 A5 1D 36 A8 37
00E0 | 7D 89 02 06 9F CE C0 2B 95 21 41 73 4B 71 00 29
00F0 | 4B 1A 84 34 D6 06 0D 8E 10 D3 26 CA 9D AD B0 E8
0100 | 93 52 A2 6A BF CB D7 DC B4 48 18 2C 45 E7 81 08
0110 | 1B 05 26 B0 CB C6 6A FE 2E 66 24 2C 43 CC 54 12
0120 | E3 C0 F0 15 7B 9D 6F 0F EA DD D5 D8 22 92 20 07</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 = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE00010026B5658C749730885AEFB395</code> <code>6B27BA6B24B3C50C6C7D9C986ECC9D71</code> <code>F8904E9A79018EC2034732C8D6FAC1FC</code> <code>3F01AC6DC40FBBF5EF171D21CACB6307</code> <code>6FB71312AFB39C73B4AF3CFF0DC6D168</code> <code>1382A92A88253166FE0E20162E80C745</code> <code>D560670C9B1C66F885C4C8137376C1A4</code> <code>882FE8A4D6BAA59460D86AE479D1E9E3</code> <code>DF5007FC1CB208B0B385618D28DDD046</code> <code>EFB21D03A6718AB9F87D7168084EF550</code> <code>5419C00CF6A4A9F3968A376AE99F84FB</code> <code>48A949D821AA7EE3044BDA1399359008</code> <code>9FCA46DEF8A42CC7F3B8E062A64C4B16</code> <code>45A1B16333A406D345772ABDFDB2B76A</code> <code>6E5D6C2D4CEC8734CD47359F478F90CB</code> <code>BE211A11F62AD73455637B86689BE476</code><br> <code>05CAA2B4</code></td>
<td><code>FE00010005DC721E4B0B65C253CB9186</code> <code>2BAAE2058D48F664B2ABE26C98900B0F</code> <code>FDB1A459CF301AE12C324998C3D6F310</code> <code>69D2A8E6EB7ACF242E6749CBB954526D</code> <code>27BB59DEE0E889CEB673705AFAA01CDB</code> <code>05B52FC65AAC0E0C5E1D0187E46A792E</code> <code>0F6F6B23898E3197AA69590110988D8F</code> <code>4A6658DA64A3CE8300FEEF763888D6D6</code> <code>CD3088A94191FEC20A2960709A75FE75</code> <code>83B0E5AECC25192646792C30899F7B05</code> <code>AB4A0EADC9345343E46F5E10719806A5</code> <code>1D36A8377D8902069FCEC02B95214173</code> <code>4B7100294B1A8434D6060D8E10D326CA</code> <code>9DADB0E89352A26ABFCBD7DCB448182C</code> <code>45E781081B0526B0CBC66AFE2E66242C</code> <code>43CC5412E3C0F0157B9D6F0FEADDD5D8</code><br> <code>22922007</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 = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50
<!-- 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 = 54B643662E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D5010000000000000000FE00010026B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4
padding = 42713D7C63F7A248A383EEA8
tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C</code></pre>
<pre><code>data = 54B643669ED2F584EA8D6FA9FBBC0C3CB68753EE86E3AD1ACBCCD193E85F5980B3277A000000000000000000FE00010005DC721E4B0B65C253CB91862BAAE2058D48F664B2ABE26C98900B0FFDB1A459CF301AE12C324998C3D6F31069D2A8E6EB7ACF242E6749CBB954526D27BB59DEE0E889CEB673705AFAA01CDB05B52FC65AAC0E0C5E1D0187E46A792E0F6F6B23898E3197AA69590110988D8F4A6658DA64A3CE8300FEEF763888D6D6CD3088A94191FEC20A2960709A75FE7583B0E5AECC25192646792C30899F7B05AB4A0EADC9345343E46F5E10719806A51D36A8377D8902069FCEC02B952141734B7100294B1A8434D6060D8E10D326CA9DADB0E89352A26ABFCBD7DCB448182C45E781081B0526B0CBC66AFE2E66242C43CC5412E3C0F0157B9D6F0FEADDD5D822922007
padding = 461732066CB04B25F76D017E
tmp_aes_key = 99CCA58E7584C1EE1903081987F4183B912B1AE70BB654F456246DC0B30EF7BC
tmp_aes_iv = 116AD638FEE958A8C07EB2FF218C4F69AEB73C67B95A2D596BAC4C2CA3CBA13D</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 = 43B58FB3C3D12AFCE51B4DEA2511C55B73FF1AB30F1B6237E7748AA38A5521830D374B878D70617ED153DA684245C422FC52F80A5DABB1E14D90D3DB688759EF5D220069D33E64BE07B0C416EDE8CE755322FD36284F6C92127F6FA08EABF37F3BF2586779306B2B65D29470AC9FD28A767E2B8F67DDDBB0C5ED9AECB1F430DB284AAF487F8E8823DC285F43931D4C316AE869D98E329B7B3DB04C82228442ADFCB86A1A28F414F4BB67456A35BE9DBE0C922B841270D7F61FABC8F8E8B124B0A12A9DF3A796D823EABB640EDB6434702AA541B5C1253EB8B1A0EB1713D242C9F2A383AEE1764763C2EEE3B21612738E41094DD230D907338AC30442E952C525BCA32412899F72D5D3FA5A47B1674A2824978BC8414201C0B8B7074C5D3AA758411C630A90D381D5834DF7295A7A933C6D779D87831401483299F4101300B3CF2F7AF32C16377FF0BA111F5DCFB0FF2F</code></pre>
<pre><code>encrypted_data = 65D4EFF0AF3B43A2336ADE8EBB600587DF201DFCE35C7F76BD0807A01995158AAAEB5E4AA477973D24851A9642B4E1BB4E3A732F3D87B5EC27EAA19B38DEB596047BADD8FF15AB2278B18255031011B1C58213123AE98EDA4A32DC17F2065290A72B9AEA1D95026E0367C051A1370BA38E1F2B66FED1D99DEE1FB7BCD5674C5C828E3738CE587B5C252FD11C9D5A2DBB216B82F620042141FB81AA61B73CF9F2EFEF898FB2E26BB3D4D61393AA55C125C0366D97DB4EE42F9526796A611FE89C9736337228AE221A171B59723A374181A2548BDCDEE5B24A33C0252F8D88D625EF996DB4E99DC2E41E263779B8CD8E593B75587CCE43C70148098D41345680DA1B5DE11835EDE90530E56DC7750E2DD7A7AB5197C42CF244E72A980F071B885B43975DC32EF129C85FB49130CA4CB923CC190731460434E7C6B7992C2D969794AC42A14381B6C1B955897945EFC4A6C9</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 20 92 03 00 78 2F 55 65
0010 | 78 01 00 00 1F 5F 04 F5 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 01 00 43 B5 8F B3
0040 | C3 D1 2A FC E5 1B 4D EA 25 11 C5 5B 73 FF 1A B3
0050 | 0F 1B 62 37 E7 74 8A A3 8A 55 21 83 0D 37 4B 87
0060 | 8D 70 61 7E D1 53 DA 68 42 45 C4 22 FC 52 F8 0A
0070 | 5D AB B1 E1 4D 90 D3 DB 68 87 59 EF 5D 22 00 69
0080 | D3 3E 64 BE 07 B0 C4 16 ED E8 CE 75 53 22 FD 36
0090 | 28 4F 6C 92 12 7F 6F A0 8E AB F3 7F 3B F2 58 67
00A0 | 79 30 6B 2B 65 D2 94 70 AC 9F D2 8A 76 7E 2B 8F
00B0 | 67 DD DB B0 C5 ED 9A EC B1 F4 30 DB 28 4A AF 48
00C0 | 7F 8E 88 23 DC 28 5F 43 93 1D 4C 31 6A E8 69 D9
00D0 | 8E 32 9B 7B 3D B0 4C 82 22 84 42 AD FC B8 6A 1A
00E0 | 28 F4 14 F4 BB 67 45 6A 35 BE 9D BE 0C 92 2B 84
00F0 | 12 70 D7 F6 1F AB C8 F8 E8 B1 24 B0 A1 2A 9D F3
0100 | A7 96 D8 23 EA BB 64 0E DB 64 34 70 2A A5 41 B5
0110 | C1 25 3E B8 B1 A0 EB 17 13 D2 42 C9 F2 A3 83 AE
0120 | E1 76 47 63 C2 EE E3 B2 16 12 73 8E 41 09 4D D2
0130 | 30 D9 07 33 8A C3 04 42 E9 52 C5 25 BC A3 24 12
0140 | 89 9F 72 D5 D3 FA 5A 47 B1 67 4A 28 24 97 8B C8
0150 | 41 42 01 C0 B8 B7 07 4C 5D 3A A7 58 41 1C 63 0A
0160 | 90 D3 81 D5 83 4D F7 29 5A 7A 93 3C 6D 77 9D 87
0170 | 83 14 01 48 32 99 F4 10 13 00 B3 CF 2F 7A F3 2C
0180 | 16 37 7F F0 BA 11 1F 5D CF B0 FF 2F</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 0C 8E 03 00 7A 78 5E 65
0010 | 78 01 00 00 1F 5F 04 F5 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE 86 E3 AD 1A CB CC D1 93
0030 | E8 5F 59 80 B3 27 7A 00 FE 50 01 00 65 D4 EF F0
0040 | AF 3B 43 A2 33 6A DE 8E BB 60 05 87 DF 20 1D FC
0050 | E3 5C 7F 76 BD 08 07 A0 19 95 15 8A AA EB 5E 4A
0060 | A4 77 97 3D 24 85 1A 96 42 B4 E1 BB 4E 3A 73 2F
0070 | 3D 87 B5 EC 27 EA A1 9B 38 DE B5 96 04 7B AD D8
0080 | FF 15 AB 22 78 B1 82 55 03 10 11 B1 C5 82 13 12
0090 | 3A E9 8E DA 4A 32 DC 17 F2 06 52 90 A7 2B 9A EA
00A0 | 1D 95 02 6E 03 67 C0 51 A1 37 0B A3 8E 1F 2B 66
00B0 | FE D1 D9 9D EE 1F B7 BC D5 67 4C 5C 82 8E 37 38
00C0 | CE 58 7B 5C 25 2F D1 1C 9D 5A 2D BB 21 6B 82 F6
00D0 | 20 04 21 41 FB 81 AA 61 B7 3C F9 F2 EF EF 89 8F
00E0 | B2 E2 6B B3 D4 D6 13 93 AA 55 C1 25 C0 36 6D 97
00F0 | DB 4E E4 2F 95 26 79 6A 61 1F E8 9C 97 36 33 72
0100 | 28 AE 22 1A 17 1B 59 72 3A 37 41 81 A2 54 8B DC
0110 | DE E5 B2 4A 33 C0 25 2F 8D 88 D6 25 EF 99 6D B4
0120 | E9 9D C2 E4 1E 26 37 79 B8 CD 8E 59 3B 75 58 7C
0130 | CE 43 C7 01 48 09 8D 41 34 56 80 DA 1B 5D E1 18
0140 | 35 ED E9 05 30 E5 6D C7 75 0E 2D D7 A7 AB 51 97
0150 | C4 2C F2 44 E7 2A 98 0F 07 1B 88 5B 43 97 5D C3
0160 | 2E F1 29 C8 5F B4 91 30 CA 4C B9 23 CC 19 07 31
0170 | 46 04 34 E7 C6 B7 99 2C 2D 96 97 94 AC 42 A1 43
0180 | 81 B6 C1 B9 55 89 79 45 EF C4 A6 C9</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>20920300782F5565</code></td>
<td><code>0C8E03007A785E65</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>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010043B58FB3C3D12AFCE51B4DEA</code> <code>2511C55B73FF1AB30F1B6237E7748AA3</code> <code>8A5521830D374B878D70617ED153DA68</code> <code>4245C422FC52F80A5DABB1E14D90D3DB</code> <code>688759EF5D220069D33E64BE07B0C416</code> <code>EDE8CE755322FD36284F6C92127F6FA0</code> <code>8EABF37F3BF2586779306B2B65D29470</code> <code>AC9FD28A767E2B8F67DDDBB0C5ED9AEC</code> <code>B1F430DB284AAF487F8E8823DC285F43</code> <code>931D4C316AE869D98E329B7B3DB04C82</code> <code>228442ADFCB86A1A28F414F4BB67456A</code> <code>35BE9DBE0C922B841270D7F61FABC8F8</code> <code>E8B124B0A12A9DF3A796D823EABB640E</code> <code>DB6434702AA541B5C1253EB8B1A0EB17</code> <code>13D242C9F2A383AEE1764763C2EEE3B2</code> <code>1612738E41094DD230D907338AC30442</code> <code>E952C525BCA32412899F72D5D3FA5A47</code> <code>B1674A2824978BC8414201C0B8B7074C</code> <code>5D3AA758411C630A90D381D5834DF729</code> <code>5A7A933C6D779D87831401483299F410</code> <code>1300B3CF2F7AF32C16377FF0BA111F5D</code><br> <code>CFB0FF2F</code></td>
<td><code>FE50010065D4EFF0AF3B43A2336ADE8E</code> <code>BB600587DF201DFCE35C7F76BD0807A0</code> <code>1995158AAAEB5E4AA477973D24851A96</code> <code>42B4E1BB4E3A732F3D87B5EC27EAA19B</code> <code>38DEB596047BADD8FF15AB2278B18255</code> <code>031011B1C58213123AE98EDA4A32DC17</code> <code>F2065290A72B9AEA1D95026E0367C051</code> <code>A1370BA38E1F2B66FED1D99DEE1FB7BC</code> <code>D5674C5C828E3738CE587B5C252FD11C</code> <code>9D5A2DBB216B82F620042141FB81AA61</code> <code>B73CF9F2EFEF898FB2E26BB3D4D61393</code> <code>AA55C125C0366D97DB4EE42F9526796A</code> <code>611FE89C9736337228AE221A171B5972</code> <code>3A374181A2548BDCDEE5B24A33C0252F</code> <code>8D88D625EF996DB4E99DC2E41E263779</code> <code>B8CD8E593B75587CCE43C70148098D41</code> <code>345680DA1B5DE11835EDE90530E56DC7</code> <code>750E2DD7A7AB5197C42CF244E72A980F</code> <code>071B885B43975DC32EF129C85FB49130</code> <code>CA4CB923CC190731460434E7C6B7992C</code> <code>2D969794AC42A14381B6C1B955897945</code><br> <code>EFC4A6C9</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 = 80E188CDCC0FEBB560B9E1F8A2D8803A8E52EF0C629EB73E75B2C197971A4EBBD1ACA56D902A5D2CF9D6BB7E64853EE4606A66663D0590607DEFAB61D0548D2FCC12DF1F39C9A94FB41EFF7FEDAE2786F92C8208EE10118751AEBFE73A77F5F8A0ECA63FDC7F157DE28AED3F5E5A7BA1049ED69E30BFB66A62AFE75267D5857895D452D0EF9297C9B705DE40E414749C876A40DE99A9EDE803B39F2B74A613311F9ACB14146173048C1931E36984ADF1A8D52C35EA9EEDBDE5F9F9D718EBA2E5F1F16A4DA33C7FD3608FC36FF068EB6CED61F229850BCA84E33606F2456F0DC921F482DFB13FA35013D6010A545DCF1519FD53781C47EE4F2E0376673B4C3783</code></pre>
<pre><code>auth_key = 93C34DA0D84A1EF6FCD2ECD5F8FBA80C2BBCD67DFF004B4AE900F9C139362A54F3E0489FEF95369A44CCE0206F3DE4B8B17EB87E70E9BD47A07359D6D013A2A44D45C12CD3A2058322E689F6495531043D1AEBFF8C071E3C4E8DE8AD0EDDD69D215E988372865734634E20AF01225BD0ECD3C402D8564382C26C6D7631ABCCBC5E5AFB1E9B4E37A4A85788327D7CC1CBE14E158A060A1AB7F5F97285278211E423F52FAAC3F97F002668919C957784A5F99612FA940E3DFD53759F65BA265B90ECFEF32AE33660417E827E04D598C717846FE907545E3F5136E3BD9D319A59AB9595772B73C79D02F27AA7C7CC49B70892226CCA7A5389BB05E7AB04FDABC926</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 A8 DE 97 78 2F 55 65
0010 | 5C 00 00 00 34 F7 CB 3B 2E 43 2C 2D 21 17 81 12
0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
0030 | 39 A6 A5 A4 4C 02 D5 01 D5 89 78 EF 7B 68 27 29
0040 | 4A 27 29 83 33 1E D6 87</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E4 9B DA 7A 78 5E 65
0010 | 60 00 00 00 34 F7 CB 3B 9E D2 F5 84 EA 8D 6F A9
0020 | FB BC 0C 3C B6 87 53 EE 86 E3 AD 1A CB CC D1 93
0030 | E8 5F 59 80 B3 27 7A 00 8A 54 7D C0 35 E2 7F 30
0040 | EF 1F BA 06 6B 3D 79 0A</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>01A8DE97782F5565</code></td>
<td><code>01E49BDA7A785E65</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>5C000000</code> (92 in decimal)</td>
<td><code>60000000</code> (96 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>2E432C2D211781126DA7CE6EF1B7456B</code></td>
<td><code>9ED2F584EA8D6FA9FBBC0C3CB68753EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3FBD310C0CC8473039A6A5A44C02D501</code></td>
<td><code>86E3AD1ACBCCD193E85F5980B3277A00</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>D58978EF7B6827294A272983331ED687</code></td>
<td><code>8A547DC035E27F30EF1FBA066B3D790A</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

@ -639,7 +639,7 @@
</tr>
<tr>
<td><a href="/constructor/updateStoryID">updateStoryID</a></td>
<td>A story was successfully uploaded.<br><br>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/constructor/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/constructor/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</td>
<td>A story was successfully uploaded.<br><br>Once a story is successfully uploaded, an <a href="/constructor/updateStoryID">updateStoryID</a> will be returned, indicating the story ID (<code>id</code>) that was attributed to the story (like for messages, <code>random_id</code> indicates the <code>random_id</code> that was passed to <a href="/method/stories.sendStory">stories.sendStory</a>: this way, you can tell which story was assigned a specific <code>id</code> by checking which <a href="/method/stories.sendStory">stories.sendStory</a> call has the returned <code>random_id</code>).</td>
</tr>
<tr>
<td><a href="/constructor/updateStoriesStealthMode">updateStoriesStealthMode</a></td>