Update content of files

This commit is contained in:
GitHub Action 2024-07-30 17:35:37 +00:00
parent da5541a1d6
commit 04f7f51ba0

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 94 1C 07 00 6F 1D A9 66
0010 | 14 00 00 00 F1 8E 7E BE 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 F9 06 00 F1 20 A9 66
0010 | 14 00 00 00 F1 8E 7E BE D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>941C07006F1DA966</code></td>
<td><code>D8F90600F120A966</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>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</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 B4 AE 01 70 1D A9 66
0010 | 74 00 00 00 63 24 16 05 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53 2B 28 6E 1E 25 E4 74 61
0030 | D3 0B C4 2E C9 8D 1F C7 08 23 4D 85 4D FC 28 0C
0040 | 41 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C4 B9 0B F2 20 A9 66
0010 | 88 00 00 00 63 24 16 05 D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE DB A2 9F C9 E2 11 06 92
0030 | 56 1C 3C 74 94 8F E1 DE 08 16 1E 19 75 2C 86 19
0040 | BB 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>01B4AE01701DA966</code></td>
<td><code>01C4B90BF220A966</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>74000000</code> (116 in decimal)</td>
<td><code>88000000</code> (136 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08234D854DFC280C41000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2543835934523657281</td>
<td><code>08161E19752C8619BB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1593739309184588219</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 = 2543835934523657281</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2543835934523657281 = 1346951269 * 1888587949</code></p>
<pre><code>p = 1346951269
q = 1888587949</code></pre>
<pre><code>pq = 1593739309184588219</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1593739309184588219 = 1129690483 * 1410775193</code></p>
<pre><code>p = 1129690483
q = 1410775193</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 23 4D 85 4D FC 28 0C 41 00 00 00
0010 | 04 50 48 D8 65 00 00 00 04 70 91 90 AD 00 00 00
0020 | 1B 09 A0 0A D2 F0 2D 7E 1C 09 6E E6 37 8E 25 53
0030 | 2B 28 6E 1E 25 E4 74 61 D3 0B C4 2E C9 8D 1F C7
0040 | 2D 36 E3 CA F0 41 D7 7A 54 F5 DD C1 10 EE 6B 0F
0050 | 9F 57 93 52 B3 0B 84 CD 97 59 03 2F D5 24 1D 9F
<pre><code>0000 | 95 5F F5 A9 08 16 1E 19 75 2C 86 19 BB 00 00 00
0010 | 04 43 55 B5 73 00 00 00 04 54 16 B8 99 00 00 00
0020 | D9 43 A3 CF F0 5D DE D8 4C BD B5 C9 73 00 93 EE
0030 | DB A2 9F C9 E2 11 06 92 56 1C 3C 74 94 8F E1 DE
0040 | 46 66 D8 D8 4F EB E4 2B 37 AA CD C4 C3 75 21 78
0050 | 00 E5 E6 61 A2 7A 63 6C 0E 6A 20 6D 03 52 1B BC
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 = 1888587949</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08234D854DFC280C41000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2543835934523657281</td>
<td><code>08161E19752C8619BB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1593739309184588219</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>045048D865000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1346951269</td>
<td><code>044355B573000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1129690483</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>04709190AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1888587949</td>
<td><code>045416B899000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1410775193</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>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>2D36E3CAF041D77A54F5DDC110EE6B0F</code> <code>9F579352B30B84CD9759032FD5241D9F</code></td>
<td><code>4666D8D84FEBE42B37AACDC4C3752178</code> <code>00E5E661A27A636C0E6A206D03521BBC</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1888587949</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 = 955FF5A908234D854DFC280C41000000045048D86500000004709190AD0000001B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC72D36E3CAF041D77A54F5DDC110EE6B0F9F579352B30B84CD9759032FD5241D9F02000000
random_padding_bytes = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5ACB4AC456E29E57798ED22A0D5740538DD13D7FB66D23FA451876C6B31621404AE1E2F2C6BACAFF48934B9152478E70E4FF3D2BD007D2F6FC3745FF2185A9961C</code></pre>
<pre><code>data = 955FF5A908161E19752C8619BB000000044355B573000000045416B899000000D943A3CFF05DDED84CBDB5C9730093EEDBA29FC9E2110692561C3C74948FE1DE4666D8D84FEBE42B37AACDC4C375217800E5E661A27A636C0E6A206D03521BBC02000000
random_padding_bytes = 198E72F87D664F2C97FF68422E35D0D39EB0DD8BE6A89351F03E56965EAFD1B699B8B87591B1F6AFF9E97068279ADD9EAC7ED4080056CC347932E4F5B5D0EFAED2D21223A8197BE51B54092FA0E64032BA5C59F22BD2D4BF6FA2E6F4</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 = 92B3AB879CD052FAF2C6C9A1E39B43258C187AD82F04408BE1B78FA906D9328AC69E06F6A7BCBAF24729630F303929841FDBBDB90DF2FDA55E6F33BB89D0F007436676A5328D97F6C7E1BC16447E54F9CC56B345F818B24216FD60829E5263EFF6E9E9F85A18E3CD26126ED3C1CBB82CFFBFDC002F17BF40E9D45FDA4252088A456FDE816CBD33DD76436BA014323F345FAFCA016A8925498727E63DDBA6ADC63DB5E5B0B1127C30C86870A70F4D4658EE30AECBB7DF1F62CABD42222E3B81BC8A729A29E0FA817B7D0DA40FBA702456BEF51198CFC60E0085B3BE7EBC62140484A37E859C601B484F06C54A9A65342A21A8F18FBB5345F56D3DAAB0D791D1F2</code></pre>
<pre><code>encrypted_data = C2332A84B37FB811AF9CA4C116FCFBE6CBEC858DBFAF84C8A6669C1E61F152294037B625BD1A06C1FF6BA810EEA3BDB7C64125040325E0D60D0069AB884F897953926C2772DE423637C883ACF410AF8A7D76DA497ECA305DC996833EC9862E40F57C83A71ED055F15BD36AD5E82702B6350D493C6AA61A64279A29873D66F13476CBA45FCD5DFACAB76367E30C75DF99B0B3E2BDC7CBD8F18E3356821746FB9300FFA3A9AC744EA104EEF0ACF83C3691576A1A1B4FAE6EFDD07154249062D47A246D703A225EF47C2B483D20341B9960A3193D86EF433674A9663C910B24DCBC425ECF4E07E07B57D060944E4627C65B59A086E08AB635A86AB8D95CF5A6B8E7</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 78 C0 07 00 70 1D A9 66
0010 | 40 01 00 00 BE E4 12 D7 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53 2B 28 6E 1E 25 E4 74 61
0030 | D3 0B C4 2E C9 8D 1F C7 04 50 48 D8 65 00 00 00
0040 | 04 70 91 90 AD 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 92 B3 AB 87 9C D0 52 FA F2 C6 C9 A1
0060 | E3 9B 43 25 8C 18 7A D8 2F 04 40 8B E1 B7 8F A9
0070 | 06 D9 32 8A C6 9E 06 F6 A7 BC BA F2 47 29 63 0F
0080 | 30 39 29 84 1F DB BD B9 0D F2 FD A5 5E 6F 33 BB
0090 | 89 D0 F0 07 43 66 76 A5 32 8D 97 F6 C7 E1 BC 16
00A0 | 44 7E 54 F9 CC 56 B3 45 F8 18 B2 42 16 FD 60 82
00B0 | 9E 52 63 EF F6 E9 E9 F8 5A 18 E3 CD 26 12 6E D3
00C0 | C1 CB B8 2C FF BF DC 00 2F 17 BF 40 E9 D4 5F DA
00D0 | 42 52 08 8A 45 6F DE 81 6C BD 33 DD 76 43 6B A0
00E0 | 14 32 3F 34 5F AF CA 01 6A 89 25 49 87 27 E6 3D
00F0 | DB A6 AD C6 3D B5 E5 B0 B1 12 7C 30 C8 68 70 A7
0100 | 0F 4D 46 58 EE 30 AE CB B7 DF 1F 62 CA BD 42 22
0110 | 2E 3B 81 BC 8A 72 9A 29 E0 FA 81 7B 7D 0D A4 0F
0120 | BA 70 24 56 BE F5 11 98 CF C6 0E 00 85 B3 BE 7E
0130 | BC 62 14 04 84 A3 7E 85 9C 60 1B 48 4F 06 C5 4A
0140 | 9A 65 34 2A 21 A8 F1 8F BB 53 45 F5 6D 3D AA B0
0150 | D7 91 D1 F2</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 C8 B5 0A 00 F2 20 A9 66
0010 | 40 01 00 00 BE E4 12 D7 D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE DB A2 9F C9 E2 11 06 92
0030 | 56 1C 3C 74 94 8F E1 DE 04 43 55 B5 73 00 00 00
0040 | 04 54 16 B8 99 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 C2 33 2A 84 B3 7F B8 11 AF 9C A4 C1
0060 | 16 FC FB E6 CB EC 85 8D BF AF 84 C8 A6 66 9C 1E
0070 | 61 F1 52 29 40 37 B6 25 BD 1A 06 C1 FF 6B A8 10
0080 | EE A3 BD B7 C6 41 25 04 03 25 E0 D6 0D 00 69 AB
0090 | 88 4F 89 79 53 92 6C 27 72 DE 42 36 37 C8 83 AC
00A0 | F4 10 AF 8A 7D 76 DA 49 7E CA 30 5D C9 96 83 3E
00B0 | C9 86 2E 40 F5 7C 83 A7 1E D0 55 F1 5B D3 6A D5
00C0 | E8 27 02 B6 35 0D 49 3C 6A A6 1A 64 27 9A 29 87
00D0 | 3D 66 F1 34 76 CB A4 5F CD 5D FA CA B7 63 67 E3
00E0 | 0C 75 DF 99 B0 B3 E2 BD C7 CB D8 F1 8E 33 56 82
00F0 | 17 46 FB 93 00 FF A3 A9 AC 74 4E A1 04 EE F0 AC
0100 | F8 3C 36 91 57 6A 1A 1B 4F AE 6E FD D0 71 54 24
0110 | 90 62 D4 7A 24 6D 70 3A 22 5E F4 7C 2B 48 3D 20
0120 | 34 1B 99 60 A3 19 3D 86 EF 43 36 74 A9 66 3C 91
0130 | 0B 24 DC BC 42 5E CF 4E 07 E0 7B 57 D0 60 94 4E
0140 | 46 27 C6 5B 59 A0 86 E0 8A B6 35 A8 6A B8 D9 5C
0150 | F5 A6 B8 E7</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 = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>78C00700701DA966</code></td>
<td><code>C8B50A00F220A966</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 = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045048D865000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1346951269</td>
<td><code>044355B573000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1129690483</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>04709190AD000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1888587949</td>
<td><code>045416B899000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1410775193</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 = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010092B3AB879CD052FAF2C6C9A1</code> <code>E39B43258C187AD82F04408BE1B78FA9</code> <code>06D9328AC69E06F6A7BCBAF24729630F</code> <code>303929841FDBBDB90DF2FDA55E6F33BB</code> <code>89D0F007436676A5328D97F6C7E1BC16</code> <code>447E54F9CC56B345F818B24216FD6082</code> <code>9E5263EFF6E9E9F85A18E3CD26126ED3</code> <code>C1CBB82CFFBFDC002F17BF40E9D45FDA</code> <code>4252088A456FDE816CBD33DD76436BA0</code> <code>14323F345FAFCA016A8925498727E63D</code> <code>DBA6ADC63DB5E5B0B1127C30C86870A7</code> <code>0F4D4658EE30AECBB7DF1F62CABD4222</code> <code>2E3B81BC8A729A29E0FA817B7D0DA40F</code> <code>BA702456BEF51198CFC60E0085B3BE7E</code> <code>BC62140484A37E859C601B484F06C54A</code> <code>9A65342A21A8F18FBB5345F56D3DAAB0</code><br> <code>D791D1F2</code></td>
<td><code>FE000100C2332A84B37FB811AF9CA4C1</code> <code>16FCFBE6CBEC858DBFAF84C8A6669C1E</code> <code>61F152294037B625BD1A06C1FF6BA810</code> <code>EEA3BDB7C64125040325E0D60D0069AB</code> <code>884F897953926C2772DE423637C883AC</code> <code>F410AF8A7D76DA497ECA305DC996833E</code> <code>C9862E40F57C83A71ED055F15BD36AD5</code> <code>E82702B6350D493C6AA61A64279A2987</code> <code>3D66F13476CBA45FCD5DFACAB76367E3</code> <code>0C75DF99B0B3E2BDC7CBD8F18E335682</code> <code>1746FB9300FFA3A9AC744EA104EEF0AC</code> <code>F83C3691576A1A1B4FAE6EFDD0715424</code> <code>9062D47A246D703A225EF47C2B483D20</code> <code>341B9960A3193D86EF433674A9663C91</code> <code>0B24DCBC425ECF4E07E07B57D060944E</code> <code>4627C65B59A086E08AB635A86AB8D95C</code><br> <code>F5A6B8E7</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<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 84 B7 9C 70 1D A9 66
0010 | F4 02 00 00 5C 07 E8 D0 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53 2B 28 6E 1E 25 E4 74 61
0030 | D3 0B C4 2E C9 8D 1F C7 FE 50 02 00 DF F2 AB 83
0040 | F3 18 F2 D9 9F 8D BC B3 CB 16 C6 51 43 08 C8 D9
0050 | B2 F5 BE BD B0 3B 9D 3D 0B 6C D0 C6 B6 5A 01 DD
0060 | B4 C4 27 D2 01 CE 8A FC 4F AE 07 37 EB B1 46 26
0070 | 2F 12 09 AA 86 6E BB FF A7 C3 80 22 76 A4 1C D5
0080 | 66 54 2D 5D 61 CE 19 AE 3D C2 76 C6 3F 9D 48 24
0090 | 71 20 0B A0 F8 4D DA F9 D5 85 61 7F 22 81 5F 36
00A0 | 09 CE CA 39 7F 09 3D 73 D2 29 10 19 D9 9A 8E DD
00B0 | BE 68 E3 27 B9 8F A9 2C E9 42 F3 B7 5F 4D 03 4E
00C0 | D3 29 0B 56 B2 D6 E8 BA 8F 1D BD 40 11 92 BE 0E
00D0 | 3A 41 03 F5 37 CB CB F9 30 F6 9E 6A C2 9D 84 96
00E0 | FD 5C F5 A7 61 9D 6E 02 49 8F 42 9B A2 D2 64 1F
00F0 | 31 A8 4B 8F CF 31 F9 FA B3 F4 28 84 29 66 58 A0
0100 | 52 0C CB 42 46 DD A8 D2 D1 0D 55 DC CA 6D A7 B3
0110 | 81 17 09 FE 42 60 47 88 7D A3 0A F9 0C B3 E4 79
0120 | FC F2 CB 3F 38 E5 58 6E E3 33 A8 3D D4 D5 E2 5F
0130 | 57 D9 A0 62 B5 9B 8A DB 77 06 CF 3C AB E6 2C F5
0140 | EA 10 28 57 D4 3A 28 87 79 64 6B 5E CA C9 21 59
0150 | 23 FD 2B 09 34 04 94 31 6D F0 E0 D9 7B A3 66 D8
0160 | 3D 22 70 79 E4 8B 7C 02 19 AC 63 FD 50 6F 18 96
0170 | 79 00 DE C5 F1 5A 14 D7 D4 A0 3E 98 02 A6 4A 3B
0180 | EF E4 FD 95 7C 69 B6 D0 23 73 FD AD AB AF 63 0D
0190 | A5 47 84 E1 AC 50 C1 AA C3 88 E2 D5 13 B9 BD 10
01A0 | 64 7A F4 D9 32 33 5B 57 F2 D8 C4 E6 C3 55 FA 02
01B0 | 6C 8C 8F CE E2 08 77 C9 60 A4 2A 29 01 B8 BE AD
01C0 | 9A 3A CB 9B A5 D3 88 F2 82 D9 29 2F D3 7B A4 89
01D0 | 2D A6 9D 35 92 D2 C2 45 01 51 95 52 45 EB 89 6A
01E0 | 29 8D 85 2B 37 82 EC EF 9D 7D A5 FB 2A 08 15 F8
01F0 | 1D 72 FD 53 29 05 42 AE 57 77 50 5F B0 53 2C 0A
0200 | 8E 0A 1D D5 DB E3 B7 90 82 5A 1A 8B 31 90 0A 6A
0210 | 00 4A 79 05 75 7B 66 4B 69 AF 22 FD 73 88 C6 39
0220 | 87 5D BE 35 17 E0 3A 05 9F A6 64 C4 B3 B6 A6 51
0230 | D6 DD DC F8 EC 17 0B C1 D1 7B 78 78 4A 07 0B ED
0240 | 40 DE 5C F9 A9 4E 75 2A 93 00 EF CD 49 EF 68 F7
0250 | B0 CD E0 FE 80 43 16 5D E5 9E D4 6D 2A EA 0A 37
0260 | FA 78 9C 98 13 B0 71 4A 96 51 7F 63 60 06 97 AE
0270 | 85 A7 A0 A0 15 F9 7F 8B 33 57 62 06 E7 52 70 E6
0280 | AF 35 94 10 33 ED F1 3F 8B E1 F0 68</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 90 20 EF F2 20 A9 66
0010 | 90 02 00 00 5C 07 E8 D0 D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE DB A2 9F C9 E2 11 06 92
0030 | 56 1C 3C 74 94 8F E1 DE FE 50 02 00 CC 1E 6E BC
0040 | 1B F2 E8 A2 2E 39 7E 40 95 66 35 06 FC 09 C7 21
0050 | 29 12 A6 F9 A2 37 85 CE FF 97 71 9D 5A 1A B5 CF
0060 | 19 13 6D C4 8C D1 4A 30 93 F8 3C 44 87 F7 23 25
0070 | 31 92 07 DB 5E 14 72 B9 36 B3 B1 92 9A F4 2B D2
0080 | 9F A1 FD 4C 90 73 23 C9 3B 36 5F 0A 0A 81 41 4F
0090 | C1 FB BD 12 49 BF 60 8C FD CC 78 6D 52 BD FD D7
00A0 | B3 3E 53 8E EA 34 92 2E FA D1 E7 FA E9 1F 49 50
00B0 | FA 28 DA 16 10 AD F2 48 E9 2E 60 8E 0A 31 9F CC
00C0 | 77 62 72 5E D1 65 3C 06 67 58 20 C3 D8 04 B7 60
00D0 | 1B 97 0D 8B BF 8D 3D FA AC 58 7B 5C D8 F7 AB 23
00E0 | D1 9D 11 55 6C 19 39 F2 7C 55 08 87 36 01 B4 42
00F0 | 1D AB 53 44 19 79 7B 57 82 A6 B0 D4 72 8D 46 C5
0100 | FD 38 A7 A2 BE 02 26 A2 58 44 F3 0A 4D 87 80 FA
0110 | 83 7A F3 74 15 4C F9 F3 3E 70 18 83 7E DD 5D 16
0120 | 30 3B 87 67 D4 A7 6D 57 E6 1F 08 E0 EE 02 AA 29
0130 | C7 3D 73 F1 AF B4 09 50 65 F6 1E 74 42 9A D2 23
0140 | DD 08 E0 42 12 1E 06 2C E8 52 25 F1 95 BC 8C 65
0150 | 50 B2 01 B7 55 55 D6 8B AF 71 D4 4A 49 51 67 F9
0160 | 47 A4 89 37 19 8D 87 F7 F6 2B 2F A2 95 A3 78 43
0170 | 9A 8B 82 A5 87 EC C8 50 78 53 55 4B 0C 53 87 2C
0180 | 78 01 91 00 75 DE DE FD AF 13 4E 6F D4 D4 12 52
0190 | A7 F6 08 99 9F A7 7E E9 B0 B7 FB EF 3B 15 BF 3C
01A0 | 43 CE 57 AA 05 A2 63 42 D5 63 AF DC D1 E4 01 FA
01B0 | F9 83 98 C2 D2 12 E4 E5 07 96 7E E0 FA 68 FA B5
01C0 | AD 25 68 1B 89 F5 6F 76 4E 98 D3 44 AD 2D 84 CF
01D0 | 42 38 43 B1 A3 9B 7A A9 0F 52 DA 7E 2A 7D 74 88
01E0 | AB 50 28 19 00 EC 61 18 60 96 76 44 2B 90 B6 33
01F0 | D4 9D C8 FD 6E DE 16 61 5B CD 0F A1 FE DC 47 AC
0200 | AE 22 92 7E 21 9C 4D 1A BC 21 3E 20 00 5A B8 9F
0210 | 35 58 A0 43 76 82 6E DD 8F 49 A9 0A FA 66 A0 AA
0220 | 99 66 C4 DA 74 B9 4B 5E 7F DB 10 DD D2 CB E2 8D
0230 | 5D 4F 7E 74 EC 5E 8B 14 52 6A 7B 44 74 5E 5D 75
0240 | E6 7D B2 CB 01 3C A4 F1 79 DA E0 B6 8F 64 1D 09
0250 | 7A 7C 1E 79 29 1E 8B 9C B2 85 7E 8B CD 5C 47 B6
0260 | A9 C9 25 4A DB 72 A0 AE DB FB CD E6 29 4A 3E 8F
0270 | FB 4C 42 EE BD 83 36 AE 9B 9E 7D F7 E5 22 5D E4
0280 | 9F 9D 84 82 6F DA A5 B2 A9 35 D4 8A</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 = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0184B79C701DA966</code></td>
<td><code>019020EFF220A966</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>F4020000</code> (756 in decimal)</td>
<td><code>90020000</code> (656 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200DFF2AB83F318F2D99F8DBCB3</code> <code>CB16C6514308C8D9B2F5BEBDB03B9D3D</code> <code>0B6CD0C6B65A01DDB4C427D201CE8AFC</code> <code>4FAE0737EBB146262F1209AA866EBBFF</code> <code>A7C3802276A41CD566542D5D61CE19AE</code> <code>3DC276C63F9D482471200BA0F84DDAF9</code> <code>D585617F22815F3609CECA397F093D73</code> <code>D2291019D99A8EDDBE68E327B98FA92C</code> <code>E942F3B75F4D034ED3290B56B2D6E8BA</code> <code>8F1DBD401192BE0E3A4103F537CBCBF9</code> <code>30F69E6AC29D8496FD5CF5A7619D6E02</code> <code>498F429BA2D2641F31A84B8FCF31F9FA</code> <code>B3F42884296658A0520CCB4246DDA8D2</code> <code>D10D55DCCA6DA7B3811709FE42604788</code> <code>7DA30AF90CB3E479FCF2CB3F38E5586E</code> <code>E333A83DD4D5E25F57D9A062B59B8ADB</code> <code>7706CF3CABE62CF5EA102857D43A2887</code> <code>79646B5ECAC9215923FD2B0934049431</code> <code>6DF0E0D97BA366D83D227079E48B7C02</code> <code>19AC63FD506F18967900DEC5F15A14D7</code> <code>D4A03E9802A64A3BEFE4FD957C69B6D0</code> <code>2373FDADABAF630DA54784E1AC50C1AA</code> <code>C388E2D513B9BD10647AF4D932335B57</code> <code>F2D8C4E6C355FA026C8C8FCEE20877C9</code> <code>60A42A2901B8BEAD9A3ACB9BA5D388F2</code> <code>82D9292FD37BA4892DA69D3592D2C245</code> <code>0151955245EB896A298D852B3782ECEF</code> <code>9D7DA5FB2A0815F81D72FD53290542AE</code> <code>5777505FB0532C0A8E0A1DD5DBE3B790</code> <code>825A1A8B31900A6A004A7905757B664B</code> <code>69AF22FD7388C639875DBE3517E03A05</code> <code>9FA664C4B3B6A651D6DDDCF8EC170BC1</code> <code>D17B78784A070BED40DE5CF9A94E752A</code> <code>9300EFCD49EF68F7B0CDE0FE8043165D</code> <code>E59ED46D2AEA0A37FA789C9813B0714A</code> <code>96517F63600697AE85A7A0A015F97F8B</code> <code>33576206E75270E6AF35941033EDF13F</code><br> <code>8BE1F068</code></td>
<td><code>FE500200CC1E6EBC1BF2E8A22E397E40</code> <code>95663506FC09C7212912A6F9A23785CE</code> <code>FF97719D5A1AB5CF19136DC48CD14A30</code> <code>93F83C4487F72325319207DB5E1472B9</code> <code>36B3B1929AF42BD29FA1FD4C907323C9</code> <code>3B365F0A0A81414FC1FBBD1249BF608C</code> <code>FDCC786D52BDFDD7B33E538EEA34922E</code> <code>FAD1E7FAE91F4950FA28DA1610ADF248</code> <code>E92E608E0A319FCC7762725ED1653C06</code> <code>675820C3D804B7601B970D8BBF8D3DFA</code> <code>AC587B5CD8F7AB23D19D11556C1939F2</code> <code>7C5508873601B4421DAB534419797B57</code> <code>82A6B0D4728D46C5FD38A7A2BE0226A2</code> <code>5844F30A4D8780FA837AF374154CF9F3</code> <code>3E7018837EDD5D16303B8767D4A76D57</code> <code>E61F08E0EE02AA29C73D73F1AFB40950</code> <code>65F61E74429AD223DD08E042121E062C</code> <code>E85225F195BC8C6550B201B75555D68B</code> <code>AF71D44A495167F947A48937198D87F7</code> <code>F62B2FA295A378439A8B82A587ECC850</code> <code>7853554B0C53872C7801910075DEDEFD</code> <code>AF134E6FD4D41252A7F608999FA77EE9</code> <code>B0B7FBEF3B15BF3C43CE57AA05A26342</code> <code>D563AFDCD1E401FAF98398C2D212E4E5</code> <code>07967EE0FA68FAB5AD25681B89F56F76</code> <code>4E98D344AD2D84CF423843B1A39B7AA9</code> <code>0F52DA7E2A7D7488AB50281900EC6118</code> <code>609676442B90B633D49DC8FD6EDE1661</code> <code>5BCD0FA1FEDC47ACAE22927E219C4D1A</code> <code>BC213E20005AB89F3558A04376826EDD</code> <code>8F49A90AFA66A0AA9966C4DA74B94B5E</code> <code>7FDB10DDD2CBE28D5D4F7E74EC5E8B14</code> <code>526A7B44745E5D75E67DB2CB013CA4F1</code> <code>79DAE0B68F641D097A7C1E79291E8B9C</code> <code>B2857E8BCD5C47B6A9C9254ADB72A0AE</code> <code>DBFBCDE6294A3E8FFB4C42EEBD8336AE</code> <code>9B9E7DF7E5225DE49F9D84826FDAA5B2</code><br> <code>A935D48A</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 10F0A617F030366CC2EF71A81ED42B90190CA7832B8BEAFC416DFF5AC
<!-- 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 = DFF2AB83F318F2D99F8DBCB3CB16C6514308C8D9B2F5BEBDB03B9D3D0B6CD0C6B65A01DDB4C427D201CE8AFC4FAE0737EBB146262F1209AA866EBBFFA7C3802276A41CD566542D5D61CE19AE3DC276C63F9D482471200BA0F84DDAF9D585617F22815F3609CECA397F093D73D2291019D99A8EDDBE68E327B98FA92CE942F3B75F4D034ED3290B56B2D6E8BA8F1DBD401192BE0E3A4103F537CBCBF930F69E6AC29D8496FD5CF5A7619D6E02498F429BA2D2641F31A84B8FCF31F9FAB3F42884296658A0520CCB4246DDA8D2D10D55DCCA6DA7B3811709FE426047887DA30AF90CB3E479FCF2CB3F38E5586EE333A83DD4D5E25F57D9A062B59B8ADB7706CF3CABE62CF5EA102857D43A288779646B5ECAC9215923FD2B09340494316DF0E0D97BA366D83D227079E48B7C0219AC63FD506F18967900DEC5F15A14D7D4A03E9802A64A3BEFE4FD957C69B6D02373FDADABAF630DA54784E1AC50C1AAC388E2D513B9BD10647AF4D932335B57F2D8C4E6C355FA026C8C8FCEE20877C960A42A2901B8BEAD9A3ACB9BA5D388F282D9292FD37BA4892DA69D3592D2C2450151955245EB896A298D852B3782ECEF9D7DA5FB2A0815F81D72FD53290542AE5777505FB0532C0A8E0A1DD5DBE3B790825A1A8B31900A6A004A7905757B664B69AF22FD7388C639875DBE3517E03A059FA664C4B3B6A651D6DDDCF8EC170BC1D17B78784A070BED40DE5CF9A94E752A9300EFCD49EF68F7B0CDE0FE8043165DE59ED46D2AEA0A37FA789C9813B0714A96517F63600697AE85A7A0A015F97F8B33576206E75270E6AF35941033EDF13F8BE1F068
tmp_aes_key = BF8FF67F42007055B61FAE3671FBA3AF607DF251913CF366DE0BA460421C070B
tmp_aes_iv = 2D68123E7ACC27D87F65F78C0E79A4322ADE8167C038837EE3CF90242D36E3CA</code></pre>
<pre><code>encrypted_answer = CC1E6EBC1BF2E8A22E397E4095663506FC09C7212912A6F9A23785CEFF97719D5A1AB5CF19136DC48CD14A3093F83C4487F72325319207DB5E1472B936B3B1929AF42BD29FA1FD4C907323C93B365F0A0A81414FC1FBBD1249BF608CFDCC786D52BDFDD7B33E538EEA34922EFAD1E7FAE91F4950FA28DA1610ADF248E92E608E0A319FCC7762725ED1653C06675820C3D804B7601B970D8BBF8D3DFAAC587B5CD8F7AB23D19D11556C1939F27C5508873601B4421DAB534419797B5782A6B0D4728D46C5FD38A7A2BE0226A25844F30A4D8780FA837AF374154CF9F33E7018837EDD5D16303B8767D4A76D57E61F08E0EE02AA29C73D73F1AFB4095065F61E74429AD223DD08E042121E062CE85225F195BC8C6550B201B75555D68BAF71D44A495167F947A48937198D87F7F62B2FA295A378439A8B82A587ECC8507853554B0C53872C7801910075DEDEFDAF134E6FD4D41252A7F608999FA77EE9B0B7FBEF3B15BF3C43CE57AA05A26342D563AFDCD1E401FAF98398C2D212E4E507967EE0FA68FAB5AD25681B89F56F764E98D344AD2D84CF423843B1A39B7AA90F52DA7E2A7D7488AB50281900EC6118609676442B90B633D49DC8FD6EDE16615BCD0FA1FEDC47ACAE22927E219C4D1ABC213E20005AB89F3558A04376826EDD8F49A90AFA66A0AA9966C4DA74B94B5E7FDB10DDD2CBE28D5D4F7E74EC5E8B14526A7B44745E5D75E67DB2CB013CA4F179DAE0B68F641D097A7C1E79291E8B9CB2857E8BCD5C47B6A9C9254ADB72A0AEDBFBCDE6294A3E8FFB4C42EEBD8336AE9B9E7DF7E5225DE49F9D84826FDAA5B2A935D48A
tmp_aes_key = 2FFA7A8B9C004E2428EDF3C965734A2180488F7E392040057C4EB60FE2805C61
tmp_aes_iv = 038D0785056EC5DBBCC8FB4CE5CC75F6DF508A3F20C99FD90C106AAF4666D8D8</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 238E6CEA29AFA41F508619EC043179DB59372EEEBA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100353086B5320D6D2ADFBBCF3E38188758836182EFF9E322C4ECCDA84589EB39E6AF37FCA53C050EACA31778DA6753B12507D57597073C5150895F0A181D25071D1B0B7D1C7DCDE99DF8069B1E795FA281082E4E16C0D3078C2867D58D8DE4E57122A960366DA5C4CA552FA22F413E8F958F91A7D4AE75D1957D9F5526E592C79EC052ADD1D6FBC2301EB7D3AB7A47C5643B0ACAAB09755AC14878EB0244F01F41A35302AC03619D62FB65E434E8390891C0517B7D3C77FF8016836B9D291BD10F269016F284FDED3A295B5753EFC3A6A79326314425973FD6FBDC464CC310A210AB138E69A987F90425A92C5D5C7BED21DA71ECEF6760656C244815F5455FC95B701DA9660A5EE20EAF966551
answer = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100353086B5320D6D2ADFBBCF3E38188758836182EFF9E322C4ECCDA84589EB39E6AF37FCA53C050EACA31778DA6753B12507D57597073C5150895F0A181D25071D1B0B7D1C7DCDE99DF8069B1E795FA281082E4E16C0D3078C2867D58D8DE4E57122A960366DA5C4CA552FA22F413E8F958F91A7D4AE75D1957D9F5526E592C79EC052ADD1D6FBC2301EB7D3AB7A47C5643B0ACAAB09755AC14878EB0244F01F41A35302AC03619D62FB65E434E8390891C0517B7D3C77FF8016836B9D291BD10F269016F284FDED3A295B5753EFC3A6A79326314425973FD6FBDC464CC310A210AB138E69A987F90425A92C5D5C7BED21DA71ECEF6760656C244815F5455FC95B701DA9660A5EE20EAF966551</code></pre>
<pre><code>answer_with_hash = EA5FB80C2C6D3157C6F494F7C6D26A9A1705F989BA0D89B5D943A3CFF05DDED84CBDB5C9730093EEDBA29FC9E2110692561C3C74948FE1DE03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100469E938124EDC32D8D55E1BE2F9CBF54122C87D19ABA6011B3B8096567986F42E75F0F1877A659AB6A5A6740D2F6B4B136A3F7115CEA0934FF6629018B971FC4B1FF9AA2FB97841DE5D7D78F3F1574C96EB7153236679C6326869C5193DCAE3A0F0F6904367DD7EEC451AFE69F5950B6FF3BD804108437913B98F4C15055B0D18ECC68CA69A1D4D110857C3E3C150CB504A3DA16ECFDFD88E382E07D6EC66D8F37ED408E5E78321196A9F104703778FE715DC50E2ABBF59B3241AFD02AD26AFA83A0F8DE35B810D8691F0DE0183055186E175E00A21076CA59C870F225332082C4DD6C7D755D7111440D58A6A4E4DAAD6A4B57EBEED1FBA14A8F24400AA369E1F220A966B6913D4661220FED
answer = BA0D89B5D943A3CFF05DDED84CBDB5C9730093EEDBA29FC9E2110692561C3C74948FE1DE03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100469E938124EDC32D8D55E1BE2F9CBF54122C87D19ABA6011B3B8096567986F42E75F0F1877A659AB6A5A6740D2F6B4B136A3F7115CEA0934FF6629018B971FC4B1FF9AA2FB97841DE5D7D78F3F1574C96EB7153236679C6326869C5193DCAE3A0F0F6904367DD7EEC451AFE69F5950B6FF3BD804108437913B98F4C15055B0D18ECC68CA69A1D4D110857C3E3C150CB504A3DA16ECFDFD88E382E07D6EC66D8F37ED408E5E78321196A9F104703778FE715DC50E2ABBF59B3241AFD02AD26AFA83A0F8DE35B810D8691F0DE0183055186E175E00A21076CA59C870F225332082C4DD6C7D755D7111440D58A6A4E4DAAD6A4B57EBEED1FBA14A8F24400AA369E1F220A966B6913D4661220FED</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 1B 09 A0 0A D2 F0 2D 7E 1C 09 6E E6
0010 | 37 8E 25 53 2B 28 6E 1E 25 E4 74 61 D3 0B C4 2E
0020 | C9 8D 1F C7 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 D9 43 A3 CF F0 5D DE D8 4C BD B5 C9
0010 | 73 00 93 EE DB A2 9F C9 E2 11 06 92 56 1C 3C 74
0020 | 94 8F E1 DE 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 = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
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 | 35 30 86 B5 32 0D 6D 2A DF BB CF 3E 38 18 87 58
0140 | 83 61 82 EF F9 E3 22 C4 EC CD A8 45 89 EB 39 E6
0150 | AF 37 FC A5 3C 05 0E AC A3 17 78 DA 67 53 B1 25
0160 | 07 D5 75 97 07 3C 51 50 89 5F 0A 18 1D 25 07 1D
0170 | 1B 0B 7D 1C 7D CD E9 9D F8 06 9B 1E 79 5F A2 81
0180 | 08 2E 4E 16 C0 D3 07 8C 28 67 D5 8D 8D E4 E5 71
0190 | 22 A9 60 36 6D A5 C4 CA 55 2F A2 2F 41 3E 8F 95
01A0 | 8F 91 A7 D4 AE 75 D1 95 7D 9F 55 26 E5 92 C7 9E
01B0 | C0 52 AD D1 D6 FB C2 30 1E B7 D3 AB 7A 47 C5 64
01C0 | 3B 0A CA AB 09 75 5A C1 48 78 EB 02 44 F0 1F 41
01D0 | A3 53 02 AC 03 61 9D 62 FB 65 E4 34 E8 39 08 91
01E0 | C0 51 7B 7D 3C 77 FF 80 16 83 6B 9D 29 1B D1 0F
01F0 | 26 90 16 F2 84 FD ED 3A 29 5B 57 53 EF C3 A6 A7
0200 | 93 26 31 44 25 97 3F D6 FB DC 46 4C C3 10 A2 10
0210 | AB 13 8E 69 A9 87 F9 04 25 A9 2C 5D 5C 7B ED 21
0220 | DA 71 EC EF 67 60 65 6C 24 48 15 F5 45 5F C9 5B
0230 | 70 1D A9 66</code></pre>
0130 | 46 9E 93 81 24 ED C3 2D 8D 55 E1 BE 2F 9C BF 54
0140 | 12 2C 87 D1 9A BA 60 11 B3 B8 09 65 67 98 6F 42
0150 | E7 5F 0F 18 77 A6 59 AB 6A 5A 67 40 D2 F6 B4 B1
0160 | 36 A3 F7 11 5C EA 09 34 FF 66 29 01 8B 97 1F C4
0170 | B1 FF 9A A2 FB 97 84 1D E5 D7 D7 8F 3F 15 74 C9
0180 | 6E B7 15 32 36 67 9C 63 26 86 9C 51 93 DC AE 3A
0190 | 0F 0F 69 04 36 7D D7 EE C4 51 AF E6 9F 59 50 B6
01A0 | FF 3B D8 04 10 84 37 91 3B 98 F4 C1 50 55 B0 D1
01B0 | 8E CC 68 CA 69 A1 D4 D1 10 85 7C 3E 3C 15 0C B5
01C0 | 04 A3 DA 16 EC FD FD 88 E3 82 E0 7D 6E C6 6D 8F
01D0 | 37 ED 40 8E 5E 78 32 11 96 A9 F1 04 70 37 78 FE
01E0 | 71 5D C5 0E 2A BB F5 9B 32 41 AF D0 2A D2 6A FA
01F0 | 83 A0 F8 DE 35 B8 10 D8 69 1F 0D E0 18 30 55 18
0200 | 6E 17 5E 00 A2 10 76 CA 59 C8 70 F2 25 33 20 82
0210 | C4 DD 6C 7D 75 5D 71 11 44 0D 58 A6 A4 E4 DA AD
0220 | 6A 4B 57 EB EE D1 FB A1 4A 8F 24 40 0A A3 69 E1
0230 | F2 20 A9 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 = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE000100353086B5320D6D2ADFBBCF3E</code> <code>38188758836182EFF9E322C4ECCDA845</code> <code>89EB39E6AF37FCA53C050EACA31778DA</code> <code>6753B12507D57597073C5150895F0A18</code> <code>1D25071D1B0B7D1C7DCDE99DF8069B1E</code> <code>795FA281082E4E16C0D3078C2867D58D</code> <code>8DE4E57122A960366DA5C4CA552FA22F</code> <code>413E8F958F91A7D4AE75D1957D9F5526</code> <code>E592C79EC052ADD1D6FBC2301EB7D3AB</code> <code>7A47C5643B0ACAAB09755AC14878EB02</code> <code>44F01F41A35302AC03619D62FB65E434</code> <code>E8390891C0517B7D3C77FF8016836B9D</code> <code>291BD10F269016F284FDED3A295B5753</code> <code>EFC3A6A79326314425973FD6FBDC464C</code> <code>C310A210AB138E69A987F90425A92C5D</code> <code>5C7BED21DA71ECEF6760656C244815F5</code><br> <code>455FC95B</code></td>
<td><code>FE000100469E938124EDC32D8D55E1BE</code> <code>2F9CBF54122C87D19ABA6011B3B80965</code> <code>67986F42E75F0F1877A659AB6A5A6740</code> <code>D2F6B4B136A3F7115CEA0934FF662901</code> <code>8B971FC4B1FF9AA2FB97841DE5D7D78F</code> <code>3F1574C96EB7153236679C6326869C51</code> <code>93DCAE3A0F0F6904367DD7EEC451AFE6</code> <code>9F5950B6FF3BD804108437913B98F4C1</code> <code>5055B0D18ECC68CA69A1D4D110857C3E</code> <code>3C150CB504A3DA16ECFDFD88E382E07D</code> <code>6EC66D8F37ED408E5E78321196A9F104</code> <code>703778FE715DC50E2ABBF59B3241AFD0</code> <code>2AD26AFA83A0F8DE35B810D8691F0DE0</code> <code>183055186E175E00A21076CA59C870F2</code> <code>25332082C4DD6C7D755D7111440D58A6</code> <code>A4E4DAAD6A4B57EBEED1FBA14A8F2440</code><br> <code>0AA369E1</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>701DA966</code> (1722359152 in decimal)</td>
<td><code>F220A966</code> (1722360050 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
<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 = C50B014B940357684175E3F98827022D9D690611C4B50ACEB30167B0BD71C1D0D93B1FB077B0033298D55D269D26BDDA90D21FDAAD2C71387FB9E8E10883147BBDB4BCF1F7218DFFA0FC619578460A108343A174D73DF72294DBCFAB78B657B29B13F503A51D48BBCEEC273B13DA839C8556471D883DC9991931A5CBA9E77A1D2BD493DC097BE3E98E8D634E26E684EFF957D4093E01F8EA80A37FDF9657ECE73C41C9F0D9F47935D22F21C5F3B869A38A4322C2B57CAA4E8564A8DE38A41DAFEAC81DC8B47115EF1CBAA3E32DD36A93FF5D1994B9A060E0A1E2A84766EC1FA266AF4E7F4AE27B8C6D2556D57346CB7D5AB960975EF6EA6BE0DB2BF3095150E9</code></pre>
<pre><code>b = 1CFBD607ECFB4A8A92411D4E252229A9A432ADEC8D0EB3FF9A24083E96902B4550ADE629A03F927F7A011F9DDC1230B7A5AB933CF256AA44E9EC51BD0E95F8047458F9D11C67F23ECCBAADD26EF34EA58FDB0243C7FE74A8F88DFC90122975F0E19DE08924055FE28F2D49E941369240122D711F93801D47FC02885B6F82C6B40448AB13E965891C890880900AF883067EFAAD00B6F8E67AB6DA195B5D0499E8ED63A92B543A91C6D9E2BC8522F762EB4D3A993151476C169B22A92AAB0C40271D97F21AAC7BAB6CF1AEBBDF72567C645546FE18844049285051EAD74E4AE7D2C35A77D7797822F4F98E8A3B89A85E10177AFE9BBBE2F03FDA6A9462CA4EC094</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 = 5BB8E71133D532E21ECEC093F121C606EA2703CF4544B34DBFA5ED57D94186BCCBFA1E1E1A0F4681518D21568CBA2A4D5B0650525D662B8D0631D10B697C0BFE71E35E798B925904EDD66EEF684927DDB490CC98CC6ADCC76A75ACCC698EFBDA1BD415D4E9E14B4A570E56DB3964B1C1D86601A3EBBF6F55FC92D7313FD8F9F17EC84386D9D7E2BFA47A318ACC094B4E75D38AAB017423EC8EA025B23FE03B3F4793AFAECB810A35077996BA424368DE5F24CCE33BA8958E86BB56A5F49E0412C02E46F7A39E2C50442CC2A0E46A0F736D04F56175CF52570C8CC661FEEDA2F4EAC223D71B10C7E78C2C7D86B28252F72B29649A488A29E9B0D3ABA238AA2EF7</code></pre>
<pre><code>g_b = 08E0814CCDE4FE2783C33149BFFDD430C60F74AA250418313773D4212DFAE2737B4F7AA9D78BCBBC303B4218E190598B828B243B02D3F844CF0EF247837DB200DAF0A310103681803FD60DFEEE2BCD9E211CFB396C70CC5A4FAD1C15B8E1986BC3268CACF094EF02CC36D13806BAFED2A6E1E92923E8166761078F8048F0B05407CA73CA57FCF2C387C7D6A9D04F091615E6D316A4CA2327D5291676B9D337F245089DEF67A765794945C3D6A1D4340C0F75A456B6E3D2BE45AC0EB9AF7360270FB3332C6AA0C15F4515A2C7E7115F69659A3CC09309D717F94F95BF2A533F8C0F9A0F82197487D322CCF68B96C7D3815CCE8D3E57AE93AB4E8F46DF5483A082</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 1B 09 A0 0A D2 F0 2D 7E 1C 09 6E E6
0010 | 37 8E 25 53 2B 28 6E 1E 25 E4 74 61 D3 0B C4 2E
0020 | C9 8D 1F C7 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 5B B8 E7 11 33 D5 32 E2 1E CE C0 93 F1 21 C6 06
0040 | EA 27 03 CF 45 44 B3 4D BF A5 ED 57 D9 41 86 BC
0050 | CB FA 1E 1E 1A 0F 46 81 51 8D 21 56 8C BA 2A 4D
0060 | 5B 06 50 52 5D 66 2B 8D 06 31 D1 0B 69 7C 0B FE
0070 | 71 E3 5E 79 8B 92 59 04 ED D6 6E EF 68 49 27 DD
0080 | B4 90 CC 98 CC 6A DC C7 6A 75 AC CC 69 8E FB DA
0090 | 1B D4 15 D4 E9 E1 4B 4A 57 0E 56 DB 39 64 B1 C1
00A0 | D8 66 01 A3 EB BF 6F 55 FC 92 D7 31 3F D8 F9 F1
00B0 | 7E C8 43 86 D9 D7 E2 BF A4 7A 31 8A CC 09 4B 4E
00C0 | 75 D3 8A AB 01 74 23 EC 8E A0 25 B2 3F E0 3B 3F
00D0 | 47 93 AF AE CB 81 0A 35 07 79 96 BA 42 43 68 DE
00E0 | 5F 24 CC E3 3B A8 95 8E 86 BB 56 A5 F4 9E 04 12
00F0 | C0 2E 46 F7 A3 9E 2C 50 44 2C C2 A0 E4 6A 0F 73
0100 | 6D 04 F5 61 75 CF 52 57 0C 8C C6 61 FE ED A2 F4
0110 | EA C2 23 D7 1B 10 C7 E7 8C 2C 7D 86 B2 82 52 F7
0120 | 2B 29 64 9A 48 8A 29 E9 B0 D3 AB A2 38 AA 2E F7</code></pre>
<pre><code>0000 | 54 B6 43 66 D9 43 A3 CF F0 5D DE D8 4C BD B5 C9
0010 | 73 00 93 EE DB A2 9F C9 E2 11 06 92 56 1C 3C 74
0020 | 94 8F E1 DE 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 08 E0 81 4C CD E4 FE 27 83 C3 31 49 BF FD D4 30
0040 | C6 0F 74 AA 25 04 18 31 37 73 D4 21 2D FA E2 73
0050 | 7B 4F 7A A9 D7 8B CB BC 30 3B 42 18 E1 90 59 8B
0060 | 82 8B 24 3B 02 D3 F8 44 CF 0E F2 47 83 7D B2 00
0070 | DA F0 A3 10 10 36 81 80 3F D6 0D FE EE 2B CD 9E
0080 | 21 1C FB 39 6C 70 CC 5A 4F AD 1C 15 B8 E1 98 6B
0090 | C3 26 8C AC F0 94 EF 02 CC 36 D1 38 06 BA FE D2
00A0 | A6 E1 E9 29 23 E8 16 67 61 07 8F 80 48 F0 B0 54
00B0 | 07 CA 73 CA 57 FC F2 C3 87 C7 D6 A9 D0 4F 09 16
00C0 | 15 E6 D3 16 A4 CA 23 27 D5 29 16 76 B9 D3 37 F2
00D0 | 45 08 9D EF 67 A7 65 79 49 45 C3 D6 A1 D4 34 0C
00E0 | 0F 75 A4 56 B6 E3 D2 BE 45 AC 0E B9 AF 73 60 27
00F0 | 0F B3 33 2C 6A A0 C1 5F 45 15 A2 C7 E7 11 5F 69
0100 | 65 9A 3C C0 93 09 D7 17 F9 4F 95 BF 2A 53 3F 8C
0110 | 0F 9A 0F 82 19 74 87 D3 22 CC F6 8B 96 C7 D3 81
0120 | 5C CE 8D 3E 57 AE 93 AB 4E 8F 46 DF 54 83 A0 82</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 = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001005BB8E71133D532E21ECEC093</code> <code>F121C606EA2703CF4544B34DBFA5ED57</code> <code>D94186BCCBFA1E1E1A0F4681518D2156</code> <code>8CBA2A4D5B0650525D662B8D0631D10B</code> <code>697C0BFE71E35E798B925904EDD66EEF</code> <code>684927DDB490CC98CC6ADCC76A75ACCC</code> <code>698EFBDA1BD415D4E9E14B4A570E56DB</code> <code>3964B1C1D86601A3EBBF6F55FC92D731</code> <code>3FD8F9F17EC84386D9D7E2BFA47A318A</code> <code>CC094B4E75D38AAB017423EC8EA025B2</code> <code>3FE03B3F4793AFAECB810A35077996BA</code> <code>424368DE5F24CCE33BA8958E86BB56A5</code> <code>F49E0412C02E46F7A39E2C50442CC2A0</code> <code>E46A0F736D04F56175CF52570C8CC661</code> <code>FEEDA2F4EAC223D71B10C7E78C2C7D86</code> <code>B28252F72B29649A488A29E9B0D3ABA2</code><br> <code>38AA2EF7</code></td>
<td><code>FE00010008E0814CCDE4FE2783C33149</code> <code>BFFDD430C60F74AA250418313773D421</code> <code>2DFAE2737B4F7AA9D78BCBBC303B4218</code> <code>E190598B828B243B02D3F844CF0EF247</code> <code>837DB200DAF0A310103681803FD60DFE</code> <code>EE2BCD9E211CFB396C70CC5A4FAD1C15</code> <code>B8E1986BC3268CACF094EF02CC36D138</code> <code>06BAFED2A6E1E92923E8166761078F80</code> <code>48F0B05407CA73CA57FCF2C387C7D6A9</code> <code>D04F091615E6D316A4CA2327D5291676</code> <code>B9D337F245089DEF67A765794945C3D6</code> <code>A1D4340C0F75A456B6E3D2BE45AC0EB9</code> <code>AF7360270FB3332C6AA0C15F4515A2C7</code> <code>E7115F69659A3CC09309D717F94F95BF</code> <code>2A533F8C0F9A0F82197487D322CCF68B</code> <code>96C7D3815CCE8D3E57AE93AB4E8F46DF</code><br> <code>5483A082</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 = BA0D89B51B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC
<!-- 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 = 54B643661B09A00AD2F02D7E1C096EE6378E25532B286E1E25E47461D30BC42EC98D1FC70000000000000000FE0001005BB8E71133D532E21ECEC093F121C606EA2703CF4544B34DBFA5ED57D94186BCCBFA1E1E1A0F4681518D21568CBA2A4D5B0650525D662B8D0631D10B697C0BFE71E35E798B925904EDD66EEF684927DDB490CC98CC6ADCC76A75ACCC698EFBDA1BD415D4E9E14B4A570E56DB3964B1C1D86601A3EBBF6F55FC92D7313FD8F9F17EC84386D9D7E2BFA47A318ACC094B4E75D38AAB017423EC8EA025B23FE03B3F4793AFAECB810A35077996BA424368DE5F24CCE33BA8958E86BB56A5F49E0412C02E46F7A39E2C50442CC2A0E46A0F736D04F56175CF52570C8CC661FEEDA2F4EAC223D71B10C7E78C2C7D86B28252F72B29649A488A29E9B0D3ABA238AA2EF7
padding = C114FC8E454401EBFCD3AADA
tmp_aes_key = BF8FF67F42007055B61FAE3671FBA3AF607DF251913CF366DE0BA460421C070B
tmp_aes_iv = 2D68123E7ACC27D87F65F78C0E79A4322ADE8167C038837EE3CF90242D36E3CA</code></pre>
<pre><code>data = 54B64366D943A3CFF05DDED84CBDB5C9730093EEDBA29FC9E2110692561C3C74948FE1DE0000000000000000FE00010008E0814CCDE4FE2783C33149BFFDD430C60F74AA250418313773D4212DFAE2737B4F7AA9D78BCBBC303B4218E190598B828B243B02D3F844CF0EF247837DB200DAF0A310103681803FD60DFEEE2BCD9E211CFB396C70CC5A4FAD1C15B8E1986BC3268CACF094EF02CC36D13806BAFED2A6E1E92923E8166761078F8048F0B05407CA73CA57FCF2C387C7D6A9D04F091615E6D316A4CA2327D5291676B9D337F245089DEF67A765794945C3D6A1D4340C0F75A456B6E3D2BE45AC0EB9AF7360270FB3332C6AA0C15F4515A2C7E7115F69659A3CC09309D717F94F95BF2A533F8C0F9A0F82197487D322CCF68B96C7D3815CCE8D3E57AE93AB4E8F46DF5483A082
padding = 50F9935FE93EF34881CD7273
tmp_aes_key = 2FFA7A8B9C004E2428EDF3C965734A2180488F7E392040057C4EB60FE2805C61
tmp_aes_iv = 038D0785056EC5DBBCC8FB4CE5CC75F6DF508A3F20C99FD90C106AAF4666D8D8</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 = A2F0334D96B6EB07B0D1A07AEFD51165EC2EBE8FDA475F17046A2105C68645E86371887BEA1C18BFE96A55866876A70591E66279724CF9CE6FDE5CC7CD01699067D9876055A147517D0CC9B06CC44540D888A978D9264074BC0A5BE53B04516A997851EBFEB6B5ECD5B0E2D1CCB0335E676D55BD41BA7F9FE32C4CE61379132AB8F947815B5C55DEF0EECB24C9A1B0A6D18F0D908FF785EDB3E3FF45C29EA0D5F5CFD4EE13A0B313B7EA578384CD61E09B188B90E126713753693D350E6CA457C346B245B2A255002D8B2C15F910E9BCB914404CB465751E04D24D13B37BA881949F91EC0FE5CB4CC4E5FF47F7ECE36CB31C02414A9392BA4CBC80BEC449CC279DE6F0FBC72E1B3B2F79D607C08F33808401EFC300B75EBAFB004343B15ABA06D3A95740E217C6707EE6F17749970A86803C310A2A6BB2F793FDDC972783351E94FC061F9FBD357C5D55BEAEDFCD236F</code></pre>
<pre><code>encrypted_data = 15C289970C2C7C0FC0B6569A788D5061C96891158EBFDE11CE28A0A90DAD574D113EBBEC68BBCF549EC8E9FBA992238903D1F3F57338491AEEBC98C0C8902863F89FD96A83F551BC54D2985E79BE7232415E516D5DC7368FFA5BC882ABDA8610109BCDACCC0674BA519B11DA151E7C23823B3C5B55ECD3EE5E8FB53B4E3624F56991C8F66F52BB0420B356AE65EA8B17A33C98DE2DA9B272B766CEDD559FBAB202873F5750E4F2498FB120B1A4E95D6460FD7A475A74EA2843133F8F27D959A5947352D25437A44EF396D31CCA7B4BA5CF1977743F7A636A80A4CF4D8047D2335B2FC41CDA4B856FA020C77A53C3FC6E392CDE6976E2879966E27C21D338493568D300CAEAC3024A879388ADFA6EE8B0E090FC2A19C1E609B7584BC9062EA2E8AC386C067AE33DDE568601067B33A6D776D2E6E7C7A1E12FC2D9FD5198337EBC17C2B6EC27A672E1E18D13BDE5D4D654</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 88 C6 0D 00 70 1D A9 66
0010 | 78 01 00 00 1F 5F 04 F5 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53 2B 28 6E 1E 25 E4 74 61
0030 | D3 0B C4 2E C9 8D 1F C7 FE 50 01 00 A2 F0 33 4D
0040 | 96 B6 EB 07 B0 D1 A0 7A EF D5 11 65 EC 2E BE 8F
0050 | DA 47 5F 17 04 6A 21 05 C6 86 45 E8 63 71 88 7B
0060 | EA 1C 18 BF E9 6A 55 86 68 76 A7 05 91 E6 62 79
0070 | 72 4C F9 CE 6F DE 5C C7 CD 01 69 90 67 D9 87 60
0080 | 55 A1 47 51 7D 0C C9 B0 6C C4 45 40 D8 88 A9 78
0090 | D9 26 40 74 BC 0A 5B E5 3B 04 51 6A 99 78 51 EB
00A0 | FE B6 B5 EC D5 B0 E2 D1 CC B0 33 5E 67 6D 55 BD
00B0 | 41 BA 7F 9F E3 2C 4C E6 13 79 13 2A B8 F9 47 81
00C0 | 5B 5C 55 DE F0 EE CB 24 C9 A1 B0 A6 D1 8F 0D 90
00D0 | 8F F7 85 ED B3 E3 FF 45 C2 9E A0 D5 F5 CF D4 EE
00E0 | 13 A0 B3 13 B7 EA 57 83 84 CD 61 E0 9B 18 8B 90
00F0 | E1 26 71 37 53 69 3D 35 0E 6C A4 57 C3 46 B2 45
0100 | B2 A2 55 00 2D 8B 2C 15 F9 10 E9 BC B9 14 40 4C
0110 | B4 65 75 1E 04 D2 4D 13 B3 7B A8 81 94 9F 91 EC
0120 | 0F E5 CB 4C C4 E5 FF 47 F7 EC E3 6C B3 1C 02 41
0130 | 4A 93 92 BA 4C BC 80 BE C4 49 CC 27 9D E6 F0 FB
0140 | C7 2E 1B 3B 2F 79 D6 07 C0 8F 33 80 84 01 EF C3
0150 | 00 B7 5E BA FB 00 43 43 B1 5A BA 06 D3 A9 57 40
0160 | E2 17 C6 70 7E E6 F1 77 49 97 0A 86 80 3C 31 0A
0170 | 2A 6B B2 F7 93 FD DC 97 27 83 35 1E 94 FC 06 1F
0180 | 9F BD 35 7C 5D 55 BE AE DF CD 23 6F</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 8C 27 0D 00 F2 20 A9 66
0010 | 78 01 00 00 1F 5F 04 F5 D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE DB A2 9F C9 E2 11 06 92
0030 | 56 1C 3C 74 94 8F E1 DE FE 50 01 00 15 C2 89 97
0040 | 0C 2C 7C 0F C0 B6 56 9A 78 8D 50 61 C9 68 91 15
0050 | 8E BF DE 11 CE 28 A0 A9 0D AD 57 4D 11 3E BB EC
0060 | 68 BB CF 54 9E C8 E9 FB A9 92 23 89 03 D1 F3 F5
0070 | 73 38 49 1A EE BC 98 C0 C8 90 28 63 F8 9F D9 6A
0080 | 83 F5 51 BC 54 D2 98 5E 79 BE 72 32 41 5E 51 6D
0090 | 5D C7 36 8F FA 5B C8 82 AB DA 86 10 10 9B CD AC
00A0 | CC 06 74 BA 51 9B 11 DA 15 1E 7C 23 82 3B 3C 5B
00B0 | 55 EC D3 EE 5E 8F B5 3B 4E 36 24 F5 69 91 C8 F6
00C0 | 6F 52 BB 04 20 B3 56 AE 65 EA 8B 17 A3 3C 98 DE
00D0 | 2D A9 B2 72 B7 66 CE DD 55 9F BA B2 02 87 3F 57
00E0 | 50 E4 F2 49 8F B1 20 B1 A4 E9 5D 64 60 FD 7A 47
00F0 | 5A 74 EA 28 43 13 3F 8F 27 D9 59 A5 94 73 52 D2
0100 | 54 37 A4 4E F3 96 D3 1C CA 7B 4B A5 CF 19 77 74
0110 | 3F 7A 63 6A 80 A4 CF 4D 80 47 D2 33 5B 2F C4 1C
0120 | DA 4B 85 6F A0 20 C7 7A 53 C3 FC 6E 39 2C DE 69
0130 | 76 E2 87 99 66 E2 7C 21 D3 38 49 35 68 D3 00 CA
0140 | EA C3 02 4A 87 93 88 AD FA 6E E8 B0 E0 90 FC 2A
0150 | 19 C1 E6 09 B7 58 4B C9 06 2E A2 E8 AC 38 6C 06
0160 | 7A E3 3D DE 56 86 01 06 7B 33 A6 D7 76 D2 E6 E7
0170 | C7 A1 E1 2F C2 D9 FD 51 98 33 7E BC 17 C2 B6 EC
0180 | 27 A6 72 E1 E1 8D 13 BD E5 D4 D6 54</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>88C60D00701DA966</code></td>
<td><code>8C270D00F220A966</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>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100A2F0334D96B6EB07B0D1A07A</code> <code>EFD51165EC2EBE8FDA475F17046A2105</code> <code>C68645E86371887BEA1C18BFE96A5586</code> <code>6876A70591E66279724CF9CE6FDE5CC7</code> <code>CD01699067D9876055A147517D0CC9B0</code> <code>6CC44540D888A978D9264074BC0A5BE5</code> <code>3B04516A997851EBFEB6B5ECD5B0E2D1</code> <code>CCB0335E676D55BD41BA7F9FE32C4CE6</code> <code>1379132AB8F947815B5C55DEF0EECB24</code> <code>C9A1B0A6D18F0D908FF785EDB3E3FF45</code> <code>C29EA0D5F5CFD4EE13A0B313B7EA5783</code> <code>84CD61E09B188B90E126713753693D35</code> <code>0E6CA457C346B245B2A255002D8B2C15</code> <code>F910E9BCB914404CB465751E04D24D13</code> <code>B37BA881949F91EC0FE5CB4CC4E5FF47</code> <code>F7ECE36CB31C02414A9392BA4CBC80BE</code> <code>C449CC279DE6F0FBC72E1B3B2F79D607</code> <code>C08F33808401EFC300B75EBAFB004343</code> <code>B15ABA06D3A95740E217C6707EE6F177</code> <code>49970A86803C310A2A6BB2F793FDDC97</code> <code>2783351E94FC061F9FBD357C5D55BEAE</code><br> <code>DFCD236F</code></td>
<td><code>FE50010015C289970C2C7C0FC0B6569A</code> <code>788D5061C96891158EBFDE11CE28A0A9</code> <code>0DAD574D113EBBEC68BBCF549EC8E9FB</code> <code>A992238903D1F3F57338491AEEBC98C0</code> <code>C8902863F89FD96A83F551BC54D2985E</code> <code>79BE7232415E516D5DC7368FFA5BC882</code> <code>ABDA8610109BCDACCC0674BA519B11DA</code> <code>151E7C23823B3C5B55ECD3EE5E8FB53B</code> <code>4E3624F56991C8F66F52BB0420B356AE</code> <code>65EA8B17A33C98DE2DA9B272B766CEDD</code> <code>559FBAB202873F5750E4F2498FB120B1</code> <code>A4E95D6460FD7A475A74EA2843133F8F</code> <code>27D959A5947352D25437A44EF396D31C</code> <code>CA7B4BA5CF1977743F7A636A80A4CF4D</code> <code>8047D2335B2FC41CDA4B856FA020C77A</code> <code>53C3FC6E392CDE6976E2879966E27C21</code> <code>D338493568D300CAEAC3024A879388AD</code> <code>FA6EE8B0E090FC2A19C1E609B7584BC9</code> <code>062EA2E8AC386C067AE33DDE56860106</code> <code>7B33A6D776D2E6E7C7A1E12FC2D9FD51</code> <code>98337EBC17C2B6EC27A672E1E18D13BD</code><br> <code>E5D4D654</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 = 16E17B2AA4A9AAB6B77E454D361E99A2DC0AC6DFFBD620DA1997D8D651F7C18297701846F1FD26601E99F62E5A4ED9996FA00BDBDB5D6EB39DDBBEA44F234B9A00D019775DEDB3782CF5D1A89E5543DAC0F7777AD1D5BD63ADA28D664BF4CECA35A671A9856FEC06D1641A3F9A0BA8B0D40B6644A5E9C9168D91DE902AE52D035EA3732BF25154B7E5BB08F658C96A0593A52CCEBB80C10CD2981E2303F1B29A9600688BB7D12E0BCAE3E1641CD6760DB5D3285FF5B4324A9E52854409A68E7841156A2410E951431D24C52F4D38F51ABF9BAF58A739AAB1657846AB859584C528A5349B103D35B99AC21550DC4A78AAAE071EEFEF77559A0867053905DF040D</code></pre>
<pre><code>auth_key = B49B8DB57B5F89BBFF49A1396D27B4093716EAECC0969D0ABF7F8B430A10DE773CDFD9F2D3B80DF78B52A0750A25A7CF1C35EED3D93BEBC6327F716B9918AA07F3CD5A135AD95CF280783362AEC18A85CF537BCE4A4AE6869D5422DC0EEDDE854778125D7FFAA77296D25F467E987E72E84F1F14CFA13241FB86D89660BB23E6657FE85216F1012BEBE153ED321A3549863204F5059D5E3393C37E76C5AA602A6A7585E42C92E474D80A51CA5C0E89DB7F1C4CEC933C0294451B9EF962BB07F59128D3F6BC718CA4BF76E96D5A0C814756A3249B546A104619C63B6D7D5730DF4F7DF6EE1143B6B29ED0ABFA26CE0FDA5418852988E968864B903B7C91F56904</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 3C DB 7D 71 1D A9 66
0010 | 58 00 00 00 34 F7 CB 3B 1B 09 A0 0A D2 F0 2D 7E
0020 | 1C 09 6E E6 37 8E 25 53 2B 28 6E 1E 25 E4 74 61
0030 | D3 0B C4 2E C9 8D 1F C7 C2 D0 77 13 D0 60 18 08
0040 | 8E DA 4B 41 66 B7 1C 8C</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C 06 FF F3 20 A9 66
0010 | A4 00 00 00 34 F7 CB 3B D9 43 A3 CF F0 5D DE D8
0020 | 4C BD B5 C9 73 00 93 EE DB A2 9F C9 E2 11 06 92
0030 | 56 1C 3C 74 94 8F E1 DE F5 FD F3 E3 EA 95 15 FD
0040 | 71 F1 06 28 13 46 38 05</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>013CDB7D711DA966</code></td>
<td><code>019C06FFF320A966</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>58000000</code> (88 in decimal)</td>
<td><code>A4000000</code> (164 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>1B09A00AD2F02D7E1C096EE6378E2553</code></td>
<td><code>D943A3CFF05DDED84CBDB5C9730093EE</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>2B286E1E25E47461D30BC42EC98D1FC7</code></td>
<td><code>DBA29FC9E2110692561C3C74948FE1DE</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>C2D07713D06018088EDA4B4166B71C8C</code></td>
<td><code>F5FDF3E3EA9515FD71F1062813463805</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>