Update content of files

This commit is contained in:
GitHub Action 2024-06-29 16:26:56 +00:00
parent f5987ec479
commit f4d1b5691f
2 changed files with 208 additions and 207 deletions

View file

@ -72,7 +72,8 @@
---functions---
<a href='/method/contacts.getLocated'>contacts.getLocated</a>#d348bc44 flags:<a href='/type/%23'>#</a> background:flags.1?<a href='/constructor/true'>true</a> geo_point:<a href='/type/InputGeoPoint'>InputGeoPoint</a> self_expires:flags.0?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>Our current location may be <a href="#fetching-nearby-users-and-geogroups">advertised to other users</a> using <a href="/method/contacts.getLocated">contacts.getLocated</a>: in this case the <code>self_expires</code> flag <strong>must always be set</strong>.</p>
<p>Our current location may be <a href="#fetching-nearby-users-and-geogroups">advertised to other users</a> using <a href="/method/contacts.getLocated">contacts.getLocated</a>: in this case the <code>self_expires</code> flag <strong>must always be set</strong>. </p>
<p>Note that if the current user is already advertising their location using the <a href="/api/business#location">Telegram Business location feature »</a> (even without a <code>geo_point</code>, just with a textual <code>address</code>), the method will return a <code>BUSINESS_ADDRESS_ACTIVE</code> error, indicating that the location may only be changed (or removed) using <a href="/method/account.updateBusinessLocation">account.updateBusinessLocation »</a>, instead of <a href="/method/contacts.getLocated">contacts.getLocated</a>. </p>
<p>This flag is used to specify the expiration TTL of the passed geolocation (i.e. the geolocation will expire after <code>self_expires</code> seconds); pass <code>0x7fffffff</code> to disable expiry, 0 to make the current geolocation private. </p>
<p>The method will also return a list of nearby users and chats, but only if the passed expiration TTL is not equal to zero.<br>
Users may still fetch nearby users and chats without making their geolocation public by simply not setting the flag, see <a href="#fetching-nearby-users-and-geogroups">here »</a> for more info. </p>

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 D0 4E 0B 00 DD 0D 80 66
0010 | 14 00 00 00 F1 8E 7E BE 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 6C A5 09 00 9F 32 80 66
0010 | 14 00 00 00 F1 8E 7E BE 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D</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>D04E0B00DD0D8066</code></td>
<td><code>6CA509009F328066</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>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</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 90 F5 2C DD 0D 80 66
0010 | 60 00 00 00 63 24 16 05 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
0030 | 1C 66 41 C4 A6 EE 58 64 08 24 D8 BA 5A 32 3A 21
0040 | A9 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 A8 08 BD 9F 32 80 66
0010 | 98 00 00 00 63 24 16 05 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D
0030 | 51 6B FA D7 C8 3F 3F 56 08 1F C7 29 04 24 F3 63
0040 | B7 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>0190F52CDD0D8066</code></td>
<td><code>01A808BD9F328066</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>60000000</code> (96 in decimal)</td>
<td><code>98000000</code> (152 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0824D8BA5A323A21A9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2655076876887400873</td>
<td><code>081FC7290424F363B7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2289844033317725111</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 = 2655076876887400873</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2655076876887400873 = 1406753197 * 1887379309</code></p>
<pre><code>p = 1406753197
q = 1887379309</code></pre>
<pre><code>pq = 2289844033317725111</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2289844033317725111 = 1338315091 * 1710990221</code></p>
<pre><code>p = 1338315091
q = 1710990221</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 24 D8 BA 5A 32 3A 21 A9 00 00 00
0010 | 04 53 D9 59 AD 00 00 00 04 70 7F 1F 6D 00 00 00
0020 | 44 36 92 6E 47 1B C5 A7 A3 BF E6 59 49 69 EF F6
0030 | 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4 A6 EE 58 64
0040 | A4 41 F5 F5 27 DC 09 CD AB 96 3D 39 0A 71 E3 2D
0050 | 75 58 A1 9D CA 71 B3 95 2F 95 96 86 71 71 9C 08
<pre><code>0000 | 95 5F F5 A9 08 1F C7 29 04 24 F3 63 B7 00 00 00
0010 | 04 4F C5 11 53 00 00 00 04 65 FB A3 8D 00 00 00
0020 | 3A B3 9B 5D F4 61 49 1E 6B 42 40 55 87 A5 96 2D
0030 | 81 4D 53 9E 05 53 F1 2D 51 6B FA D7 C8 3F 3F 56
0040 | DD A9 C1 74 6F 55 CD 90 DE D0 20 7E A2 C7 A8 FB
0050 | 93 40 52 92 AA 69 DC B9 9B E1 15 3F AB 42 40 3B
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 = 1887379309</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0824D8BA5A323A21A9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2655076876887400873</td>
<td><code>081FC7290424F363B7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2289844033317725111</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>0453D959AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1406753197</td>
<td><code>044FC51153000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1338315091</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>04707F1F6D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1887379309</td>
<td><code>0465FBA38D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1710990221</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>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>A441F5F527DC09CDAB963D390A71E32D</code> <code>7558A19DCA71B3952F95968671719C08</code></td>
<td><code>DDA9C1746F55CD90DED0207EA2C7A8FB</code> <code>93405292AA69DCB99BE1153FAB42403B</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1887379309</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 = 955FF5A90824D8BA5A323A21A90000000453D959AD00000004707F1F6D0000004436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE5864A441F5F527DC09CDAB963D390A71E32D7558A19DCA71B3952F95968671719C0802000000
random_padding_bytes = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C0F5DD6E28647B00A550DBCCBAF76CA8366D2F62ED25D0125A76D71BB10FAD5C216D3A4F4461B8E5B83F3F5E1E2D8DDAAC6E2D0EB539DAC148CDF5933E313545</code></pre>
<pre><code>data = 955FF5A9081FC7290424F363B7000000044FC511530000000465FBA38D0000003AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F56DDA9C1746F55CD90DED0207EA2C7A8FB93405292AA69DCB99BE1153FAB42403B02000000
random_padding_bytes = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3739215A4BB1870D27FFEC167D31600E5E49657723129C58053EE0E8799DED77C6C17E194837B2CB32EC4F5B7EDF37516E1DA334A9C7CA59B0DD8EA9B21D4DED</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 = 5F70F2C5C9B7024B40BFD12BBE89FF5D183DDD0159BDE2A27B9F2A0D2629B3BE655469F40E472B78EF2A1B34394D0128363A9821DE4CD27FD1527578D81EA812B413A9E2BFCA1E8E995AE49E15A706351F292318C18A78265CBDC6D95CC60A6FA8B79FB307B8463FB81A12F67AB9B88A3F95D1B567AF75E1B50F7E6CFBF9896508895FC1B52E90DC40B05FE48D7173E4F17D550C97E2522D0B7860AB46AB421AF4013FB340D5BD480EFEB4B6303ABFE030DACE39078C27C1313506F8D4AF89E9ABA779CD12D3B177A43FB49A51D0004297FEF19830B9FA251165DCCC8D6336BF9B38BD3933942568F6D8033DD97AB96CCF5DCFCC99CB46C85866F6A78FA49648</code></pre>
<pre><code>encrypted_data = A161D14BFB565E241127BEF9394602CF4FD3C8C6BCDB64E135CE3E7CACF5AA916775C267AC5FDFF6A22947F7F13DB45CC7AA15C7555C9896FF5068D1164A018DD2667DC6A4E1F85386062248067941F994573B1CB0BD076B12B62A17A7F43A705A828A47FA7BC5C4C8555B5D8983405C14213243A20F35B6F37784A559422A18D84FB7D6DE77ACFF4AA20DB35D35F6BC1ED6B76AD76033923DE13060EEBDEC95CE31B880C1EAE8B5E94331A6D2EA2F29B6DB485768B93AE85C532F1D8A5E5EAF0AB3F601BAC909FA457BEE4BC0485DC311EDF3AF490D61B76986F3F6CC28E070E44286CCE5D33270BC0C3EBFCD08CB501F52CE6C3BE0184BF0DDF397563575CF</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 D4 4E 0B 00 DD 0D 80 66
0010 | 40 01 00 00 BE E4 12 D7 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
0030 | 1C 66 41 C4 A6 EE 58 64 04 53 D9 59 AD 00 00 00
0040 | 04 70 7F 1F 6D 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 5F 70 F2 C5 C9 B7 02 4B 40 BF D1 2B
0060 | BE 89 FF 5D 18 3D DD 01 59 BD E2 A2 7B 9F 2A 0D
0070 | 26 29 B3 BE 65 54 69 F4 0E 47 2B 78 EF 2A 1B 34
0080 | 39 4D 01 28 36 3A 98 21 DE 4C D2 7F D1 52 75 78
0090 | D8 1E A8 12 B4 13 A9 E2 BF CA 1E 8E 99 5A E4 9E
00A0 | 15 A7 06 35 1F 29 23 18 C1 8A 78 26 5C BD C6 D9
00B0 | 5C C6 0A 6F A8 B7 9F B3 07 B8 46 3F B8 1A 12 F6
00C0 | 7A B9 B8 8A 3F 95 D1 B5 67 AF 75 E1 B5 0F 7E 6C
00D0 | FB F9 89 65 08 89 5F C1 B5 2E 90 DC 40 B0 5F E4
00E0 | 8D 71 73 E4 F1 7D 55 0C 97 E2 52 2D 0B 78 60 AB
00F0 | 46 AB 42 1A F4 01 3F B3 40 D5 BD 48 0E FE B4 B6
0100 | 30 3A BF E0 30 DA CE 39 07 8C 27 C1 31 35 06 F8
0110 | D4 AF 89 E9 AB A7 79 CD 12 D3 B1 77 A4 3F B4 9A
0120 | 51 D0 00 42 97 FE F1 98 30 B9 FA 25 11 65 DC CC
0130 | 8D 63 36 BF 9B 38 BD 39 33 94 25 68 F6 D8 03 3D
0140 | D9 7A B9 6C CF 5D CF CC 99 CB 46 C8 58 66 F6 A7
0150 | 8F A4 96 48</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 70 A5 09 00 9F 32 80 66
0010 | 40 01 00 00 BE E4 12 D7 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D
0030 | 51 6B FA D7 C8 3F 3F 56 04 4F C5 11 53 00 00 00
0040 | 04 65 FB A3 8D 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 A1 61 D1 4B FB 56 5E 24 11 27 BE F9
0060 | 39 46 02 CF 4F D3 C8 C6 BC DB 64 E1 35 CE 3E 7C
0070 | AC F5 AA 91 67 75 C2 67 AC 5F DF F6 A2 29 47 F7
0080 | F1 3D B4 5C C7 AA 15 C7 55 5C 98 96 FF 50 68 D1
0090 | 16 4A 01 8D D2 66 7D C6 A4 E1 F8 53 86 06 22 48
00A0 | 06 79 41 F9 94 57 3B 1C B0 BD 07 6B 12 B6 2A 17
00B0 | A7 F4 3A 70 5A 82 8A 47 FA 7B C5 C4 C8 55 5B 5D
00C0 | 89 83 40 5C 14 21 32 43 A2 0F 35 B6 F3 77 84 A5
00D0 | 59 42 2A 18 D8 4F B7 D6 DE 77 AC FF 4A A2 0D B3
00E0 | 5D 35 F6 BC 1E D6 B7 6A D7 60 33 92 3D E1 30 60
00F0 | EE BD EC 95 CE 31 B8 80 C1 EA E8 B5 E9 43 31 A6
0100 | D2 EA 2F 29 B6 DB 48 57 68 B9 3A E8 5C 53 2F 1D
0110 | 8A 5E 5E AF 0A B3 F6 01 BA C9 09 FA 45 7B EE 4B
0120 | C0 48 5D C3 11 ED F3 AF 49 0D 61 B7 69 86 F3 F6
0130 | CC 28 E0 70 E4 42 86 CC E5 D3 32 70 BC 0C 3E BF
0140 | CD 08 CB 50 1F 52 CE 6C 3B E0 18 4B F0 DD F3 97
0150 | 56 35 75 CF</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 = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>D44E0B00DD0D8066</code></td>
<td><code>70A509009F328066</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 = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>0453D959AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1406753197</td>
<td><code>044FC51153000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1338315091</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>04707F1F6D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1887379309</td>
<td><code>0465FBA38D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1710990221</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 = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001005F70F2C5C9B7024B40BFD12B</code> <code>BE89FF5D183DDD0159BDE2A27B9F2A0D</code> <code>2629B3BE655469F40E472B78EF2A1B34</code> <code>394D0128363A9821DE4CD27FD1527578</code> <code>D81EA812B413A9E2BFCA1E8E995AE49E</code> <code>15A706351F292318C18A78265CBDC6D9</code> <code>5CC60A6FA8B79FB307B8463FB81A12F6</code> <code>7AB9B88A3F95D1B567AF75E1B50F7E6C</code> <code>FBF9896508895FC1B52E90DC40B05FE4</code> <code>8D7173E4F17D550C97E2522D0B7860AB</code> <code>46AB421AF4013FB340D5BD480EFEB4B6</code> <code>303ABFE030DACE39078C27C1313506F8</code> <code>D4AF89E9ABA779CD12D3B177A43FB49A</code> <code>51D0004297FEF19830B9FA251165DCCC</code> <code>8D6336BF9B38BD3933942568F6D8033D</code> <code>D97AB96CCF5DCFCC99CB46C85866F6A7</code><br> <code>8FA49648</code></td>
<td><code>FE000100A161D14BFB565E241127BEF9</code> <code>394602CF4FD3C8C6BCDB64E135CE3E7C</code> <code>ACF5AA916775C267AC5FDFF6A22947F7</code> <code>F13DB45CC7AA15C7555C9896FF5068D1</code> <code>164A018DD2667DC6A4E1F85386062248</code> <code>067941F994573B1CB0BD076B12B62A17</code> <code>A7F43A705A828A47FA7BC5C4C8555B5D</code> <code>8983405C14213243A20F35B6F37784A5</code> <code>59422A18D84FB7D6DE77ACFF4AA20DB3</code> <code>5D35F6BC1ED6B76AD76033923DE13060</code> <code>EEBDEC95CE31B880C1EAE8B5E94331A6</code> <code>D2EA2F29B6DB485768B93AE85C532F1D</code> <code>8A5E5EAF0AB3F601BAC909FA457BEE4B</code> <code>C0485DC311EDF3AF490D61B76986F3F6</code> <code>CC28E070E44286CCE5D33270BC0C3EBF</code> <code>CD08CB501F52CE6C3BE0184BF0DDF397</code><br> <code>563575CF</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<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 A0 F6 F3 DD 0D 80 66
0010 | C0 02 00 00 5C 07 E8 D0 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
0030 | 1C 66 41 C4 A6 EE 58 64 FE 50 02 00 B8 71 13 FD
0040 | 1B 46 D7 7D FC 86 2E 2D CD 04 7D F6 C1 4D D8 85
0050 | 97 3A 80 7A 79 F2 B7 54 A0 D4 97 F3 2F 60 64 D3
0060 | 1C 20 89 DF 34 11 97 B9 6F F8 4B 27 21 71 8C 11
0070 | 30 95 ED F8 6B 96 9C B7 A5 65 22 65 01 BA 40 8E
0080 | 4B A7 FA 4D 28 10 10 F7 A5 9F 16 B1 03 DB DF 1A
0090 | 57 9E 7A E9 F8 C6 01 B2 DE D3 1E AF FB 36 5B 4C
00A0 | 50 21 0C FC 22 52 74 89 5B B9 29 CD 2C 30 7D 27
00B0 | 51 51 6A C1 1A D8 0C 8B 08 D4 7F 79 96 0C EA 18
00C0 | 40 40 0D B0 55 67 9C 0D 36 F9 C7 1E 27 1B 77 4F
00D0 | 36 91 62 E7 C7 90 74 BC 0A 68 61 87 AA 42 B9 31
00E0 | 3D 07 E1 1F 7D BA A1 A1 EB 02 97 CF 14 88 B7 BC
00F0 | 1C 1A 7A C4 B2 94 0E 47 14 CC 48 D0 23 0A 1D 69
0100 | 4A C9 0A 2A FE 23 BC 8E 70 B0 D9 F1 2E BD 0F DC
0110 | 30 70 EA D2 77 9D 7F 6F 76 E6 DB B8 AE 38 A7 FB
0120 | EC 0F A5 6D 23 F0 5D D3 B6 17 98 28 D7 03 F7 DD
0130 | CF E6 D7 FE 9D 32 1F BD 6D 98 3B FB 99 32 51 95
0140 | 47 93 D1 93 F9 92 2A 9D 1E AD 27 08 5B BC 51 54
0150 | 77 A3 6D 1B 57 D7 12 A2 7C E2 DC A0 90 C4 34 1C
0160 | 0D B2 CF 68 1F A1 D4 E0 EA 14 B7 D5 0B 72 CE B6
0170 | 3B 83 98 25 EA F2 00 F4 CB F0 9F E1 01 2C 7C 70
0180 | 5A 3C 22 E0 5E BC 36 F0 36 70 6C B9 E1 91 A1 09
0190 | 29 2B 6B 5E FB 32 FD 68 B0 AF A1 B9 48 E4 30 AA
01A0 | DD 88 A1 6C 3A 2C 7D AF 4B D9 3D 80 2C 85 86 E9
01B0 | 44 3D CA CC 41 0E 84 D1 ED E7 A7 8E 79 4B 4B FA
01C0 | A1 81 96 9E 12 BA B3 F8 CC 9F 74 82 2B 0C D6 1B
01D0 | 88 76 4E C6 07 4B 96 8E 7E E0 FF 1F 9F 89 5E 56
01E0 | 16 87 FC 9C 7C 8C 11 BE BB ED A2 8C 4E AD 50 45
01F0 | 43 EF E5 06 BB F7 89 67 97 53 18 B8 35 C9 70 8F
0200 | 53 A2 29 37 EB EC 6F 7C D8 A4 AC 70 D7 D3 80 8D
0210 | 4D BB B4 BF 46 5D 61 56 FC 4B 7D DD FD 99 16 52
0220 | 01 C4 18 5B E2 C7 D5 6D C4 E9 79 13 BC 90 31 4C
0230 | 7B 1D 85 38 3C B6 FD 70 05 D5 05 67 09 15 17 27
0240 | 09 72 4B B1 0C A7 32 16 5E C6 40 D0 C2 DB DF CD
0250 | 36 F9 76 89 83 8E CB 8E 41 31 59 41 1E B6 87 BF
0260 | B0 EA C3 58 93 D0 A8 3E 8B A1 99 49 AE 1E 3B 05
0270 | 63 00 96 6A 79 5E E6 4A F8 6F AB 68 98 BA A4 96
0280 | BD CC 38 8A 5E F5 1A 35 96 66 D6 D6</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC 0A 6D A0 32 80 66
0010 | 7C 02 00 00 5C 07 E8 D0 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D
0030 | 51 6B FA D7 C8 3F 3F 56 FE 50 02 00 3E 84 CB 50
0040 | 71 23 7A E5 E7 82 39 5C 60 CF 63 20 FB 2B 0F 90
0050 | 6A 76 A0 33 1B BC 1D 80 C6 79 82 9D CD 89 9E 30
0060 | 02 6F 58 81 CC 91 15 A9 84 87 D4 09 45 B6 73 E4
0070 | 34 CD A0 3A 5D DE CD 46 18 CA E3 22 61 8C 98 8A
0080 | 64 8B 4E 4D B3 18 6E F5 12 CE 05 42 A4 DB 8C 86
0090 | 78 BD 9B 56 C6 54 7B 57 E9 76 2F 0F C6 BE A8 F7
00A0 | 0C 9F 40 4F E4 DB AA C4 A0 1D B7 06 09 67 6B 5F
00B0 | 14 7E 7B A6 43 DA 81 24 C7 61 02 43 31 11 90 08
00C0 | 9F E2 85 62 60 2F 4A 84 3A 44 D3 5B 6A 11 3D AB
00D0 | E1 6F BE 16 24 14 1A D8 FF 9A F9 0C 01 66 29 18
00E0 | D1 01 57 40 48 E7 9F 0C 8A 9C 24 11 69 25 36 C7
00F0 | F4 1D 64 3B ED 1C B6 43 48 E6 9B 66 F3 27 E1 8D
0100 | E3 21 C0 35 2F 93 30 49 D7 CD A9 AC 32 5D DD 3F
0110 | 47 38 72 78 11 AA AF A6 F5 82 4C E3 B2 6A 96 DC
0120 | DE BE 97 D8 F4 01 F7 EA F4 F9 AF 87 66 79 DC 2E
0130 | 9C 9C 60 2F 91 C8 37 BB E4 28 A0 7F 53 08 D8 5A
0140 | 7A 31 97 A5 A3 6B 2F AE 8F 82 59 F3 68 D6 F2 55
0150 | 86 6A 34 1F 11 AB AA F2 5F A6 87 E5 85 8A C0 48
0160 | FC FB 94 B6 6C FE 0E 60 53 95 C2 D1 7A E8 21 60
0170 | A1 72 25 E1 F8 3D 75 E6 9D 95 5A 62 CF 14 C0 17
0180 | 42 3B 0F 81 DC F7 EC B3 56 A4 2F 04 73 0F C0 D3
0190 | B8 D7 2C A2 D9 39 CF 3A C8 9A 78 5A 09 7A 89 F7
01A0 | 36 8A 9B BA 91 C9 E7 AC 95 EF 8F A3 FC B9 95 B5
01B0 | 57 17 A8 CA B2 39 B7 8E F1 30 E6 B9 B2 D7 62 BC
01C0 | 3E 02 6C BA C1 F9 DC 44 DD D8 30 DD F9 34 38 93
01D0 | 2C B6 AE 5C 42 10 4E EA 0C 09 CA 31 6F F2 9B 08
01E0 | CD FC E5 8A D2 D5 32 AE 02 65 C8 05 38 ED DF 6C
01F0 | 48 E8 13 E3 6B 9B E0 BE E2 2C 39 CB 33 CD 46 BB
0200 | AC B8 EB 9B EA 26 57 B9 8D 9B 95 6D 19 A1 37 2C
0210 | 25 59 7C 26 A3 65 21 25 69 F8 F5 7E 73 6B A2 EF
0220 | 3D 35 F9 F4 66 E6 46 1E F8 F8 2B 83 69 8D 62 5E
0230 | 08 F3 54 8C AB 01 D9 F3 C6 EC BF ED 5E F2 D8 D0
0240 | 4F 8A DD 7F EA 8A 3A 1F 74 88 82 35 15 C5 93 C5
0250 | D6 43 A6 5C 8F 34 47 66 BF FD CB E0 B5 A4 3F C2
0260 | CA CA CB 05 86 A1 8B F7 E5 62 A0 09 BD DA 02 F7
0270 | CA 6D C7 98 D8 C5 18 78 AB 24 8E BB A4 6F 03 A8
0280 | 9D 50 E0 0A 6A 02 98 43 FD 9F B5 BC</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 = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01A0F6F3DD0D8066</code></td>
<td><code>01BC0A6DA0328066</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>7C020000</code> (636 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200B87113FD1B46D77DFC862E2D</code> <code>CD047DF6C14DD885973A807A79F2B754</code> <code>A0D497F32F6064D31C2089DF341197B9</code> <code>6FF84B2721718C113095EDF86B969CB7</code> <code>A565226501BA408E4BA7FA4D281010F7</code> <code>A59F16B103DBDF1A579E7AE9F8C601B2</code> <code>DED31EAFFB365B4C50210CFC22527489</code> <code>5BB929CD2C307D2751516AC11AD80C8B</code> <code>08D47F79960CEA1840400DB055679C0D</code> <code>36F9C71E271B774F369162E7C79074BC</code> <code>0A686187AA42B9313D07E11F7DBAA1A1</code> <code>EB0297CF1488B7BC1C1A7AC4B2940E47</code> <code>14CC48D0230A1D694AC90A2AFE23BC8E</code> <code>70B0D9F12EBD0FDC3070EAD2779D7F6F</code> <code>76E6DBB8AE38A7FBEC0FA56D23F05DD3</code> <code>B6179828D703F7DDCFE6D7FE9D321FBD</code> <code>6D983BFB993251954793D193F9922A9D</code> <code>1EAD27085BBC515477A36D1B57D712A2</code> <code>7CE2DCA090C4341C0DB2CF681FA1D4E0</code> <code>EA14B7D50B72CEB63B839825EAF200F4</code> <code>CBF09FE1012C7C705A3C22E05EBC36F0</code> <code>36706CB9E191A109292B6B5EFB32FD68</code> <code>B0AFA1B948E430AADD88A16C3A2C7DAF</code> <code>4BD93D802C8586E9443DCACC410E84D1</code> <code>EDE7A78E794B4BFAA181969E12BAB3F8</code> <code>CC9F74822B0CD61B88764EC6074B968E</code> <code>7EE0FF1F9F895E561687FC9C7C8C11BE</code> <code>BBEDA28C4EAD504543EFE506BBF78967</code> <code>975318B835C9708F53A22937EBEC6F7C</code> <code>D8A4AC70D7D3808D4DBBB4BF465D6156</code> <code>FC4B7DDDFD99165201C4185BE2C7D56D</code> <code>C4E97913BC90314C7B1D85383CB6FD70</code> <code>05D505670915172709724BB10CA73216</code> <code>5EC640D0C2DBDFCD36F97689838ECB8E</code> <code>413159411EB687BFB0EAC35893D0A83E</code> <code>8BA19949AE1E3B056300966A795EE64A</code> <code>F86FAB6898BAA496BDCC388A5EF51A35</code><br> <code>9666D6D6</code></td>
<td><code>FE5002003E84CB5071237AE5E782395C</code> <code>60CF6320FB2B0F906A76A0331BBC1D80</code> <code>C679829DCD899E30026F5881CC9115A9</code> <code>8487D40945B673E434CDA03A5DDECD46</code> <code>18CAE322618C988A648B4E4DB3186EF5</code> <code>12CE0542A4DB8C8678BD9B56C6547B57</code> <code>E9762F0FC6BEA8F70C9F404FE4DBAAC4</code> <code>A01DB70609676B5F147E7BA643DA8124</code> <code>C7610243311190089FE28562602F4A84</code> <code>3A44D35B6A113DABE16FBE1624141AD8</code> <code>FF9AF90C01662918D101574048E79F0C</code> <code>8A9C2411692536C7F41D643BED1CB643</code> <code>48E69B66F327E18DE321C0352F933049</code> <code>D7CDA9AC325DDD3F4738727811AAAFA6</code> <code>F5824CE3B26A96DCDEBE97D8F401F7EA</code> <code>F4F9AF876679DC2E9C9C602F91C837BB</code> <code>E428A07F5308D85A7A3197A5A36B2FAE</code> <code>8F8259F368D6F255866A341F11ABAAF2</code> <code>5FA687E5858AC048FCFB94B66CFE0E60</code> <code>5395C2D17AE82160A17225E1F83D75E6</code> <code>9D955A62CF14C017423B0F81DCF7ECB3</code> <code>56A42F04730FC0D3B8D72CA2D939CF3A</code> <code>C89A785A097A89F7368A9BBA91C9E7AC</code> <code>95EF8FA3FCB995B55717A8CAB239B78E</code> <code>F130E6B9B2D762BC3E026CBAC1F9DC44</code> <code>DDD830DDF93438932CB6AE5C42104EEA</code> <code>0C09CA316FF29B08CDFCE58AD2D532AE</code> <code>0265C80538EDDF6C48E813E36B9BE0BE</code> <code>E22C39CB33CD46BBACB8EB9BEA2657B9</code> <code>8D9B956D19A1372C25597C26A3652125</code> <code>69F8F57E736BA2EF3D35F9F466E6461E</code> <code>F8F82B83698D625E08F3548CAB01D9F3</code> <code>C6ECBFED5EF2D8D04F8ADD7FEA8A3A1F</code> <code>7488823515C593C5D643A65C8F344766</code> <code>BFFDCBE0B5A43FC2CACACB0586A18BF7</code> <code>E562A009BDDA02F7CA6DC798D8C51878</code> <code>AB248EBBA46F03A89D50E00A6A029843</code><br> <code>FD9FB5BC</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C
<!-- 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 = B87113FD1B46D77DFC862E2DCD047DF6C14DD885973A807A79F2B754A0D497F32F6064D31C2089DF341197B96FF84B2721718C113095EDF86B969CB7A565226501BA408E4BA7FA4D281010F7A59F16B103DBDF1A579E7AE9F8C601B2DED31EAFFB365B4C50210CFC225274895BB929CD2C307D2751516AC11AD80C8B08D47F79960CEA1840400DB055679C0D36F9C71E271B774F369162E7C79074BC0A686187AA42B9313D07E11F7DBAA1A1EB0297CF1488B7BC1C1A7AC4B2940E4714CC48D0230A1D694AC90A2AFE23BC8E70B0D9F12EBD0FDC3070EAD2779D7F6F76E6DBB8AE38A7FBEC0FA56D23F05DD3B6179828D703F7DDCFE6D7FE9D321FBD6D983BFB993251954793D193F9922A9D1EAD27085BBC515477A36D1B57D712A27CE2DCA090C4341C0DB2CF681FA1D4E0EA14B7D50B72CEB63B839825EAF200F4CBF09FE1012C7C705A3C22E05EBC36F036706CB9E191A109292B6B5EFB32FD68B0AFA1B948E430AADD88A16C3A2C7DAF4BD93D802C8586E9443DCACC410E84D1EDE7A78E794B4BFAA181969E12BAB3F8CC9F74822B0CD61B88764EC6074B968E7EE0FF1F9F895E561687FC9C7C8C11BEBBEDA28C4EAD504543EFE506BBF78967975318B835C9708F53A22937EBEC6F7CD8A4AC70D7D3808D4DBBB4BF465D6156FC4B7DDDFD99165201C4185BE2C7D56DC4E97913BC90314C7B1D85383CB6FD7005D505670915172709724BB10CA732165EC640D0C2DBDFCD36F97689838ECB8E413159411EB687BFB0EAC35893D0A83E8BA19949AE1E3B056300966A795EE64AF86FAB6898BAA496BDCC388A5EF51A359666D6D6
tmp_aes_key = 19FF563FC6595F36B2B7E11EE1C8DD0D9621705A8A9D1A94F7E92B44A80E5263
tmp_aes_iv = 3F9571D56B8A52725AA6191E34CD015E2BB36446736E5E44F1B63CF7A441F5F5</code></pre>
<pre><code>encrypted_answer = 3E84CB5071237AE5E782395C60CF6320FB2B0F906A76A0331BBC1D80C679829DCD899E30026F5881CC9115A98487D40945B673E434CDA03A5DDECD4618CAE322618C988A648B4E4DB3186EF512CE0542A4DB8C8678BD9B56C6547B57E9762F0FC6BEA8F70C9F404FE4DBAAC4A01DB70609676B5F147E7BA643DA8124C7610243311190089FE28562602F4A843A44D35B6A113DABE16FBE1624141AD8FF9AF90C01662918D101574048E79F0C8A9C2411692536C7F41D643BED1CB64348E69B66F327E18DE321C0352F933049D7CDA9AC325DDD3F4738727811AAAFA6F5824CE3B26A96DCDEBE97D8F401F7EAF4F9AF876679DC2E9C9C602F91C837BBE428A07F5308D85A7A3197A5A36B2FAE8F8259F368D6F255866A341F11ABAAF25FA687E5858AC048FCFB94B66CFE0E605395C2D17AE82160A17225E1F83D75E69D955A62CF14C017423B0F81DCF7ECB356A42F04730FC0D3B8D72CA2D939CF3AC89A785A097A89F7368A9BBA91C9E7AC95EF8FA3FCB995B55717A8CAB239B78EF130E6B9B2D762BC3E026CBAC1F9DC44DDD830DDF93438932CB6AE5C42104EEA0C09CA316FF29B08CDFCE58AD2D532AE0265C80538EDDF6C48E813E36B9BE0BEE22C39CB33CD46BBACB8EB9BEA2657B98D9B956D19A1372C25597C26A365212569F8F57E736BA2EF3D35F9F466E6461EF8F82B83698D625E08F3548CAB01D9F3C6ECBFED5EF2D8D04F8ADD7FEA8A3A1F7488823515C593C5D643A65C8F344766BFFDCBE0B5A43FC2CACACB0586A18BF7E562A009BDDA02F7CA6DC798D8C51878AB248EBBA46F03A89D50E00A6A029843FD9FB5BC
tmp_aes_key = 7FBDE9E487F9211313C2DDEF82FAF92EC7497A572C2065751336C6BCA845C2A5
tmp_aes_iv = 2B53D9C0535046BF6FA57B072BDF214E145D181FF7EA28761BD0DE0CDDA9C174</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 9A6E616DE954BF99BB4307C01B75B867353604EDBA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E504381CAB477A783C28C385DFD63D3828D98941219FC1BC08B7D6BD87417BF05355BD2BE1DAFB191D21D3C09995A769AE03A07D36D81264EB27F87CEED2B9DEF5D67D45DEE3B874C057116EC42B819F983ECD03C9EF5ABBA896605C953EC286149503C5E38229D578407CA36F80D512584EB8CE7BF5A13294C1CD6FA18C0986E01E6C5E6840A439E84DA2F0782A54DF9AA98E6F7A0F030B30EC06C5E023A45E6F636102DEC0748839DEC625A6176A7DEC93088A6A304F7C17D7D433FFBF397739ADE0FFFDE9ADE08BD70757031D0B4779C505A18D17BCB26872896D9D09D9DCE6D728CB14C5CBB7E5E78A456AE217F9FFE52AF1B0BA86B055B6FC1D530E559DD0D806614AA9DCE4E198F01
answer = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E504381CAB477A783C28C385DFD63D3828D98941219FC1BC08B7D6BD87417BF05355BD2BE1DAFB191D21D3C09995A769AE03A07D36D81264EB27F87CEED2B9DEF5D67D45DEE3B874C057116EC42B819F983ECD03C9EF5ABBA896605C953EC286149503C5E38229D578407CA36F80D512584EB8CE7BF5A13294C1CD6FA18C0986E01E6C5E6840A439E84DA2F0782A54DF9AA98E6F7A0F030B30EC06C5E023A45E6F636102DEC0748839DEC625A6176A7DEC93088A6A304F7C17D7D433FFBF397739ADE0FFFDE9ADE08BD70757031D0B4779C505A18D17BCB26872896D9D09D9DCE6D728CB14C5CBB7E5E78A456AE217F9FFE52AF1B0BA86B055B6FC1D530E559DD0D806614AA9DCE4E198F01</code></pre>
<pre><code>answer_with_hash = A615635BF510762782425B7DE9297ABE84E67FF9BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000211B007E08F8E41860CD681A021C1D4D1CB2361E756BDEE5ABA6DCBDBF3EB00B5AE87E26C0999F32E8A03E3B82008691A8DEB8F063B6673426DD0FA8FB130EAD492A5EA274033FCE934712B77B0FD31FF29AA16FC10DA95ADB889CADD7A78A7EED960815453A91204FB354316361B65B70E4CE0DD088F9F5579F7E3F66FA49B73C455FCA71267008BDBBB09E0B173B0287B287DFB54C5DA80FFA40C1902B906483C6F7568D9FB19BC7FA0AA137B37E297C1F6916B2FDA0E04E51A3B669E71A27E4FA8A4D38A89130A474113CC4789194DDBAF72899E73285B49025C80C547B17B23E93F830B32AAD8B3162AC73BF195D54E159F0FA23A39057FC38B31E45DBFA03280660F57D1B05D6BA8C5
answer = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000211B007E08F8E41860CD681A021C1D4D1CB2361E756BDEE5ABA6DCBDBF3EB00B5AE87E26C0999F32E8A03E3B82008691A8DEB8F063B6673426DD0FA8FB130EAD492A5EA274033FCE934712B77B0FD31FF29AA16FC10DA95ADB889CADD7A78A7EED960815453A91204FB354316361B65B70E4CE0DD088F9F5579F7E3F66FA49B73C455FCA71267008BDBBB09E0B173B0287B287DFB54C5DA80FFA40C1902B906483C6F7568D9FB19BC7FA0AA137B37E297C1F6916B2FDA0E04E51A3B669E71A27E4FA8A4D38A89130A474113CC4789194DDBAF72899E73285B49025C80C547B17B23E93F830B32AAD8B3162AC73BF195D54E159F0FA23A39057FC38B31E45DBFA03280660F57D1B05D6BA8C5</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 44 36 92 6E 47 1B C5 A7 A3 BF E6 59
0010 | 49 69 EF F6 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4
0020 | A6 EE 58 64 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 3A B3 9B 5D F4 61 49 1E 6B 42 40 55
0010 | 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D 51 6B FA D7
0020 | C8 3F 3F 56 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 = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
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 | 3E 50 43 81 CA B4 77 A7 83 C2 8C 38 5D FD 63 D3
0140 | 82 8D 98 94 12 19 FC 1B C0 8B 7D 6B D8 74 17 BF
0150 | 05 35 5B D2 BE 1D AF B1 91 D2 1D 3C 09 99 5A 76
0160 | 9A E0 3A 07 D3 6D 81 26 4E B2 7F 87 CE ED 2B 9D
0170 | EF 5D 67 D4 5D EE 3B 87 4C 05 71 16 EC 42 B8 19
0180 | F9 83 EC D0 3C 9E F5 AB BA 89 66 05 C9 53 EC 28
0190 | 61 49 50 3C 5E 38 22 9D 57 84 07 CA 36 F8 0D 51
01A0 | 25 84 EB 8C E7 BF 5A 13 29 4C 1C D6 FA 18 C0 98
01B0 | 6E 01 E6 C5 E6 84 0A 43 9E 84 DA 2F 07 82 A5 4D
01C0 | F9 AA 98 E6 F7 A0 F0 30 B3 0E C0 6C 5E 02 3A 45
01D0 | E6 F6 36 10 2D EC 07 48 83 9D EC 62 5A 61 76 A7
01E0 | DE C9 30 88 A6 A3 04 F7 C1 7D 7D 43 3F FB F3 97
01F0 | 73 9A DE 0F FF DE 9A DE 08 BD 70 75 70 31 D0 B4
0200 | 77 9C 50 5A 18 D1 7B CB 26 87 28 96 D9 D0 9D 9D
0210 | CE 6D 72 8C B1 4C 5C BB 7E 5E 78 A4 56 AE 21 7F
0220 | 9F FE 52 AF 1B 0B A8 6B 05 5B 6F C1 D5 30 E5 59
0230 | DD 0D 80 66</code></pre>
0130 | 02 11 B0 07 E0 8F 8E 41 86 0C D6 81 A0 21 C1 D4
0140 | D1 CB 23 61 E7 56 BD EE 5A BA 6D CB DB F3 EB 00
0150 | B5 AE 87 E2 6C 09 99 F3 2E 8A 03 E3 B8 20 08 69
0160 | 1A 8D EB 8F 06 3B 66 73 42 6D D0 FA 8F B1 30 EA
0170 | D4 92 A5 EA 27 40 33 FC E9 34 71 2B 77 B0 FD 31
0180 | FF 29 AA 16 FC 10 DA 95 AD B8 89 CA DD 7A 78 A7
0190 | EE D9 60 81 54 53 A9 12 04 FB 35 43 16 36 1B 65
01A0 | B7 0E 4C E0 DD 08 8F 9F 55 79 F7 E3 F6 6F A4 9B
01B0 | 73 C4 55 FC A7 12 67 00 8B DB BB 09 E0 B1 73 B0
01C0 | 28 7B 28 7D FB 54 C5 DA 80 FF A4 0C 19 02 B9 06
01D0 | 48 3C 6F 75 68 D9 FB 19 BC 7F A0 AA 13 7B 37 E2
01E0 | 97 C1 F6 91 6B 2F DA 0E 04 E5 1A 3B 66 9E 71 A2
01F0 | 7E 4F A8 A4 D3 8A 89 13 0A 47 41 13 CC 47 89 19
0200 | 4D DB AF 72 89 9E 73 28 5B 49 02 5C 80 C5 47 B1
0210 | 7B 23 E9 3F 83 0B 32 AA D8 B3 16 2A C7 3B F1 95
0220 | D5 4E 15 9F 0F A2 3A 39 05 7F C3 8B 31 E4 5D BF
0230 | A0 32 80 66</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 = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001003E504381CAB477A783C28C38</code> <code>5DFD63D3828D98941219FC1BC08B7D6B</code> <code>D87417BF05355BD2BE1DAFB191D21D3C</code> <code>09995A769AE03A07D36D81264EB27F87</code> <code>CEED2B9DEF5D67D45DEE3B874C057116</code> <code>EC42B819F983ECD03C9EF5ABBA896605</code> <code>C953EC286149503C5E38229D578407CA</code> <code>36F80D512584EB8CE7BF5A13294C1CD6</code> <code>FA18C0986E01E6C5E6840A439E84DA2F</code> <code>0782A54DF9AA98E6F7A0F030B30EC06C</code> <code>5E023A45E6F636102DEC0748839DEC62</code> <code>5A6176A7DEC93088A6A304F7C17D7D43</code> <code>3FFBF397739ADE0FFFDE9ADE08BD7075</code> <code>7031D0B4779C505A18D17BCB26872896</code> <code>D9D09D9DCE6D728CB14C5CBB7E5E78A4</code> <code>56AE217F9FFE52AF1B0BA86B055B6FC1</code><br> <code>D530E559</code></td>
<td><code>FE0001000211B007E08F8E41860CD681</code> <code>A021C1D4D1CB2361E756BDEE5ABA6DCB</code> <code>DBF3EB00B5AE87E26C0999F32E8A03E3</code> <code>B82008691A8DEB8F063B6673426DD0FA</code> <code>8FB130EAD492A5EA274033FCE934712B</code> <code>77B0FD31FF29AA16FC10DA95ADB889CA</code> <code>DD7A78A7EED960815453A91204FB3543</code> <code>16361B65B70E4CE0DD088F9F5579F7E3</code> <code>F66FA49B73C455FCA71267008BDBBB09</code> <code>E0B173B0287B287DFB54C5DA80FFA40C</code> <code>1902B906483C6F7568D9FB19BC7FA0AA</code> <code>137B37E297C1F6916B2FDA0E04E51A3B</code> <code>669E71A27E4FA8A4D38A89130A474113</code> <code>CC4789194DDBAF72899E73285B49025C</code> <code>80C547B17B23E93F830B32AAD8B3162A</code> <code>C73BF195D54E159F0FA23A39057FC38B</code><br> <code>31E45DBF</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>DD0D8066</code> (1719668189 in decimal)</td>
<td><code>A0328066</code> (1719677600 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
<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 = 43854873396F6CC062353301A7B99D3B88FA994B84E9D76D06501D2554D02DD7AAF11DF485B5FE2980124077850012219D8BEDD0DDAFD7935A56605B64767E62D11AB0DCBF0331434B4C322BE6766D6AAB420A8C3CFAD588CDB6F48B1DA41098A6B5FCA96A2F9FC9264D723DFE367665D7CE59873894D18B1082D29183BF11F8511D1CCD443EE58D862C272BAC4A97D80E44C2493AE9138B694E7583A5E92D1AFAA52FC94DEA8172C8EFAD1DB24BE841227A0714268B62F62EFDC3D0DB1BAE6E7A118257F19E182E38894549AC63FA88D130386C407BE2BD3358B49AA5FB4BF6A67051757CED63D9C9C642E0228ABACAC6DF2A3D1FCC39DFA34B55D3124442DC</code></pre>
<pre><code>b = ACA869DA8FD7DC5DF11AD1CD1CCB9FF6649C84249ABB4D69A333875990C90BF304BFC98D6AF799A0AE4D3CFC99B51CEF99FC3A8D28C3BC1C32F8CDF072E31D5ECD24C6C8DAD7C5EB8140A2E4215E57B78C619247D161A596D208D9EDF7DCD3FC4C4683265859C95D1685631D6610B7E397ACB8667064BFEDE7F2718DB3552AB79042585922E5A1EF9407DF2C23B780958C48A5C1D4DDCB53561B8FD9572D9E730FA47E85D7AE5D61A75A72D95430FE6CF8F31B9107BF7F57FACFA039E1AE34DF0C2AEC64432BEB01EBD463DBA5D2CD99DAF4326CBC6153EA89CF04C1F89FFE222EEB610D10D7A20360699A8338721CA591637E8F492251649C72624841F6647B</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 = 7E0A64D764CE7D6D2CD1F3533ABF0B61FB031D2EBFA5601799B80537569458B5BCD65DC2C6BCC9848FE78E1441E9D28C89D7E22B8ECF0FF6B06970E07B1FE031B8938E958E44977A725CF7137F47DDCABD0F8303DEC7973396910704BD05CB7CB34EBA8E3BC006F72680A5910E23F3D24ADEDA33FDF7D2926A402A3D97F84595873277E2C19C872385F8D064CE008D4E917BFADFD4AE79C782660A0495CDF68E962E113F9589272E5A866BBB60A0ED226F351C122BE0766A2A447274158708709A82834199E2B2BF73799B204074D399432175C2A8A65AAD479726DAC00DDF0BAA125F2CC2F614404EEA2EA4BC0F6A2636BF1E20818F80C7C714A00B9B9B3C5A</code></pre>
<pre><code>g_b = A95F052E98CE2FA2A234EF66114DD8B0DB035AFD89DFF3D4051A68DB177F88B1D746AE37F7D667E1C07B64EF9DC86B9F2B81CFAC9E0D40C51A89BD2B0A4396A516EEA4E71062A0EEE82FBAD298B6EF56044949D15EBAF337305DD6C0A747CC00E284625C7C9FD75CC98162589C716C9FFC020BDEC14C7B08805E53B873BB55352009B209FE7472FB916D78CE03ACBA2252B68EE0DCDA0FA261D0AEF57B65A7B273861EEB39BDF9B7EFA95E49425F0904A98CB37D8392B4FE3EBF7F3F95E1EA0419EA8114781AEFF970115B0914CFFE050AAEC657398091E53468CB0FB28105670ACF25D9C775C36BC0A9A849C36466C5C8C81BF20735CDFDFF1568473CFB0743</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 44 36 92 6E 47 1B C5 A7 A3 BF E6 59
0010 | 49 69 EF F6 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4
0020 | A6 EE 58 64 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 7E 0A 64 D7 64 CE 7D 6D 2C D1 F3 53 3A BF 0B 61
0040 | FB 03 1D 2E BF A5 60 17 99 B8 05 37 56 94 58 B5
0050 | BC D6 5D C2 C6 BC C9 84 8F E7 8E 14 41 E9 D2 8C
0060 | 89 D7 E2 2B 8E CF 0F F6 B0 69 70 E0 7B 1F E0 31
0070 | B8 93 8E 95 8E 44 97 7A 72 5C F7 13 7F 47 DD CA
0080 | BD 0F 83 03 DE C7 97 33 96 91 07 04 BD 05 CB 7C
0090 | B3 4E BA 8E 3B C0 06 F7 26 80 A5 91 0E 23 F3 D2
00A0 | 4A DE DA 33 FD F7 D2 92 6A 40 2A 3D 97 F8 45 95
00B0 | 87 32 77 E2 C1 9C 87 23 85 F8 D0 64 CE 00 8D 4E
00C0 | 91 7B FA DF D4 AE 79 C7 82 66 0A 04 95 CD F6 8E
00D0 | 96 2E 11 3F 95 89 27 2E 5A 86 6B BB 60 A0 ED 22
00E0 | 6F 35 1C 12 2B E0 76 6A 2A 44 72 74 15 87 08 70
00F0 | 9A 82 83 41 99 E2 B2 BF 73 79 9B 20 40 74 D3 99
0100 | 43 21 75 C2 A8 A6 5A AD 47 97 26 DA C0 0D DF 0B
0110 | AA 12 5F 2C C2 F6 14 40 4E EA 2E A4 BC 0F 6A 26
0120 | 36 BF 1E 20 81 8F 80 C7 C7 14 A0 0B 9B 9B 3C 5A</code></pre>
<pre><code>0000 | 54 B6 43 66 3A B3 9B 5D F4 61 49 1E 6B 42 40 55
0010 | 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D 51 6B FA D7
0020 | C8 3F 3F 56 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A9 5F 05 2E 98 CE 2F A2 A2 34 EF 66 11 4D D8 B0
0040 | DB 03 5A FD 89 DF F3 D4 05 1A 68 DB 17 7F 88 B1
0050 | D7 46 AE 37 F7 D6 67 E1 C0 7B 64 EF 9D C8 6B 9F
0060 | 2B 81 CF AC 9E 0D 40 C5 1A 89 BD 2B 0A 43 96 A5
0070 | 16 EE A4 E7 10 62 A0 EE E8 2F BA D2 98 B6 EF 56
0080 | 04 49 49 D1 5E BA F3 37 30 5D D6 C0 A7 47 CC 00
0090 | E2 84 62 5C 7C 9F D7 5C C9 81 62 58 9C 71 6C 9F
00A0 | FC 02 0B DE C1 4C 7B 08 80 5E 53 B8 73 BB 55 35
00B0 | 20 09 B2 09 FE 74 72 FB 91 6D 78 CE 03 AC BA 22
00C0 | 52 B6 8E E0 DC DA 0F A2 61 D0 AE F5 7B 65 A7 B2
00D0 | 73 86 1E EB 39 BD F9 B7 EF A9 5E 49 42 5F 09 04
00E0 | A9 8C B3 7D 83 92 B4 FE 3E BF 7F 3F 95 E1 EA 04
00F0 | 19 EA 81 14 78 1A EF F9 70 11 5B 09 14 CF FE 05
0100 | 0A AE C6 57 39 80 91 E5 34 68 CB 0F B2 81 05 67
0110 | 0A CF 25 D9 C7 75 C3 6B C0 A9 A8 49 C3 64 66 C5
0120 | C8 C8 1B F2 07 35 CD FD FF 15 68 47 3C FB 07 43</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 = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001007E0A64D764CE7D6D2CD1F353</code> <code>3ABF0B61FB031D2EBFA5601799B80537</code> <code>569458B5BCD65DC2C6BCC9848FE78E14</code> <code>41E9D28C89D7E22B8ECF0FF6B06970E0</code> <code>7B1FE031B8938E958E44977A725CF713</code> <code>7F47DDCABD0F8303DEC7973396910704</code> <code>BD05CB7CB34EBA8E3BC006F72680A591</code> <code>0E23F3D24ADEDA33FDF7D2926A402A3D</code> <code>97F84595873277E2C19C872385F8D064</code> <code>CE008D4E917BFADFD4AE79C782660A04</code> <code>95CDF68E962E113F9589272E5A866BBB</code> <code>60A0ED226F351C122BE0766A2A447274</code> <code>158708709A82834199E2B2BF73799B20</code> <code>4074D399432175C2A8A65AAD479726DA</code> <code>C00DDF0BAA125F2CC2F614404EEA2EA4</code> <code>BC0F6A2636BF1E20818F80C7C714A00B</code><br> <code>9B9B3C5A</code></td>
<td><code>FE000100A95F052E98CE2FA2A234EF66</code> <code>114DD8B0DB035AFD89DFF3D4051A68DB</code> <code>177F88B1D746AE37F7D667E1C07B64EF</code> <code>9DC86B9F2B81CFAC9E0D40C51A89BD2B</code> <code>0A4396A516EEA4E71062A0EEE82FBAD2</code> <code>98B6EF56044949D15EBAF337305DD6C0</code> <code>A747CC00E284625C7C9FD75CC9816258</code> <code>9C716C9FFC020BDEC14C7B08805E53B8</code> <code>73BB55352009B209FE7472FB916D78CE</code> <code>03ACBA2252B68EE0DCDA0FA261D0AEF5</code> <code>7B65A7B273861EEB39BDF9B7EFA95E49</code> <code>425F0904A98CB37D8392B4FE3EBF7F3F</code> <code>95E1EA0419EA8114781AEFF970115B09</code> <code>14CFFE050AAEC657398091E53468CB0F</code> <code>B28105670ACF25D9C775C36BC0A9A849</code> <code>C36466C5C8C81BF20735CDFDFF156847</code><br> <code>3CFB0743</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 = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586
<!-- 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 = 54B643664436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE58640000000000000000FE0001007E0A64D764CE7D6D2CD1F3533ABF0B61FB031D2EBFA5601799B80537569458B5BCD65DC2C6BCC9848FE78E1441E9D28C89D7E22B8ECF0FF6B06970E07B1FE031B8938E958E44977A725CF7137F47DDCABD0F8303DEC7973396910704BD05CB7CB34EBA8E3BC006F72680A5910E23F3D24ADEDA33FDF7D2926A402A3D97F84595873277E2C19C872385F8D064CE008D4E917BFADFD4AE79C782660A0495CDF68E962E113F9589272E5A866BBB60A0ED226F351C122BE0766A2A447274158708709A82834199E2B2BF73799B204074D399432175C2A8A65AAD479726DAC00DDF0BAA125F2CC2F614404EEA2EA4BC0F6A2636BF1E20818F80C7C714A00B9B9B3C5A
padding = 4291D92FF3F3CC64DF28BFF2
tmp_aes_key = 19FF563FC6595F36B2B7E11EE1C8DD0D9621705A8A9D1A94F7E92B44A80E5263
tmp_aes_iv = 3F9571D56B8A52725AA6191E34CD015E2BB36446736E5E44F1B63CF7A441F5F5</code></pre>
<pre><code>data = 54B643663AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F560000000000000000FE000100A95F052E98CE2FA2A234EF66114DD8B0DB035AFD89DFF3D4051A68DB177F88B1D746AE37F7D667E1C07B64EF9DC86B9F2B81CFAC9E0D40C51A89BD2B0A4396A516EEA4E71062A0EEE82FBAD298B6EF56044949D15EBAF337305DD6C0A747CC00E284625C7C9FD75CC98162589C716C9FFC020BDEC14C7B08805E53B873BB55352009B209FE7472FB916D78CE03ACBA2252B68EE0DCDA0FA261D0AEF57B65A7B273861EEB39BDF9B7EFA95E49425F0904A98CB37D8392B4FE3EBF7F3F95E1EA0419EA8114781AEFF970115B0914CFFE050AAEC657398091E53468CB0FB28105670ACF25D9C775C36BC0A9A849C36466C5C8C81BF20735CDFDFF1568473CFB0743
padding = 3553EA49424C71F74F3B31B0
tmp_aes_key = 7FBDE9E487F9211313C2DDEF82FAF92EC7497A572C2065751336C6BCA845C2A5
tmp_aes_iv = 2B53D9C0535046BF6FA57B072BDF214E145D181FF7EA28761BD0DE0CDDA9C174</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 = 18A392A24AD8E840E5CA8B0C7FA14D23339D9DC0BC73CE81CE7451203B6CE2ACD25CB746C839ABAEA5994BE8827047BD6091C98C815B570FC76DEB448143F1E4CDEFBD682EA03A3A943DF92F54C0B0C6B50E14018C4C92058A5613A74065D1DF1F87F6D7E668A94140344F848268498AC33ED2B1BE6EA2ECD77FEF169221BA144E1CC0339C3C23CC32C9A9C6B00E9F7057B652337555B6A0D7C5CE1B41D27C93AF1C23626EF7BCAD06A59A35CFA062F53CCEAF0D154A8D50E2B150DA5A8913629DFC7EB532CD20C45649A50ED5F98BBFDE18C17BF56725608A7D3887375B08FB5865778E269D6293498D5AF4986A6190357214C7302DEB86ABA0DBA2F7FE3EDBB020615F1A54D9AE6E5A0313308F74F6866CD3D77C0B90152EBFEE24CB7A402752BA169EDAC197E004C34D7084511E72248D098E7D2AD597774870496EE7A0DA89BF585877C2362ECE0CD210EDE03328</code></pre>
<pre><code>encrypted_data = 47FFE32022A06C0960E59A93DB410C55FFAB86EBF37FF444610076862176B46464BCEB481F5F4200F67C5ABE12B696747981BC836E168B49DC2292CD300AE0BF6E0615C9A59B084ABDCE50BFCED834DE731808C85512441C9294DE098E7C4225DC84F15F4C82438A117A620B7BA4582B1E04C168BD5B09AAEC2FF608779F17F80CA66BFF4A23539722A7F3F83C8E638052ADDAAE4243C165A000D15F538ED852E1B9FFA53E2AE1FE28C6C8247D1A94C2DC1771E873CEB22DE97E7B556D2A9F12D629AC3CDABA48DED712E9E92CE55D88BA73A2AD9D2F083F46519568EAEB138A53FF1B669E36D975734F473405FDB0659B4E36380629639B9795E06257ABB212FFE8DC9E76381148B288CE3C5B5A589D9B84EFAC13B8C15E80ACA1F0D3768D718044845B22A4B1AFB28EDB3C64B43DEC1DDB9888CD1EBD064EC131EB17E619FFCFE706E2445A7C89EB33AF94ADF5BF5E</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 D8 4E 0B 00 DD 0D 80 66
0010 | 78 01 00 00 1F 5F 04 F5 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
0030 | 1C 66 41 C4 A6 EE 58 64 FE 50 01 00 18 A3 92 A2
0040 | 4A D8 E8 40 E5 CA 8B 0C 7F A1 4D 23 33 9D 9D C0
0050 | BC 73 CE 81 CE 74 51 20 3B 6C E2 AC D2 5C B7 46
0060 | C8 39 AB AE A5 99 4B E8 82 70 47 BD 60 91 C9 8C
0070 | 81 5B 57 0F C7 6D EB 44 81 43 F1 E4 CD EF BD 68
0080 | 2E A0 3A 3A 94 3D F9 2F 54 C0 B0 C6 B5 0E 14 01
0090 | 8C 4C 92 05 8A 56 13 A7 40 65 D1 DF 1F 87 F6 D7
00A0 | E6 68 A9 41 40 34 4F 84 82 68 49 8A C3 3E D2 B1
00B0 | BE 6E A2 EC D7 7F EF 16 92 21 BA 14 4E 1C C0 33
00C0 | 9C 3C 23 CC 32 C9 A9 C6 B0 0E 9F 70 57 B6 52 33
00D0 | 75 55 B6 A0 D7 C5 CE 1B 41 D2 7C 93 AF 1C 23 62
00E0 | 6E F7 BC AD 06 A5 9A 35 CF A0 62 F5 3C CE AF 0D
00F0 | 15 4A 8D 50 E2 B1 50 DA 5A 89 13 62 9D FC 7E B5
0100 | 32 CD 20 C4 56 49 A5 0E D5 F9 8B BF DE 18 C1 7B
0110 | F5 67 25 60 8A 7D 38 87 37 5B 08 FB 58 65 77 8E
0120 | 26 9D 62 93 49 8D 5A F4 98 6A 61 90 35 72 14 C7
0130 | 30 2D EB 86 AB A0 DB A2 F7 FE 3E DB B0 20 61 5F
0140 | 1A 54 D9 AE 6E 5A 03 13 30 8F 74 F6 86 6C D3 D7
0150 | 7C 0B 90 15 2E BF EE 24 CB 7A 40 27 52 BA 16 9E
0160 | DA C1 97 E0 04 C3 4D 70 84 51 1E 72 24 8D 09 8E
0170 | 7D 2A D5 97 77 48 70 49 6E E7 A0 DA 89 BF 58 58
0180 | 77 C2 36 2E CE 0C D2 10 ED E0 33 28</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 EC 86 07 00 A0 32 80 66
0010 | 78 01 00 00 1F 5F 04 F5 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D
0030 | 51 6B FA D7 C8 3F 3F 56 FE 50 01 00 47 FF E3 20
0040 | 22 A0 6C 09 60 E5 9A 93 DB 41 0C 55 FF AB 86 EB
0050 | F3 7F F4 44 61 00 76 86 21 76 B4 64 64 BC EB 48
0060 | 1F 5F 42 00 F6 7C 5A BE 12 B6 96 74 79 81 BC 83
0070 | 6E 16 8B 49 DC 22 92 CD 30 0A E0 BF 6E 06 15 C9
0080 | A5 9B 08 4A BD CE 50 BF CE D8 34 DE 73 18 08 C8
0090 | 55 12 44 1C 92 94 DE 09 8E 7C 42 25 DC 84 F1 5F
00A0 | 4C 82 43 8A 11 7A 62 0B 7B A4 58 2B 1E 04 C1 68
00B0 | BD 5B 09 AA EC 2F F6 08 77 9F 17 F8 0C A6 6B FF
00C0 | 4A 23 53 97 22 A7 F3 F8 3C 8E 63 80 52 AD DA AE
00D0 | 42 43 C1 65 A0 00 D1 5F 53 8E D8 52 E1 B9 FF A5
00E0 | 3E 2A E1 FE 28 C6 C8 24 7D 1A 94 C2 DC 17 71 E8
00F0 | 73 CE B2 2D E9 7E 7B 55 6D 2A 9F 12 D6 29 AC 3C
0100 | DA BA 48 DE D7 12 E9 E9 2C E5 5D 88 BA 73 A2 AD
0110 | 9D 2F 08 3F 46 51 95 68 EA EB 13 8A 53 FF 1B 66
0120 | 9E 36 D9 75 73 4F 47 34 05 FD B0 65 9B 4E 36 38
0130 | 06 29 63 9B 97 95 E0 62 57 AB B2 12 FF E8 DC 9E
0140 | 76 38 11 48 B2 88 CE 3C 5B 5A 58 9D 9B 84 EF AC
0150 | 13 B8 C1 5E 80 AC A1 F0 D3 76 8D 71 80 44 84 5B
0160 | 22 A4 B1 AF B2 8E DB 3C 64 B4 3D EC 1D DB 98 88
0170 | CD 1E BD 06 4E C1 31 EB 17 E6 19 FF CF E7 06 E2
0180 | 44 5A 7C 89 EB 33 AF 94 AD F5 BF 5E</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>D84E0B00DD0D8066</code></td>
<td><code>EC860700A0328066</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>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010018A392A24AD8E840E5CA8B0C</code> <code>7FA14D23339D9DC0BC73CE81CE745120</code> <code>3B6CE2ACD25CB746C839ABAEA5994BE8</code> <code>827047BD6091C98C815B570FC76DEB44</code> <code>8143F1E4CDEFBD682EA03A3A943DF92F</code> <code>54C0B0C6B50E14018C4C92058A5613A7</code> <code>4065D1DF1F87F6D7E668A94140344F84</code> <code>8268498AC33ED2B1BE6EA2ECD77FEF16</code> <code>9221BA144E1CC0339C3C23CC32C9A9C6</code> <code>B00E9F7057B652337555B6A0D7C5CE1B</code> <code>41D27C93AF1C23626EF7BCAD06A59A35</code> <code>CFA062F53CCEAF0D154A8D50E2B150DA</code> <code>5A8913629DFC7EB532CD20C45649A50E</code> <code>D5F98BBFDE18C17BF56725608A7D3887</code> <code>375B08FB5865778E269D6293498D5AF4</code> <code>986A6190357214C7302DEB86ABA0DBA2</code> <code>F7FE3EDBB020615F1A54D9AE6E5A0313</code> <code>308F74F6866CD3D77C0B90152EBFEE24</code> <code>CB7A402752BA169EDAC197E004C34D70</code> <code>84511E72248D098E7D2AD59777487049</code> <code>6EE7A0DA89BF585877C2362ECE0CD210</code><br> <code>EDE03328</code></td>
<td><code>FE50010047FFE32022A06C0960E59A93</code> <code>DB410C55FFAB86EBF37FF44461007686</code> <code>2176B46464BCEB481F5F4200F67C5ABE</code> <code>12B696747981BC836E168B49DC2292CD</code> <code>300AE0BF6E0615C9A59B084ABDCE50BF</code> <code>CED834DE731808C85512441C9294DE09</code> <code>8E7C4225DC84F15F4C82438A117A620B</code> <code>7BA4582B1E04C168BD5B09AAEC2FF608</code> <code>779F17F80CA66BFF4A23539722A7F3F8</code> <code>3C8E638052ADDAAE4243C165A000D15F</code> <code>538ED852E1B9FFA53E2AE1FE28C6C824</code> <code>7D1A94C2DC1771E873CEB22DE97E7B55</code> <code>6D2A9F12D629AC3CDABA48DED712E9E9</code> <code>2CE55D88BA73A2AD9D2F083F46519568</code> <code>EAEB138A53FF1B669E36D975734F4734</code> <code>05FDB0659B4E36380629639B9795E062</code> <code>57ABB212FFE8DC9E76381148B288CE3C</code> <code>5B5A589D9B84EFAC13B8C15E80ACA1F0</code> <code>D3768D718044845B22A4B1AFB28EDB3C</code> <code>64B43DEC1DDB9888CD1EBD064EC131EB</code> <code>17E619FFCFE706E2445A7C89EB33AF94</code><br> <code>ADF5BF5E</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 = 440EEC95D09DAE497D84A0DFFD34CF45B13F241E115088D41C4C8E6E9220CCFEA9EFB666CEF83D09F12E7F9B34B2AEBABDC868910548A6C883CB505D9987170CC361327B0B1F15C1A6FD4BB2019E2694863F754A1F7F5865C8CEF54198BFCAF1D9682DBD54AA1AE070ABAABF47A421C5A435382B95B01E67D42A705936560BC13057DCBA30133243832B6799CEE274F72622DDF8904C3323F1220C427EFEFD517468E522B526FED3A03C31AA014D7423CC8D15AD567E7E37E411B5DF2ED964C8502460E6BC67D0390AA277BBE30AFB0B4047D6DD628BEC92DF037059061456F04D5AEA054F1388D8870502EAFE3D7A6A5123952125E22B6854F373AECE6B13DF</code></pre>
<pre><code>auth_key = 09025C57A9B256B8987EF4BD7E993282D907931A766D3E5ACCEF52CA389C6D62716EEEC8BC1EEF8298852E3761D1F80E898B11005EAE1F6C2BF8C3C8D094959071C592EA88100C8B4BB57D3110D37843012D56AC5419BAD62E3146973BB25A457D22D5D9BEDA129526236B02D6FD2744D2ECA7A172BC3015E93DCBDDE80386D9E0D32E70252F01E410AE0D6E1FA41F0202663B3732705FC46E05C770FDC805EB39CCAE26A72BC858985B2EFF7C829820ED79B45CB8276498D6EE1EB1D370B68E8CEE9A3CBAE7D5236F02D5317281A29160383B7A04B7F9B16FBFE1BF928B58319EB3B68381124173F11AA74FFC63A7B9FE28174AB955B182365B0D64EF0511B2</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 AC 82 9F DE 0D 80 66
0010 | 68 00 00 00 34 F7 CB 3B 44 36 92 6E 47 1B C5 A7
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
0030 | 1C 66 41 C4 A6 EE 58 64 A1 EF ED 43 84 82 9C 4F
0040 | E7 2A 10 D9 B0 FD 47 A2</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 7C 28 68 A1 32 80 66
0010 | 38 00 00 00 34 F7 CB 3B 3A B3 9B 5D F4 61 49 1E
0020 | 6B 42 40 55 87 A5 96 2D 81 4D 53 9E 05 53 F1 2D
0030 | 51 6B FA D7 C8 3F 3F 56 54 DA B3 47 E9 01 EE D1
0040 | 80 A8 B8 A8 30 25 DA 83</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>01AC829FDE0D8066</code></td>
<td><code>017C2868A1328066</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>38000000</code> (56 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>4436926E471BC5A7A3BFE6594969EFF6</code></td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>A1EFED4384829C4FE72A10D9B0FD47A2</code></td>
<td><code>54DAB347E901EED180A8B8A83025DA83</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>