Update content of files

This commit is contained in:
GitHub Action 2024-06-29 18:45:38 +00:00
parent f4d1b5691f
commit df31a10edf

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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 EC 1D 03 00 F3 53 80 66
0010 | 14 00 00 00 F1 8E 7E BE 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7</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>6CA509009F328066</code></td>
<td><code>EC1D0300F3538066</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>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</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 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
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 68 13 0F F4 53 80 66
0010 | 94 00 00 00 63 24 16 05 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D
0030 | 43 DE 4B 90 FA 2E 32 84 08 14 EF 2A 74 5F 64 09
0040 | 17 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>01A808BD9F328066</code></td>
<td><code>0168130FF4538066</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>98000000</code> (152 in decimal)</td>
<td><code>94000000</code> (148 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081FC7290424F363B7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2289844033317725111</td>
<td><code>0814EF2A745F640917000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1508471079497369879</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 = 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>
<pre><code>pq = 1508471079497369879</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1508471079497369879 = 1108947353 * 1360272943</code></p>
<pre><code>p = 1108947353
q = 1360272943</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 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
<pre><code>0000 | 95 5F F5 A9 08 14 EF 2A 74 5F 64 09 17 00 00 00
0010 | 04 42 19 31 99 00 00 00 04 51 14 1E 2F 00 00 00
0020 | 4F FD 74 02 5B 71 15 B1 79 D5 22 08 0D 95 26 F7
0030 | E4 0E E9 C2 E3 06 43 7D 43 DE 4B 90 FA 2E 32 84
0040 | BD BC 63 F1 0B 3D C4 09 83 10 E1 54 DA C9 DF 85
0050 | 02 35 69 44 47 C6 38 AD 3C ED B8 D2 18 AB B0 22
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 = 1710990221</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081FC7290424F363B7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2289844033317725111</td>
<td><code>0814EF2A745F640917000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1508471079497369879</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>044FC51153000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1338315091</td>
<td><code>0442193199000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1108947353</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>0465FBA38D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1710990221</td>
<td><code>0451141E2F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1360272943</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>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>DDA9C1746F55CD90DED0207EA2C7A8FB</code> <code>93405292AA69DCB99BE1153FAB42403B</code></td>
<td><code>BDBC63F10B3DC4098310E154DAC9DF85</code> <code>0235694447C638AD3CEDB8D218ABB022</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1710990221</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 = 955FF5A9081FC7290424F363B7000000044FC511530000000465FBA38D0000003AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F56DDA9C1746F55CD90DED0207EA2C7A8FB93405292AA69DCB99BE1153FAB42403B02000000
random_padding_bytes = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3739215A4BB1870D27FFEC167D31600E5E49657723129C58053EE0E8799DED77C6C17E194837B2CB32EC4F5B7EDF37516E1DA334A9C7CA59B0DD8EA9B21D4DED</code></pre>
<pre><code>data = 955FF5A90814EF2A745F64091700000004421931990000000451141E2F0000004FFD74025B7115B179D522080D9526F7E40EE9C2E306437D43DE4B90FA2E3284BDBC63F10B3DC4098310E154DAC9DF850235694447C638AD3CEDB8D218ABB02202000000
random_padding_bytes = 516F5D77E67E28DEFAEEDBA1B2C7650CA2CB432393C59E0506AEC3C022B4564F44051CBCEDAF8853E518A636B450714323C34E2464E7011AB94A3CC1C49F0AE2F54B56966BF521C8A3E76F3F3C878E8B55CA9FC00983D10BEB05CC1E</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 = A161D14BFB565E241127BEF9394602CF4FD3C8C6BCDB64E135CE3E7CACF5AA916775C267AC5FDFF6A22947F7F13DB45CC7AA15C7555C9896FF5068D1164A018DD2667DC6A4E1F85386062248067941F994573B1CB0BD076B12B62A17A7F43A705A828A47FA7BC5C4C8555B5D8983405C14213243A20F35B6F37784A559422A18D84FB7D6DE77ACFF4AA20DB35D35F6BC1ED6B76AD76033923DE13060EEBDEC95CE31B880C1EAE8B5E94331A6D2EA2F29B6DB485768B93AE85C532F1D8A5E5EAF0AB3F601BAC909FA457BEE4BC0485DC311EDF3AF490D61B76986F3F6CC28E070E44286CCE5D33270BC0C3EBFCD08CB501F52CE6C3BE0184BF0DDF397563575CF</code></pre>
<pre><code>encrypted_data = 3EE03E231A32A07D7BEECD03B7F7771BED69FA523363BE5E9E374608F0B42FAACBFB344A1A8760FCF4C0DA7F70540550ED7B434E5C6CA8F0D3F21E5B0126ECA7D4F2A4B4F4A6987470916534BFAF1C474020D78EAD8E3B82C4F6D0AF951F439B7D63DFB3D556347192E1D4506D546045D85E7D16316971C2422AB64E98FCA4C16994F878C2DCC8823F907FDCC4AD024E12E08B58FCFAE13E74B4D578248C179B571C5C3DDE6DDACFE4F4CF5AE02FFCA3E8216CCB2450FF2214C80A5898B80BB51AB3C54CDBF5244A8E4F4035E6B716E94BC4CF11EE82E9F491E77B5124AC651E1C58F0ACF982AC8EF5824EFE22252FA49F3750259E751DB8A5E715714722B857</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 44 AA 09 00 F4 53 80 66
0010 | 40 01 00 00 BE E4 12 D7 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D
0030 | 43 DE 4B 90 FA 2E 32 84 04 42 19 31 99 00 00 00
0040 | 04 51 14 1E 2F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 3E E0 3E 23 1A 32 A0 7D 7B EE CD 03
0060 | B7 F7 77 1B ED 69 FA 52 33 63 BE 5E 9E 37 46 08
0070 | F0 B4 2F AA CB FB 34 4A 1A 87 60 FC F4 C0 DA 7F
0080 | 70 54 05 50 ED 7B 43 4E 5C 6C A8 F0 D3 F2 1E 5B
0090 | 01 26 EC A7 D4 F2 A4 B4 F4 A6 98 74 70 91 65 34
00A0 | BF AF 1C 47 40 20 D7 8E AD 8E 3B 82 C4 F6 D0 AF
00B0 | 95 1F 43 9B 7D 63 DF B3 D5 56 34 71 92 E1 D4 50
00C0 | 6D 54 60 45 D8 5E 7D 16 31 69 71 C2 42 2A B6 4E
00D0 | 98 FC A4 C1 69 94 F8 78 C2 DC C8 82 3F 90 7F DC
00E0 | C4 AD 02 4E 12 E0 8B 58 FC FA E1 3E 74 B4 D5 78
00F0 | 24 8C 17 9B 57 1C 5C 3D DE 6D DA CF E4 F4 CF 5A
0100 | E0 2F FC A3 E8 21 6C CB 24 50 FF 22 14 C8 0A 58
0110 | 98 B8 0B B5 1A B3 C5 4C DB F5 24 4A 8E 4F 40 35
0120 | E6 B7 16 E9 4B C4 CF 11 EE 82 E9 F4 91 E7 7B 51
0130 | 24 AC 65 1E 1C 58 F0 AC F9 82 AC 8E F5 82 4E FE
0140 | 22 25 2F A4 9F 37 50 25 9E 75 1D B8 A5 E7 15 71
0150 | 47 22 B8 57</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 = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>70A509009F328066</code></td>
<td><code>44AA0900F4538066</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 = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044FC51153000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1338315091</td>
<td><code>0442193199000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1108947353</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>0465FBA38D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1710990221</td>
<td><code>0451141E2F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1360272943</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 = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<tr>
<td>encrypted_data</td>
<td>80, 260</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><code>FE0001003EE03E231A32A07D7BEECD03</code> <code>B7F7771BED69FA523363BE5E9E374608</code> <code>F0B42FAACBFB344A1A8760FCF4C0DA7F</code> <code>70540550ED7B434E5C6CA8F0D3F21E5B</code> <code>0126ECA7D4F2A4B4F4A6987470916534</code> <code>BFAF1C474020D78EAD8E3B82C4F6D0AF</code> <code>951F439B7D63DFB3D556347192E1D450</code> <code>6D546045D85E7D16316971C2422AB64E</code> <code>98FCA4C16994F878C2DCC8823F907FDC</code> <code>C4AD024E12E08B58FCFAE13E74B4D578</code> <code>248C179B571C5C3DDE6DDACFE4F4CF5A</code> <code>E02FFCA3E8216CCB2450FF2214C80A58</code> <code>98B80BB51AB3C54CDBF5244A8E4F4035</code> <code>E6B716E94BC4CF11EE82E9F491E77B51</code> <code>24AC651E1C58F0ACF982AC8EF5824EFE</code> <code>22252FA49F3750259E751DB8A5E71571</code><br> <code>4722B857</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A0 72 C6 F4 53 80 66
0010 | A8 02 00 00 5C 07 E8 D0 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D
0030 | 43 DE 4B 90 FA 2E 32 84 FE 50 02 00 79 DB 14 50
0040 | 50 CC 2B 86 8B D7 B9 93 C6 2D 97 95 90 68 0B 67
0050 | E8 D3 E4 44 5B E6 90 EB 75 DE 7B 63 1E E4 99 22
0060 | 3D 61 B2 36 CE 9D E1 7F 54 FA D9 58 B7 9E D2 B1
0070 | 95 EF F9 FE AE BB C8 29 64 C5 E9 DA 98 38 26 13
0080 | 5F 09 E4 E1 BF C6 41 0B B7 D2 E3 47 AD FE 0F F2
0090 | 7A 9B A3 99 77 F7 D3 01 8C 64 DD 8B 62 3D 44 71
00A0 | C9 59 9B 65 D2 6E BB E4 65 6A F8 31 B2 C0 34 28
00B0 | 38 5A 9A D4 6C FB 04 80 11 81 57 27 76 4C 0E FF
00C0 | 86 8E FB 6B 0E EE 13 9A E1 1E DD C7 52 72 00 F1
00D0 | E5 C4 90 2F DA C3 3C FE 69 15 C0 BE 59 F5 22 6C
00E0 | 32 E9 A2 6D E3 19 51 91 95 93 E7 21 94 BC 1C E7
00F0 | E3 38 06 5E A0 63 65 1E C3 70 47 E0 FD 60 36 52
0100 | B6 E0 FF 49 3B C0 AB C3 84 22 1E 8F 05 3B E0 36
0110 | 8A 69 1F 2E AC 9E 20 83 3A 60 A8 00 33 CE CD F0
0120 | 8A 95 71 8A 63 52 F2 9A 4C DD 89 2A 3B 19 81 BF
0130 | 1A FB E4 77 44 B5 93 F3 C4 45 AD 2B 81 48 6D 1F
0140 | 89 EA 50 79 69 40 8D CC 17 9A 1E 66 7C 0C E8 0A
0150 | 13 8F 52 F6 41 34 DF 19 C9 B0 56 7F 67 28 DA 58
0160 | 3A 9E F4 E7 5B EF 79 BC 5F 09 E3 CC 10 E8 5A A8
0170 | 2B 49 A7 F2 AD 3F 8C F4 88 44 B4 C5 84 F7 FB 05
0180 | CF 0F 74 13 38 F8 62 77 D5 8F 3B B3 5C 96 0A 0C
0190 | 8F DE 2E 96 67 88 03 BC 3E EF E1 6D 8B C9 93 E5
01A0 | 80 AC 60 3D E8 CB E1 E5 5A D8 EC A7 56 1B 61 BC
01B0 | F1 6D 6B 9A A7 0A A6 83 CA A3 D2 9D 3E 0F 76 BA
01C0 | B3 D9 A9 B0 15 F3 88 64 57 E8 C7 62 E6 26 20 81
01D0 | AD D1 3C E4 EA 8D EB 19 90 F7 84 F1 C8 09 8C C0
01E0 | E7 59 37 FC 4D 3A D0 22 ED 28 2A 0F 2F 22 C4 66
01F0 | 38 FC 20 7B 43 5B 2D 33 3D 87 9A 9A 82 03 BE EB
0200 | 99 8F 90 B2 C4 A2 04 37 53 16 31 73 BE B4 F2 4C
0210 | 37 5C A7 BF 6F C1 90 E9 FE 2D ED A0 89 06 9A 6B
0220 | 2E 02 08 66 59 06 33 70 18 59 1D C3 7C B9 A3 69
0230 | CF A0 35 E5 92 4C 3F 2E BE 5A BB 9B 87 9B 44 0E
0240 | 27 FB FF 6A 3A C6 E5 ED E4 4D B1 07 42 E3 37 1D
0250 | FC EB 77 04 4C 35 50 CF BD 15 9B 45 B6 F5 F9 4F
0260 | 94 9D 3F 20 75 1D D3 08 5F CE 20 2B EF 90 8D D5
0270 | 9A 4E 5A F7 AC D1 F1 82 88 31 53 A5 FC 87 15 C4
0280 | C9 94 C4 6B 91 F6 B7 F9 91 53 27 CF</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 = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01BC0A6DA0328066</code></td>
<td><code>01A072C6F4538066</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>7C020000</code> (636 in decimal)</td>
<td><code>A8020000</code> (680 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</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><code>FE50020079DB145050CC2B868BD7B993</code> <code>C62D979590680B67E8D3E4445BE690EB</code> <code>75DE7B631EE499223D61B236CE9DE17F</code> <code>54FAD958B79ED2B195EFF9FEAEBBC829</code> <code>64C5E9DA983826135F09E4E1BFC6410B</code> <code>B7D2E347ADFE0FF27A9BA39977F7D301</code> <code>8C64DD8B623D4471C9599B65D26EBBE4</code> <code>656AF831B2C03428385A9AD46CFB0480</code> <code>11815727764C0EFF868EFB6B0EEE139A</code> <code>E11EDDC7527200F1E5C4902FDAC33CFE</code> <code>6915C0BE59F5226C32E9A26DE3195191</code> <code>9593E72194BC1CE7E338065EA063651E</code> <code>C37047E0FD603652B6E0FF493BC0ABC3</code> <code>84221E8F053BE0368A691F2EAC9E2083</code> <code>3A60A80033CECDF08A95718A6352F29A</code> <code>4CDD892A3B1981BF1AFBE47744B593F3</code> <code>C445AD2B81486D1F89EA507969408DCC</code> <code>179A1E667C0CE80A138F52F64134DF19</code> <code>C9B0567F6728DA583A9EF4E75BEF79BC</code> <code>5F09E3CC10E85AA82B49A7F2AD3F8CF4</code> <code>8844B4C584F7FB05CF0F741338F86277</code> <code>D58F3BB35C960A0C8FDE2E96678803BC</code> <code>3EEFE16D8BC993E580AC603DE8CBE1E5</code> <code>5AD8ECA7561B61BCF16D6B9AA70AA683</code> <code>CAA3D29D3E0F76BAB3D9A9B015F38864</code> <code>57E8C762E6262081ADD13CE4EA8DEB19</code> <code>90F784F1C8098CC0E75937FC4D3AD022</code> <code>ED282A0F2F22C46638FC207B435B2D33</code> <code>3D879A9A8203BEEB998F90B2C4A20437</code> <code>53163173BEB4F24C375CA7BF6FC190E9</code> <code>FE2DEDA089069A6B2E02086659063370</code> <code>18591DC37CB9A369CFA035E5924C3F2E</code> <code>BE5ABB9B879B440E27FBFF6A3AC6E5ED</code> <code>E44DB10742E3371DFCEB77044C3550CF</code> <code>BD159B45B6F5F94F949D3F20751DD308</code> <code>5FCE202BEF908DD59A4E5AF7ACD1F182</code> <code>883153A5FC8715C4C994C46B91F6B7F9</code><br> <code>915327CF</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 90C29C905E06B0344C841A08CABCEF6936FA4251D22207BC1D06C57A3
<!-- 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 = 3E84CB5071237AE5E782395C60CF6320FB2B0F906A76A0331BBC1D80C679829DCD899E30026F5881CC9115A98487D40945B673E434CDA03A5DDECD4618CAE322618C988A648B4E4DB3186EF512CE0542A4DB8C8678BD9B56C6547B57E9762F0FC6BEA8F70C9F404FE4DBAAC4A01DB70609676B5F147E7BA643DA8124C7610243311190089FE28562602F4A843A44D35B6A113DABE16FBE1624141AD8FF9AF90C01662918D101574048E79F0C8A9C2411692536C7F41D643BED1CB64348E69B66F327E18DE321C0352F933049D7CDA9AC325DDD3F4738727811AAAFA6F5824CE3B26A96DCDEBE97D8F401F7EAF4F9AF876679DC2E9C9C602F91C837BBE428A07F5308D85A7A3197A5A36B2FAE8F8259F368D6F255866A341F11ABAAF25FA687E5858AC048FCFB94B66CFE0E605395C2D17AE82160A17225E1F83D75E69D955A62CF14C017423B0F81DCF7ECB356A42F04730FC0D3B8D72CA2D939CF3AC89A785A097A89F7368A9BBA91C9E7AC95EF8FA3FCB995B55717A8CAB239B78EF130E6B9B2D762BC3E026CBAC1F9DC44DDD830DDF93438932CB6AE5C42104EEA0C09CA316FF29B08CDFCE58AD2D532AE0265C80538EDDF6C48E813E36B9BE0BEE22C39CB33CD46BBACB8EB9BEA2657B98D9B956D19A1372C25597C26A365212569F8F57E736BA2EF3D35F9F466E6461EF8F82B83698D625E08F3548CAB01D9F3C6ECBFED5EF2D8D04F8ADD7FEA8A3A1F7488823515C593C5D643A65C8F344766BFFDCBE0B5A43FC2CACACB0586A18BF7E562A009BDDA02F7CA6DC798D8C51878AB248EBBA46F03A89D50E00A6A029843FD9FB5BC
tmp_aes_key = 7FBDE9E487F9211313C2DDEF82FAF92EC7497A572C2065751336C6BCA845C2A5
tmp_aes_iv = 2B53D9C0535046BF6FA57B072BDF214E145D181FF7EA28761BD0DE0CDDA9C174</code></pre>
<pre><code>encrypted_answer = 79DB145050CC2B868BD7B993C62D979590680B67E8D3E4445BE690EB75DE7B631EE499223D61B236CE9DE17F54FAD958B79ED2B195EFF9FEAEBBC82964C5E9DA983826135F09E4E1BFC6410BB7D2E347ADFE0FF27A9BA39977F7D3018C64DD8B623D4471C9599B65D26EBBE4656AF831B2C03428385A9AD46CFB048011815727764C0EFF868EFB6B0EEE139AE11EDDC7527200F1E5C4902FDAC33CFE6915C0BE59F5226C32E9A26DE31951919593E72194BC1CE7E338065EA063651EC37047E0FD603652B6E0FF493BC0ABC384221E8F053BE0368A691F2EAC9E20833A60A80033CECDF08A95718A6352F29A4CDD892A3B1981BF1AFBE47744B593F3C445AD2B81486D1F89EA507969408DCC179A1E667C0CE80A138F52F64134DF19C9B0567F6728DA583A9EF4E75BEF79BC5F09E3CC10E85AA82B49A7F2AD3F8CF48844B4C584F7FB05CF0F741338F86277D58F3BB35C960A0C8FDE2E96678803BC3EEFE16D8BC993E580AC603DE8CBE1E55AD8ECA7561B61BCF16D6B9AA70AA683CAA3D29D3E0F76BAB3D9A9B015F3886457E8C762E6262081ADD13CE4EA8DEB1990F784F1C8098CC0E75937FC4D3AD022ED282A0F2F22C46638FC207B435B2D333D879A9A8203BEEB998F90B2C4A2043753163173BEB4F24C375CA7BF6FC190E9FE2DEDA089069A6B2E0208665906337018591DC37CB9A369CFA035E5924C3F2EBE5ABB9B879B440E27FBFF6A3AC6E5EDE44DB10742E3371DFCEB77044C3550CFBD159B45B6F5F94F949D3F20751DD3085FCE202BEF908DD59A4E5AF7ACD1F182883153A5FC8715C4C994C46B91F6B7F9915327CF
tmp_aes_key = E4AA87BC8EF68FA820FA6A4D1D3049C5B7C23C84300AEA91965C5293D672F1F1
tmp_aes_iv = AD629073561090F2D8DCAF3053C26850DCE96FF5BE6A6AD595706A13BDBC63F1</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = A615635BF510762782425B7DE9297ABE84E67FF9BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000211B007E08F8E41860CD681A021C1D4D1CB2361E756BDEE5ABA6DCBDBF3EB00B5AE87E26C0999F32E8A03E3B82008691A8DEB8F063B6673426DD0FA8FB130EAD492A5EA274033FCE934712B77B0FD31FF29AA16FC10DA95ADB889CADD7A78A7EED960815453A91204FB354316361B65B70E4CE0DD088F9F5579F7E3F66FA49B73C455FCA71267008BDBBB09E0B173B0287B287DFB54C5DA80FFA40C1902B906483C6F7568D9FB19BC7FA0AA137B37E297C1F6916B2FDA0E04E51A3B669E71A27E4FA8A4D38A89130A474113CC4789194DDBAF72899E73285B49025C80C547B17B23E93F830B32AAD8B3162AC73BF195D54E159F0FA23A39057FC38B31E45DBFA03280660F57D1B05D6BA8C5
answer = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000211B007E08F8E41860CD681A021C1D4D1CB2361E756BDEE5ABA6DCBDBF3EB00B5AE87E26C0999F32E8A03E3B82008691A8DEB8F063B6673426DD0FA8FB130EAD492A5EA274033FCE934712B77B0FD31FF29AA16FC10DA95ADB889CADD7A78A7EED960815453A91204FB354316361B65B70E4CE0DD088F9F5579F7E3F66FA49B73C455FCA71267008BDBBB09E0B173B0287B287DFB54C5DA80FFA40C1902B906483C6F7568D9FB19BC7FA0AA137B37E297C1F6916B2FDA0E04E51A3B669E71A27E4FA8A4D38A89130A474113CC4789194DDBAF72899E73285B49025C80C547B17B23E93F830B32AAD8B3162AC73BF195D54E159F0FA23A39057FC38B31E45DBFA03280660F57D1B05D6BA8C5</code></pre>
<pre><code>answer_with_hash = A8F7DAFD8EBDAB9D8ABD17183AC62BADE297D59CBA0D89B54FFD74025B7115B179D522080D9526F7E40EE9C2E306437D43DE4B90FA2E328403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010013933F276A94930322BED5FF198EC1C882E979E8A55FA0C56B3230B881F84A8BD521DC2215414C6B8D20D2982F4424ABA11D80F0E7AEBD74732BCFA5DCB7670400B67F5F3D9E90828F1037F287D13763541A6213711759A406328179ADE70B7F2B99933CC1299531E79573D6A71A0F512EAE44B72FA64A113ECB8EDC6FFFCB7A9A1C9FA969D3395CBA7B7B0CE0C192FD962459695BDA9423BE2645E54F68E9B6DF68A36CC42E5F947FDF024FCCDCAAA8C3E489AB8EA1A78079EFD7196D8BB298BBF0268E57975C2353BBC75976F5EF2E02C8C1626D5BAEB8A489EF64B840212660F9625C560E0E06244A4D94324FBB36C8B1406F4B8B2452EC184F037CD29B9BF4538066D97245331B4806A1
answer = BA0D89B54FFD74025B7115B179D522080D9526F7E40EE9C2E306437D43DE4B90FA2E328403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010013933F276A94930322BED5FF198EC1C882E979E8A55FA0C56B3230B881F84A8BD521DC2215414C6B8D20D2982F4424ABA11D80F0E7AEBD74732BCFA5DCB7670400B67F5F3D9E90828F1037F287D13763541A6213711759A406328179ADE70B7F2B99933CC1299531E79573D6A71A0F512EAE44B72FA64A113ECB8EDC6FFFCB7A9A1C9FA969D3395CBA7B7B0CE0C192FD962459695BDA9423BE2645E54F68E9B6DF68A36CC42E5F947FDF024FCCDCAAA8C3E489AB8EA1A78079EFD7196D8BB298BBF0268E57975C2353BBC75976F5EF2E02C8C1626D5BAEB8A489EF64B840212660F9625C560E0E06244A4D94324FBB36C8B1406F4B8B2452EC184F037CD29B9BF4538066D97245331B4806A1</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 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
<pre><code>0000 | BA 0D 89 B5 4F FD 74 02 5B 71 15 B1 79 D5 22 08
0010 | 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D 43 DE 4B 90
0020 | FA 2E 32 84 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 = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
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 | 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>
0130 | 13 93 3F 27 6A 94 93 03 22 BE D5 FF 19 8E C1 C8
0140 | 82 E9 79 E8 A5 5F A0 C5 6B 32 30 B8 81 F8 4A 8B
0150 | D5 21 DC 22 15 41 4C 6B 8D 20 D2 98 2F 44 24 AB
0160 | A1 1D 80 F0 E7 AE BD 74 73 2B CF A5 DC B7 67 04
0170 | 00 B6 7F 5F 3D 9E 90 82 8F 10 37 F2 87 D1 37 63
0180 | 54 1A 62 13 71 17 59 A4 06 32 81 79 AD E7 0B 7F
0190 | 2B 99 93 3C C1 29 95 31 E7 95 73 D6 A7 1A 0F 51
01A0 | 2E AE 44 B7 2F A6 4A 11 3E CB 8E DC 6F FF CB 7A
01B0 | 9A 1C 9F A9 69 D3 39 5C BA 7B 7B 0C E0 C1 92 FD
01C0 | 96 24 59 69 5B DA 94 23 BE 26 45 E5 4F 68 E9 B6
01D0 | DF 68 A3 6C C4 2E 5F 94 7F DF 02 4F CC DC AA A8
01E0 | C3 E4 89 AB 8E A1 A7 80 79 EF D7 19 6D 8B B2 98
01F0 | BB F0 26 8E 57 97 5C 23 53 BB C7 59 76 F5 EF 2E
0200 | 02 C8 C1 62 6D 5B AE B8 A4 89 EF 64 B8 40 21 26
0210 | 60 F9 62 5C 56 0E 0E 06 24 4A 4D 94 32 4F BB 36
0220 | C8 B1 40 6F 4B 8B 24 52 EC 18 4F 03 7C D2 9B 9B
0230 | F4 53 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 = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
<tr>
<td>g_a</td>
<td>300, 260</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>FE00010013933F276A94930322BED5FF</code> <code>198EC1C882E979E8A55FA0C56B3230B8</code> <code>81F84A8BD521DC2215414C6B8D20D298</code> <code>2F4424ABA11D80F0E7AEBD74732BCFA5</code> <code>DCB7670400B67F5F3D9E90828F1037F2</code> <code>87D13763541A6213711759A406328179</code> <code>ADE70B7F2B99933CC1299531E79573D6</code> <code>A71A0F512EAE44B72FA64A113ECB8EDC</code> <code>6FFFCB7A9A1C9FA969D3395CBA7B7B0C</code> <code>E0C192FD962459695BDA9423BE2645E5</code> <code>4F68E9B6DF68A36CC42E5F947FDF024F</code> <code>CCDCAAA8C3E489AB8EA1A78079EFD719</code> <code>6D8BB298BBF0268E57975C2353BBC759</code> <code>76F5EF2E02C8C1626D5BAEB8A489EF64</code> <code>B840212660F9625C560E0E06244A4D94</code> <code>324FBB36C8B1406F4B8B2452EC184F03</code><br> <code>7CD29B9B</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>A0328066</code> (1719677600 in decimal)</td>
<td><code>F4538066</code> (1719686132 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
<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 = ACA869DA8FD7DC5DF11AD1CD1CCB9FF6649C84249ABB4D69A333875990C90BF304BFC98D6AF799A0AE4D3CFC99B51CEF99FC3A8D28C3BC1C32F8CDF072E31D5ECD24C6C8DAD7C5EB8140A2E4215E57B78C619247D161A596D208D9EDF7DCD3FC4C4683265859C95D1685631D6610B7E397ACB8667064BFEDE7F2718DB3552AB79042585922E5A1EF9407DF2C23B780958C48A5C1D4DDCB53561B8FD9572D9E730FA47E85D7AE5D61A75A72D95430FE6CF8F31B9107BF7F57FACFA039E1AE34DF0C2AEC64432BEB01EBD463DBA5D2CD99DAF4326CBC6153EA89CF04C1F89FFE222EEB610D10D7A20360699A8338721CA591637E8F492251649C72624841F6647B</code></pre>
<pre><code>b = E0B02BF67DB0DB4AD728A8A994B6F59DC982FC26ADA4F6E20F8CC88E754C862BA273913EFAA4690B77686F8A973DB2F46623D35F548CC890C8E2C2F9F889AD243F91021DF465EBA1A139AC4632126D9AE0791E3E1953A4F2E1A5D25100D9B8D4EE01894F6069022F2AF75D83EB27C8ADC248F4676AE9B7B05E29DF9C0405D062A96E765C0972B881A373794BEF2C6844058C1902E6D17924C8707FE54AAEA058D6C6A44FCE3BC05639B8059EDC4E8ACFBB86EA875C27F84AC35AB4B47C918D7C5B4AFD059FAEAA5E3315A774555D264D65F188805151C236EE1094D3117A81C54C8913E19880FF0DF3E3500FFCF166B946C7A7FAA3C95642CBFE2D29AE30C79B</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 = A95F052E98CE2FA2A234EF66114DD8B0DB035AFD89DFF3D4051A68DB177F88B1D746AE37F7D667E1C07B64EF9DC86B9F2B81CFAC9E0D40C51A89BD2B0A4396A516EEA4E71062A0EEE82FBAD298B6EF56044949D15EBAF337305DD6C0A747CC00E284625C7C9FD75CC98162589C716C9FFC020BDEC14C7B08805E53B873BB55352009B209FE7472FB916D78CE03ACBA2252B68EE0DCDA0FA261D0AEF57B65A7B273861EEB39BDF9B7EFA95E49425F0904A98CB37D8392B4FE3EBF7F3F95E1EA0419EA8114781AEFF970115B0914CFFE050AAEC657398091E53468CB0FB28105670ACF25D9C775C36BC0A9A849C36466C5C8C81BF20735CDFDFF1568473CFB0743</code></pre>
<pre><code>g_b = 75FA35FCB6728EAA9B893E70B15513D6D47DE68C321E7224D99D2D29B5FEBAC5BF9FCABDB31B2F831059085A231A5B5FF695A914C544038CC6CF45AA3CB751772A3FC236F75425CF862AB2C061DD7AD76F89BAC88D2D43D1579FF0126B397B77301078C3B4C4B9E0464E31FDF07C816174AE9EE9537E95E6B339ABF84E220A5BF243565B5AFB26F276DE604C706E2BBF4AB6D3928759E166513825CE8F896D15917F9A34582238745D1B3C80DFC9C899C171B50B56512C9A2D53DC1163F23BB3553309E0444F2E20FA0965D94A782F5CEFE849724EDD0F07B336B58FBBE224E47FBB34D03ED58E806186C283A17F28A05A3E52050975AECA0F52CECB6A3414EE</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 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>
<pre><code>0000 | 54 B6 43 66 4F FD 74 02 5B 71 15 B1 79 D5 22 08
0010 | 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D 43 DE 4B 90
0020 | FA 2E 32 84 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 75 FA 35 FC B6 72 8E AA 9B 89 3E 70 B1 55 13 D6
0040 | D4 7D E6 8C 32 1E 72 24 D9 9D 2D 29 B5 FE BA C5
0050 | BF 9F CA BD B3 1B 2F 83 10 59 08 5A 23 1A 5B 5F
0060 | F6 95 A9 14 C5 44 03 8C C6 CF 45 AA 3C B7 51 77
0070 | 2A 3F C2 36 F7 54 25 CF 86 2A B2 C0 61 DD 7A D7
0080 | 6F 89 BA C8 8D 2D 43 D1 57 9F F0 12 6B 39 7B 77
0090 | 30 10 78 C3 B4 C4 B9 E0 46 4E 31 FD F0 7C 81 61
00A0 | 74 AE 9E E9 53 7E 95 E6 B3 39 AB F8 4E 22 0A 5B
00B0 | F2 43 56 5B 5A FB 26 F2 76 DE 60 4C 70 6E 2B BF
00C0 | 4A B6 D3 92 87 59 E1 66 51 38 25 CE 8F 89 6D 15
00D0 | 91 7F 9A 34 58 22 38 74 5D 1B 3C 80 DF C9 C8 99
00E0 | C1 71 B5 0B 56 51 2C 9A 2D 53 DC 11 63 F2 3B B3
00F0 | 55 33 09 E0 44 4F 2E 20 FA 09 65 D9 4A 78 2F 5C
0100 | EF E8 49 72 4E DD 0F 07 B3 36 B5 8F BB E2 24 E4
0110 | 7F BB 34 D0 3E D5 8E 80 61 86 C2 83 A1 7F 28 A0
0120 | 5A 3E 52 05 09 75 AE CA 0F 52 CE CB 6A 34 14 EE</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 = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</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><code>FE00010075FA35FCB6728EAA9B893E70</code> <code>B15513D6D47DE68C321E7224D99D2D29</code> <code>B5FEBAC5BF9FCABDB31B2F831059085A</code> <code>231A5B5FF695A914C544038CC6CF45AA</code> <code>3CB751772A3FC236F75425CF862AB2C0</code> <code>61DD7AD76F89BAC88D2D43D1579FF012</code> <code>6B397B77301078C3B4C4B9E0464E31FD</code> <code>F07C816174AE9EE9537E95E6B339ABF8</code> <code>4E220A5BF243565B5AFB26F276DE604C</code> <code>706E2BBF4AB6D3928759E166513825CE</code> <code>8F896D15917F9A34582238745D1B3C80</code> <code>DFC9C899C171B50B56512C9A2D53DC11</code> <code>63F23BB3553309E0444F2E20FA0965D9</code> <code>4A782F5CEFE849724EDD0F07B336B58F</code> <code>BBE224E47FBB34D03ED58E806186C283</code> <code>A17F28A05A3E52050975AECA0F52CECB</code><br> <code>6A3414EE</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 = BA0D89B53AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F5
<!-- 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 = 54B643663AB39B5DF461491E6B42405587A5962D814D539E0553F12D516BFAD7C83F3F560000000000000000FE000100A95F052E98CE2FA2A234EF66114DD8B0DB035AFD89DFF3D4051A68DB177F88B1D746AE37F7D667E1C07B64EF9DC86B9F2B81CFAC9E0D40C51A89BD2B0A4396A516EEA4E71062A0EEE82FBAD298B6EF56044949D15EBAF337305DD6C0A747CC00E284625C7C9FD75CC98162589C716C9FFC020BDEC14C7B08805E53B873BB55352009B209FE7472FB916D78CE03ACBA2252B68EE0DCDA0FA261D0AEF57B65A7B273861EEB39BDF9B7EFA95E49425F0904A98CB37D8392B4FE3EBF7F3F95E1EA0419EA8114781AEFF970115B0914CFFE050AAEC657398091E53468CB0FB28105670ACF25D9C775C36BC0A9A849C36466C5C8C81BF20735CDFDFF1568473CFB0743
padding = 3553EA49424C71F74F3B31B0
tmp_aes_key = 7FBDE9E487F9211313C2DDEF82FAF92EC7497A572C2065751336C6BCA845C2A5
tmp_aes_iv = 2B53D9C0535046BF6FA57B072BDF214E145D181FF7EA28761BD0DE0CDDA9C174</code></pre>
<pre><code>data = 54B643664FFD74025B7115B179D522080D9526F7E40EE9C2E306437D43DE4B90FA2E32840000000000000000FE00010075FA35FCB6728EAA9B893E70B15513D6D47DE68C321E7224D99D2D29B5FEBAC5BF9FCABDB31B2F831059085A231A5B5FF695A914C544038CC6CF45AA3CB751772A3FC236F75425CF862AB2C061DD7AD76F89BAC88D2D43D1579FF0126B397B77301078C3B4C4B9E0464E31FDF07C816174AE9EE9537E95E6B339ABF84E220A5BF243565B5AFB26F276DE604C706E2BBF4AB6D3928759E166513825CE8F896D15917F9A34582238745D1B3C80DFC9C899C171B50B56512C9A2D53DC1163F23BB3553309E0444F2E20FA0965D94A782F5CEFE849724EDD0F07B336B58FBBE224E47FBB34D03ED58E806186C283A17F28A05A3E52050975AECA0F52CECB6A3414EE
padding = E9507C3044D329555B85F36D
tmp_aes_key = E4AA87BC8EF68FA820FA6A4D1D3049C5B7C23C84300AEA91965C5293D672F1F1
tmp_aes_iv = AD629073561090F2D8DCAF3053C26850DCE96FF5BE6A6AD595706A13BDBC63F1</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 = 47FFE32022A06C0960E59A93DB410C55FFAB86EBF37FF444610076862176B46464BCEB481F5F4200F67C5ABE12B696747981BC836E168B49DC2292CD300AE0BF6E0615C9A59B084ABDCE50BFCED834DE731808C85512441C9294DE098E7C4225DC84F15F4C82438A117A620B7BA4582B1E04C168BD5B09AAEC2FF608779F17F80CA66BFF4A23539722A7F3F83C8E638052ADDAAE4243C165A000D15F538ED852E1B9FFA53E2AE1FE28C6C8247D1A94C2DC1771E873CEB22DE97E7B556D2A9F12D629AC3CDABA48DED712E9E92CE55D88BA73A2AD9D2F083F46519568EAEB138A53FF1B669E36D975734F473405FDB0659B4E36380629639B9795E06257ABB212FFE8DC9E76381148B288CE3C5B5A589D9B84EFAC13B8C15E80ACA1F0D3768D718044845B22A4B1AFB28EDB3C64B43DEC1DDB9888CD1EBD064EC131EB17E619FFCFE706E2445A7C89EB33AF94ADF5BF5E</code></pre>
<pre><code>encrypted_data = E74DA6BC5658DEF1EC2E6F6DB0D5F02E950B9C62098009F12BA6570691377CCEE928D07529766A8193EA7DFAB492DB3400DC4E66D5A96B64371ADCC1D968D3AFA01187818ED9D2FE63B8EAA6E842C6DCF5F05CA9D6E6F8DD23C046CF25B1D5AFD25B12E2DA206FAD2F6E24A15AB759452AFF6A1A4215FB76067D95BFFE0E274E0991FFE382E543547CA6E287556E5CF7259DE6B22916CA5DB64948FFE0DCE9B9CD3D7335106BE3F585AC83E001DEFE1D398AA812EA909302CB01F770E64D8350E35346CCEB3715A209DF1F98A6D8D8D797C1A91698CA611C280328B5B4C95C5E623AD4FA406278563B71A94A1F23C2879EA7B31C37D39E2AD9C809EFBE3CE244D4C9FE949909659CEE4B074D29CD490BFD3BEFCFEC653C33E2B1A073CD26890DAAE30165E1B0A480B9FA4611F5ED037526CFFF4FBB660E491F1DFA38C9F8EFAD19A0B45C5E2FD38C4D083B2EC6530001</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 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 30 A7 05 00 F5 53 80 66
0010 | 78 01 00 00 1F 5F 04 F5 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D
0030 | 43 DE 4B 90 FA 2E 32 84 FE 50 01 00 E7 4D A6 BC
0040 | 56 58 DE F1 EC 2E 6F 6D B0 D5 F0 2E 95 0B 9C 62
0050 | 09 80 09 F1 2B A6 57 06 91 37 7C CE E9 28 D0 75
0060 | 29 76 6A 81 93 EA 7D FA B4 92 DB 34 00 DC 4E 66
0070 | D5 A9 6B 64 37 1A DC C1 D9 68 D3 AF A0 11 87 81
0080 | 8E D9 D2 FE 63 B8 EA A6 E8 42 C6 DC F5 F0 5C A9
0090 | D6 E6 F8 DD 23 C0 46 CF 25 B1 D5 AF D2 5B 12 E2
00A0 | DA 20 6F AD 2F 6E 24 A1 5A B7 59 45 2A FF 6A 1A
00B0 | 42 15 FB 76 06 7D 95 BF FE 0E 27 4E 09 91 FF E3
00C0 | 82 E5 43 54 7C A6 E2 87 55 6E 5C F7 25 9D E6 B2
00D0 | 29 16 CA 5D B6 49 48 FF E0 DC E9 B9 CD 3D 73 35
00E0 | 10 6B E3 F5 85 AC 83 E0 01 DE FE 1D 39 8A A8 12
00F0 | EA 90 93 02 CB 01 F7 70 E6 4D 83 50 E3 53 46 CC
0100 | EB 37 15 A2 09 DF 1F 98 A6 D8 D8 D7 97 C1 A9 16
0110 | 98 CA 61 1C 28 03 28 B5 B4 C9 5C 5E 62 3A D4 FA
0120 | 40 62 78 56 3B 71 A9 4A 1F 23 C2 87 9E A7 B3 1C
0130 | 37 D3 9E 2A D9 C8 09 EF BE 3C E2 44 D4 C9 FE 94
0140 | 99 09 65 9C EE 4B 07 4D 29 CD 49 0B FD 3B EF CF
0150 | EC 65 3C 33 E2 B1 A0 73 CD 26 89 0D AA E3 01 65
0160 | E1 B0 A4 80 B9 FA 46 11 F5 ED 03 75 26 CF FF 4F
0170 | BB 66 0E 49 1F 1D FA 38 C9 F8 EF AD 19 A0 B4 5C
0180 | 5E 2F D3 8C 4D 08 3B 2E C6 53 00 01</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>EC860700A0328066</code></td>
<td><code>30A70500F5538066</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>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</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><code>FE500100E74DA6BC5658DEF1EC2E6F6D</code> <code>B0D5F02E950B9C62098009F12BA65706</code> <code>91377CCEE928D07529766A8193EA7DFA</code> <code>B492DB3400DC4E66D5A96B64371ADCC1</code> <code>D968D3AFA01187818ED9D2FE63B8EAA6</code> <code>E842C6DCF5F05CA9D6E6F8DD23C046CF</code> <code>25B1D5AFD25B12E2DA206FAD2F6E24A1</code> <code>5AB759452AFF6A1A4215FB76067D95BF</code> <code>FE0E274E0991FFE382E543547CA6E287</code> <code>556E5CF7259DE6B22916CA5DB64948FF</code> <code>E0DCE9B9CD3D7335106BE3F585AC83E0</code> <code>01DEFE1D398AA812EA909302CB01F770</code> <code>E64D8350E35346CCEB3715A209DF1F98</code> <code>A6D8D8D797C1A91698CA611C280328B5</code> <code>B4C95C5E623AD4FA406278563B71A94A</code> <code>1F23C2879EA7B31C37D39E2AD9C809EF</code> <code>BE3CE244D4C9FE949909659CEE4B074D</code> <code>29CD490BFD3BEFCFEC653C33E2B1A073</code> <code>CD26890DAAE30165E1B0A480B9FA4611</code> <code>F5ED037526CFFF4FBB660E491F1DFA38</code> <code>C9F8EFAD19A0B45C5E2FD38C4D083B2E</code><br> <code>C6530001</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 = 09025C57A9B256B8987EF4BD7E993282D907931A766D3E5ACCEF52CA389C6D62716EEEC8BC1EEF8298852E3761D1F80E898B11005EAE1F6C2BF8C3C8D094959071C592EA88100C8B4BB57D3110D37843012D56AC5419BAD62E3146973BB25A457D22D5D9BEDA129526236B02D6FD2744D2ECA7A172BC3015E93DCBDDE80386D9E0D32E70252F01E410AE0D6E1FA41F0202663B3732705FC46E05C770FDC805EB39CCAE26A72BC858985B2EFF7C829820ED79B45CB8276498D6EE1EB1D370B68E8CEE9A3CBAE7D5236F02D5317281A29160383B7A04B7F9B16FBFE1BF928B58319EB3B68381124173F11AA74FFC63A7B9FE28174AB955B182365B0D64EF0511B2</code></pre>
<pre><code>auth_key = A8BECD2600C465423CA1D7C7DCD5761C7D5A6976EED715C0F7155F2A74F625698AD583FCD8DA543F3322557C06510B24B171E899F21F029653AAFD5FB53702E68A22F03BFF231527770B066C453727B44204F8E902D2E172C58CB34E0ABA5E2C3BE7555FF8EF39DCDF59E560D48092246CBD87DA83F0498239973FD8E3CE63246D71F1BB4E3B9CC7F8AE99DAB5055D663AA53E6C748E5FAD6C6D437B988C204841573EC5C68907B3C48AB03115F4E4D20B47AD90CE309581A2DFCC1F3F728B908D1692486FF65047BC74E0B69C11A524B05F4F1659D231B7C1F19DF5242C0CE71157CF46C7FF0F0B9191EC1690BBF091BB362A4D98654DA405A21EBDEA5BFFF5</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 7C 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>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 20 70 EF F5 53 80 66
0010 | 40 00 00 00 34 F7 CB 3B 4F FD 74 02 5B 71 15 B1
0020 | 79 D5 22 08 0D 95 26 F7 E4 0E E9 C2 E3 06 43 7D
0030 | 43 DE 4B 90 FA 2E 32 84 6B 59 22 92 30 E0 2A 80
0040 | EE C8 A7 07 E5 37 EC 08</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>017C2868A1328066</code></td>
<td><code>012070EFF5538066</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>38000000</code> (56 in decimal)</td>
<td><code>40000000</code> (64 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>3AB39B5DF461491E6B42405587A5962D</code></td>
<td><code>4FFD74025B7115B179D522080D9526F7</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>814D539E0553F12D516BFAD7C83F3F56</code></td>
<td><code>E40EE9C2E306437D43DE4B90FA2E3284</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>54DAB347E901EED180A8B8A83025DA83</code></td>
<td><code>6B59229230E02A80EEC8A707E537EC08</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>