Update content of files

This commit is contained in:
GitHub Action 2023-12-15 20:03:53 +00:00
parent c9d9c932a0
commit 69968f8486
6 changed files with 223 additions and 211 deletions

View file

@ -528,9 +528,13 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#boosts-per-sent-gift" id="boosts-per-sent-gift" name="boosts-per-sent-gift"><i class="anchor-icon"></i></a><code>boosts_per_sent_gift</code></h4>
<h4><a class="anchor" href="#quote-length-max" id="quote-length-max" name="quote-length-max"><i class="anchor-icon"></i></a><code>quote_length_max</code></h4>
<h4><a class="anchor" href="#transcribe-audio-trial-weekly-number" id="transcribe-audio-trial-weekly-number" name="transcribe-audio-trial-weekly-number"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_weekly_number</code></h4>
<p>The maximum number of <a href="/api/transcribe">speech recognition »</a> calls per week for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#transcribe-audio-trial-duration-max" id="transcribe-audio-trial-duration-max" name="transcribe-audio-trial-duration-max"><i class="anchor-icon"></i></a><code>transcribe_audio_trial_duration_max</code></h4>
<p>The maximum allowed duration of media for <a href="/api/transcribe">speech recognition »</a> for non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-default" id="recommended-channels-limit-default" name="recommended-channels-limit-default"><i class="anchor-icon"></i></a><code>recommended_channels_limit_default</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to non-<a href="/api/premium">Premium</a> users. (integer)</p>
<h4><a class="anchor" href="#recommended-channels-limit-premium" id="recommended-channels-limit-premium" name="recommended-channels-limit-premium"><i class="anchor-icon"></i></a><code>recommended_channels_limit_premium</code></h4>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a> users. (integer)</p>
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>

View file

@ -106,7 +106,7 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
<p><code>peer_colors</code> - Premium users can <a href="/api/colors">choose a custom color and background emoji for their profile background and messages</a>. </p>
</li>
<li>
<p><code>voice_to_text</code> - Premium users can <a href="/api/transcribe">transcribe voice messages</a>.</p>
<p><code>voice_to_text</code> - Premium users can <a href="/api/transcribe">transcribe voice messages without limits</a>.</p>
</li>
<li>
<p><code>translations</code> - Premium users can enable <a href="/api/translation">real-time chat translation</a>.</p>
@ -160,6 +160,7 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
<li><code>about_length_limit_*</code> - The maximum UTF-8 length of user bios.</li>
<li><code>chatlist_invites_limit_*</code> - Maximum number of per-folder <a href="/api/links#chat-folder-links">chat folder deep links »</a> that can be created.</li>
<li><code>chatlists_joined_limit_*</code> - Maximum number of <a href="/api/links#chat-folder-links">shareable folders</a> a user may have. </li>
<li><code>recommended_channels_limit_*</code> - The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to users.</li>
</ul>
<h4><a class="anchor" href="#badge" id="badge" name="badge"><i class="anchor-icon"></i></a>Badge</h4>
<p>Users with a Telegram Premium subscription (<a href="/constructor/user">user</a>.<code>premium</code> is set) should have a Telegram Premium badge next to their name. </p>

View file

@ -53,7 +53,8 @@
<a href='/method/channels.getChannelRecommendations'>channels.getChannelRecommendations</a>#83b70d97 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.Chats'>messages.Chats</a>;</code></pre>
<p>Clients should invoke this method after joining a <a href="/api/channel">channel</a>, automatically displaying a popup with a list of similarly themed channels. </p>
<p>The same method should also be invoked when opening a special "Similar channels" tab in the channel's profile (similar to the Media/Links/Gifs/etc tabs).</p></div>
<p>The same method should also be invoked when opening a special "Similar channels" tab in the channel's profile (similar to the Media/Links/Gifs/etc tabs). </p>
<p>The maximum number of similar channels that can be recommended by <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations»</a> to <a href="/api/premium">Premium</a>/non-<a href="/api/premium">Premium</a> users is contained in the <a href="/api/config#recommended-channels-limit-premium">recommended_channels_limit_premium</a>/<a href="/api/config#recommended-channels-limit-default">recommended_channels_limit_default</a> app configuration keys.</p></div>
</div>

View file

@ -57,7 +57,9 @@
<p>Use <a href="/method/messages.transcribeAudio">messages.transcribeAudio</a> to initiate transcription of a message.<br>
The returned <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> constructor will have the <code>pending</code> flag set if the transcription is still in progress and the transcribed text contained in <code>text</code> will be updated in future with <a href="/constructor/updateTranscribedAudio">updateTranscribedAudio</a> updates.<br>
These updates will contain the updated <code>text</code> with the same <code>transcription_id</code> returned in the first <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a>, and the <code>pending</code> flag will be set if the transcription is still in progress. </p>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>.</p></div>
<p>A transcription can then be rated as good or bad using <a href="/method/messages.rateTranscribedAudio">messages.rateTranscribedAudio</a>. </p>
<p>Users without a <a href="/api/premium">Telegram Premium</a> subscription can only transcribe <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a> messages per week, of maximum duration equal to <a href="/api/config#transcribe-audio-trial-duration-max">transcribe_audio_trial_duration_max</a>.<br>
For non-premium users, the <code>trial_remains_num</code> and <code>trial_remains_until_date</code> flags of the <a href="/constructor/messages.transcribedAudio">messages.transcribedAudio</a> will also be set, indicating the remaining transcriptions, and the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>.</p></div>
</div>

View file

