Update content of files

This commit is contained in:
GitHub Action 2024-01-20 13:19:41 +00:00
parent 541a541163
commit 00171f4e5a
3 changed files with 248 additions and 214 deletions

View file

@ -59,6 +59,8 @@
<a href='/constructor/messages.savedDialogsSlice'>messages.savedDialogsSlice</a>#44ba9dd9 count:<a href='/type/int'>int</a> dialogs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/SavedDialog'>SavedDialog</a>&gt; messages:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Message'>Message</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/messages.SavedDialogs'>messages.SavedDialogs</a>;
<a href='/constructor/messages.savedDialogsNotModified'>messages.savedDialogsNotModified</a>#c01f6fe8 count:<a href='/type/int'>int</a> = <a href='/type/messages.SavedDialogs'>messages.SavedDialogs</a>;
<a href='/constructor/savedDialog'>savedDialog</a>#bd87cb6c flags:<a href='/type/%23'>#</a> pinned:flags.2?<a href='/constructor/true'>true</a> peer:<a href='/type/Peer'>Peer</a> top_message:<a href='/type/int'>int</a> = <a href='/type/SavedDialog'>SavedDialog</a>;
---functions---
<a href='/method/messages.getSavedDialogs'>messages.getSavedDialogs</a>#5381d21a flags:<a href='/type/%23'>#</a> exclude_pinned:flags.0?<a href='/constructor/true'>true</a> offset_date:<a href='/type/int'>int</a> offset_id:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.SavedDialogs'>messages.SavedDialogs</a>;
@ -73,12 +75,44 @@
<a href='/method/messages.getSearchCounters'>messages.getSearchCounters</a>#1bbcf300 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> saved_peer_id:flags.2?<a href='/type/InputPeer'>InputPeer</a> top_msg_id:flags.0?<a href='/type/int'>int</a> filters:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessagesFilter'>MessagesFilter</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/messages.SearchCounter'>messages.SearchCounter</a>&gt;;
<a href='/method/messages.getSearchResultsCalendar'>messages.getSearchResultsCalendar</a>#6aa3f6bd flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> saved_peer_id:flags.2?<a href='/type/InputPeer'>InputPeer</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> offset_id:<a href='/type/int'>int</a> offset_date:<a href='/type/int'>int</a> = <a href='/type/messages.SearchResultsCalendar'>messages.SearchResultsCalendar</a>;
<a href='/method/messages.getSearchResultsPositions'>messages.getSearchResultsPositions</a>#9c7f2f10 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> saved_peer_id:flags.2?<a href='/type/InputPeer'>InputPeer</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.SearchResultsPositions'>messages.SearchResultsPositions</a>;</code></pre>
<p>Messages sent and forwarded from various users (including ourselves) to Saved Messages are automatically categorized by their original sender into a saved dialog list, quite similar to the main dialog list used to normally interact with chats. </p>
<p>To add new dialogs to the main dialog list a user has to write to them (or join a channel/chat, etc.).<br>
To add new dialogs to the saved dialog list, simply forward or send messages to <a href="/constructor/inputPeerSelf">inputPeerSelf</a> (the current user): the original sender of the forwarded message will be the dialog peer, and the saved dialog's messages will be only the messages from that peer that were forwarded to Saved Messages. </p>
<p>Saving messages from users with forward privacy enabled will add them to a saved dialog entry of a special anonymous user with <code>id=2666000</code>, sending new messages directly to ourselves will add them to a saved dialog entry with ourselves. </p>
<p>Messages sent and forwarded from various users (including ourselves) to Saved Messages are automatically categorized by their original dialog into a saved dialog list, quite similar to the normal dialog list used to normally interact with chats. </p>
<p>To add new dialogs to the normal dialog list a user has to write to them (or join a channel/chat, etc.).<br>
To add new dialogs to the saved dialog list, simply forward messages from any normal dialog to <a href="/constructor/inputPeerSelf">inputPeerSelf</a> (the current user): the forwarded messages (including outgoing ones) will be added to a saved dialog with the same ID of the original dialog.</p>
<p>This includes outgoing messages, for example assume the following:</p>
<ul>
<li>Our user <code>id</code> is equal to <code>11111111</code></li>
<li>We send a message A with ID <code>10</code> to a <a href="/api/channel">supergroup</a> with <code>id=-100122222222</code> (bot API format, equivalent to a <a href="/constructor/peerChannel">peerChannel</a> with ID <code>122222222</code>) </li>
<li>Another user with <code>id=133333333</code> replies <code>B</code> to our previous message, message ID <code>11</code></li>
<li>We forward both messages <code>A</code> and <code>B</code> with IDs <code>10</code> and <code>11</code> to <a href="/constructor/inputPeerSelf">inputPeerSelf</a>, which will:<ul>
<li>Create a new <a href="/constructor/savedDialog">savedDialog</a> with <code>peer=-100122222222</code> (if it doesn't exist already because we already forwarded messages from that supergroup)</li>
<li>Generate two messages:<ul>
<li>Message <code>A</code>:<ul>
<li><code>id</code>: an unrelated message ID, the next one in the common ID sequence, for example <code>1234</code></li>
<li><code>peer_id</code>: <code>11111111</code></li>
<li><code>saved_peer_id</code>: <code>-100122222222</code></li>
<li><code>fwd_from.from_id</code>: <code>11111111</code></li>
<li><code>fwd_from.saved_from_peer</code>: <code>-100122222222</code></li>
<li><code>fwd_from.saved_from_msg_id</code>: <code>10</code></li>
</ul>
</li>
<li>Message <code>B</code>:<ul>
<li><code>id</code>: an unrelated message ID, the next one in the common ID sequence, for example <code>1235</code></li>
<li><code>reply_to.reply_to_msg_id</code>: <code>1234</code></li>
<li><code>peer_id</code>: <code>11111111</code></li>
<li><code>saved_peer_id</code>: <code>-100122222222</code></li>
<li><code>fwd_from.from_id</code>: <code>133333333</code></li>
<li><code>fwd_from.saved_from_peer</code>: <code>-100122222222</code></li>
<li><code>fwd_from.saved_from_msg_id</code>: <code>11</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Saving messages from private chats with users with forward privacy enabled will add them to a saved dialog entry of a special anonymous user with <code>id=2666000</code>. </p>
<p>Sending (not forwarding) new messages directly to ourselves will add them to a saved dialog entry with ourselves. </p>
<p>A set of methods can then be used to obtain this dialog list, pin/unpin dialogs inside of it, view and remove messages from saved dialogs: <a href="/method/messages.getSavedDialogs">messages.getSavedDialogs</a>, <a href="/method/messages.getSavedHistory">messages.getSavedHistory</a>, <a href="/method/messages.deleteSavedHistory">messages.deleteSavedHistory</a>, <a href="/method/messages.getPinnedSavedDialogs">messages.getPinnedSavedDialogs</a>, <a href="/method/messages.toggleSavedDialogPin">messages.toggleSavedDialogPin</a>, <a href="/method/messages.reorderPinnedSavedDialogs">messages.reorderPinnedSavedDialogs</a> work just like their counterparts <a href="/method/messages.getDialogs">messages.getDialogs</a>, <a href="/method/messages.getHistory">messages.getHistory</a>, <a href="/method/messages.deleteHistory">messages.deleteHistory</a>, <a href="/method/messages.getPinnedDialogs">messages.getPinnedDialogs</a>, <a href="/method/messages.toggleDialogPin">messages.toggleDialogPin</a>, <a href="/method/messages.reorderPinnedDialogs">messages.reorderPinnedDialogs</a>, with the sole difference that they affect the saved dialog list, instead of the main dialog list. </p>
<p>Messages fetched from a saved dialog will have <code>peer</code>=<a href="/constructor/inputPeerSelf">inputPeerSelf</a> and the <code>saved_peer_id</code> flag set to the ID of the saved dialog.</p>
<p>To search for messages within a saved dialog, use the usual <a href="/method/messages.search">messages.search</a>, <a href="/method/messages.search">messages.search</a>, <a href="/method/messages.getSearchResultsCalendar">messages.getSearchResultsCalendar</a>, <a href="/method/messages.getSearchResultsPositions">messages.getSearchResultsPositions</a> methods with <code>peer</code>=<a href="/constructor/inputPeerSelf">inputPeerSelf</a> and <code>saved_peer_id=id of the saved dialog</code>.</p></div>
</div>

View file

@ -84,17 +84,17 @@
<tr>
<td><strong>video</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether this is a video.</td>
</tr>
<tr>
<td><strong>round</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.7?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether this is a round video.</td>
</tr>
<tr>
<td><strong>voice</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.8?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether this is a voice message.</td>
</tr>
<tr>
<td><strong>document</strong></td>

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 14 5D 0A 00 B7 CF AA 65
0010 | 14 00 00 00 F1 8E 7E BE 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 64 F7 0D 00 FC C0 AB 65
0010 | 14 00 00 00 F1 8E 7E BE 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68</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>145D0A00B7CFAA65</code></td>
<td><code>64F70D00FCC0AB65</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>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</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 4C B2 A3 B7 CF AA 65
0010 | CC 00 00 00 63 24 16 05 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C
0030 | 54 A6 BD A5 58 A8 5A EE 08 26 5C DC 3F 6C E0 E7
0040 | D3 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C4 6F BE FC C0 AB 65
0010 | B8 00 00 00 63 24 16 05 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
0030 | C9 66 E5 31 8F 55 64 A8 08 14 60 E7 D3 FA 72 77
0040 | 91 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>014CB2A3B7CFAA65</code></td>
<td><code>01C46FBEFCC0AB65</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>CC000000</code> (204 in decimal)</td>
<td><code>B8000000</code> (184 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08265CDC3F6CE0E7D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2764326436266371027</td>
<td><code>081460E7D3FA727791000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1468428376148703121</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 = 2764326436266371027</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2764326436266371027 = 1572225121 * 1758225587</code></p>
<pre><code>p = 1572225121
q = 1758225587</code></pre>
<pre><code>pq = 1468428376148703121</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1468428376148703121 = 1008949199 * 1455403679</code></p>
<pre><code>p = 1008949199
q = 1455403679</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 26 5C DC 3F 6C E0 E7 D3 00 00 00
0010 | 04 5D B6 40 61 00 00 00 04 68 CC 64 B3 00 00 00
0020 | 2F EA 31 5F B6 88 08 65 FE 75 8C DD 2F 8B 68 E5
0030 | 30 FE 3B ED 24 23 E3 6C 54 A6 BD A5 58 A8 5A EE
0040 | 81 40 5A 48 3E 6A 7A A0 6D 96 E5 9D 47 63 3A 04
0050 | 9F 40 63 26 23 A7 2B 86 0E 6B 90 92 62 40 E8 3D
<pre><code>0000 | 95 5F F5 A9 08 14 60 E7 D3 FA 72 77 91 00 00 00
0010 | 04 3C 23 57 CF 00 00 00 04 56 BF B2 9F 00 00 00
0020 | 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4 4B 78 FE 68
0030 | D6 70 1F CD 21 2C EB 87 C9 66 E5 31 8F 55 64 A8
0040 | 84 5F AD 32 D1 0A 4C 79 67 DA 49 A8 9F BE 50 8A
0050 | D2 4A A3 15 09 92 B4 99 B3 B2 C7 2C DC 0F 36 4C
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 = 1758225587</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08265CDC3F6CE0E7D3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2764326436266371027</td>
<td><code>081460E7D3FA727791000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1468428376148703121</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>045DB64061000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1572225121</td>
<td><code>043C2357CF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1008949199</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>0468CC64B3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1758225587</td>
<td><code>0456BFB29F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1455403679</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>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>81405A483E6A7AA06D96E59D47633A04</code> <code>9F40632623A72B860E6B90926240E83D</code></td>
<td><code>845FAD32D10A4C7967DA49A89FBE508A</code> <code>D24AA3150992B499B3B2C72CDC0F364C</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1758225587</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 = 955FF5A908265CDC3F6CE0E7D3000000045DB640610000000468CC64B30000002FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AEE81405A483E6A7AA06D96E59D47633A049F40632623A72B860E6B90926240E83D02000000
random_padding_bytes = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A4672425371A36EC6635D136F03824AE0AE1690944DF33E341E3F95E2964A78A223ED2160DE09F287B95DFF1463786A711F05BEA31846563D526511D4E42CB78</code></pre>
<pre><code>data = 955FF5A9081460E7D3FA727791000000043C2357CF0000000456BFB29F00000015A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A8845FAD32D10A4C7967DA49A89FBE508AD24AA3150992B499B3B2C72CDC0F364C02000000
random_padding_bytes = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B7E2F9BA25E3539490DA77CEB9AB45A44F9D7D3CB5DE7C0F69F0D5819112F5CACF06C964AE5D8BC3C727AC39A058681B8E80AAB76BF06CD90FCBC2B7CFBF8135</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 = 8F5A22A8B5C7BB1E4D2826C960D06E1473F431B409D7B2BCA3E1D6847FD3408A13EA075D9C4514003E9B83A0A1929F6C107A7FF3A0AC7FB1345B9D63FA90B2742D2110F1012CE2EAC700FF22D88627CD0CDBC36A7347BA6270AE24A9FA4A430C8EAC115CF86523B81B3B95D5D8B635F343E1067D3E8135D9A066393CC8DDA498C57F63E62C239C298FA4A4E65B814B4359B3816976FDE8F91531C735CEDD8D015B57B85588307CBA846B5C1156BCF56C338F965116F5A6312045F1F964BF289C3771864A54B0865092079C3A7D90331A86C67ECE13A9C8E16E326ED3EEAD2824455CA8F834B639A2A7A76482134A1E0778E368FD342042A563A8C726134729B3</code></pre>
<pre><code>encrypted_data = 8AEC7230B35085FA65678B7F89AB27414B5D3CBCE86D14A84557C24E36FD27B35FC5B4FF3C1C9013D4882024A44625EBCE779EBA82BDB479002343980775165EDD6D9ABF090C01240B16055BD66C66F0CA508F850D9690783339B61833845E9AB1E2170A8017620BCE98C5B43644F629E6DBA1CF612C77D5133DB227649592A419F6616EACE0E3F24D8C094800C3A06F98D2B9F2BB4151A23E3F21DBED9E89E5C2A7070692FAF4646876560723286276209A796A3429A0035FA82828B3A7BA4B4123FE10AE7CD92EC3C0CE8173046A28462491998012A0BD094B4162F9A9720E1995D08AF2FB19864BD27A9E6F4D0EF68C4F6190857238C8C7DB9F058CCD17D0</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 18 5D 0A 00 B7 CF AA 65
0010 | 40 01 00 00 BE E4 12 D7 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C
0030 | 54 A6 BD A5 58 A8 5A EE 04 5D B6 40 61 00 00 00
0040 | 04 68 CC 64 B3 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 8F 5A 22 A8 B5 C7 BB 1E 4D 28 26 C9
0060 | 60 D0 6E 14 73 F4 31 B4 09 D7 B2 BC A3 E1 D6 84
0070 | 7F D3 40 8A 13 EA 07 5D 9C 45 14 00 3E 9B 83 A0
0080 | A1 92 9F 6C 10 7A 7F F3 A0 AC 7F B1 34 5B 9D 63
0090 | FA 90 B2 74 2D 21 10 F1 01 2C E2 EA C7 00 FF 22
00A0 | D8 86 27 CD 0C DB C3 6A 73 47 BA 62 70 AE 24 A9
00B0 | FA 4A 43 0C 8E AC 11 5C F8 65 23 B8 1B 3B 95 D5
00C0 | D8 B6 35 F3 43 E1 06 7D 3E 81 35 D9 A0 66 39 3C
00D0 | C8 DD A4 98 C5 7F 63 E6 2C 23 9C 29 8F A4 A4 E6
00E0 | 5B 81 4B 43 59 B3 81 69 76 FD E8 F9 15 31 C7 35
00F0 | CE DD 8D 01 5B 57 B8 55 88 30 7C BA 84 6B 5C 11
0100 | 56 BC F5 6C 33 8F 96 51 16 F5 A6 31 20 45 F1 F9
0110 | 64 BF 28 9C 37 71 86 4A 54 B0 86 50 92 07 9C 3A
0120 | 7D 90 33 1A 86 C6 7E CE 13 A9 C8 E1 6E 32 6E D3
0130 | EE AD 28 24 45 5C A8 F8 34 B6 39 A2 A7 A7 64 82
0140 | 13 4A 1E 07 78 E3 68 FD 34 20 42 A5 63 A8 C7 26
0150 | 13 47 29 B3</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 68 F7 0D 00 FC C0 AB 65
0010 | 40 01 00 00 BE E4 12 D7 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
0030 | C9 66 E5 31 8F 55 64 A8 04 3C 23 57 CF 00 00 00
0040 | 04 56 BF B2 9F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 8A EC 72 30 B3 50 85 FA 65 67 8B 7F
0060 | 89 AB 27 41 4B 5D 3C BC E8 6D 14 A8 45 57 C2 4E
0070 | 36 FD 27 B3 5F C5 B4 FF 3C 1C 90 13 D4 88 20 24
0080 | A4 46 25 EB CE 77 9E BA 82 BD B4 79 00 23 43 98
0090 | 07 75 16 5E DD 6D 9A BF 09 0C 01 24 0B 16 05 5B
00A0 | D6 6C 66 F0 CA 50 8F 85 0D 96 90 78 33 39 B6 18
00B0 | 33 84 5E 9A B1 E2 17 0A 80 17 62 0B CE 98 C5 B4
00C0 | 36 44 F6 29 E6 DB A1 CF 61 2C 77 D5 13 3D B2 27
00D0 | 64 95 92 A4 19 F6 61 6E AC E0 E3 F2 4D 8C 09 48
00E0 | 00 C3 A0 6F 98 D2 B9 F2 BB 41 51 A2 3E 3F 21 DB
00F0 | ED 9E 89 E5 C2 A7 07 06 92 FA F4 64 68 76 56 07
0100 | 23 28 62 76 20 9A 79 6A 34 29 A0 03 5F A8 28 28
0110 | B3 A7 BA 4B 41 23 FE 10 AE 7C D9 2E C3 C0 CE 81
0120 | 73 04 6A 28 46 24 91 99 80 12 A0 BD 09 4B 41 62
0130 | F9 A9 72 0E 19 95 D0 8A F2 FB 19 86 4B D2 7A 9E
0140 | 6F 4D 0E F6 8C 4F 61 90 85 72 38 C8 C7 DB 9F 05
0150 | 8C CD 17 D0</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 = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>185D0A00B7CFAA65</code></td>
<td><code>68F70D00FCC0AB65</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 = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045DB64061000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1572225121</td>
<td><code>043C2357CF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1008949199</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>0468CC64B3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1758225587</td>
<td><code>0456BFB29F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1455403679</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 = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001008F5A22A8B5C7BB1E4D2826C9</code> <code>60D06E1473F431B409D7B2BCA3E1D684</code> <code>7FD3408A13EA075D9C4514003E9B83A0</code> <code>A1929F6C107A7FF3A0AC7FB1345B9D63</code> <code>FA90B2742D2110F1012CE2EAC700FF22</code> <code>D88627CD0CDBC36A7347BA6270AE24A9</code> <code>FA4A430C8EAC115CF86523B81B3B95D5</code> <code>D8B635F343E1067D3E8135D9A066393C</code> <code>C8DDA498C57F63E62C239C298FA4A4E6</code> <code>5B814B4359B3816976FDE8F91531C735</code> <code>CEDD8D015B57B85588307CBA846B5C11</code> <code>56BCF56C338F965116F5A6312045F1F9</code> <code>64BF289C3771864A54B0865092079C3A</code> <code>7D90331A86C67ECE13A9C8E16E326ED3</code> <code>EEAD2824455CA8F834B639A2A7A76482</code> <code>134A1E0778E368FD342042A563A8C726</code><br> <code>134729B3</code></td>
<td><code>FE0001008AEC7230B35085FA65678B7F</code> <code>89AB27414B5D3CBCE86D14A84557C24E</code> <code>36FD27B35FC5B4FF3C1C9013D4882024</code> <code>A44625EBCE779EBA82BDB47900234398</code> <code>0775165EDD6D9ABF090C01240B16055B</code> <code>D66C66F0CA508F850D9690783339B618</code> <code>33845E9AB1E2170A8017620BCE98C5B4</code> <code>3644F629E6DBA1CF612C77D5133DB227</code> <code>649592A419F6616EACE0E3F24D8C0948</code> <code>00C3A06F98D2B9F2BB4151A23E3F21DB</code> <code>ED9E89E5C2A7070692FAF46468765607</code> <code>23286276209A796A3429A0035FA82828</code> <code>B3A7BA4B4123FE10AE7CD92EC3C0CE81</code> <code>73046A28462491998012A0BD094B4162</code> <code>F9A9720E1995D08AF2FB19864BD27A9E</code> <code>6F4D0EF68C4F6190857238C8C7DB9F05</code><br> <code>8CCD17D0</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<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 94 AE 64 B8 CF AA 65
0010 | C8 02 00 00 5C 07 E8 D0 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C
0030 | 54 A6 BD A5 58 A8 5A EE FE 50 02 00 99 A6 01 EC
0040 | 50 42 FF 46 EF F5 BD 58 7A 39 6D 7E 64 66 37 0E
0050 | 45 26 2F AB 27 07 51 A2 0A 07 6C 5F 10 36 F8 0B
0060 | B9 DB 0C CA AC FB E5 A1 8E 6D 9D 9A 4F 47 B3 4F
0070 | 66 1B 25 FE 5F 53 FE 5B D4 C2 6D 43 F8 90 BB 1D
0080 | 60 02 03 0A D2 56 3D 4D 4B 68 F3 37 41 B0 29 95
0090 | 56 3B 15 2B 23 D7 17 45 84 45 74 F6 58 72 B0 18
00A0 | 27 25 10 F3 B5 53 6D 5A E5 DE C5 4D 40 38 A9 4C
00B0 | 63 5F 28 84 FC 8A 63 80 C3 44 F6 10 13 C1 D9 90
00C0 | 76 A7 3C 82 FF 21 AF A5 04 0E 84 B1 1A 0B 71 EB
00D0 | 44 97 67 DC 55 41 23 8C 87 43 77 E2 C2 C7 18 D2
00E0 | B0 A0 3A 69 8D 78 4B 2A 3A F3 F5 96 C4 9D C1 5B
00F0 | 81 DA E6 73 D4 AF 8D 3D 62 FB 21 71 63 48 B2 5F
0100 | 89 DB D5 5A 13 20 55 8B 5A A7 D9 10 E7 DD A1 7C
0110 | 0E 60 B2 BD 77 99 21 58 C6 4F BE E7 38 14 23 A7
0120 | 9F 40 06 23 B7 B4 22 37 28 19 88 AA 64 5B 7D D6
0130 | 59 92 48 28 A4 3D FD 24 44 41 08 AB B6 B3 7D 1C
0140 | 35 AD 3A 44 AB 49 19 11 0C 92 B0 C4 A0 79 D6 F5
0150 | EC D5 E3 0E 6B 61 50 5A A5 CD A5 8F 31 4C 75 4E
0160 | 6A CA 5F 39 B6 68 A7 8E F9 2D E5 6F C8 DB 75 75
0170 | 0B 11 0C 7C B7 56 FE A7 F6 89 31 7F DF 82 E8 DB
0180 | 5B 53 1B 9F 2C D5 B0 8B 2A 86 CC 73 A3 AC 85 AE
0190 | F5 DA C4 AB 9B 6D 18 CA 8C 43 E4 86 AE 0C 48 C2
01A0 | 34 41 EF B0 EE B0 9F 1E 74 75 3E FC 0D 50 1C 6F
01B0 | 87 31 DD 05 62 37 76 30 8C F2 A5 4F AF 91 C8 70
01C0 | DD 8B C3 4A 6E CC F6 8A F9 A4 80 DB FB 22 70 9B
01D0 | 49 E0 1F B0 38 3B FC 10 F8 EC 16 79 A5 51 E0 2B
01E0 | F9 6F 44 88 27 FF 93 3A C0 85 3C 7F 6C A3 BA 98
01F0 | BE 6A A3 CD A3 89 D1 7F CE 1E DD 7F 24 1B 1C 94
0200 | A4 4E 24 82 82 DC 1F AD 59 21 29 40 98 EF FD 02
0210 | 90 C4 C3 3E 19 BD 61 FE 85 1E 0B B9 DE 87 B6 A1
0220 | D8 1F FA C9 F6 0E 72 49 E2 95 1D E8 05 4B 0E 25
0230 | D9 76 1F 44 C2 9B 67 31 AE 0C 3F 17 C9 E9 62 83
0240 | 04 99 28 EC 0E 9D CB 22 F5 D5 89 12 B4 5A E6 2D
0250 | 38 31 60 37 13 65 1E A5 E1 39 F4 D5 15 74 89 A6
0260 | 7F 4B B7 82 61 D1 F1 1A 80 42 F4 61 E4 9F 99 C3
0270 | C3 F5 F7 67 9C AE FD 41 C3 8F BC D2 01 8D D5 69
0280 | 0B 63 96 B1 4F 6E 68 D8 2B 40 C8 B8</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 9A 64 FD C0 AB 65
0010 | 9C 02 00 00 5C 07 E8 D0 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
0030 | C9 66 E5 31 8F 55 64 A8 FE 50 02 00 FE F6 27 AC
0040 | 3A 88 02 7B C6 58 3F 95 D8 2E 61 00 66 A8 7B 83
0050 | 96 14 EE 34 3C D8 D3 7F 2B 2C 81 FC 96 45 61 BA
0060 | 16 4F 44 E4 B3 C3 9A 6C C7 4C 6E 2F 26 87 C2 E5
0070 | 87 26 58 E4 30 17 34 B3 81 4D 42 0C 68 4D 94 C0
0080 | B9 3C 4B 33 5D BB 34 62 66 CD AD 20 B3 EE C9 1A
0090 | E4 9B 59 E1 30 EA B8 77 FD 03 C0 7B A7 86 DA 8E
00A0 | FF 7B DD CB 77 3E 0C 4C 1C 7C 66 FE 5C 5A 39 D3
00B0 | 2A 76 40 0D 71 FB D2 A0 9D 5B FD F3 B3 97 6F 17
00C0 | C1 DA 7F D7 73 49 CB D9 7E BC 52 17 18 15 41 F4
00D0 | 3D 8D ED B3 02 7D C3 98 96 23 DC F8 49 FF 39 18
00E0 | 32 F4 09 90 3E 76 20 EB BF 76 75 CE FA 13 CE C9
00F0 | 05 70 BB 0E E1 96 C5 BB 67 DB 16 9D B9 02 C1 19
0100 | 2F 67 D9 A7 4B 1B 97 82 FF 02 FD 4D B7 8C 76 11
0110 | 7D 66 39 A6 ED 87 F5 DE B3 7E D4 92 96 F2 C9 4E
0120 | A8 35 D0 98 8A 27 07 49 C3 E6 D1 D0 B0 BE 88 F3
0130 | 98 5D 68 3E 48 F2 E2 AC 76 48 17 5E E7 2B EA 1B
0140 | 52 64 1C 23 EC 8E EF BD 60 25 51 6E 91 CC E2 0C
0150 | 25 CB 51 59 B5 C9 D9 CA 19 A1 5D D4 A4 4F 42 29
0160 | 46 B7 58 EC 4C 96 8B DE 08 32 E2 38 9D 5B 9F 3C
0170 | 3A C5 20 AC 58 75 37 47 71 7F 72 76 A7 DF 3F F8
0180 | 41 A7 AB D1 85 24 A3 15 0F 53 74 71 F7 3A 98 18
0190 | 09 7E 82 D9 64 5A 9C E3 8F 85 8D 51 0F FC 79 CE
01A0 | 11 D9 61 73 C2 2D DE 2B 0A E4 90 B8 CC 7B 10 BC
01B0 | C7 BB 88 79 02 78 72 E7 24 DC C6 48 DD F7 AE 6F
01C0 | 14 C3 22 9E 7D 61 14 63 E5 13 D3 8B E9 13 D0 D5
01D0 | 0E 9D 43 93 37 C0 FD 8D 71 C9 EF 70 C6 02 A4 71
01E0 | 73 D6 99 30 82 16 C7 C4 4C 40 61 5B F8 E9 80 6A
01F0 | 5D FA 56 F4 52 9A D7 0E 78 4C 19 04 A9 48 8A 01
0200 | 9A 6C 7A B7 D8 22 A9 A6 92 6A 19 16 89 13 02 C1
0210 | 82 7C E5 4E 9D 88 29 EE 07 9D 19 73 0D FE BA 21
0220 | 8D 31 7E B4 F2 2A 24 18 EF 93 43 DA 75 13 1F C6
0230 | F3 7A 80 D5 EE B9 33 09 71 12 44 AE 3A 1D 4C A1
0240 | 90 6F 10 B4 F0 6C 8F 9B F5 47 A6 FE A9 A8 D0 CC
0250 | 91 0B 15 E7 DA 9A 0A CF 0C 2E 79 34 F7 A7 DB A8
0260 | EF FE 4D 13 5D BD 20 7C 60 9B FC 3B AC 89 BA 94
0270 | 9D DF 75 48 79 71 2F 6B 97 C5 0A 54 F5 60 D0 A7
0280 | 5D A8 A0 78 A0 39 F2 1B CA 12 9F CB</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 = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0194AE64B8CFAA65</code></td>
<td><code>01E09A64FDC0AB65</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>C8020000</code> (712 in decimal)</td>
<td><code>9C020000</code> (668 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE50020099A601EC5042FF46EFF5BD58</code> <code>7A396D7E6466370E45262FAB270751A2</code> <code>0A076C5F1036F80BB9DB0CCAACFBE5A1</code> <code>8E6D9D9A4F47B34F661B25FE5F53FE5B</code> <code>D4C26D43F890BB1D6002030AD2563D4D</code> <code>4B68F33741B02995563B152B23D71745</code> <code>844574F65872B018272510F3B5536D5A</code> <code>E5DEC54D4038A94C635F2884FC8A6380</code> <code>C344F61013C1D99076A73C82FF21AFA5</code> <code>040E84B11A0B71EB449767DC5541238C</code> <code>874377E2C2C718D2B0A03A698D784B2A</code> <code>3AF3F596C49DC15B81DAE673D4AF8D3D</code> <code>62FB21716348B25F89DBD55A1320558B</code> <code>5AA7D910E7DDA17C0E60B2BD77992158</code> <code>C64FBEE7381423A79F400623B7B42237</code> <code>281988AA645B7DD659924828A43DFD24</code> <code>444108ABB6B37D1C35AD3A44AB491911</code> <code>0C92B0C4A079D6F5ECD5E30E6B61505A</code> <code>A5CDA58F314C754E6ACA5F39B668A78E</code> <code>F92DE56FC8DB75750B110C7CB756FEA7</code> <code>F689317FDF82E8DB5B531B9F2CD5B08B</code> <code>2A86CC73A3AC85AEF5DAC4AB9B6D18CA</code> <code>8C43E486AE0C48C23441EFB0EEB09F1E</code> <code>74753EFC0D501C6F8731DD0562377630</code> <code>8CF2A54FAF91C870DD8BC34A6ECCF68A</code> <code>F9A480DBFB22709B49E01FB0383BFC10</code> <code>F8EC1679A551E02BF96F448827FF933A</code> <code>C0853C7F6CA3BA98BE6AA3CDA389D17F</code> <code>CE1EDD7F241B1C94A44E248282DC1FAD</code> <code>5921294098EFFD0290C4C33E19BD61FE</code> <code>851E0BB9DE87B6A1D81FFAC9F60E7249</code> <code>E2951DE8054B0E25D9761F44C29B6731</code> <code>AE0C3F17C9E96283049928EC0E9DCB22</code> <code>F5D58912B45AE62D3831603713651EA5</code> <code>E139F4D5157489A67F4BB78261D1F11A</code> <code>8042F461E49F99C3C3F5F7679CAEFD41</code> <code>C38FBCD2018DD5690B6396B14F6E68D8</code><br> <code>2B40C8B8</code></td>
<td><code>FE500200FEF627AC3A88027BC6583F95</code> <code>D82E610066A87B839614EE343CD8D37F</code> <code>2B2C81FC964561BA164F44E4B3C39A6C</code> <code>C74C6E2F2687C2E5872658E4301734B3</code> <code>814D420C684D94C0B93C4B335DBB3462</code> <code>66CDAD20B3EEC91AE49B59E130EAB877</code> <code>FD03C07BA786DA8EFF7BDDCB773E0C4C</code> <code>1C7C66FE5C5A39D32A76400D71FBD2A0</code> <code>9D5BFDF3B3976F17C1DA7FD77349CBD9</code> <code>7EBC5217181541F43D8DEDB3027DC398</code> <code>9623DCF849FF391832F409903E7620EB</code> <code>BF7675CEFA13CEC90570BB0EE196C5BB</code> <code>67DB169DB902C1192F67D9A74B1B9782</code> <code>FF02FD4DB78C76117D6639A6ED87F5DE</code> <code>B37ED49296F2C94EA835D0988A270749</code> <code>C3E6D1D0B0BE88F3985D683E48F2E2AC</code> <code>7648175EE72BEA1B52641C23EC8EEFBD</code> <code>6025516E91CCE20C25CB5159B5C9D9CA</code> <code>19A15DD4A44F422946B758EC4C968BDE</code> <code>0832E2389D5B9F3C3AC520AC58753747</code> <code>717F7276A7DF3FF841A7ABD18524A315</code> <code>0F537471F73A9818097E82D9645A9CE3</code> <code>8F858D510FFC79CE11D96173C22DDE2B</code> <code>0AE490B8CC7B10BCC7BB8879027872E7</code> <code>24DCC648DDF7AE6F14C3229E7D611463</code> <code>E513D38BE913D0D50E9D439337C0FD8D</code> <code>71C9EF70C602A47173D699308216C7C4</code> <code>4C40615BF8E9806A5DFA56F4529AD70E</code> <code>784C1904A9488A019A6C7AB7D822A9A6</code> <code>926A1916891302C1827CE54E9D8829EE</code> <code>079D19730DFEBA218D317EB4F22A2418</code> <code>EF9343DA75131FC6F37A80D5EEB93309</code> <code>711244AE3A1D4CA1906F10B4F06C8F9B</code> <code>F547A6FEA9A8D0CC910B15E7DA9A0ACF</code> <code>0C2E7934F7A7DBA8EFFE4D135DBD207C</code> <code>609BFC3BAC89BA949DDF754879712F6B</code> <code>97C50A54F560D0A75DA8A078A039F21B</code><br> <code>CA129FCB</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 4BCFFC5DDA8FCA36590F6A9BE074987728198C6090DB37BABFAC4520A
<!-- 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 = 99A601EC5042FF46EFF5BD587A396D7E6466370E45262FAB270751A20A076C5F1036F80BB9DB0CCAACFBE5A18E6D9D9A4F47B34F661B25FE5F53FE5BD4C26D43F890BB1D6002030AD2563D4D4B68F33741B02995563B152B23D71745844574F65872B018272510F3B5536D5AE5DEC54D4038A94C635F2884FC8A6380C344F61013C1D99076A73C82FF21AFA5040E84B11A0B71EB449767DC5541238C874377E2C2C718D2B0A03A698D784B2A3AF3F596C49DC15B81DAE673D4AF8D3D62FB21716348B25F89DBD55A1320558B5AA7D910E7DDA17C0E60B2BD77992158C64FBEE7381423A79F400623B7B42237281988AA645B7DD659924828A43DFD24444108ABB6B37D1C35AD3A44AB4919110C92B0C4A079D6F5ECD5E30E6B61505AA5CDA58F314C754E6ACA5F39B668A78EF92DE56FC8DB75750B110C7CB756FEA7F689317FDF82E8DB5B531B9F2CD5B08B2A86CC73A3AC85AEF5DAC4AB9B6D18CA8C43E486AE0C48C23441EFB0EEB09F1E74753EFC0D501C6F8731DD05623776308CF2A54FAF91C870DD8BC34A6ECCF68AF9A480DBFB22709B49E01FB0383BFC10F8EC1679A551E02BF96F448827FF933AC0853C7F6CA3BA98BE6AA3CDA389D17FCE1EDD7F241B1C94A44E248282DC1FAD5921294098EFFD0290C4C33E19BD61FE851E0BB9DE87B6A1D81FFAC9F60E7249E2951DE8054B0E25D9761F44C29B6731AE0C3F17C9E96283049928EC0E9DCB22F5D58912B45AE62D3831603713651EA5E139F4D5157489A67F4BB78261D1F11A8042F461E49F99C3C3F5F7679CAEFD41C38FBCD2018DD5690B6396B14F6E68D82B40C8B8
tmp_aes_key = 781F6119988127EE7CC210BB5F2FAE436DE67BF169A04F7D510C2027B3783060
tmp_aes_iv = 4B618D0127BE3DCE9CFA8D61132CC31EB9738E3749E3D22DFA0E1B6F81405A48</code></pre>
<pre><code>encrypted_answer = FEF627AC3A88027BC6583F95D82E610066A87B839614EE343CD8D37F2B2C81FC964561BA164F44E4B3C39A6CC74C6E2F2687C2E5872658E4301734B3814D420C684D94C0B93C4B335DBB346266CDAD20B3EEC91AE49B59E130EAB877FD03C07BA786DA8EFF7BDDCB773E0C4C1C7C66FE5C5A39D32A76400D71FBD2A09D5BFDF3B3976F17C1DA7FD77349CBD97EBC5217181541F43D8DEDB3027DC3989623DCF849FF391832F409903E7620EBBF7675CEFA13CEC90570BB0EE196C5BB67DB169DB902C1192F67D9A74B1B9782FF02FD4DB78C76117D6639A6ED87F5DEB37ED49296F2C94EA835D0988A270749C3E6D1D0B0BE88F3985D683E48F2E2AC7648175EE72BEA1B52641C23EC8EEFBD6025516E91CCE20C25CB5159B5C9D9CA19A15DD4A44F422946B758EC4C968BDE0832E2389D5B9F3C3AC520AC58753747717F7276A7DF3FF841A7ABD18524A3150F537471F73A9818097E82D9645A9CE38F858D510FFC79CE11D96173C22DDE2B0AE490B8CC7B10BCC7BB8879027872E724DCC648DDF7AE6F14C3229E7D611463E513D38BE913D0D50E9D439337C0FD8D71C9EF70C602A47173D699308216C7C44C40615BF8E9806A5DFA56F4529AD70E784C1904A9488A019A6C7AB7D822A9A6926A1916891302C1827CE54E9D8829EE079D19730DFEBA218D317EB4F22A2418EF9343DA75131FC6F37A80D5EEB93309711244AE3A1D4CA1906F10B4F06C8F9BF547A6FEA9A8D0CC910B15E7DA9A0ACF0C2E7934F7A7DBA8EFFE4D135DBD207C609BFC3BAC89BA949DDF754879712F6B97C50A54F560D0A75DA8A078A039F21BCA129FCB
tmp_aes_key = D32E4A7F18252AE2B0406B84633E1117833ED75BDA40011D1E1700E3E08A8AE7
tmp_aes_iv = 4FFC40D969D49934ED3740FF66D9179947A5E1D85C4C7F15555920C1845FAD32</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 915FF572F24CCCA4CF0DA78AA41CB17CD679CF68BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AEE03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010007E2EFE593490D143C448A84ADBE8EE03213DED2028797D981B414FCB0BF7A6D2876E72810AA63D901915C2CCD4DCE9008983489FDDBDF0E915FEABFE9849A23C5BEC177A7020383E6A5D1E0FC7F5F7FE0AAC96950913B699E75C86A0673E9A78B0A66AC2A8D6CECE2CB1A40F7EC7413BE7A06EB39F61AC82DD44D6F67BB8F0CE267CD05B300DEFCDAC8F6B65F7A0915E4CCB0F61403E7A6F477A37DC94E71DEF10853B001744477F645114C51EDD0B2BEBE68EBA2CCB289ECF0451BEAB070FD58BDC4771B729EA5CAF0708833EEE7116669E81426AA2BB80948A487D812616C3E76A57DA77D550227C53647CBD661550208C6DBDE6491F5EB08868D102C4777B8CFAA65F38FEE5E2261B015
answer = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AEE03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010007E2EFE593490D143C448A84ADBE8EE03213DED2028797D981B414FCB0BF7A6D2876E72810AA63D901915C2CCD4DCE9008983489FDDBDF0E915FEABFE9849A23C5BEC177A7020383E6A5D1E0FC7F5F7FE0AAC96950913B699E75C86A0673E9A78B0A66AC2A8D6CECE2CB1A40F7EC7413BE7A06EB39F61AC82DD44D6F67BB8F0CE267CD05B300DEFCDAC8F6B65F7A0915E4CCB0F61403E7A6F477A37DC94E71DEF10853B001744477F645114C51EDD0B2BEBE68EBA2CCB289ECF0451BEAB070FD58BDC4771B729EA5CAF0708833EEE7116669E81426AA2BB80948A487D812616C3E76A57DA77D550227C53647CBD661550208C6DBDE6491F5EB08868D102C4777B8CFAA65F38FEE5E2261B015</code></pre>
<pre><code>answer_with_hash = ADDDF2FEB5E14F93EE8D3A5181F9D89A39E4439CBA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009828B2E4CAEC188BB94216F5E2DB632A17630A21FD00C67465E741D26137C8E2B757F349D8DD1B62B601642ACB9E3B390ABF153D3A11615A128ED1D79379D763C14D2DF5CEF99C96945C51290C1FD82C4B482078863B2BC7022C7886C21C0F1D24814C768321C05934303E50AE22CBC83F2A3994BBC3C72E77BF10CDB695CBD86655D1BC0A083551E59D0FBFCFA13825A182105A78DA35AF5A15C064275B6E6729049C84209B898675C9110ADCD1CBB2AAB333C05D3E9F70D05FEE7C54EFCE927E1B40A719D04D15C7E950EB885E60AAAE990231719DBDDD84C65B2F3A606FE1F78DEA7C8FAD25C1CD7876EB6F5A46270B82D549E31EDD3C2DC2F82970A4999CFDC0AB657607B7374780E1C0
answer = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009828B2E4CAEC188BB94216F5E2DB632A17630A21FD00C67465E741D26137C8E2B757F349D8DD1B62B601642ACB9E3B390ABF153D3A11615A128ED1D79379D763C14D2DF5CEF99C96945C51290C1FD82C4B482078863B2BC7022C7886C21C0F1D24814C768321C05934303E50AE22CBC83F2A3994BBC3C72E77BF10CDB695CBD86655D1BC0A083551E59D0FBFCFA13825A182105A78DA35AF5A15C064275B6E6729049C84209B898675C9110ADCD1CBB2AAB333C05D3E9F70D05FEE7C54EFCE927E1B40A719D04D15C7E950EB885E60AAAE990231719DBDDD84C65B2F3A606FE1F78DEA7C8FAD25C1CD7876EB6F5A46270B82D549E31EDD3C2DC2F82970A4999CFDC0AB657607B7374780E1C0</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 2F EA 31 5F B6 88 08 65 FE 75 8C DD
0010 | 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C 54 A6 BD A5
0020 | 58 A8 5A EE 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4
0010 | 4B 78 FE 68 D6 70 1F CD 21 2C EB 87 C9 66 E5 31
0020 | 8F 55 64 A8 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 = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
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 | 07 E2 EF E5 93 49 0D 14 3C 44 8A 84 AD BE 8E E0
0140 | 32 13 DE D2 02 87 97 D9 81 B4 14 FC B0 BF 7A 6D
0150 | 28 76 E7 28 10 AA 63 D9 01 91 5C 2C CD 4D CE 90
0160 | 08 98 34 89 FD DB DF 0E 91 5F EA BF E9 84 9A 23
0170 | C5 BE C1 77 A7 02 03 83 E6 A5 D1 E0 FC 7F 5F 7F
0180 | E0 AA C9 69 50 91 3B 69 9E 75 C8 6A 06 73 E9 A7
0190 | 8B 0A 66 AC 2A 8D 6C EC E2 CB 1A 40 F7 EC 74 13
01A0 | BE 7A 06 EB 39 F6 1A C8 2D D4 4D 6F 67 BB 8F 0C
01B0 | E2 67 CD 05 B3 00 DE FC DA C8 F6 B6 5F 7A 09 15
01C0 | E4 CC B0 F6 14 03 E7 A6 F4 77 A3 7D C9 4E 71 DE
01D0 | F1 08 53 B0 01 74 44 77 F6 45 11 4C 51 ED D0 B2
01E0 | BE BE 68 EB A2 CC B2 89 EC F0 45 1B EA B0 70 FD
01F0 | 58 BD C4 77 1B 72 9E A5 CA F0 70 88 33 EE E7 11
0200 | 66 69 E8 14 26 AA 2B B8 09 48 A4 87 D8 12 61 6C
0210 | 3E 76 A5 7D A7 7D 55 02 27 C5 36 47 CB D6 61 55
0220 | 02 08 C6 DB DE 64 91 F5 EB 08 86 8D 10 2C 47 77
0230 | B8 CF AA 65</code></pre>
0130 | 98 28 B2 E4 CA EC 18 8B B9 42 16 F5 E2 DB 63 2A
0140 | 17 63 0A 21 FD 00 C6 74 65 E7 41 D2 61 37 C8 E2
0150 | B7 57 F3 49 D8 DD 1B 62 B6 01 64 2A CB 9E 3B 39
0160 | 0A BF 15 3D 3A 11 61 5A 12 8E D1 D7 93 79 D7 63
0170 | C1 4D 2D F5 CE F9 9C 96 94 5C 51 29 0C 1F D8 2C
0180 | 4B 48 20 78 86 3B 2B C7 02 2C 78 86 C2 1C 0F 1D
0190 | 24 81 4C 76 83 21 C0 59 34 30 3E 50 AE 22 CB C8
01A0 | 3F 2A 39 94 BB C3 C7 2E 77 BF 10 CD B6 95 CB D8
01B0 | 66 55 D1 BC 0A 08 35 51 E5 9D 0F BF CF A1 38 25
01C0 | A1 82 10 5A 78 DA 35 AF 5A 15 C0 64 27 5B 6E 67
01D0 | 29 04 9C 84 20 9B 89 86 75 C9 11 0A DC D1 CB B2
01E0 | AA B3 33 C0 5D 3E 9F 70 D0 5F EE 7C 54 EF CE 92
01F0 | 7E 1B 40 A7 19 D0 4D 15 C7 E9 50 EB 88 5E 60 AA
0200 | AE 99 02 31 71 9D BD DD 84 C6 5B 2F 3A 60 6F E1
0210 | F7 8D EA 7C 8F AD 25 C1 CD 78 76 EB 6F 5A 46 27
0220 | 0B 82 D5 49 E3 1E DD 3C 2D C2 F8 29 70 A4 99 9C
0230 | FD C0 AB 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 = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010007E2EFE593490D143C448A84</code> <code>ADBE8EE03213DED2028797D981B414FC</code> <code>B0BF7A6D2876E72810AA63D901915C2C</code> <code>CD4DCE9008983489FDDBDF0E915FEABF</code> <code>E9849A23C5BEC177A7020383E6A5D1E0</code> <code>FC7F5F7FE0AAC96950913B699E75C86A</code> <code>0673E9A78B0A66AC2A8D6CECE2CB1A40</code> <code>F7EC7413BE7A06EB39F61AC82DD44D6F</code> <code>67BB8F0CE267CD05B300DEFCDAC8F6B6</code> <code>5F7A0915E4CCB0F61403E7A6F477A37D</code> <code>C94E71DEF10853B001744477F645114C</code> <code>51EDD0B2BEBE68EBA2CCB289ECF0451B</code> <code>EAB070FD58BDC4771B729EA5CAF07088</code> <code>33EEE7116669E81426AA2BB80948A487</code> <code>D812616C3E76A57DA77D550227C53647</code> <code>CBD661550208C6DBDE6491F5EB08868D</code><br> <code>102C4777</code></td>
<td><code>FE0001009828B2E4CAEC188BB94216F5</code> <code>E2DB632A17630A21FD00C67465E741D2</code> <code>6137C8E2B757F349D8DD1B62B601642A</code> <code>CB9E3B390ABF153D3A11615A128ED1D7</code> <code>9379D763C14D2DF5CEF99C96945C5129</code> <code>0C1FD82C4B482078863B2BC7022C7886</code> <code>C21C0F1D24814C768321C05934303E50</code> <code>AE22CBC83F2A3994BBC3C72E77BF10CD</code> <code>B695CBD86655D1BC0A083551E59D0FBF</code> <code>CFA13825A182105A78DA35AF5A15C064</code> <code>275B6E6729049C84209B898675C9110A</code> <code>DCD1CBB2AAB333C05D3E9F70D05FEE7C</code> <code>54EFCE927E1B40A719D04D15C7E950EB</code> <code>885E60AAAE990231719DBDDD84C65B2F</code> <code>3A606FE1F78DEA7C8FAD25C1CD7876EB</code> <code>6F5A46270B82D549E31EDD3C2DC2F829</code><br> <code>70A4999C</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>B8CFAA65</code> (1705693112 in decimal)</td>
<td><code>FDC0AB65</code> (1705754877 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
<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 = 1DB297C7D42FC0B00BF819E28AC95B45D90EFDC1CC43252DECC328A1FBFBC443AD91C9A971F3AD0E5854BF82B92FB4C6D9EAB844FA3CAEC4E67C2BC02342742FDA0F34A4847466E71097C51724DFCDCD200EF88E00B4C95B4158C19DC4ECC20BFA97AB6824486E1630F4A1C6C373BF8644972B545D9A7755B8AD5476488382049E52AA8D0F58AB883C745BDE9E66FFCEADC706D3D703CEBB041B279AF8300BC24A7D768447AECAA2C75E9CF88EE8337BF93FFF1D70ADBC801ECDB08B5E91B0534568050A012A2261F5C1A591887EC9CF92422BAD4BAE820F3BA17DE5F8DD9C860BAD56991AD54607DEC230437B52065E3A18715DA2220A90267FD411620DEAB5</code></pre>
<pre><code>b = A521C97B9D210812C56055C62FE8C3CE7FC97A75E51D4428F78F7D5F7325FCE03FF70D99039502FB75059DC40E36CF4F4D7A073937CC6DBC86AB864E7B3F26EFE833F766856033931BC41F031507DD571FCFEBB28F1B3DF1577A90C25B95C56894AAB64C681961AC68AFA9AADF03752D0E26EADD645A02D7895B64846EB83B3DDD458D856870CD8C0765B985C1ED50D5D802DDE67B159C899898A9B738D17802F3D50B83A868738D8502BBE33B8D7FBC3348E3E444352816FD84D300A2A8E2117CAC0EAEC654235183187D85548791BF25ABFD1AC97EAB7FA685F67A57E7BBE47B96A99B8F34B8EB523C18AEE074EABACB6FA9A28A41F4F961F41D86B19F4EC1</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 = 2FFC9B491D3822AB6109DF538CA64EDEF92EF14E2EE263AF694ABE51423D16BDD03B97D44E2FD1BD3CE329BA926410E2F52275D69D3CEA079F14D0EFFD4A000539D7141A55C212DACCD657C610326788AD857DA87F0C5AE01CA55C11B3A04A13AD0BBEFC4021237AA7E7D299DFE12F0F59EE983926A95D818F2B4F064A1EAA7EE14E12B38B18774EC61B01B564CF66729A7D0501C4DD19486F17CA77E1F1955C9BD66C13A7193FF65CA9FF3FBC7A8FC3973AFAC2F2895C61EF58E41F2FB90E6DD82093D1C2FA503DAF9E442FC50E10B0FED58AC98A367DBA336AD3F27EC918E04C89AF2D435241EE9128B1D95A2B04BB9C377C6F3E186CBA510032052B2A59DA</code></pre>
<pre><code>g_b = A0BB357C5A5FBC4EC9D8B2171C030CB68A693A8024CD9E3630BAE4CE000A14A5DBF8A40DFB322678A797ED3D591032D0A1C529BE4E76B7EBD5436E7BF7539A9AB5A5FE9DD62F37CAE704EFE0C10DD608E5D9554F7B2F7198E99CE29A9A86CCE0FBB1491EBA269DEB6AA20C5CB2134E75E5C70A7C0E7D47EE16F87189D135EDAE37EAD992063C11AEA4AC660CF3EBE61B6C21ADAAC2A9317120A6F4D1DA65978FA74BF94CC65A0CA2479D064906E78575049E7654D346CA576C6778F478CDB48FCA2FD9202E6E5F95FEF623A206207AFB41619C419357B49F4F8825B37EF7E74811FBA22BDF45730F423793C5049514363232F3358BC5F60A416BDCE7D7BBFB49</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 2F EA 31 5F B6 88 08 65 FE 75 8C DD
0010 | 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C 54 A6 BD A5
0020 | 58 A8 5A EE 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 2F FC 9B 49 1D 38 22 AB 61 09 DF 53 8C A6 4E DE
0040 | F9 2E F1 4E 2E E2 63 AF 69 4A BE 51 42 3D 16 BD
0050 | D0 3B 97 D4 4E 2F D1 BD 3C E3 29 BA 92 64 10 E2
0060 | F5 22 75 D6 9D 3C EA 07 9F 14 D0 EF FD 4A 00 05
0070 | 39 D7 14 1A 55 C2 12 DA CC D6 57 C6 10 32 67 88
0080 | AD 85 7D A8 7F 0C 5A E0 1C A5 5C 11 B3 A0 4A 13
0090 | AD 0B BE FC 40 21 23 7A A7 E7 D2 99 DF E1 2F 0F
00A0 | 59 EE 98 39 26 A9 5D 81 8F 2B 4F 06 4A 1E AA 7E
00B0 | E1 4E 12 B3 8B 18 77 4E C6 1B 01 B5 64 CF 66 72
00C0 | 9A 7D 05 01 C4 DD 19 48 6F 17 CA 77 E1 F1 95 5C
00D0 | 9B D6 6C 13 A7 19 3F F6 5C A9 FF 3F BC 7A 8F C3
00E0 | 97 3A FA C2 F2 89 5C 61 EF 58 E4 1F 2F B9 0E 6D
00F0 | D8 20 93 D1 C2 FA 50 3D AF 9E 44 2F C5 0E 10 B0
0100 | FE D5 8A C9 8A 36 7D BA 33 6A D3 F2 7E C9 18 E0
0110 | 4C 89 AF 2D 43 52 41 EE 91 28 B1 D9 5A 2B 04 BB
0120 | 9C 37 7C 6F 3E 18 6C BA 51 00 32 05 2B 2A 59 DA</code></pre>
<pre><code>0000 | 54 B6 43 66 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4
0010 | 4B 78 FE 68 D6 70 1F CD 21 2C EB 87 C9 66 E5 31
0020 | 8F 55 64 A8 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A0 BB 35 7C 5A 5F BC 4E C9 D8 B2 17 1C 03 0C B6
0040 | 8A 69 3A 80 24 CD 9E 36 30 BA E4 CE 00 0A 14 A5
0050 | DB F8 A4 0D FB 32 26 78 A7 97 ED 3D 59 10 32 D0
0060 | A1 C5 29 BE 4E 76 B7 EB D5 43 6E 7B F7 53 9A 9A
0070 | B5 A5 FE 9D D6 2F 37 CA E7 04 EF E0 C1 0D D6 08
0080 | E5 D9 55 4F 7B 2F 71 98 E9 9C E2 9A 9A 86 CC E0
0090 | FB B1 49 1E BA 26 9D EB 6A A2 0C 5C B2 13 4E 75
00A0 | E5 C7 0A 7C 0E 7D 47 EE 16 F8 71 89 D1 35 ED AE
00B0 | 37 EA D9 92 06 3C 11 AE A4 AC 66 0C F3 EB E6 1B
00C0 | 6C 21 AD AA C2 A9 31 71 20 A6 F4 D1 DA 65 97 8F
00D0 | A7 4B F9 4C C6 5A 0C A2 47 9D 06 49 06 E7 85 75
00E0 | 04 9E 76 54 D3 46 CA 57 6C 67 78 F4 78 CD B4 8F
00F0 | CA 2F D9 20 2E 6E 5F 95 FE F6 23 A2 06 20 7A FB
0100 | 41 61 9C 41 93 57 B4 9F 4F 88 25 B3 7E F7 E7 48
0110 | 11 FB A2 2B DF 45 73 0F 42 37 93 C5 04 95 14 36
0120 | 32 32 F3 35 8B C5 F6 0A 41 6B DC E7 D7 BB FB 49</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 = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001002FFC9B491D3822AB6109DF53</code> <code>8CA64EDEF92EF14E2EE263AF694ABE51</code> <code>423D16BDD03B97D44E2FD1BD3CE329BA</code> <code>926410E2F52275D69D3CEA079F14D0EF</code> <code>FD4A000539D7141A55C212DACCD657C6</code> <code>10326788AD857DA87F0C5AE01CA55C11</code> <code>B3A04A13AD0BBEFC4021237AA7E7D299</code> <code>DFE12F0F59EE983926A95D818F2B4F06</code> <code>4A1EAA7EE14E12B38B18774EC61B01B5</code> <code>64CF66729A7D0501C4DD19486F17CA77</code> <code>E1F1955C9BD66C13A7193FF65CA9FF3F</code> <code>BC7A8FC3973AFAC2F2895C61EF58E41F</code> <code>2FB90E6DD82093D1C2FA503DAF9E442F</code> <code>C50E10B0FED58AC98A367DBA336AD3F2</code> <code>7EC918E04C89AF2D435241EE9128B1D9</code> <code>5A2B04BB9C377C6F3E186CBA51003205</code><br> <code>2B2A59DA</code></td>
<td><code>FE000100A0BB357C5A5FBC4EC9D8B217</code> <code>1C030CB68A693A8024CD9E3630BAE4CE</code> <code>000A14A5DBF8A40DFB322678A797ED3D</code> <code>591032D0A1C529BE4E76B7EBD5436E7B</code> <code>F7539A9AB5A5FE9DD62F37CAE704EFE0</code> <code>C10DD608E5D9554F7B2F7198E99CE29A</code> <code>9A86CCE0FBB1491EBA269DEB6AA20C5C</code> <code>B2134E75E5C70A7C0E7D47EE16F87189</code> <code>D135EDAE37EAD992063C11AEA4AC660C</code> <code>F3EBE61B6C21ADAAC2A9317120A6F4D1</code> <code>DA65978FA74BF94CC65A0CA2479D0649</code> <code>06E78575049E7654D346CA576C6778F4</code> <code>78CDB48FCA2FD9202E6E5F95FEF623A2</code> <code>06207AFB41619C419357B49F4F8825B3</code> <code>7EF7E74811FBA22BDF45730F423793C5</code> <code>049514363232F3358BC5F60A416BDCE7</code><br> <code>D7BBFB49</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 = BA0D89B52FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AE
<!-- 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 = 54B643662FEA315FB6880865FE758CDD2F8B68E530FE3BED2423E36C54A6BDA558A85AEE0000000000000000FE0001002FFC9B491D3822AB6109DF538CA64EDEF92EF14E2EE263AF694ABE51423D16BDD03B97D44E2FD1BD3CE329BA926410E2F52275D69D3CEA079F14D0EFFD4A000539D7141A55C212DACCD657C610326788AD857DA87F0C5AE01CA55C11B3A04A13AD0BBEFC4021237AA7E7D299DFE12F0F59EE983926A95D818F2B4F064A1EAA7EE14E12B38B18774EC61B01B564CF66729A7D0501C4DD19486F17CA77E1F1955C9BD66C13A7193FF65CA9FF3FBC7A8FC3973AFAC2F2895C61EF58E41F2FB90E6DD82093D1C2FA503DAF9E442FC50E10B0FED58AC98A367DBA336AD3F27EC918E04C89AF2D435241EE9128B1D95A2B04BB9C377C6F3E186CBA510032052B2A59DA
padding = FC54F9ABBA2E69E3FD6051F5
tmp_aes_key = 781F6119988127EE7CC210BB5F2FAE436DE67BF169A04F7D510C2027B3783060
tmp_aes_iv = 4B618D0127BE3DCE9CFA8D61132CC31EB9738E3749E3D22DFA0E1B6F81405A48</code></pre>
<pre><code>data = 54B6436615A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A80000000000000000FE000100A0BB357C5A5FBC4EC9D8B2171C030CB68A693A8024CD9E3630BAE4CE000A14A5DBF8A40DFB322678A797ED3D591032D0A1C529BE4E76B7EBD5436E7BF7539A9AB5A5FE9DD62F37CAE704EFE0C10DD608E5D9554F7B2F7198E99CE29A9A86CCE0FBB1491EBA269DEB6AA20C5CB2134E75E5C70A7C0E7D47EE16F87189D135EDAE37EAD992063C11AEA4AC660CF3EBE61B6C21ADAAC2A9317120A6F4D1DA65978FA74BF94CC65A0CA2479D064906E78575049E7654D346CA576C6778F478CDB48FCA2FD9202E6E5F95FEF623A206207AFB41619C419357B49F4F8825B37EF7E74811FBA22BDF45730F423793C5049514363232F3358BC5F60A416BDCE7D7BBFB49
padding = C320374A97C7BB863CFF9F97
tmp_aes_key = D32E4A7F18252AE2B0406B84633E1117833ED75BDA40011D1E1700E3E08A8AE7
tmp_aes_iv = 4FFC40D969D49934ED3740FF66D9179947A5E1D85C4C7F15555920C1845FAD32</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 = 28EB8E2BDC6C108DA309C2231B08EDABD635AC2C743171A92159B460D1CC996373BFD1C07197568395100DD6E94C82C92CE2747D385917659F315AECB44137C513276BA98E615B3669B988918ACABD220107F3FA43EA41276C17A09367F2E0B960D49A73823FA39D9098B9ADE00AEDED8A9C2E5425AA42F095C8B4FA9835589083CC9355BB9D611218E02037F61EE11A3A8E5D2B677A606CB7FF5F268CD93E69E17BB258B55505FAAC8770AEA386A1585F3F6C56295C6B2776F585BDC80D44376BACDA4FB39B9759016E482F06B3AE92F8ED19C3754D432DB92CAF3CFBD2A9ABEE99CB613604B9CF6DE5B49095D2AE68EC6CB60BEDD35F569793F94974B9B58AFCAAA410C6709EF9F885FD0DBB4601D15BCB473E013D601AA3D6618F1723D4FC9FF73FFAD014C38D2956D147A0F94C180E786157EF99ACFD90212F834ADB2BF84618CFDA20B2B068DA97351588542317</code></pre>
<pre><code>encrypted_data = 79CA5B557095AD847C53D6308A38B62FC9A6F2356C07F298D21C9B0DB4002D90C4C0FB9C72626F9F146B4E3A81F59ED5CC6A0B4F59BC7411CDCA6BDA8C27B6C3B6DB548F076BB6CCB6791DB116E6368C7328BA21212121446CE754EC118CF380ED0CB0D798418CE54D7F68FCAE7AF146F4F8DF31F98794FF6EE06C35DE10A86518434A9F83CDC05FD5B151A50F63AD87D8529D7AA032498AF9C17C6F02E7EE1E8733F5752186880FA475F2977C7F00E1D8384E20613971F98EFD81A3C6BFB3B8F97969FB39D172527961341BBFDC9D2895306365A52F2CB9087C122E53990800BD596E05AA25A5642996AFB43061178A580F21E3C47080418B4CF0B6B10FC0C78595D486B3A3DD401D1BF37257C2584BFD5D71A708B138A6E22F853E522696AA6D1A8532461ABAEA7935A975E3C978A7A00C792CB3ADF688D0B1480C6C016B04CD1BC36546CD9ACABAA0C84DB571749B</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 70 19 0B 00 B8 CF AA 65
0010 | 78 01 00 00 1F 5F 04 F5 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C
0030 | 54 A6 BD A5 58 A8 5A EE FE 50 01 00 28 EB 8E 2B
0040 | DC 6C 10 8D A3 09 C2 23 1B 08 ED AB D6 35 AC 2C
0050 | 74 31 71 A9 21 59 B4 60 D1 CC 99 63 73 BF D1 C0
0060 | 71 97 56 83 95 10 0D D6 E9 4C 82 C9 2C E2 74 7D
0070 | 38 59 17 65 9F 31 5A EC B4 41 37 C5 13 27 6B A9
0080 | 8E 61 5B 36 69 B9 88 91 8A CA BD 22 01 07 F3 FA
0090 | 43 EA 41 27 6C 17 A0 93 67 F2 E0 B9 60 D4 9A 73
00A0 | 82 3F A3 9D 90 98 B9 AD E0 0A ED ED 8A 9C 2E 54
00B0 | 25 AA 42 F0 95 C8 B4 FA 98 35 58 90 83 CC 93 55
00C0 | BB 9D 61 12 18 E0 20 37 F6 1E E1 1A 3A 8E 5D 2B
00D0 | 67 7A 60 6C B7 FF 5F 26 8C D9 3E 69 E1 7B B2 58
00E0 | B5 55 05 FA AC 87 70 AE A3 86 A1 58 5F 3F 6C 56
00F0 | 29 5C 6B 27 76 F5 85 BD C8 0D 44 37 6B AC DA 4F
0100 | B3 9B 97 59 01 6E 48 2F 06 B3 AE 92 F8 ED 19 C3
0110 | 75 4D 43 2D B9 2C AF 3C FB D2 A9 AB EE 99 CB 61
0120 | 36 04 B9 CF 6D E5 B4 90 95 D2 AE 68 EC 6C B6 0B
0130 | ED D3 5F 56 97 93 F9 49 74 B9 B5 8A FC AA A4 10
0140 | C6 70 9E F9 F8 85 FD 0D BB 46 01 D1 5B CB 47 3E
0150 | 01 3D 60 1A A3 D6 61 8F 17 23 D4 FC 9F F7 3F FA
0160 | D0 14 C3 8D 29 56 D1 47 A0 F9 4C 18 0E 78 61 57
0170 | EF 99 AC FD 90 21 2F 83 4A DB 2B F8 46 18 CF DA
0180 | 20 B2 B0 68 DA 97 35 15 88 54 23 17</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 48 CD 0E 00 FD C0 AB 65
0010 | 78 01 00 00 1F 5F 04 F5 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
0030 | C9 66 E5 31 8F 55 64 A8 FE 50 01 00 79 CA 5B 55
0040 | 70 95 AD 84 7C 53 D6 30 8A 38 B6 2F C9 A6 F2 35
0050 | 6C 07 F2 98 D2 1C 9B 0D B4 00 2D 90 C4 C0 FB 9C
0060 | 72 62 6F 9F 14 6B 4E 3A 81 F5 9E D5 CC 6A 0B 4F
0070 | 59 BC 74 11 CD CA 6B DA 8C 27 B6 C3 B6 DB 54 8F
0080 | 07 6B B6 CC B6 79 1D B1 16 E6 36 8C 73 28 BA 21
0090 | 21 21 21 44 6C E7 54 EC 11 8C F3 80 ED 0C B0 D7
00A0 | 98 41 8C E5 4D 7F 68 FC AE 7A F1 46 F4 F8 DF 31
00B0 | F9 87 94 FF 6E E0 6C 35 DE 10 A8 65 18 43 4A 9F
00C0 | 83 CD C0 5F D5 B1 51 A5 0F 63 AD 87 D8 52 9D 7A
00D0 | A0 32 49 8A F9 C1 7C 6F 02 E7 EE 1E 87 33 F5 75
00E0 | 21 86 88 0F A4 75 F2 97 7C 7F 00 E1 D8 38 4E 20
00F0 | 61 39 71 F9 8E FD 81 A3 C6 BF B3 B8 F9 79 69 FB
0100 | 39 D1 72 52 79 61 34 1B BF DC 9D 28 95 30 63 65
0110 | A5 2F 2C B9 08 7C 12 2E 53 99 08 00 BD 59 6E 05
0120 | AA 25 A5 64 29 96 AF B4 30 61 17 8A 58 0F 21 E3
0130 | C4 70 80 41 8B 4C F0 B6 B1 0F C0 C7 85 95 D4 86
0140 | B3 A3 DD 40 1D 1B F3 72 57 C2 58 4B FD 5D 71 A7
0150 | 08 B1 38 A6 E2 2F 85 3E 52 26 96 AA 6D 1A 85 32
0160 | 46 1A BA EA 79 35 A9 75 E3 C9 78 A7 A0 0C 79 2C
0170 | B3 AD F6 88 D0 B1 48 0C 6C 01 6B 04 CD 1B C3 65
0180 | 46 CD 9A CA BA A0 C8 4D B5 71 74 9B</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>70190B00B8CFAA65</code></td>
<td><code>48CD0E00FDC0AB65</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>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010028EB8E2BDC6C108DA309C223</code> <code>1B08EDABD635AC2C743171A92159B460</code> <code>D1CC996373BFD1C07197568395100DD6</code> <code>E94C82C92CE2747D385917659F315AEC</code> <code>B44137C513276BA98E615B3669B98891</code> <code>8ACABD220107F3FA43EA41276C17A093</code> <code>67F2E0B960D49A73823FA39D9098B9AD</code> <code>E00AEDED8A9C2E5425AA42F095C8B4FA</code> <code>9835589083CC9355BB9D611218E02037</code> <code>F61EE11A3A8E5D2B677A606CB7FF5F26</code> <code>8CD93E69E17BB258B55505FAAC8770AE</code> <code>A386A1585F3F6C56295C6B2776F585BD</code> <code>C80D44376BACDA4FB39B9759016E482F</code> <code>06B3AE92F8ED19C3754D432DB92CAF3C</code> <code>FBD2A9ABEE99CB613604B9CF6DE5B490</code> <code>95D2AE68EC6CB60BEDD35F569793F949</code> <code>74B9B58AFCAAA410C6709EF9F885FD0D</code> <code>BB4601D15BCB473E013D601AA3D6618F</code> <code>1723D4FC9FF73FFAD014C38D2956D147</code> <code>A0F94C180E786157EF99ACFD90212F83</code> <code>4ADB2BF84618CFDA20B2B068DA973515</code><br> <code>88542317</code></td>
<td><code>FE50010079CA5B557095AD847C53D630</code> <code>8A38B62FC9A6F2356C07F298D21C9B0D</code> <code>B4002D90C4C0FB9C72626F9F146B4E3A</code> <code>81F59ED5CC6A0B4F59BC7411CDCA6BDA</code> <code>8C27B6C3B6DB548F076BB6CCB6791DB1</code> <code>16E6368C7328BA21212121446CE754EC</code> <code>118CF380ED0CB0D798418CE54D7F68FC</code> <code>AE7AF146F4F8DF31F98794FF6EE06C35</code> <code>DE10A86518434A9F83CDC05FD5B151A5</code> <code>0F63AD87D8529D7AA032498AF9C17C6F</code> <code>02E7EE1E8733F5752186880FA475F297</code> <code>7C7F00E1D8384E20613971F98EFD81A3</code> <code>C6BFB3B8F97969FB39D172527961341B</code> <code>BFDC9D2895306365A52F2CB9087C122E</code> <code>53990800BD596E05AA25A5642996AFB4</code> <code>3061178A580F21E3C47080418B4CF0B6</code> <code>B10FC0C78595D486B3A3DD401D1BF372</code> <code>57C2584BFD5D71A708B138A6E22F853E</code> <code>522696AA6D1A8532461ABAEA7935A975</code> <code>E3C978A7A00C792CB3ADF688D0B1480C</code> <code>6C016B04CD1BC36546CD9ACABAA0C84D</code><br> <code>B571749B</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 = 1388284CBA1BF43AA8F3F61F72170EE11B7C39668B3C0FDDD36C9E4FB8037D8DF02AA1D75DB4D55DC2F35531355B9FEC73A78B82DC504BC0079A635BED2C6C3612ED738BD49C8C3264DD397F59568427304B90D9CA5DCDF45940BA8FE9677CAFD3E7D4416CBC70E63EB6F5E98D57892C7CC8EEA9C70157E50E180A6227079EBAC9D4BBE878AEA5729F9CF14786EFC9193E22AAA3AA6A1E2F771A3395664FE8AACD35ECA62344467D09FB20539FDCB42D83EC0EE31151DEDE0B547D24727CC64179359B17D2320B14150B671D9A42B94DAE8D15299CE5DD898E7744D8C26BA1ECE8FB096F0A4B1CC89F5EB682783B35B643B781E288C3CA9781D4B4DB4F5893D3</code></pre>
<pre><code>auth_key = 77379866D71627E6C3635361F9681B03C9EE8A7AAB9552EF513A13315EABC18A118ED649614AE1F01DAB8F71D83341309C5999AD4889E5D9F3E911AAAD00D9DDC24273D7B97DD92151F969242F347C8F9D5DE44E8D7E87A69C2AE1757F5ECD20AAFC586EDD34C89AC8D5B8F7C9EB33A0C7F06A69632BCEB8DE03E336E5AF0332D4B1F52BA73FBE7A3A6FE8C2268C10B9357E5474A7CCEB0E39FE3B4A92900CD09AF3C307D8FA90CB9DA2AD35643FB0335BD0B7E6D30D1038741EB632E6A97B692A1F76F418AF74337D05539B59DF1D4E16B7E0C87240595DDFD26037CDB7E70DB4B6C5CAE532F49BC6974F6F46FD3CBDCD90EBB6795FD9A43421BCDF893D5C46</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 2C A4 2D B9 CF AA 65
0010 | 34 00 00 00 34 F7 CB 3B 2F EA 31 5F B6 88 08 65
0020 | FE 75 8C DD 2F 8B 68 E5 30 FE 3B ED 24 23 E3 6C
0030 | 54 A6 BD A5 58 A8 5A EE 54 B7 DA 16 76 A5 CC 81
0040 | 75 D5 1F 22 9B 5F 7B EE</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C0 A6 F6 FD C0 AB 65
0010 | 70 00 00 00 34 F7 CB 3B 15 A0 84 B3 B9 CA 2A 17
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
0030 | C9 66 E5 31 8F 55 64 A8 67 7F 48 3B B8 9F D2 06
0040 | B2 44 A2 D1 AC 38 CB 31</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>012CA42DB9CFAA65</code></td>
<td><code>01C0A6F6FDC0AB65</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>34000000</code> (52 in decimal)</td>
<td><code>70000000</code> (112 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>2FEA315FB6880865FE758CDD2F8B68E5</code></td>
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>30FE3BED2423E36C54A6BDA558A85AEE</code></td>
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>54B7DA1676A5CC8175D51F229B5F7BEE</code></td>
<td><code>677F483BB89FD206B244A2D1AC38CB31</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>