@ -89,12 +89,12 @@
<tr>
<td><strong>trial_remains_num</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/int">int</a></td>
<td> </td>
<td>For non-<a href="/api/premium">Premium</a> users, this flag will be set, indicating the remaining transcriptions in the free trial period.</td>
</tr>
<tr>
<td><strong>trial_remains_until_date</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/int">int</a></td>
<td> </td>
<td>For non-<a href="/api/premium">Premium</a> users, this flag will be set, indicating the date when the <code>trial_remains_num</code> counter will be reset to the maximum value of <a href="/api/config#transcribe-audio-trial-weekly-number">transcribe_audio_trial_weekly_number</a>.</td>
</tr>
</tbody>
</table>
@ -103,6 +103,10 @@
<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="#updatetranscribedaudio" id="updatetranscribedaudio" name="updatetranscribedaudio"><i class="anchor-icon"></i></a><a href="/constructor/updateTranscribedAudio">updateTranscribedAudio</a></h4>
<p>A pending <a href="/api/transcribe">voice message transcription »</a> initiated with <a href="/method/messages.transcribeAudio">messages.transcribeAudio</a> was updated.</p>
<h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4>
<p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p>
<h4><a class="anchor" href="#client-configuration" id="client-configuration" name="client-configuration"><i class="anchor-icon"></i></a><a href="/api/config">Client configuration</a></h4>
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</p>
<h4><a class="anchor" href="#voice-message-transcription" id="voice-message-transcription" name="voice-message-transcription"><i class="anchor-icon"></i></a><a href="/api/transcribe">Voice message transcription</a></h4>
<p>How to transcribe voice messages.</p></div>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 F4 28 09 00 69 A7 7C 65
0010 | 14 00 00 00 F1 8E 7E BE EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B8 66 08 00 6B AC 7C 65
0010 | 14 00 00 00 F1 8E 7E BE 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA</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>F428090069A77C65</code></td>
<td><code>B86608006BAC7C65</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>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</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 98 FC EC 69 A7 7C 65
0010 | 68 00 00 00 63 24 16 05 EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C A2 A0 68 94 28 07 FB E9
0030 | C4 16 81 0B EB 9E 03 A5 08 17 33 04 C8 68 FF 9C
0040 | 49 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 0C 7F 03 6D AC 7C 65
0010 | 78 00 00 00 63 24 16 05 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA EB A4 DF 47 84 75 8E BA
0030 | 7D B4 DA 94 FF AB 83 FD 08 16 4E C3 0C A4 B3 9E
0040 | 13 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>0198FCEC69A77C65</code></td>
<td><code>010C7F036DAC7C65</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>68000000</code> (104 in decimal)</td>
<td><code>78000000</code> (120 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08173304C868FF9C49000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1671685145486138441</td>
<td><code>08164EC30CA4B39E13000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1607436576088104467</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 = 1671685145486138441</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1671685145486138441 = 1001973023 * 1668393367</code></p>
<pre><code>p = 1001973023
q = 1668393367</code></pre>
<pre><code>pq = 1607436576088104467</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1607436576088104467 = 1206120829 * 1332732623</code></p>
<pre><code>p = 1206120829
q = 1332732623</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 17 33 04 C8 68 FF 9C 49 00 00 00
0010 | 04 3B B8 E5 1F 00 00 00 04 63 71 A9 97 00 00 00
0020 | EB 7B 0E A1 99 7D 01 79 D5 4F 04 D1 19 D1 05 5C
0030 | A2 A0 68 94 28 07 FB E9 C4 16 81 0B EB 9E 03 A5
0040 | 59 61 30 91 F7 07 20 AB EB EC 07 3D 42 34 C7 E9
0050 | 2E 0F 7F 43 4E 0F 4F E0 89 76 6C A2 1C 78 CD C5
<pre><code>0000 | 95 5F F5 A9 08 16 4E C3 0C A4 B3 9E 13 00 00 00
0010 | 04 47 E3 F1 7D 00 00 00 04 4F 6F E2 CF 00 00 00
0020 | 40 D6 59 B1 27 2C F7 5A EE A1 83 3A 66 BE D1 DA
0030 | EB A4 DF 47 84 75 8E BA 7D B4 DA 94 FF AB 83 FD
0040 | AD EB 4D 91 E6 F8 10 59 07 33 3D A4 D6 32 39 FD
0050 | 6E 51 BD 27 66 2A B5 FB 26 9A 15 57 ED 3F 34 34
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 = 1668393367</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08173304C868FF9C49000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1671685145486138441</td>
<td><code>08164EC30CA4B39E13000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1607436576088104467</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>043BB8E51F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001973023</td>
<td><code>0447E3F17D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1206120829</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>046371A997000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1668393367</td>
<td><code>044F6FE2CF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1332732623</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>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>59613091F70720ABEBEC073D4234C7E9</code> <code>2E0F7F434E0F4FE089766CA21C78CDC5</code></td>
<td><code>ADEB4D91E6F8105907333DA4D63239FD</code> <code>6E51BD27662AB5FB269A1557ED3F3434</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1668393367</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 = 955FF5A908173304C868FF9C49000000043BB8E51F000000046371A997000000EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A559613091F70720ABEBEC073D4234C7E92E0F7F434E0F4FE089766CA21C78CDC502000000
random_padding_bytes = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F75318140EBA79B9BF83873FA62D857C6F9B7E5F07C9A71456AAC7600BBDE8ED9C830B28799E545763B4135C331083D670E9B3E7289F16C49B52A390D32AAEA182CADF9</code></pre>
<pre><code>data = 955FF5A908164EC30CA4B39E130000000447E3F17D000000044F6FE2CF00000040D659B1272CF75AEEA1833A66BED1DAEBA4DF4784758EBA7DB4DA94FFAB83FDADEB4D91E6F8105907333DA4D63239FD6E51BD27662AB5FB269A1557ED3F343402000000
random_padding_bytes = 5DE6C16341AE74DECDCFD12BD4C0F5AF682D9FE21E75E1B98AFBA471ADE48CAA72A180EFEDA49B18393E545BB01909B3A8A30D4607EA9BB0EA4E24D950F905460BFFD80E2C24592514421A062D69A04F8CC37BADDC4970DC113A2FAB</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 = AA967CA705CCFF5B80D6E998E12EFBEC9FCAF190CF0CD6068B00B8C2E52AEC6FC2F4CC7E8FF7F47BAD0EF80C08AFD28BF6F707E245A6D6FB7CBF71EC0E178FA5919BCF17ABD386CD5A710D8034607FE150A3CD50140826C26B3F80779B08C6D955CF09D5B9555412286D4D62B6EFEA9E744AEC9F89732D318F2C0DF4D48414B06B75B7708E743AA52A8D58F35817D8CB3CD158B7E093F9E763D6847F49B33E92B771673D2CC2F15DC6D2EF708A83C79295068F2C64B3D91D7914B8863A5C1C479ACFADFF7F5A98C5CCE637F33900EA1042A44AAC1111E18C1F9514FD260D309AD8C8D9AC1D9D1E8EC305D30F733767C29E8E40DE6E5C01F9B84874FB25BD6675</code></pre>
<pre><code>encrypted_data = C0CB80E9A662A637CD5BEEE6DD739B1327050614AC82763F8728DB2080FE229CF551CDBC5529DB1AA10B489ED09C4569810AE5CB8D5644F6A66929224B206A984CD48132B8C8B3EDABCC2E13C80DEFC44C2718E3C933CAA3E4AD92A461426FDA5A420B3A6C96EA0A8E879FD46C4A9E473DE0E99F6B5A3090E8B98E7FD34BAFF26FC8A093F77FC1715536B4D044043DD78B28C40749FF137C3F8A2D16649795B799785A48E9316441E6EDCA30BEED7729A2793D842295CF9923B333EA3DD7DAF424AA7493F19BFF0D936E9D136357CA292ED0DE718DBF11E62EF5323AAB3487E887A1B952ED3D4865F90386AF9C05882C77AAF573A11C489DEF3D305863EF39FB</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 E4 DF 09 00 69 A7 7C 65
0010 | 40 01 00 00 BE E4 12 D7 EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C A2 A0 68 94 28 07 FB E9
0030 | C4 16 81 0B EB 9E 03 A5 04 3B B8 E5 1F 00 00 00
0040 | 04 63 71 A9 97 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 AA 96 7C A7 05 CC FF 5B 80 D6 E9 98
0060 | E1 2E FB EC 9F CA F1 90 CF 0C D6 06 8B 00 B8 C2
0070 | E5 2A EC 6F C2 F4 CC 7E 8F F7 F4 7B AD 0E F8 0C
0080 | 08 AF D2 8B F6 F7 07 E2 45 A6 D6 FB 7C BF 71 EC
0090 | 0E 17 8F A5 91 9B CF 17 AB D3 86 CD 5A 71 0D 80
00A0 | 34 60 7F E1 50 A3 CD 50 14 08 26 C2 6B 3F 80 77
00B0 | 9B 08 C6 D9 55 CF 09 D5 B9 55 54 12 28 6D 4D 62
00C0 | B6 EF EA 9E 74 4A EC 9F 89 73 2D 31 8F 2C 0D F4
00D0 | D4 84 14 B0 6B 75 B7 70 8E 74 3A A5 2A 8D 58 F3
00E0 | 58 17 D8 CB 3C D1 58 B7 E0 93 F9 E7 63 D6 84 7F
00F0 | 49 B3 3E 92 B7 71 67 3D 2C C2 F1 5D C6 D2 EF 70
0100 | 8A 83 C7 92 95 06 8F 2C 64 B3 D9 1D 79 14 B8 86
0110 | 3A 5C 1C 47 9A CF AD FF 7F 5A 98 C5 CC E6 37 F3
0120 | 39 00 EA 10 42 A4 4A AC 11 11 E1 8C 1F 95 14 FD
0130 | 26 0D 30 9A D8 C8 D9 AC 1D 9D 1E 8E C3 05 D3 0F
0140 | 73 37 67 C2 9E 8E 40 DE 6E 5C 01 F9 B8 48 74 FB
0150 | 25 BD 66 75</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 4C 21 00 00 6C AC 7C 65
0010 | 40 01 00 00 BE E4 12 D7 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA EB A4 DF 47 84 75 8E BA
0030 | 7D B4 DA 94 FF AB 83 FD 04 47 E3 F1 7D 00 00 00
0040 | 04 4F 6F E2 CF 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 C0 CB 80 E9 A6 62 A6 37 CD 5B EE E6
0060 | DD 73 9B 13 27 05 06 14 AC 82 76 3F 87 28 DB 20
0070 | 80 FE 22 9C F5 51 CD BC 55 29 DB 1A A1 0B 48 9E
0080 | D0 9C 45 69 81 0A E5 CB 8D 56 44 F6 A6 69 29 22
0090 | 4B 20 6A 98 4C D4 81 32 B8 C8 B3 ED AB CC 2E 13
00A0 | C8 0D EF C4 4C 27 18 E3 C9 33 CA A3 E4 AD 92 A4
00B0 | 61 42 6F DA 5A 42 0B 3A 6C 96 EA 0A 8E 87 9F D4
00C0 | 6C 4A 9E 47 3D E0 E9 9F 6B 5A 30 90 E8 B9 8E 7F
00D0 | D3 4B AF F2 6F C8 A0 93 F7 7F C1 71 55 36 B4 D0
00E0 | 44 04 3D D7 8B 28 C4 07 49 FF 13 7C 3F 8A 2D 16
00F0 | 64 97 95 B7 99 78 5A 48 E9 31 64 41 E6 ED CA 30
0100 | BE ED 77 29 A2 79 3D 84 22 95 CF 99 23 B3 33 EA
0110 | 3D D7 DA F4 24 AA 74 93 F1 9B FF 0D 93 6E 9D 13
0120 | 63 57 CA 29 2E D0 DE 71 8D BF 11 E6 2E F5 32 3A
0130 | AB 34 87 E8 87 A1 B9 52 ED 3D 48 65 F9 03 86 AF
0140 | 9C 05 88 2C 77 AA F5 73 A1 1C 48 9D EF 3D 30 58
0150 | 63 EF 39 FB</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 = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>E4DF090069A77C65</code></td>
<td><code>4C2100006CAC7C65</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 = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>043BB8E51F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001973023</td>
<td><code>0447E3F17D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1206120829</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>046371A997000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1668393367</td>
<td><code>044F6FE2CF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1332732623</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 = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE000100AA967CA705CCFF5B80D6E998</code> <code>E12EFBEC9FCAF190CF0CD6068B00B8C2</code> <code>E52AEC6FC2F4CC7E8FF7F47BAD0EF80C</code> <code>08AFD28BF6F707E245A6D6FB7CBF71EC</code> <code>0E178FA5919BCF17ABD386CD5A710D80</code> <code>34607FE150A3CD50140826C26B3F8077</code> <code>9B08C6D955CF09D5B9555412286D4D62</code> <code>B6EFEA9E744AEC9F89732D318F2C0DF4</code> <code>D48414B06B75B7708E743AA52A8D58F3</code> <code>5817D8CB3CD158B7E093F9E763D6847F</code> <code>49B33E92B771673D2CC2F15DC6D2EF70</code> <code>8A83C79295068F2C64B3D91D7914B886</code> <code>3A5C1C479ACFADFF7F5A98C5CCE637F3</code> <code>3900EA1042A44AAC1111E18C1F9514FD</code> <code>260D309AD8C8D9AC1D9D1E8EC305D30F</code> <code>733767C29E8E40DE6E5C01F9B84874FB</code><br> <code>25BD6675</code></td>
<td><code>FE000100C0CB80E9A662A637CD5BEEE6</code> <code>DD739B1327050614AC82763F8728DB20</code> <code>80FE229CF551CDBC5529DB1AA10B489E</code> <code>D09C4569810AE5CB8D5644F6A6692922</code> <code>4B206A984CD48132B8C8B3EDABCC2E13</code> <code>C80DEFC44C2718E3C933CAA3E4AD92A4</code> <code>61426FDA5A420B3A6C96EA0A8E879FD4</code> <code>6C4A9E473DE0E99F6B5A3090E8B98E7F</code> <code>D34BAFF26FC8A093F77FC1715536B4D0</code> <code>44043DD78B28C40749FF137C3F8A2D16</code> <code>649795B799785A48E9316441E6EDCA30</code> <code>BEED7729A2793D842295CF9923B333EA</code> <code>3DD7DAF424AA7493F19BFF0D936E9D13</code> <code>6357CA292ED0DE718DBF11E62EF5323A</code> <code>AB3487E887A1B952ED3D4865F90386AF</code> <code>9C05882C77AAF573A11C489DEF3D3058</code><br> <code>63EF39FB</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<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 40 22 8C 6A A7 7C 65
0010 | C0 02 00 00 5C 07 E8 D0 EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C A2 A0 68 94 28 07 FB E9
0030 | C4 16 81 0B EB 9E 03 A5 FE 50 02 00 9A B0 EB E5
0040 | 7A 4B 51 3D 05 82 8B A8 6C 21 B5 D2 EE 7E B0 E9
0050 | DF 94 CB 93 FB C8 1D AC 0F FF 3C DA 22 72 CB 69
0060 | 00 13 29 7B C0 41 AF 6E 53 6C 36 4E 8C 40 79 D4
0070 | 96 46 DD 0A 26 63 0A 2B 24 AA 65 5F 39 F9 1D C2
0080 | 5D 9A 70 CE E6 0F 21 96 2D 8F C0 3A F5 7E 01 6A
0090 | F4 FF 70 71 E1 E2 81 AD FF A9 E7 44 E0 5F 3E D2
00A0 | F7 00 21 5C 9B 57 DD 3E D2 91 8F 45 59 6A 0F BC
00B0 | 90 DC 7C F5 17 57 45 2E 0B 74 98 31 50 34 CC 30
00C0 | 23 BF 5C E3 20 CF F2 77 B3 72 EE F7 53 5F 5D 98
00D0 | A1 D0 60 87 C1 CE DC 1E FA 28 2C 49 1D 72 59 C7
00E0 | 7F F0 1C 74 3F 6D E1 FA 52 C3 04 A9 6C 42 C6 DF
00F0 | AE B7 E0 EA CA 90 0C D0 A3 86 6E F0 44 8D 27 18
0100 | C1 EF 65 A9 81 95 E0 2A 32 E6 F7 36 31 8C DC 2A
0110 | 36 39 41 98 A0 4B DB BE F3 E0 03 69 A0 DA D4 60
0120 | 04 55 D7 B7 6F BF 2A 13 4C 36 92 E6 D1 E7 9B 7E
0130 | 89 DD DC 1E B8 E0 40 9B 9F E0 61 C9 66 AE 90 15
0140 | FD 9C 46 A6 B8 70 93 E3 0E 77 43 9C A7 88 88 19
0150 | E7 70 C5 A4 EE C7 5F D2 32 09 6B D1 57 43 28 BE
0160 | 93 82 BF 29 73 40 A1 5C 23 56 9A B1 5E 3C 77 4F
0170 | 30 5F 72 09 9F CE 24 BF B5 F2 63 12 CC 9F 9E 88
0180 | 8E 83 01 A1 4E D9 01 35 C6 98 01 E4 DB A7 29 53
0190 | BE 45 FD F5 13 7C 1F 2E 8C CE D7 63 52 47 A6 52
01A0 | 62 E8 F3 34 04 35 54 53 CE 99 73 6A ED B6 81 93
01B0 | F5 F6 25 5E 6B 51 93 02 0F A4 DE A5 E3 9A 77 6C
01C0 | C8 05 E3 BD 0E 6A EE 1D 36 83 5B 55 68 D0 10 C6
01D0 | 3F 54 88 98 8A CE F9 8F E0 2A 8F 4D E0 98 01 B7
01E0 | 20 F6 9B 2E E3 19 A8 A4 A2 5B 8C 7F 3B B5 EC 44
01F0 | FB 7E AB 1E 9F CF 16 3D B0 36 D2 DF 90 39 6B 6A
0200 | AD 7F 03 60 CE 9D CC E1 1E C0 E7 AD D5 C3 14 65
0210 | DC 64 23 91 90 C9 02 2A B2 90 D1 D8 00 A0 82 9C
0220 | 60 F9 F3 4D EE 7B 9F FF D7 46 46 8B 4B 87 F4 4B
0230 | 75 17 3F 5A 1C A1 23 27 23 2E 12 0E B4 63 54 1C
0240 | 13 36 29 F0 7A AF BF 80 1F 15 B7 58 5D 8F 7D ED
0250 | 8F 3F 9A 2D DA E1 C9 30 7F ED 77 D7 A4 3E DC 5C
0260 | C7 C3 6C C8 0C B4 DD 2E 43 9F AB 2E 69 78 D5 43
0270 | 5D 21 90 11 54 2D C2 9D 44 4F D2 6A 91 18 04 40
0280 | C0 8F DA B1 F1 96 FB B4 5E 54 29 DB</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 CC 71 B0 6D AC 7C 65
0010 | A8 02 00 00 5C 07 E8 D0 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA EB A4 DF 47 84 75 8E BA
0030 | 7D B4 DA 94 FF AB 83 FD FE 50 02 00 AC 5B 51 4F
0040 | C5 8A 8D B4 C5 AF BC C9 E0 F0 41 D7 93 21 F0 24
0050 | 58 EB 97 26 D3 36 7C 68 72 68 8A C4 10 72 7D C4
0060 | C6 BF 7D 2E 25 29 9E FE 20 62 8F B4 64 68 DF 37
0070 | DC 4C DD 60 30 30 87 77 B0 65 60 32 F7 44 31 4D
0080 | 49 42 80 1B DD 3B 52 61 0C 32 3A 5A AF 54 0E 4F
0090 | C5 80 1E F4 B2 F6 1C DE 9C 0E B8 0A 17 98 A2 44
00A0 | 99 CA 73 39 04 E9 9B B7 BF 0C 39 81 C9 96 F4 99
00B0 | 66 89 09 18 1A 4C 56 31 01 E5 5C EF C3 66 B4 1B
00C0 | B0 E9 B0 AC 40 7B 76 24 3F D1 80 BF 25 F8 95 0B
00D0 | 7C 04 90 E6 02 10 26 32 33 C5 5D 6A A8 88 D8 5F
00E0 | 72 02 38 D0 14 98 BA 05 ED 4C 1C 9B D2 3E 6B FF
00F0 | C3 71 2A ED 44 A9 81 1C 4E 15 0E AD 9B FC 24 4F
0100 | 1D 8B 0E 29 F1 0F D6 B1 7C 11 6D B5 5D 23 E6 72
0110 | 7D 8D 26 F4 C7 B3 59 37 44 E6 98 76 24 75 57 E1
0120 | FA 4F B4 8E 7F 1D 6C 30 83 3A B2 29 D2 57 8D E5
0130 | 25 9A BA DC 09 40 DE CD CB 76 3C 52 37 2F 33 78
0140 | EC 65 64 EF CC BA 2A 0F 78 5B 57 12 CE B6 52 92
0150 | 03 97 45 A3 3A DB 5D CA ED 6E D7 46 63 F7 36 1A
0160 | 95 B7 BF 43 61 55 97 15 0F FC 8C 21 80 FE F1 8F
0170 | 2D 83 B9 4C 0A 11 1F 45 D2 B7 32 83 CE 7B FD 52
0180 | CF 65 E5 45 4D 67 24 5D B2 92 23 1B FF 5E 68 63
0190 | 77 E7 DC 19 56 3C 19 F3 01 67 8F 66 DE A5 16 12
01A0 | F1 78 56 AB FC 78 7A F0 FD 6A 39 CE D7 43 E0 05
01B0 | 33 AA 84 44 D9 C3 CF AD 4A FC CE 95 1A B1 4D A3
01C0 | 01 92 AE AA 21 31 68 CB F1 42 D7 1B 0E 55 51 1E
01D0 | 97 C4 67 FF 58 7F C3 D6 C3 BC FD 06 E2 33 F9 55
01E0 | 08 D8 97 74 91 16 55 BC 2C 51 98 DB 6B 1B AE EF
01F0 | FE 5E 54 41 AA A6 52 BF 0E E4 84 F0 1A 5B 95 75
0200 | 2B 30 02 4B 9B 58 65 19 41 39 1C 7E 13 D0 96 1E
0210 | 0E F8 83 50 5A 0A B3 F0 52 A9 8C A6 C4 F2 A4 2B
0220 | F5 E5 35 D6 83 7E B9 BE 92 CA 2F 03 A5 BB 4A 0A
0230 | B0 DE EB 22 69 F4 40 19 81 BE 5B B6 A1 6F 1A 86
0240 | 08 A4 5D 37 11 C6 F8 6B B3 9A 2F EA 26 89 0A 98
0250 | 45 83 F0 67 33 6D F8 05 A6 29 FB E9 FA 67 20 EA
0260 | 8E B2 C4 DC 0C 05 59 D7 8D 2E E4 E8 C4 E7 8B 83
0270 | 16 71 E4 6B 8F 72 48 02 74 69 3F 51 23 D2 F8 3A
0280 | E8 C9 0A 70 F9 A8 47 C8 78 08 81 05</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 = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0140228C6AA77C65</code></td>
<td><code>01CC71B06DAC7C65</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>C0020000</code> (704 in decimal)</td>
<td><code>A8020000</code> (680 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE5002009AB0EBE57A4B513D05828BA8</code> <code>6C21B5D2EE7EB0E9DF94CB93FBC81DAC</code> <code>0FFF3CDA2272CB690013297BC041AF6E</code> <code>536C364E8C4079D49646DD0A26630A2B</code> <code>24AA655F39F91DC25D9A70CEE60F2196</code> <code>2D8FC03AF57E016AF4FF7071E1E281AD</code> <code>FFA9E744E05F3ED2F700215C9B57DD3E</code> <code>D2918F45596A0FBC90DC7CF51757452E</code> <code>0B7498315034CC3023BF5CE320CFF277</code> <code>B372EEF7535F5D98A1D06087C1CEDC1E</code> <code>FA282C491D7259C77FF01C743F6DE1FA</code> <code>52C304A96C42C6DFAEB7E0EACA900CD0</code> <code>A3866EF0448D2718C1EF65A98195E02A</code> <code>32E6F736318CDC2A36394198A04BDBBE</code> <code>F3E00369A0DAD4600455D7B76FBF2A13</code> <code>4C3692E6D1E79B7E89DDDC1EB8E0409B</code> <code>9FE061C966AE9015FD9C46A6B87093E3</code> <code>0E77439CA7888819E770C5A4EEC75FD2</code> <code>32096BD1574328BE9382BF297340A15C</code> <code>23569AB15E3C774F305F72099FCE24BF</code> <code>B5F26312CC9F9E888E8301A14ED90135</code> <code>C69801E4DBA72953BE45FDF5137C1F2E</code> <code>8CCED7635247A65262E8F33404355453</code> <code>CE99736AEDB68193F5F6255E6B519302</code> <code>0FA4DEA5E39A776CC805E3BD0E6AEE1D</code> <code>36835B5568D010C63F5488988ACEF98F</code> <code>E02A8F4DE09801B720F69B2EE319A8A4</code> <code>A25B8C7F3BB5EC44FB7EAB1E9FCF163D</code> <code>B036D2DF90396B6AAD7F0360CE9DCCE1</code> <code>1EC0E7ADD5C31465DC64239190C9022A</code> <code>B290D1D800A0829C60F9F34DEE7B9FFF</code> <code>D746468B4B87F44B75173F5A1CA12327</code> <code>232E120EB463541C133629F07AAFBF80</code> <code>1F15B7585D8F7DED8F3F9A2DDAE1C930</code> <code>7FED77D7A43EDC5CC7C36CC80CB4DD2E</code> <code>439FAB2E6978D5435D219011542DC29D</code> <code>444FD26A91180440C08FDAB1F196FBB4</code><br> <code>5E5429DB</code></td>
<td><code>FE500200AC5B514FC58A8DB4C5AFBCC9</code> <code>E0F041D79321F02458EB9726D3367C68</code> <code>72688AC410727DC4C6BF7D2E25299EFE</code> <code>20628FB46468DF37DC4CDD6030308777</code> <code>B0656032F744314D4942801BDD3B5261</code> <code>0C323A5AAF540E4FC5801EF4B2F61CDE</code> <code>9C0EB80A1798A24499CA733904E99BB7</code> <code>BF0C3981C996F499668909181A4C5631</code> <code>01E55CEFC366B41BB0E9B0AC407B7624</code> <code>3FD180BF25F8950B7C0490E602102632</code> <code>33C55D6AA888D85F720238D01498BA05</code> <code>ED4C1C9BD23E6BFFC3712AED44A9811C</code> <code>4E150EAD9BFC244F1D8B0E29F10FD6B1</code> <code>7C116DB55D23E6727D8D26F4C7B35937</code> <code>44E69876247557E1FA4FB48E7F1D6C30</code> <code>833AB229D2578DE5259ABADC0940DECD</code> <code>CB763C52372F3378EC6564EFCCBA2A0F</code> <code>785B5712CEB65292039745A33ADB5DCA</code> <code>ED6ED74663F7361A95B7BF4361559715</code> <code>0FFC8C2180FEF18F2D83B94C0A111F45</code> <code>D2B73283CE7BFD52CF65E5454D67245D</code> <code>B292231BFF5E686377E7DC19563C19F3</code> <code>01678F66DEA51612F17856ABFC787AF0</code> <code>FD6A39CED743E00533AA8444D9C3CFAD</code> <code>4AFCCE951AB14DA30192AEAA213168CB</code> <code>F142D71B0E55511E97C467FF587FC3D6</code> <code>C3BCFD06E233F95508D89774911655BC</code> <code>2C5198DB6B1BAEEFFE5E5441AAA652BF</code> <code>0EE484F01A5B95752B30024B9B586519</code> <code>41391C7E13D0961E0EF883505A0AB3F0</code> <code>52A98CA6C4F2A42BF5E535D6837EB9BE</code> <code>92CA2F03A5BB4A0AB0DEEB2269F44019</code> <code>81BE5BB6A16F1A8608A45D3711C6F86B</code> <code>B39A2FEA26890A984583F067336DF805</code> <code>A629FBE9FA6720EA8EB2C4DC0C0559D7</code> <code>8D2EE4E8C4E78B831671E46B8F724802</code> <code>74693F5123D2F83AE8C90A70F9A847C8</code><br> <code>78088105</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = EEBA3434C615134553B00DEBC46195C1D0833963B2B736022F7531814
<!-- 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 = 9AB0EBE57A4B513D05828BA86C21B5D2EE7EB0E9DF94CB93FBC81DAC0FFF3CDA2272CB690013297BC041AF6E536C364E8C4079D49646DD0A26630A2B24AA655F39F91DC25D9A70CEE60F21962D8FC03AF57E016AF4FF7071E1E281ADFFA9E744E05F3ED2F700215C9B57DD3ED2918F45596A0FBC90DC7CF51757452E0B7498315034CC3023BF5CE320CFF277B372EEF7535F5D98A1D06087C1CEDC1EFA282C491D7259C77FF01C743F6DE1FA52C304A96C42C6DFAEB7E0EACA900CD0A3866EF0448D2718C1EF65A98195E02A32E6F736318CDC2A36394198A04BDBBEF3E00369A0DAD4600455D7B76FBF2A134C3692E6D1E79B7E89DDDC1EB8E0409B9FE061C966AE9015FD9C46A6B87093E30E77439CA7888819E770C5A4EEC75FD232096BD1574328BE9382BF297340A15C23569AB15E3C774F305F72099FCE24BFB5F26312CC9F9E888E8301A14ED90135C69801E4DBA72953BE45FDF5137C1F2E8CCED7635247A65262E8F33404355453CE99736AEDB68193F5F6255E6B5193020FA4DEA5E39A776CC805E3BD0E6AEE1D36835B5568D010C63F5488988ACEF98FE02A8F4DE09801B720F69B2EE319A8A4A25B8C7F3BB5EC44FB7EAB1E9FCF163DB036D2DF90396B6AAD7F0360CE9DCCE11EC0E7ADD5C31465DC64239190C9022AB290D1D800A0829C60F9F34DEE7B9FFFD746468B4B87F44B75173F5A1CA12327232E120EB463541C133629F07AAFBF801F15B7585D8F7DED8F3F9A2DDAE1C9307FED77D7A43EDC5CC7C36CC80CB4DD2E439FAB2E6978D5435D219011542DC29D444FD26A91180440C08FDAB1F196FBB45E5429DB
tmp_aes_key = 275B889088CE5A26C0BF451502C89FD28FD1F257E0AFDC0EAA03CC8E5CDC8131
tmp_aes_iv = 05B14F80F5EE413FB9958A0817559888C2207326A7F9A475C35190E259613091</code></pre>
<pre><code>encrypted_answer = AC5B514FC58A8DB4C5AFBCC9E0F041D79321F02458EB9726D3367C6872688AC410727DC4C6BF7D2E25299EFE20628FB46468DF37DC4CDD6030308777B0656032F744314D4942801BDD3B52610C323A5AAF540E4FC5801EF4B2F61CDE9C0EB80A1798A24499CA733904E99BB7BF0C3981C996F499668909181A4C563101E55CEFC366B41BB0E9B0AC407B76243FD180BF25F8950B7C0490E60210263233C55D6AA888D85F720238D01498BA05ED4C1C9BD23E6BFFC3712AED44A9811C4E150EAD9BFC244F1D8B0E29F10FD6B17C116DB55D23E6727D8D26F4C7B3593744E69876247557E1FA4FB48E7F1D6C30833AB229D2578DE5259ABADC0940DECDCB763C52372F3378EC6564EFCCBA2A0F785B5712CEB65292039745A33ADB5DCAED6ED74663F7361A95B7BF43615597150FFC8C2180FEF18F2D83B94C0A111F45D2B73283CE7BFD52CF65E5454D67245DB292231BFF5E686377E7DC19563C19F301678F66DEA51612F17856ABFC787AF0FD6A39CED743E00533AA8444D9C3CFAD4AFCCE951AB14DA30192AEAA213168CBF142D71B0E55511E97C467FF587FC3D6C3BCFD06E233F95508D89774911655BC2C5198DB6B1BAEEFFE5E5441AAA652BF0EE484F01A5B95752B30024B9B58651941391C7E13D0961E0EF883505A0AB3F052A98CA6C4F2A42BF5E535D6837EB9BE92CA2F03A5BB4A0AB0DEEB2269F4401981BE5BB6A16F1A8608A45D3711C6F86BB39A2FEA26890A984583F067336DF805A629FBE9FA6720EA8EB2C4DC0C0559D78D2EE4E8C4E78B831671E46B8F72480274693F5123D2F83AE8C90A70F9A847C878088105
tmp_aes_key = 9F80404847B20E9F8D5357E4FE4CCDF4D9D670F8D21B57ED4AA667DC16391151
tmp_aes_iv = 4826EC48442743B263E4F6F7A8C874D2B11E4D67634DA5F05B5963FEADEB4D91</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = CD1B709CE6CE16DDB05CA4CCA51D8C2C532F5BDBBA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A3A669963FCB029A3DFE3D4492EA38E7A07D609E46EE5E600FAED40994C123FBB8015820517944911A2CC7A0199F9400A7A5AC71456AF6058BCF00615AFF2A14032D4E26664345006CCD1994171372517817479213F7C79EC2AF7BBE73406F41C1B2BA8F3030F4F8DC6A51D735FE352F47A7CC31F8BEC90C620CC30435C8E8E0AFFA24634E7417302D662D179A7B493FD071C4302707B5C38234845F332050F17946B8DCE573AC3DBD36EABEDBA1B4753672E66493F49951B0E8BE928F476BA2A7EE58E3C5DCCFC0ACDD6DF4CF7E15121CDBEC2BFC3AA1D9A158DE9E18C2857F29324E1A8191B082C7E13DDA1B080ECBB7FF443880EF287EBADC2037F82C6726AA77C652EBC83D6F26C0818
answer = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A3A669963FCB029A3DFE3D4492EA38E7A07D609E46EE5E600FAED40994C123FBB8015820517944911A2CC7A0199F9400A7A5AC71456AF6058BCF00615AFF2A14032D4E26664345006CCD1994171372517817479213F7C79EC2AF7BBE73406F41C1B2BA8F3030F4F8DC6A51D735FE352F47A7CC31F8BEC90C620CC30435C8E8E0AFFA24634E7417302D662D179A7B493FD071C4302707B5C38234845F332050F17946B8DCE573AC3DBD36EABEDBA1B4753672E66493F49951B0E8BE928F476BA2A7EE58E3C5DCCFC0ACDD6DF4CF7E15121CDBEC2BFC3AA1D9A158DE9E18C2857F29324E1A8191B082C7E13DDA1B080ECBB7FF443880EF287EBADC2037F82C6726AA77C652EBC83D6F26C0818</code></pre>
<pre><code>answer_with_hash = 20FE7C212E6557A75EF65010B94C3E5CFBF115CCBA0D89B540D659B1272CF75AEEA1833A66BED1DAEBA4DF4784758EBA7DB4DA94FFAB83FD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010062AA2F3D99A2D62E6036E2D5E67CB62D56254D74281F80EFD33BD9B29104649A14BFE483A7BA2958AF765B0F9284994C0B39AFE1D5B33637F627629E2DCE51D1797A17E4D7A8B9C2E113FCD808EA745D1D6033399CDCC74D150CF57F4CFC846041249425B8F12FCF1FF6B6FD8A438221D96D33EA97EAE8D9011DF9B3BBA34CF2A095CF28C564D46C25F1C5A1AC46032F20A5B0C1366E93F92DD5B2A33D69F7106D7B0E7E933167A25F86706A3B483041886912D705A08F6F026B7A8B51980E204D02707AD1A4CB181061FC4B9E70CB33E28FFE5BDD4DDC2A3B7886AE702CDC54DFA8918B34E1E3813F48C30DEAF8B79AB78111EF66FB3139E196BDB43CA8D6F76DAC7C653E866F144BF2F8B8
answer = BA0D89B540D659B1272CF75AEEA1833A66BED1DAEBA4DF4784758EBA7DB4DA94FFAB83FD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010062AA2F3D99A2D62E6036E2D5E67CB62D56254D74281F80EFD33BD9B29104649A14BFE483A7BA2958AF765B0F9284994C0B39AFE1D5B33637F627629E2DCE51D1797A17E4D7A8B9C2E113FCD808EA745D1D6033399CDCC74D150CF57F4CFC846041249425B8F12FCF1FF6B6FD8A438221D96D33EA97EAE8D9011DF9B3BBA34CF2A095CF28C564D46C25F1C5A1AC46032F20A5B0C1366E93F92DD5B2A33D69F7106D7B0E7E933167A25F86706A3B483041886912D705A08F6F026B7A8B51980E204D02707AD1A4CB181061FC4B9E70CB33E28FFE5BDD4DDC2A3B7886AE702CDC54DFA8918B34E1E3813F48C30DEAF8B79AB78111EF66FB3139E196BDB43CA8D6F76DAC7C653E866F144BF2F8B8</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 EB 7B 0E A1 99 7D 01 79 D5 4F 04 D1
0010 | 19 D1 05 5C A2 A0 68 94 28 07 FB E9 C4 16 81 0B
0020 | EB 9E 03 A5 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 40 D6 59 B1 27 2C F7 5A EE A1 83 3A
0010 | 66 BE D1 DA EB A4 DF 47 84 75 8E BA 7D B4 DA 94
0020 | FF AB 83 FD 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 = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
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 | 0A 3A 66 99 63 FC B0 29 A3 DF E3 D4 49 2E A3 8E
0140 | 7A 07 D6 09 E4 6E E5 E6 00 FA ED 40 99 4C 12 3F
0150 | BB 80 15 82 05 17 94 49 11 A2 CC 7A 01 99 F9 40
0160 | 0A 7A 5A C7 14 56 AF 60 58 BC F0 06 15 AF F2 A1
0170 | 40 32 D4 E2 66 64 34 50 06 CC D1 99 41 71 37 25
0180 | 17 81 74 79 21 3F 7C 79 EC 2A F7 BB E7 34 06 F4
0190 | 1C 1B 2B A8 F3 03 0F 4F 8D C6 A5 1D 73 5F E3 52
01A0 | F4 7A 7C C3 1F 8B EC 90 C6 20 CC 30 43 5C 8E 8E
01B0 | 0A FF A2 46 34 E7 41 73 02 D6 62 D1 79 A7 B4 93
01C0 | FD 07 1C 43 02 70 7B 5C 38 23 48 45 F3 32 05 0F
01D0 | 17 94 6B 8D CE 57 3A C3 DB D3 6E AB ED BA 1B 47
01E0 | 53 67 2E 66 49 3F 49 95 1B 0E 8B E9 28 F4 76 BA
01F0 | 2A 7E E5 8E 3C 5D CC FC 0A CD D6 DF 4C F7 E1 51
0200 | 21 CD BE C2 BF C3 AA 1D 9A 15 8D E9 E1 8C 28 57
0210 | F2 93 24 E1 A8 19 1B 08 2C 7E 13 DD A1 B0 80 EC
0220 | BB 7F F4 43 88 0E F2 87 EB AD C2 03 7F 82 C6 72
0230 | 6A A7 7C 65</code></pre>
0130 | 62 AA 2F 3D 99 A2 D6 2E 60 36 E2 D5 E6 7C B6 2D
0140 | 56 25 4D 74 28 1F 80 EF D3 3B D9 B2 91 04 64 9A
0150 | 14 BF E4 83 A7 BA 29 58 AF 76 5B 0F 92 84 99 4C
0160 | 0B 39 AF E1 D5 B3 36 37 F6 27 62 9E 2D CE 51 D1
0170 | 79 7A 17 E4 D7 A8 B9 C2 E1 13 FC D8 08 EA 74 5D
0180 | 1D 60 33 39 9C DC C7 4D 15 0C F5 7F 4C FC 84 60
0190 | 41 24 94 25 B8 F1 2F CF 1F F6 B6 FD 8A 43 82 21
01A0 | D9 6D 33 EA 97 EA E8 D9 01 1D F9 B3 BB A3 4C F2
01B0 | A0 95 CF 28 C5 64 D4 6C 25 F1 C5 A1 AC 46 03 2F
01C0 | 20 A5 B0 C1 36 6E 93 F9 2D D5 B2 A3 3D 69 F7 10
01D0 | 6D 7B 0E 7E 93 31 67 A2 5F 86 70 6A 3B 48 30 41
01E0 | 88 69 12 D7 05 A0 8F 6F 02 6B 7A 8B 51 98 0E 20
01F0 | 4D 02 70 7A D1 A4 CB 18 10 61 FC 4B 9E 70 CB 33
0200 | E2 8F FE 5B DD 4D DC 2A 3B 78 86 AE 70 2C DC 54
0210 | DF A8 91 8B 34 E1 E3 81 3F 48 C3 0D EA F8 B7 9A
0220 | B7 81 11 EF 66 FB 31 39 E1 96 BD B4 3C A8 D6 F7
0230 | 6D AC 7C 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 = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001000A3A669963FCB029A3DFE3D4</code> <code>492EA38E7A07D609E46EE5E600FAED40</code> <code>994C123FBB8015820517944911A2CC7A</code> <code>0199F9400A7A5AC71456AF6058BCF006</code> <code>15AFF2A14032D4E26664345006CCD199</code> <code>4171372517817479213F7C79EC2AF7BB</code> <code>E73406F41C1B2BA8F3030F4F8DC6A51D</code> <code>735FE352F47A7CC31F8BEC90C620CC30</code> <code>435C8E8E0AFFA24634E7417302D662D1</code> <code>79A7B493FD071C4302707B5C38234845</code> <code>F332050F17946B8DCE573AC3DBD36EAB</code> <code>EDBA1B4753672E66493F49951B0E8BE9</code> <code>28F476BA2A7EE58E3C5DCCFC0ACDD6DF</code> <code>4CF7E15121CDBEC2BFC3AA1D9A158DE9</code> <code>E18C2857F29324E1A8191B082C7E13DD</code> <code>A1B080ECBB7FF443880EF287EBADC203</code><br> <code>7F82C672</code></td>
<td><code>FE00010062AA2F3D99A2D62E6036E2D5</code> <code>E67CB62D56254D74281F80EFD33BD9B2</code> <code>9104649A14BFE483A7BA2958AF765B0F</code> <code>9284994C0B39AFE1D5B33637F627629E</code> <code>2DCE51D1797A17E4D7A8B9C2E113FCD8</code> <code>08EA745D1D6033399CDCC74D150CF57F</code> <code>4CFC846041249425B8F12FCF1FF6B6FD</code> <code>8A438221D96D33EA97EAE8D9011DF9B3</code> <code>BBA34CF2A095CF28C564D46C25F1C5A1</code> <code>AC46032F20A5B0C1366E93F92DD5B2A3</code> <code>3D69F7106D7B0E7E933167A25F86706A</code> <code>3B483041886912D705A08F6F026B7A8B</code> <code>51980E204D02707AD1A4CB181061FC4B</code> <code>9E70CB33E28FFE5BDD4DDC2A3B7886AE</code> <code>702CDC54DFA8918B34E1E3813F48C30D</code> <code>EAF8B79AB78111EF66FB3139E196BDB4</code><br> <code>3CA8D6F7</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>6AA77C65</code> (1702668138 in decimal)</td>
<td><code>6DAC7C65</code> (1702669421 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
<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 = 0847DE3EB9F6690864BC0C267C603318E9F20DDAE4C725DD087452E1A4BFF2B132E753F68E0D5621BA06E3C51B43F1A7F4BE2A1B944B5AD264B7C2E4F1315249793ACDA94327BB0DC8CA5C5FE049993A7770B91AFC1BB921B1C0565FBC35AD175E01942BDF47FE973524388D427C5DF32F14FDCB5A9DB276BFC64CEE91CB5CED93110796CC41DEA65AD2BBAED6E365AA51EC5272967948EDB7F2537A8D1A725657C441CAB20D0ADAC523AC7D9E4AC0E2A3E5E651F40659C7C6C54A371DC1E9EF70FD890FC53891313D1D108473B6EC1F64F466F8C18CE6964FB425484228B156AB6A8D34AB4F7A9DB011CFFDD30A83CF068CEE2490F1213CE6D308F064C80F45</code></pre>
<pre><code>b = 010D0C826F5EB17198EF2B07B58506138CBD144D275A81E8D54BDDBE3156BA40BA7D8EC57D2995A34312FFD1C6F3D6FF879101A1B84A9D0E4844192CBC2A6A927763F4C40AE603FB573AD3BB64C3E094DA135F1F6DDC662DBB49E75622E06C848F872648C4260142624EF8F5FB362FC996C2461D4C341383237B6C6FBFABCE529B3EFBC7511FAE912B9D3D0112A293CAA1DE6C7E1C28DDF019578C21A5731ACB8FE4753F3F6421045471E00E33BB82D848214E34C0C0528AF144DBDB62F45DC74D3774595C00058747F1C4D78B2C28938BA47B5EF62AFDD3719CB10A08F5633C0D88F9AEAE9C3B4E74883A11D6F25F052CD1F7269784654FFB3B95DBB8B7E49F</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 = BC80AF986526DB25A08912129ED64D76962E351B624A14959904E03E20E72B496F5BDBED65020338782F286A9C26AF4F9A3867449C2B47EE1D12C628E533319CDF5D224CC5516B45569E597ACA300F5203EA4D8043BCCD4A9C4FC849526D8C4B9D58E97864CB303E0233F156BF073070433444702AEFE21ADD30644032AFE1EBB2ADDC6713D1DF96C14CDE3E1DE9E16D6255AB8966F1ED0DA2C558F6630AB2C9C68DAE096ABBBA6DBF3B0CA6CF5227A5BEB6FBD42465D148396348CC95E309B850405EE6D007544641C4BEDD185A4378C249A7F209EADDADB57B541500FB65354CFCC74D270B4B2B03E554E61EA79EEBB48F0225676D6B4C0DAAC6D36CEBABD5</code></pre>
<pre><code>g_b = 1C4CD5DFF6CCC5B2FB8E7535A8374D7C1028788BA8E0E14E20EA1EC24967675B4DC9B63FCD82EA35E6195B2B33CFC213DB4AE06412884CA1AE1619252109C121024FCD42A9BE2B23B3AA45AD1F1CCC7516AC449025954F1140B2D6123AADB21DA3C07773AE304036B6497D78693E599277F4D6FBBC5092E5F53C4185351EA8F26E9D9F08F125177A17F1E75F1AE88C0F64BE7325A69736E1F32F1523861C0A0C30969CAEB3BB0B9FFA2A854D38EC839623C2DD5256CF1DA13BEE06D4AAB305BBD7253F0F00ABE209EED2F9DEBA24F084E5BBD3CDBE07A95B87EE88B800C5150E5D0293046DD068E5896F6ACE8DB7919C741ECBA15C508FA902192C7D9A53B401</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 EB 7B 0E A1 99 7D 01 79 D5 4F 04 D1
0010 | 19 D1 05 5C A2 A0 68 94 28 07 FB E9 C4 16 81 0B
0020 | EB 9E 03 A5 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | BC 80 AF 98 65 26 DB 25 A0 89 12 12 9E D6 4D 76
0040 | 96 2E 35 1B 62 4A 14 95 99 04 E0 3E 20 E7 2B 49
0050 | 6F 5B DB ED 65 02 03 38 78 2F 28 6A 9C 26 AF 4F
0060 | 9A 38 67 44 9C 2B 47 EE 1D 12 C6 28 E5 33 31 9C
0070 | DF 5D 22 4C C5 51 6B 45 56 9E 59 7A CA 30 0F 52
0080 | 03 EA 4D 80 43 BC CD 4A 9C 4F C8 49 52 6D 8C 4B
0090 | 9D 58 E9 78 64 CB 30 3E 02 33 F1 56 BF 07 30 70
00A0 | 43 34 44 70 2A EF E2 1A DD 30 64 40 32 AF E1 EB
00B0 | B2 AD DC 67 13 D1 DF 96 C1 4C DE 3E 1D E9 E1 6D
00C0 | 62 55 AB 89 66 F1 ED 0D A2 C5 58 F6 63 0A B2 C9
00D0 | C6 8D AE 09 6A BB BA 6D BF 3B 0C A6 CF 52 27 A5
00E0 | BE B6 FB D4 24 65 D1 48 39 63 48 CC 95 E3 09 B8
00F0 | 50 40 5E E6 D0 07 54 46 41 C4 BE DD 18 5A 43 78
0100 | C2 49 A7 F2 09 EA DD AD B5 7B 54 15 00 FB 65 35
0110 | 4C FC C7 4D 27 0B 4B 2B 03 E5 54 E6 1E A7 9E EB
0120 | B4 8F 02 25 67 6D 6B 4C 0D AA C6 D3 6C EB AB D5</code></pre>
<pre><code>0000 | 54 B6 43 66 40 D6 59 B1 27 2C F7 5A EE A1 83 3A
0010 | 66 BE D1 DA EB A4 DF 47 84 75 8E BA 7D B4 DA 94
0020 | FF AB 83 FD 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 1C 4C D5 DF F6 CC C5 B2 FB 8E 75 35 A8 37 4D 7C
0040 | 10 28 78 8B A8 E0 E1 4E 20 EA 1E C2 49 67 67 5B
0050 | 4D C9 B6 3F CD 82 EA 35 E6 19 5B 2B 33 CF C2 13
0060 | DB 4A E0 64 12 88 4C A1 AE 16 19 25 21 09 C1 21
0070 | 02 4F CD 42 A9 BE 2B 23 B3 AA 45 AD 1F 1C CC 75
0080 | 16 AC 44 90 25 95 4F 11 40 B2 D6 12 3A AD B2 1D
0090 | A3 C0 77 73 AE 30 40 36 B6 49 7D 78 69 3E 59 92
00A0 | 77 F4 D6 FB BC 50 92 E5 F5 3C 41 85 35 1E A8 F2
00B0 | 6E 9D 9F 08 F1 25 17 7A 17 F1 E7 5F 1A E8 8C 0F
00C0 | 64 BE 73 25 A6 97 36 E1 F3 2F 15 23 86 1C 0A 0C
00D0 | 30 96 9C AE B3 BB 0B 9F FA 2A 85 4D 38 EC 83 96
00E0 | 23 C2 DD 52 56 CF 1D A1 3B EE 06 D4 AA B3 05 BB
00F0 | D7 25 3F 0F 00 AB E2 09 EE D2 F9 DE BA 24 F0 84
0100 | E5 BB D3 CD BE 07 A9 5B 87 EE 88 B8 00 C5 15 0E
0110 | 5D 02 93 04 6D D0 68 E5 89 6F 6A CE 8D B7 91 9C
0120 | 74 1E CB A1 5C 50 8F A9 02 19 2C 7D 9A 53 B4 01</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 = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE000100BC80AF986526DB25A0891212</code> <code>9ED64D76962E351B624A14959904E03E</code> <code>20E72B496F5BDBED65020338782F286A</code> <code>9C26AF4F9A3867449C2B47EE1D12C628</code> <code>E533319CDF5D224CC5516B45569E597A</code> <code>CA300F5203EA4D8043BCCD4A9C4FC849</code> <code>526D8C4B9D58E97864CB303E0233F156</code> <code>BF073070433444702AEFE21ADD306440</code> <code>32AFE1EBB2ADDC6713D1DF96C14CDE3E</code> <code>1DE9E16D6255AB8966F1ED0DA2C558F6</code> <code>630AB2C9C68DAE096ABBBA6DBF3B0CA6</code> <code>CF5227A5BEB6FBD42465D148396348CC</code> <code>95E309B850405EE6D007544641C4BEDD</code> <code>185A4378C249A7F209EADDADB57B5415</code> <code>00FB65354CFCC74D270B4B2B03E554E6</code> <code>1EA79EEBB48F0225676D6B4C0DAAC6D3</code><br> <code>6CEBABD5</code></td>
<td><code>FE0001001C4CD5DFF6CCC5B2FB8E7535</code> <code>A8374D7C1028788BA8E0E14E20EA1EC2</code> <code>4967675B4DC9B63FCD82EA35E6195B2B</code> <code>33CFC213DB4AE06412884CA1AE161925</code> <code>2109C121024FCD42A9BE2B23B3AA45AD</code> <code>1F1CCC7516AC449025954F1140B2D612</code> <code>3AADB21DA3C07773AE304036B6497D78</code> <code>693E599277F4D6FBBC5092E5F53C4185</code> <code>351EA8F26E9D9F08F125177A17F1E75F</code> <code>1AE88C0F64BE7325A69736E1F32F1523</code> <code>861C0A0C30969CAEB3BB0B9FFA2A854D</code> <code>38EC839623C2DD5256CF1DA13BEE06D4</code> <code>AAB305BBD7253F0F00ABE209EED2F9DE</code> <code>BA24F084E5BBD3CDBE07A95B87EE88B8</code> <code>00C5150E5D0293046DD068E5896F6ACE</code> <code>8DB7919C741ECBA15C508FA902192C7D</code><br> <code>9A53B401</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 = BA0D89B5EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A
<!-- 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 = 54B64366EB7B0EA1997D0179D54F04D119D1055CA2A068942807FBE9C416810BEB9E03A50000000000000000FE000100BC80AF986526DB25A08912129ED64D76962E351B624A14959904E03E20E72B496F5BDBED65020338782F286A9C26AF4F9A3867449C2B47EE1D12C628E533319CDF5D224CC5516B45569E597ACA300F5203EA4D8043BCCD4A9C4FC849526D8C4B9D58E97864CB303E0233F156BF073070433444702AEFE21ADD30644032AFE1EBB2ADDC6713D1DF96C14CDE3E1DE9E16D6255AB8966F1ED0DA2C558F6630AB2C9C68DAE096ABBBA6DBF3B0CA6CF5227A5BEB6FBD42465D148396348CC95E309B850405EE6D007544641C4BEDD185A4378C249A7F209EADDADB57B541500FB65354CFCC74D270B4B2B03E554E61EA79EEBB48F0225676D6B4C0DAAC6D36CEBABD5
padding = CCC8EC019F365604BB43AA05
tmp_aes_key = 275B889088CE5A26C0BF451502C89FD28FD1F257E0AFDC0EAA03CC8E5CDC8131
tmp_aes_iv = 05B14F80F5EE413FB9958A0817559888C2207326A7F9A475C35190E259613091</code></pre>
<pre><code>data = 54B6436640D659B1272CF75AEEA1833A66BED1DAEBA4DF4784758EBA7DB4DA94FFAB83FD0000000000000000FE0001001C4CD5DFF6CCC5B2FB8E7535A8374D7C1028788BA8E0E14E20EA1EC24967675B4DC9B63FCD82EA35E6195B2B33CFC213DB4AE06412884CA1AE1619252109C121024FCD42A9BE2B23B3AA45AD1F1CCC7516AC449025954F1140B2D6123AADB21DA3C07773AE304036B6497D78693E599277F4D6FBBC5092E5F53C4185351EA8F26E9D9F08F125177A17F1E75F1AE88C0F64BE7325A69736E1F32F1523861C0A0C30969CAEB3BB0B9FFA2A854D38EC839623C2DD5256CF1DA13BEE06D4AAB305BBD7253F0F00ABE209EED2F9DEBA24F084E5BBD3CDBE07A95B87EE88B800C5150E5D0293046DD068E5896F6ACE8DB7919C741ECBA15C508FA902192C7D9A53B401
padding = E13CA42691F8DB3231782F87
tmp_aes_key = 9F80404847B20E9F8D5357E4FE4CCDF4D9D670F8D21B57ED4AA667DC16391151
tmp_aes_iv = 4826EC48442743B263E4F6F7A8C874D2B11E4D67634DA5F05B5963FEADEB4D91</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 = C256F7B27B79470C3F2FBEEC58594E1BFEA4D761EB1AB092B75C00C785762B4F4F55A15E37CD75461B9BFB6461F96E85601DC5759DDA52D530279FED4E318A3183BBB5680636AFB4B6FEFB8D4139772EF43A81ABC4DC989C020ADEF3893F666CC968E33AFDD2DBB259C79A5DF77475FDE583928A2BD045624553A604ABF4B17DF03884EF9BB761FC5D56C608A0108B4C0420745418C8984CD01567FBC9FACFC1499AF5726DC6FA6DA5E9A05948D590DBF1876B5363F37E9784D15B0B0E5002220D44C9B3AC5DB7D6A954DB26BD25BAE4F9D01ABA9366F735EC4DD4C3159253DDE09FE4C4E4B75A58F05D85D8B244F5A6021B84EABD9B20590D887520E8883BD41E742E9FBF263A819E01CC65BD60D80640B94142F4ACBC10A00FCD73B6DDB6F2C8AB9941330B930D538CAE4CAD872203920E9277E0FBB2CCEC051E21B3CEF5EDC0C73E920D27F813DB35F79BEFA6D828</code></pre>
<pre><code>encrypted_data = 9650445AD6C9B22DA795AEA28948BD7D2FEDC2AB174CA134361803ABFF40DC52E8322703D55A0A01556511D329AAB8DA1017EFAF1746CB6BA8E48FADBBA12EA797D9BF4532C368908D05E7F57B0108BFACE7922CB7C05897EB3B2D0E45F89E9C7425B0E9B35A52FE7D0D89CC412C8DA2D4C84512C306909D61FE6179D38C3CE5F163068F08FDE60201FEFF083E6B075EE8F8CB63CB9E48D1AD814BB14D211C3A993E8959684B19C6AB2CF4494E68FB7217BC9F62DC6C432995D34CC63BC04EB8C17E4FB9BCC34F401FD737384AB0AEA73CE407667D266BB8683A70BBD3EDBD3BBC4CC7049BDD731A422D98E5010F9D389E365D38287EB406154DA781621C7D61FCFFA007371D1FB866EC3E6933B4C8284EE8C0F29CF27778B0AB574F42921F8622E22E730F0900A05BCC29C0D05B6C7AE901323FF88E7BCCE4AA1805C1F2559FF52B46D3D814C52E2E9E5BCE339F91BA</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 F0 F5 00 00 6A A7 7C 65
0010 | 78 01 00 00 1F 5F 04 F5 EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C A2 A0 68 94 28 07 FB E9
0030 | C4 16 81 0B EB 9E 03 A5 FE 50 01 00 C2 56 F7 B2
0040 | 7B 79 47 0C 3F 2F BE EC 58 59 4E 1B FE A4 D7 61
0050 | EB 1A B0 92 B7 5C 00 C7 85 76 2B 4F 4F 55 A1 5E
0060 | 37 CD 75 46 1B 9B FB 64 61 F9 6E 85 60 1D C5 75
0070 | 9D DA 52 D5 30 27 9F ED 4E 31 8A 31 83 BB B5 68
0080 | 06 36 AF B4 B6 FE FB 8D 41 39 77 2E F4 3A 81 AB
0090 | C4 DC 98 9C 02 0A DE F3 89 3F 66 6C C9 68 E3 3A
00A0 | FD D2 DB B2 59 C7 9A 5D F7 74 75 FD E5 83 92 8A
00B0 | 2B D0 45 62 45 53 A6 04 AB F4 B1 7D F0 38 84 EF
00C0 | 9B B7 61 FC 5D 56 C6 08 A0 10 8B 4C 04 20 74 54
00D0 | 18 C8 98 4C D0 15 67 FB C9 FA CF C1 49 9A F5 72
00E0 | 6D C6 FA 6D A5 E9 A0 59 48 D5 90 DB F1 87 6B 53
00F0 | 63 F3 7E 97 84 D1 5B 0B 0E 50 02 22 0D 44 C9 B3
0100 | AC 5D B7 D6 A9 54 DB 26 BD 25 BA E4 F9 D0 1A BA
0110 | 93 66 F7 35 EC 4D D4 C3 15 92 53 DD E0 9F E4 C4
0120 | E4 B7 5A 58 F0 5D 85 D8 B2 44 F5 A6 02 1B 84 EA
0130 | BD 9B 20 59 0D 88 75 20 E8 88 3B D4 1E 74 2E 9F
0140 | BF 26 3A 81 9E 01 CC 65 BD 60 D8 06 40 B9 41 42
0150 | F4 AC BC 10 A0 0F CD 73 B6 DD B6 F2 C8 AB 99 41
0160 | 33 0B 93 0D 53 8C AE 4C AD 87 22 03 92 0E 92 77
0170 | E0 FB B2 CC EC 05 1E 21 B3 CE F5 ED C0 C7 3E 92
0180 | 0D 27 F8 13 DB 35 F7 9B EF A6 D8 28</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 9C 8D 0E 00 6D AC 7C 65
0010 | 78 01 00 00 1F 5F 04 F5 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA EB A4 DF 47 84 75 8E BA
0030 | 7D B4 DA 94 FF AB 83 FD FE 50 01 00 96 50 44 5A
0040 | D6 C9 B2 2D A7 95 AE A2 89 48 BD 7D 2F ED C2 AB
0050 | 17 4C A1 34 36 18 03 AB FF 40 DC 52 E8 32 27 03
0060 | D5 5A 0A 01 55 65 11 D3 29 AA B8 DA 10 17 EF AF
0070 | 17 46 CB 6B A8 E4 8F AD BB A1 2E A7 97 D9 BF 45
0080 | 32 C3 68 90 8D 05 E7 F5 7B 01 08 BF AC E7 92 2C
0090 | B7 C0 58 97 EB 3B 2D 0E 45 F8 9E 9C 74 25 B0 E9
00A0 | B3 5A 52 FE 7D 0D 89 CC 41 2C 8D A2 D4 C8 45 12
00B0 | C3 06 90 9D 61 FE 61 79 D3 8C 3C E5 F1 63 06 8F
00C0 | 08 FD E6 02 01 FE FF 08 3E 6B 07 5E E8 F8 CB 63
00D0 | CB 9E 48 D1 AD 81 4B B1 4D 21 1C 3A 99 3E 89 59
00E0 | 68 4B 19 C6 AB 2C F4 49 4E 68 FB 72 17 BC 9F 62
00F0 | DC 6C 43 29 95 D3 4C C6 3B C0 4E B8 C1 7E 4F B9
0100 | BC C3 4F 40 1F D7 37 38 4A B0 AE A7 3C E4 07 66
0110 | 7D 26 6B B8 68 3A 70 BB D3 ED BD 3B BC 4C C7 04
0120 | 9B DD 73 1A 42 2D 98 E5 01 0F 9D 38 9E 36 5D 38
0130 | 28 7E B4 06 15 4D A7 81 62 1C 7D 61 FC FF A0 07
0140 | 37 1D 1F B8 66 EC 3E 69 33 B4 C8 28 4E E8 C0 F2
0150 | 9C F2 77 78 B0 AB 57 4F 42 92 1F 86 22 E2 2E 73
0160 | 0F 09 00 A0 5B CC 29 C0 D0 5B 6C 7A E9 01 32 3F
0170 | F8 8E 7B CC E4 AA 18 05 C1 F2 55 9F F5 2B 46 D3
0180 | D8 14 C5 2E 2E 9E 5B CE 33 9F 91 BA</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>F0F500006AA77C65</code></td>
<td><code>9C8D0E006DAC7C65</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>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100C256F7B27B79470C3F2FBEEC</code> <code>58594E1BFEA4D761EB1AB092B75C00C7</code> <code>85762B4F4F55A15E37CD75461B9BFB64</code> <code>61F96E85601DC5759DDA52D530279FED</code> <code>4E318A3183BBB5680636AFB4B6FEFB8D</code> <code>4139772EF43A81ABC4DC989C020ADEF3</code> <code>893F666CC968E33AFDD2DBB259C79A5D</code> <code>F77475FDE583928A2BD045624553A604</code> <code>ABF4B17DF03884EF9BB761FC5D56C608</code> <code>A0108B4C0420745418C8984CD01567FB</code> <code>C9FACFC1499AF5726DC6FA6DA5E9A059</code> <code>48D590DBF1876B5363F37E9784D15B0B</code> <code>0E5002220D44C9B3AC5DB7D6A954DB26</code> <code>BD25BAE4F9D01ABA9366F735EC4DD4C3</code> <code>159253DDE09FE4C4E4B75A58F05D85D8</code> <code>B244F5A6021B84EABD9B20590D887520</code> <code>E8883BD41E742E9FBF263A819E01CC65</code> <code>BD60D80640B94142F4ACBC10A00FCD73</code> <code>B6DDB6F2C8AB9941330B930D538CAE4C</code> <code>AD872203920E9277E0FBB2CCEC051E21</code> <code>B3CEF5EDC0C73E920D27F813DB35F79B</code><br> <code>EFA6D828</code></td>
<td><code>FE5001009650445AD6C9B22DA795AEA2</code> <code>8948BD7D2FEDC2AB174CA134361803AB</code> <code>FF40DC52E8322703D55A0A01556511D3</code> <code>29AAB8DA1017EFAF1746CB6BA8E48FAD</code> <code>BBA12EA797D9BF4532C368908D05E7F5</code> <code>7B0108BFACE7922CB7C05897EB3B2D0E</code> <code>45F89E9C7425B0E9B35A52FE7D0D89CC</code> <code>412C8DA2D4C84512C306909D61FE6179</code> <code>D38C3CE5F163068F08FDE60201FEFF08</code> <code>3E6B075EE8F8CB63CB9E48D1AD814BB1</code> <code>4D211C3A993E8959684B19C6AB2CF449</code> <code>4E68FB7217BC9F62DC6C432995D34CC6</code> <code>3BC04EB8C17E4FB9BCC34F401FD73738</code> <code>4AB0AEA73CE407667D266BB8683A70BB</code> <code>D3EDBD3BBC4CC7049BDD731A422D98E5</code> <code>010F9D389E365D38287EB406154DA781</code> <code>621C7D61FCFFA007371D1FB866EC3E69</code> <code>33B4C8284EE8C0F29CF27778B0AB574F</code> <code>42921F8622E22E730F0900A05BCC29C0</code> <code>D05B6C7AE901323FF88E7BCCE4AA1805</code> <code>C1F2559FF52B46D3D814C52E2E9E5BCE</code><br> <code>339F91BA</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 = 5A845B26373924B96EFE1B615EE6E12C91CD3913BAEE7B7C2B9AD470DF469AE79FC3A2C8A148DC58A071CC0556DB1802F2D4BC78E9DD846BC1CB95A258C7163EA937ADADC8DE1140E46561ACE51831EF24B27EFCAA0C692E969332E23CB979B2A5379110F41D74992AC6E457BB36E8610B325B4C8D28ECFFE642A290DEB7F4C0A9C6A68AE4E6D41D294938341D038E5460D779BA993E0F8B0CC5BD496E6158B76165B38E63A27C2093B006B3F5C72F883D133433D4EC91F4D2C8F3201F0610A4431163904FCFD009B67E535F742DD85F670BCB32AB1712D25270D22A0E83535D65016C25712B8E4A5E2EDC4EF82E8068433D1F2BE92D27352AEDC40778910140</code></pre>
<pre><code>auth_key = 704962C6CEE4F017E536B0FCD4E4C0A67BF4281A5192E1729EDA71F69744F28735DD10CCAF8CBF9A8B41B7C6552CE597D2E798CDEEA549151B6732A9993EE6E4594B27F7344F10A655888EF4EB7695A150E5BCAF826EBAE56724252B42425F72B5AF57F88141617247513A7DCED1B4A77CDA6EA70D4E7838391B43814C4A57FE87EB9FC3C11246DC6480A35E51045598AE8C5C3BDBBEF945E2F3E5B23B7D613CF818B6340280B91FDDB182D3DE96BAD1DD1A88A03B801158FCD816488DC9A0C186BBBB6FFDCE4D959556FE82115BB1DCDBD8880666FEE86B4F3FF51254873DA79E3F90CA692EB2784A48413FB663A472542B8A9B7DC3E449CF94B3E1C8163BC9</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 C0 E2 D8 6A A7 7C 65
0010 | 70 00 00 00 34 F7 CB 3B EB 7B 0E A1 99 7D 01 79
0020 | D5 4F 04 D1 19 D1 05 5C A2 A0 68 94 28 07 FB E9
0030 | C4 16 81 0B EB 9E 03 A5 40 94 BD 6C 16 45 12 A1
0040 | C3 1B C1 F0 35 DF 17 5F</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 8C D5 FB 6D AC 7C 65
0010 | 58 00 00 00 34 F7 CB 3B 40 D6 59 B1 27 2C F7 5A
0020 | EE A1 83 3A 66 BE D1 DA EB A4 DF 47 84 75 8E BA
0030 | 7D B4 DA 94 FF AB 83 FD 0A D7 C8 3B BA 5E 75 ED
0040 | C6 53 7C D2 2A 01 D0 AE</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>01C0E2D86AA77C65</code></td>
<td><code>018CD5FB6DAC7C65</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>70000000</code> (112 in decimal)</td>
<td><code>58000000</code> (88 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>EB7B0EA1997D0179D54F04D119D1055C</code></td>
<td><code>40D659B1272CF75AEEA1833A66BED1DA</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>A2A068942807FBE9C416810BEB9E03A5</code></td>
<td><code>EBA4DF4784758EBA7DB4DA94FFAB83FD</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>4094BD6C164512A1C31BC1F035DF175F</code></td>
<td><code>0AD7C83BBA5E75EDC6537CD22A01D0AE</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>