Update content of files

This commit is contained in:
GitHub Action 2024-08-01 16:36:08 +00:00
parent 7eee45aa08
commit 81e96dc49b
3 changed files with 212 additions and 207 deletions

View file

@ -121,7 +121,7 @@
<tr>
<td>400</td>
<td>BUSINESS_RECIPIENTS_EMPTY</td>
<td> </td>
<td>You didn't set any flag in inputBusinessBotRecipients, thus the bot cannot work with <em>any</em> peer.</td>
</tr>
<tr>
<td>403</td>

View file

@ -195,6 +195,11 @@
</tr>
<tr>
<td>400</td>
<td>BUTTON_POS_INVALID</td>
<td>The position of one of the keyboard buttons is invalid (i.e. a Game or Pay button not in the first position, and so on...).</td>
</tr>
<tr>
<td>400</td>
<td>BUTTON_TYPE_INVALID</td>
<td>The type of one or more of the buttons you provided is invalid.</td>
</tr>

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 E4 2A 05 00 6A 21 A9 66
0010 | 14 00 00 00 F1 8E 7E BE 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B0 7C 0C 00 01 B9 AB 66
0010 | 14 00 00 00 F1 8E 7E BE A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00</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>E42A05006A21A966</code></td>
<td><code>B07C0C0001B9AB66</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>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</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 10 B0 60 6A 21 A9 66
0010 | A0 00 00 00 63 24 16 05 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9 BB EB 55 8F 3B 71 35 7F
0030 | 86 21 B7 12 51 B2 70 D2 08 23 AB 87 90 54 2E F8
0040 | 51 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 60 33 47 01 B9 AB 66
0010 | 6C 00 00 00 63 24 16 05 A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3
0030 | 3B 8E D0 94 91 64 C4 44 08 20 B3 A6 52 7B D9 8C
0040 | 5F 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>0110B0606A21A966</code></td>
<td><code>0160334701B9AB66</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>A0000000</code> (160 in decimal)</td>
<td><code>6C000000</code> (108 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0823AB8790542EF851000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2570297066302404689</td>
<td><code>0820B3A6527BD98C5F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2356409903240285279</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 = 2570297066302404689</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2570297066302404689 = 1549256099 * 1659052411</code></p>
<pre><code>p = 1549256099
q = 1659052411</code></pre>
<pre><code>pq = 2356409903240285279</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2356409903240285279 = 1465403767 * 1608027737</code></p>
<pre><code>p = 1465403767
q = 1608027737</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 AB 87 90 54 2E F8 51 00 00 00
0010 | 04 5C 57 C5 A3 00 00 00 04 62 E3 21 7B 00 00 00
0020 | 12 C3 06 4D DC AA 11 9F 34 EB 28 26 C7 82 24 D9
0030 | BB EB 55 8F 3B 71 35 7F 86 21 B7 12 51 B2 70 D2
0040 | C7 C0 98 2D 64 05 1B B3 4A 9E 71 F3 AD 2E E5 B5
0050 | E0 9F AB B7 7D 2A 41 FF FB B6 D3 58 27 85 00 78
<pre><code>0000 | 95 5F F5 A9 08 20 B3 A6 52 7B D9 8C 5F 00 00 00
0010 | 04 57 58 49 77 00 00 00 04 5F D8 8E 59 00 00 00
0020 | A7 DE B1 F0 60 93 B2 7E 6E 98 40 24 9B D3 CC 00
0030 | 79 6D 6C 2F 93 79 BD C3 3B 8E D0 94 91 64 C4 44
0040 | 25 02 2B C0 F4 48 36 6E 6A 81 6A 00 37 54 20 C8
0050 | BF 1E 35 EA E6 45 26 9F 0E 96 02 7C 07 CD F5 00
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 = 1659052411</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0823AB8790542EF851000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2570297066302404689</td>
<td><code>0820B3A6527BD98C5F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2356409903240285279</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>045C57C5A3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1549256099</td>
<td><code>0457584977000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1465403767</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>0462E3217B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1659052411</td>
<td><code>045FD88E59000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1608027737</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>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>C7C0982D64051BB34A9E71F3AD2EE5B5</code> <code>E09FABB77D2A41FFFBB6D35827850078</code></td>
<td><code>25022BC0F448366E6A816A00375420C8</code> <code>BF1E35EAE645269F0E96027C07CDF500</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1659052411</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 = 955FF5A90823AB8790542EF851000000045C57C5A30000000462E3217B00000012C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D2C7C0982D64051BB34A9E71F3AD2EE5B5E09FABB77D2A41FFFBB6D3582785007802000000
random_padding_bytes = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D218814070360CB514E5C6B84618331C84DE0205961470A7C6995C672BC8D5F38B2C6BEB22CB094A7F02ED3A137F6ED657F8465B346A42EC333896B61150C8C4874A3</code></pre>
<pre><code>data = 955FF5A90820B3A6527BD98C5F0000000457584977000000045FD88E59000000A7DEB1F06093B27E6E9840249BD3CC00796D6C2F9379BDC33B8ED0949164C44425022BC0F448366E6A816A00375420C8BF1E35EAE645269F0E96027C07CDF50002000000
random_padding_bytes = 370349728C611B3B5FBD135DA242B23A91DB12514EB3D3B0A44C9BF7B71D69CB2F4CA827B64399721E88D8C215AEE2EF3786FA19DF9D380344E1CF81A76B1D0A582D3856938A1D5A3536B7A270A7663FD32B3E568FDA37199612D21C</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 = 2BB791D49E5670EBE5789CF1F352DC19444359CFFFB31B26C2123C12CA3AE4C7E3E9992ACAFB38B3D869D3C219105BDF83278D42E0D32B3748E8046983F6059FEE588A950E7A9DC5264CE58A354536768013E87EA92F41A8EAF505F17F29149D6484509BEFB74407EFBE9412F7B8CB337AC916ACD6AC79E0BD719E1D15D4939440F6DC6C0C391BD66ED9E4C61F346CAB66248D1A07E67874700E5FCAA31D9DF8674B32D012FE6DF23EBD7EC57AEED0F74238812536B87D92DD4AB7613309DCBD642157D1D5E0D2E2A34D7CA3D8873804F8EDE1D800E0205231288552630D94E00D17436B94370ABE89995A3713101AE649A4C393A888F5B9CBACF0EB8917DB4D</code></pre>
<pre><code>encrypted_data = 6D6E8A696EF41351D3F75C502BDA372FD264C46B62F6D23B5E56DBCF25FB528D78F0E0A17E4700CA36D9726D7A067B1DD5A6E22B56664B2ECD4F14436421F7F0ABBECB74139CB14FED6105D377714602EFEF632641C78370B917B492EBD5DA7E8F5A0CD8811408ACF0C021B8530DA4E3AABD332EE111BB83384018150DCD76640D6E4C89A316665020AD69B48590F4AAC24425DE2E6678E6DD2246FFCB483B9A30E2ED47BCBAC4E47859D76E8BCE15AE471EB53FC313C7D5BCAD77F013F685D3A5C932D873A268050308D80F4FF6A2AB39CC9B10CB399A4CA9ED6492B868B3475CBB362AAFC6655DE707724C183EC84F057453E38CC5FBE50BFE694A4E1B39B3</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 E8 2A 05 00 6A 21 A9 66
0010 | 40 01 00 00 BE E4 12 D7 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9 BB EB 55 8F 3B 71 35 7F
0030 | 86 21 B7 12 51 B2 70 D2 04 5C 57 C5 A3 00 00 00
0040 | 04 62 E3 21 7B 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 2B B7 91 D4 9E 56 70 EB E5 78 9C F1
0060 | F3 52 DC 19 44 43 59 CF FF B3 1B 26 C2 12 3C 12
0070 | CA 3A E4 C7 E3 E9 99 2A CA FB 38 B3 D8 69 D3 C2
0080 | 19 10 5B DF 83 27 8D 42 E0 D3 2B 37 48 E8 04 69
0090 | 83 F6 05 9F EE 58 8A 95 0E 7A 9D C5 26 4C E5 8A
00A0 | 35 45 36 76 80 13 E8 7E A9 2F 41 A8 EA F5 05 F1
00B0 | 7F 29 14 9D 64 84 50 9B EF B7 44 07 EF BE 94 12
00C0 | F7 B8 CB 33 7A C9 16 AC D6 AC 79 E0 BD 71 9E 1D
00D0 | 15 D4 93 94 40 F6 DC 6C 0C 39 1B D6 6E D9 E4 C6
00E0 | 1F 34 6C AB 66 24 8D 1A 07 E6 78 74 70 0E 5F CA
00F0 | A3 1D 9D F8 67 4B 32 D0 12 FE 6D F2 3E BD 7E C5
0100 | 7A EE D0 F7 42 38 81 25 36 B8 7D 92 DD 4A B7 61
0110 | 33 09 DC BD 64 21 57 D1 D5 E0 D2 E2 A3 4D 7C A3
0120 | D8 87 38 04 F8 ED E1 D8 00 E0 20 52 31 28 85 52
0130 | 63 0D 94 E0 0D 17 43 6B 94 37 0A BE 89 99 5A 37
0140 | 13 10 1A E6 49 A4 C3 93 A8 88 F5 B9 CB AC F0 EB
0150 | 89 17 DB 4D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B4 7C 0C 00 01 B9 AB 66
0010 | 40 01 00 00 BE E4 12 D7 A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3
0030 | 3B 8E D0 94 91 64 C4 44 04 57 58 49 77 00 00 00
0040 | 04 5F D8 8E 59 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 6D 6E 8A 69 6E F4 13 51 D3 F7 5C 50
0060 | 2B DA 37 2F D2 64 C4 6B 62 F6 D2 3B 5E 56 DB CF
0070 | 25 FB 52 8D 78 F0 E0 A1 7E 47 00 CA 36 D9 72 6D
0080 | 7A 06 7B 1D D5 A6 E2 2B 56 66 4B 2E CD 4F 14 43
0090 | 64 21 F7 F0 AB BE CB 74 13 9C B1 4F ED 61 05 D3
00A0 | 77 71 46 02 EF EF 63 26 41 C7 83 70 B9 17 B4 92
00B0 | EB D5 DA 7E 8F 5A 0C D8 81 14 08 AC F0 C0 21 B8
00C0 | 53 0D A4 E3 AA BD 33 2E E1 11 BB 83 38 40 18 15
00D0 | 0D CD 76 64 0D 6E 4C 89 A3 16 66 50 20 AD 69 B4
00E0 | 85 90 F4 AA C2 44 25 DE 2E 66 78 E6 DD 22 46 FF
00F0 | CB 48 3B 9A 30 E2 ED 47 BC BA C4 E4 78 59 D7 6E
0100 | 8B CE 15 AE 47 1E B5 3F C3 13 C7 D5 BC AD 77 F0
0110 | 13 F6 85 D3 A5 C9 32 D8 73 A2 68 05 03 08 D8 0F
0120 | 4F F6 A2 AB 39 CC 9B 10 CB 39 9A 4C A9 ED 64 92
0130 | B8 68 B3 47 5C BB 36 2A AF C6 65 5D E7 07 72 4C
0140 | 18 3E C8 4F 05 74 53 E3 8C C5 FB E5 0B FE 69 4A
0150 | 4E 1B 39 B3</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 = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>E82A05006A21A966</code></td>
<td><code>B47C0C0001B9AB66</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 = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045C57C5A3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1549256099</td>
<td><code>0457584977000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1465403767</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>0462E3217B000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1659052411</td>
<td><code>045FD88E59000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1608027737</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 = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001002BB791D49E5670EBE5789CF1</code> <code>F352DC19444359CFFFB31B26C2123C12</code> <code>CA3AE4C7E3E9992ACAFB38B3D869D3C2</code> <code>19105BDF83278D42E0D32B3748E80469</code> <code>83F6059FEE588A950E7A9DC5264CE58A</code> <code>354536768013E87EA92F41A8EAF505F1</code> <code>7F29149D6484509BEFB74407EFBE9412</code> <code>F7B8CB337AC916ACD6AC79E0BD719E1D</code> <code>15D4939440F6DC6C0C391BD66ED9E4C6</code> <code>1F346CAB66248D1A07E67874700E5FCA</code> <code>A31D9DF8674B32D012FE6DF23EBD7EC5</code> <code>7AEED0F74238812536B87D92DD4AB761</code> <code>3309DCBD642157D1D5E0D2E2A34D7CA3</code> <code>D8873804F8EDE1D800E0205231288552</code> <code>630D94E00D17436B94370ABE89995A37</code> <code>13101AE649A4C393A888F5B9CBACF0EB</code><br> <code>8917DB4D</code></td>
<td><code>FE0001006D6E8A696EF41351D3F75C50</code> <code>2BDA372FD264C46B62F6D23B5E56DBCF</code> <code>25FB528D78F0E0A17E4700CA36D9726D</code> <code>7A067B1DD5A6E22B56664B2ECD4F1443</code> <code>6421F7F0ABBECB74139CB14FED6105D3</code> <code>77714602EFEF632641C78370B917B492</code> <code>EBD5DA7E8F5A0CD8811408ACF0C021B8</code> <code>530DA4E3AABD332EE111BB8338401815</code> <code>0DCD76640D6E4C89A316665020AD69B4</code> <code>8590F4AAC24425DE2E6678E6DD2246FF</code> <code>CB483B9A30E2ED47BCBAC4E47859D76E</code> <code>8BCE15AE471EB53FC313C7D5BCAD77F0</code> <code>13F685D3A5C932D873A268050308D80F</code> <code>4FF6A2AB39CC9B10CB399A4CA9ED6492</code> <code>B868B3475CBB362AAFC6655DE707724C</code> <code>183EC84F057453E38CC5FBE50BFE694A</code><br> <code>4E1B39B3</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A0 3A 19 6B 21 A9 66
0010 | C0 02 00 00 5C 07 E8 D0 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9 BB EB 55 8F 3B 71 35 7F
0030 | 86 21 B7 12 51 B2 70 D2 FE 50 02 00 D2 99 17 ED
0040 | 5F F3 F8 F5 1E 7F 8A 47 C7 B2 5F B7 AA E6 9F 7B
0050 | E1 98 FB D3 FC 7A 6A 87 98 30 CE B4 2C 24 F0 39
0060 | C4 B6 96 CC 07 28 A1 8E 28 43 F7 E1 F7 F9 F8 6D
0070 | 46 49 9A BE 9F 05 0B F1 2D EC F4 CB 6E 07 5E CB
0080 | 6F 28 BC 76 9E 9E 23 D3 37 20 FB 3A EF 17 14 36
0090 | 52 1B 08 81 47 6B 91 F8 75 F8 BF D4 03 DE F5 B4
00A0 | 67 B9 BE E7 DA A4 F9 72 21 4C 34 BC 76 75 63 B5
00B0 | 37 9F 1D D4 97 0E 95 EC DA 9D 46 A9 1D CB 60 CE
00C0 | 26 31 97 88 1A F6 51 31 EF 01 35 0F 3E D2 C7 E3
00D0 | 16 BC 36 EE 00 7E CE 88 CF DD A7 DF C9 DA 94 B8
00E0 | 58 C7 63 5D 9A C3 F7 71 A5 9B DD D3 92 55 EB 72
00F0 | 3B 27 BA 90 75 49 0C E0 7F 0C D6 C7 34 82 F9 E1
0100 | C8 2C 9F 33 FA 33 4F 78 C7 71 91 D1 E8 2E BC 6A
0110 | 7A 1D C8 8C 9C C2 71 91 C0 B0 7A 6E 15 08 15 A5
0120 | 3E 7F 74 62 BF E4 D4 41 B6 3E AA EF D9 5D 3A D5
0130 | DE 0A BA E9 0C 6F DB CF B9 C5 6C 73 46 0C 97 46
0140 | D8 58 45 A3 11 41 F6 09 E1 64 6B C9 76 B2 C4 93
0150 | E7 E1 5E B5 77 40 71 70 2F 1C 6F D2 FB 2C 78 F7
0160 | 61 F1 2C F9 D5 5B F2 3E 6C A2 67 27 40 52 05 B3
0170 | 5E EF 50 64 7B 61 63 3F 03 91 64 F0 D0 6C 0A DD
0180 | 7B 88 47 E0 07 7B AA 2E 26 00 33 F2 20 19 3F EB
0190 | 93 F6 F0 30 13 E5 99 3F 15 F9 07 EC 0B AA 70 21
01A0 | E1 4E 7E 7D AF 3D 34 30 79 30 36 76 7D CD FE DB
01B0 | AC A4 27 0D D4 6D D4 5E 46 F8 6F D7 6D 35 C7 05
01C0 | F7 B9 3D 91 5B DE 0D 80 39 C3 75 59 71 A0 86 5E
01D0 | 27 E5 E7 36 72 D9 B7 28 4E 3B 8E E6 01 FA 35 81
01E0 | 7E F5 B3 64 52 46 4B 3C F4 85 86 2B F3 B5 8C E2
01F0 | DE 2D D3 E1 81 7E 40 C2 76 CA 5A 3A 11 0E 1A E3
0200 | 0A A2 85 D2 EF 5E F3 8C 3E 39 7F 38 5E 7B 2E A7
0210 | 5C 4B 62 42 2E E5 0E CF 87 23 EB 88 27 3A E9 12
0220 | 5B 70 E5 AB 1D 43 16 92 C9 2C 91 DD 44 EB 25 2B
0230 | ED 0E A3 22 22 C8 71 22 81 CA CF 2D F5 63 52 66
0240 | FD 58 3E 0C 12 27 64 DB CA AF 43 9E D5 35 22 C9
0250 | B8 25 3A 8C 12 A8 D9 35 EA 77 1D 5F A6 DB 42 6D
0260 | A6 AE 60 29 A2 B0 0A E4 F9 22 ED C7 5A D3 0E C6
0270 | 47 F4 AF BA 2E 69 56 EC 8B E8 30 08 04 74 E1 14
0280 | C2 7D 6A D5 22 49 DF 75 F9 55 37 CD</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 24 B7 ED 01 B9 AB 66
0010 | E4 02 00 00 5C 07 E8 D0 A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3
0030 | 3B 8E D0 94 91 64 C4 44 FE 50 02 00 5F A3 62 58
0040 | 28 AD 50 78 AF 38 E5 72 0F 5B 58 76 BB 5B 48 7F
0050 | 5D C9 0E AA 2F 3A 4E DF 98 05 05 B7 CD C6 7C 47
0060 | 28 B6 C0 DB 2A 01 42 7E 15 E4 21 88 10 E2 85 19
0070 | F7 F5 CC 45 AA 78 45 2E B8 EC 1D 9A 79 6A 1B 8A
0080 | F1 1E 40 1B 50 79 B9 2C 91 74 26 06 D3 AE 7F 12
0090 | 1C A1 12 8B 1D A8 17 CD F0 3C 39 F4 68 12 06 C3
00A0 | 93 16 59 D0 60 AA E9 11 A3 B9 88 20 6C D1 B6 42
00B0 | AA A9 9D 1F 91 FD 6B DE EE 83 D2 D7 99 1E 1B 19
00C0 | 04 A6 EE 41 46 04 28 1E 43 02 AF C7 81 9E 74 14
00D0 | EE FF 9E C8 CD D4 29 31 07 34 5D A1 35 10 EE 8B
00E0 | F7 62 35 0F 2B 9B 73 46 90 89 4A A0 8E 3B F7 14
00F0 | 92 77 F9 1D CE 97 D8 B8 4F 1C 68 A4 7B B7 10 40
0100 | 77 E4 B2 B0 44 A0 EF 44 E8 F0 CF 89 CF AA F6 49
0110 | 0C F7 C5 16 50 41 27 43 D0 34 41 FA 15 EE 46 94
0120 | 96 74 74 79 F0 B2 46 CB EE 64 F3 4F 17 8C FA 91
0130 | 50 68 B0 A8 1F BB F1 3B CF 60 6B 08 28 F1 CC CA
0140 | 48 A4 1E 5E 3F FE F8 F1 70 33 F1 3B D1 D3 C2 50
0150 | 26 6C 75 0E DA DF A7 5D DF E4 15 22 67 0C F5 DE
0160 | CD 46 76 6E 99 FC 10 6D 2A 17 1B C3 DA 2A 82 B2
0170 | 4E 1B C4 5D 97 5C 5E EE FE EE 52 33 FD C6 CB 33
0180 | D1 3D DE 33 31 BE 7B AD 6D BB E1 1C 60 38 9C E7
0190 | 76 B2 75 DD 09 89 91 B1 EA EB 7E C7 E2 CB 39 47
01A0 | EB 54 B1 9E 82 0D 78 E0 B6 21 BE A4 61 6C 8A 24
01B0 | F4 7C FA 2F 8F 05 AD 92 E0 73 69 10 7C 80 6D 3B
01C0 | 40 C6 A6 03 1D EC 11 67 BF 16 79 E2 C4 34 85 25
01D0 | E9 6B 88 CC 43 19 AF 4D ED 61 A0 52 E4 2C 3D FE
01E0 | 47 C9 94 6A 8A 37 86 2F 1D B3 CB 0E AE 2F EF 06
01F0 | A1 EF C5 6E 67 5D 27 17 C6 00 02 47 EB 0E 0F 3A
0200 | EF 5F 18 76 66 8D C7 78 3A 63 45 B5 D4 0B 31 0F
0210 | 51 A6 B6 B8 B2 29 BA 7B 02 E3 87 66 CA AC 94 DB
0220 | 50 B9 4C 35 43 53 B7 5C C6 E8 68 37 A5 D6 C2 1A
0230 | 94 36 02 DA 08 7D CF 1E B0 6E 7D A2 B3 E8 B7 8D
0240 | CB 09 3B 9F A4 8E 27 22 C7 A0 45 49 D5 DE 8E F6
0250 | B4 19 FB 58 64 08 73 B3 0D 56 B2 B8 2F F6 59 2A
0260 | A5 57 42 C2 FB 52 FB 58 A7 07 40 87 2D F8 5C FD
0270 | A0 23 D1 65 CD D7 D3 86 24 49 93 EE ED 77 3F 37
0280 | E8 22 3E 8D E0 BA AE 61 5A FB DD F9</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 = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01A03A196B21A966</code></td>
<td><code>0124B7ED01B9AB66</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>C0020000</code> (704 in decimal)</td>
<td><code>E4020000</code> (740 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200D29917ED5FF3F8F51E7F8A47</code> <code>C7B25FB7AAE69F7BE198FBD3FC7A6A87</code> <code>9830CEB42C24F039C4B696CC0728A18E</code> <code>2843F7E1F7F9F86D46499ABE9F050BF1</code> <code>2DECF4CB6E075ECB6F28BC769E9E23D3</code> <code>3720FB3AEF171436521B0881476B91F8</code> <code>75F8BFD403DEF5B467B9BEE7DAA4F972</code> <code>214C34BC767563B5379F1DD4970E95EC</code> <code>DA9D46A91DCB60CE263197881AF65131</code> <code>EF01350F3ED2C7E316BC36EE007ECE88</code> <code>CFDDA7DFC9DA94B858C7635D9AC3F771</code> <code>A59BDDD39255EB723B27BA9075490CE0</code> <code>7F0CD6C73482F9E1C82C9F33FA334F78</code> <code>C77191D1E82EBC6A7A1DC88C9CC27191</code> <code>C0B07A6E150815A53E7F7462BFE4D441</code> <code>B63EAAEFD95D3AD5DE0ABAE90C6FDBCF</code> <code>B9C56C73460C9746D85845A31141F609</code> <code>E1646BC976B2C493E7E15EB577407170</code> <code>2F1C6FD2FB2C78F761F12CF9D55BF23E</code> <code>6CA26727405205B35EEF50647B61633F</code> <code>039164F0D06C0ADD7B8847E0077BAA2E</code> <code>260033F220193FEB93F6F03013E5993F</code> <code>15F907EC0BAA7021E14E7E7DAF3D3430</code> <code>793036767DCDFEDBACA4270DD46DD45E</code> <code>46F86FD76D35C705F7B93D915BDE0D80</code> <code>39C3755971A0865E27E5E73672D9B728</code> <code>4E3B8EE601FA35817EF5B36452464B3C</code> <code>F485862BF3B58CE2DE2DD3E1817E40C2</code> <code>76CA5A3A110E1AE30AA285D2EF5EF38C</code> <code>3E397F385E7B2EA75C4B62422EE50ECF</code> <code>8723EB88273AE9125B70E5AB1D431692</code> <code>C92C91DD44EB252BED0EA32222C87122</code> <code>81CACF2DF5635266FD583E0C122764DB</code> <code>CAAF439ED53522C9B8253A8C12A8D935</code> <code>EA771D5FA6DB426DA6AE6029A2B00AE4</code> <code>F922EDC75AD30EC647F4AFBA2E6956EC</code> <code>8BE830080474E114C27D6AD52249DF75</code><br> <code>F95537CD</code></td>
<td><code>FE5002005FA3625828AD5078AF38E572</code> <code>0F5B5876BB5B487F5DC90EAA2F3A4EDF</code> <code>980505B7CDC67C4728B6C0DB2A01427E</code> <code>15E4218810E28519F7F5CC45AA78452E</code> <code>B8EC1D9A796A1B8AF11E401B5079B92C</code> <code>91742606D3AE7F121CA1128B1DA817CD</code> <code>F03C39F4681206C3931659D060AAE911</code> <code>A3B988206CD1B642AAA99D1F91FD6BDE</code> <code>EE83D2D7991E1B1904A6EE414604281E</code> <code>4302AFC7819E7414EEFF9EC8CDD42931</code> <code>07345DA13510EE8BF762350F2B9B7346</code> <code>90894AA08E3BF7149277F91DCE97D8B8</code> <code>4F1C68A47BB7104077E4B2B044A0EF44</code> <code>E8F0CF89CFAAF6490CF7C51650412743</code> <code>D03441FA15EE469496747479F0B246CB</code> <code>EE64F34F178CFA915068B0A81FBBF13B</code> <code>CF606B0828F1CCCA48A41E5E3FFEF8F1</code> <code>7033F13BD1D3C250266C750EDADFA75D</code> <code>DFE41522670CF5DECD46766E99FC106D</code> <code>2A171BC3DA2A82B24E1BC45D975C5EEE</code> <code>FEEE5233FDC6CB33D13DDE3331BE7BAD</code> <code>6DBBE11C60389CE776B275DD098991B1</code> <code>EAEB7EC7E2CB3947EB54B19E820D78E0</code> <code>B621BEA4616C8A24F47CFA2F8F05AD92</code> <code>E07369107C806D3B40C6A6031DEC1167</code> <code>BF1679E2C4348525E96B88CC4319AF4D</code> <code>ED61A052E42C3DFE47C9946A8A37862F</code> <code>1DB3CB0EAE2FEF06A1EFC56E675D2717</code> <code>C6000247EB0E0F3AEF5F1876668DC778</code> <code>3A6345B5D40B310F51A6B6B8B229BA7B</code> <code>02E38766CAAC94DB50B94C354353B75C</code> <code>C6E86837A5D6C21A943602DA087DCF1E</code> <code>B06E7DA2B3E8B78DCB093B9FA48E2722</code> <code>C7A04549D5DE8EF6B419FB58640873B3</code> <code>0D56B2B82FF6592AA55742C2FB52FB58</code> <code>A70740872DF85CFDA023D165CDD7D386</code> <code>244993EEED773F37E8223E8DE0BAAE61</code><br> <code>5AFBDDF9</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = ACD454656EAD6AB342120E881FCE70D5F4B7565EDDA77E028B1D21881
<!-- 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 = D29917ED5FF3F8F51E7F8A47C7B25FB7AAE69F7BE198FBD3FC7A6A879830CEB42C24F039C4B696CC0728A18E2843F7E1F7F9F86D46499ABE9F050BF12DECF4CB6E075ECB6F28BC769E9E23D33720FB3AEF171436521B0881476B91F875F8BFD403DEF5B467B9BEE7DAA4F972214C34BC767563B5379F1DD4970E95ECDA9D46A91DCB60CE263197881AF65131EF01350F3ED2C7E316BC36EE007ECE88CFDDA7DFC9DA94B858C7635D9AC3F771A59BDDD39255EB723B27BA9075490CE07F0CD6C73482F9E1C82C9F33FA334F78C77191D1E82EBC6A7A1DC88C9CC27191C0B07A6E150815A53E7F7462BFE4D441B63EAAEFD95D3AD5DE0ABAE90C6FDBCFB9C56C73460C9746D85845A31141F609E1646BC976B2C493E7E15EB5774071702F1C6FD2FB2C78F761F12CF9D55BF23E6CA26727405205B35EEF50647B61633F039164F0D06C0ADD7B8847E0077BAA2E260033F220193FEB93F6F03013E5993F15F907EC0BAA7021E14E7E7DAF3D3430793036767DCDFEDBACA4270DD46DD45E46F86FD76D35C705F7B93D915BDE0D8039C3755971A0865E27E5E73672D9B7284E3B8EE601FA35817EF5B36452464B3CF485862BF3B58CE2DE2DD3E1817E40C276CA5A3A110E1AE30AA285D2EF5EF38C3E397F385E7B2EA75C4B62422EE50ECF8723EB88273AE9125B70E5AB1D431692C92C91DD44EB252BED0EA32222C8712281CACF2DF5635266FD583E0C122764DBCAAF439ED53522C9B8253A8C12A8D935EA771D5FA6DB426DA6AE6029A2B00AE4F922EDC75AD30EC647F4AFBA2E6956EC8BE830080474E114C27D6AD52249DF75F95537CD
tmp_aes_key = 98173694F80A3DEA8E6E1237B317DC8EA983D7B180F7152E25F461CCA059CA25
tmp_aes_iv = C6DC6366725C19455CDCD47707D1843FF21BBFE2B9B17ED018930B13C7C0982D</code></pre>
<pre><code>encrypted_answer = 5FA3625828AD5078AF38E5720F5B5876BB5B487F5DC90EAA2F3A4EDF980505B7CDC67C4728B6C0DB2A01427E15E4218810E28519F7F5CC45AA78452EB8EC1D9A796A1B8AF11E401B5079B92C91742606D3AE7F121CA1128B1DA817CDF03C39F4681206C3931659D060AAE911A3B988206CD1B642AAA99D1F91FD6BDEEE83D2D7991E1B1904A6EE414604281E4302AFC7819E7414EEFF9EC8CDD4293107345DA13510EE8BF762350F2B9B734690894AA08E3BF7149277F91DCE97D8B84F1C68A47BB7104077E4B2B044A0EF44E8F0CF89CFAAF6490CF7C51650412743D03441FA15EE469496747479F0B246CBEE64F34F178CFA915068B0A81FBBF13BCF606B0828F1CCCA48A41E5E3FFEF8F17033F13BD1D3C250266C750EDADFA75DDFE41522670CF5DECD46766E99FC106D2A171BC3DA2A82B24E1BC45D975C5EEEFEEE5233FDC6CB33D13DDE3331BE7BAD6DBBE11C60389CE776B275DD098991B1EAEB7EC7E2CB3947EB54B19E820D78E0B621BEA4616C8A24F47CFA2F8F05AD92E07369107C806D3B40C6A6031DEC1167BF1679E2C4348525E96B88CC4319AF4DED61A052E42C3DFE47C9946A8A37862F1DB3CB0EAE2FEF06A1EFC56E675D2717C6000247EB0E0F3AEF5F1876668DC7783A6345B5D40B310F51A6B6B8B229BA7B02E38766CAAC94DB50B94C354353B75CC6E86837A5D6C21A943602DA087DCF1EB06E7DA2B3E8B78DCB093B9FA48E2722C7A04549D5DE8EF6B419FB58640873B30D56B2B82FF6592AA55742C2FB52FB58A70740872DF85CFDA023D165CDD7D386244993EEED773F37E8223E8DE0BAAE615AFBDDF9
tmp_aes_key = 2C99D95C8A6F7256F976E8EC2DE74F7FA48A1D1BBD2C3CE21040B45A0C9FF10C
tmp_aes_iv = FFC0644F47C406AAFC9F41386ADE90487D82EEB7F2C5DEAD4BC0294D25022BC0</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 1CC8DB90C412DD0B7D01620E920AB2CD83D53243BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006F1A1A25F92E2204530154FEDF318B67275B2D36514352899B61C29A3A3BCCED0BF5DA7202FCC84181BA7411173AF0AB9D2BEEF79F211033E9A068E960965328CB9AC93851E8D3A0CB0E907EF89C7AC9553D951165610E4122DF11745C0445EABF5EE96E0AFB2599A08CA30CDB56FFA1866124B575AFF159302B786BAC597074BE21CD352541B4D3B88AF8787E242292CCA84A5D2BC2EA89D423306E6C11BABF5C8CAFE34E468E41DE822BCA6F93A8CF88635A7B9D740ACF196F6289BA5A5021018EC726DE61F253C40E6FF23665639932708437C97E837B7ADD0674DB2D9CF72B012763EFF57B08D4C396A7EA4B9EE0F4141A037FC67E1C6970E49FBE7FA9586B21A966A561E92B4398E2DE
answer = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006F1A1A25F92E2204530154FEDF318B67275B2D36514352899B61C29A3A3BCCED0BF5DA7202FCC84181BA7411173AF0AB9D2BEEF79F211033E9A068E960965328CB9AC93851E8D3A0CB0E907EF89C7AC9553D951165610E4122DF11745C0445EABF5EE96E0AFB2599A08CA30CDB56FFA1866124B575AFF159302B786BAC597074BE21CD352541B4D3B88AF8787E242292CCA84A5D2BC2EA89D423306E6C11BABF5C8CAFE34E468E41DE822BCA6F93A8CF88635A7B9D740ACF196F6289BA5A5021018EC726DE61F253C40E6FF23665639932708437C97E837B7ADD0674DB2D9CF72B012763EFF57B08D4C396A7EA4B9EE0F4141A037FC67E1C6970E49FBE7FA9586B21A966A561E92B4398E2DE</code></pre>
<pre><code>answer_with_hash = 04D26F8BD0B19BD24417777A66EBDE32E695833CBA0D89B5A7DEB1F06093B27E6E9840249BD3CC00796D6C2F9379BDC33B8ED0949164C44403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009E576DA4788AF103ED40CB497A595E1858D9001DC1D3A658A13F09E8EC0259B2EB3388C539AA515E95D0DBC4B072C1762ECD34715E10E56B508A85311EDEAA190BD45ED1E35BFCA889DC0BA60FCD9CDCCB029CA821A01DBFFC278A10AFFCC2A9A59AC19FCEB8283CC937D1970D4BD9B643DAE1E028D0582238C59B68BDA5664B52438885AEB23B0FD1558E0BF63C74595A4D128F0C0F6FB6BD0FEB8802E1BC251716A6C8CE9B33766810698FBA0BAAF04B094E502697E1B4B8B903A2F20844D52FA557313C0C24F3AB3A9011606364A432B0B70D688BF72B05D0E4485BC43B7FC4CA7FF74C76D91A653DC45C4CD71E3A1D2551A435E24344460C6CD2E7CC8ABA01B9AB66818DBA9804E2C998
answer = BA0D89B5A7DEB1F06093B27E6E9840249BD3CC00796D6C2F9379BDC33B8ED0949164C44403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009E576DA4788AF103ED40CB497A595E1858D9001DC1D3A658A13F09E8EC0259B2EB3388C539AA515E95D0DBC4B072C1762ECD34715E10E56B508A85311EDEAA190BD45ED1E35BFCA889DC0BA60FCD9CDCCB029CA821A01DBFFC278A10AFFCC2A9A59AC19FCEB8283CC937D1970D4BD9B643DAE1E028D0582238C59B68BDA5664B52438885AEB23B0FD1558E0BF63C74595A4D128F0C0F6FB6BD0FEB8802E1BC251716A6C8CE9B33766810698FBA0BAAF04B094E502697E1B4B8B903A2F20844D52FA557313C0C24F3AB3A9011606364A432B0B70D688BF72B05D0E4485BC43B7FC4CA7FF74C76D91A653DC45C4CD71E3A1D2551A435E24344460C6CD2E7CC8ABA01B9AB66818DBA9804E2C998</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 12 C3 06 4D DC AA 11 9F 34 EB 28 26
0010 | C7 82 24 D9 BB EB 55 8F 3B 71 35 7F 86 21 B7 12
0020 | 51 B2 70 D2 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 A7 DE B1 F0 60 93 B2 7E 6E 98 40 24
0010 | 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3 3B 8E D0 94
0020 | 91 64 C4 44 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 = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
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 | 6F 1A 1A 25 F9 2E 22 04 53 01 54 FE DF 31 8B 67
0140 | 27 5B 2D 36 51 43 52 89 9B 61 C2 9A 3A 3B CC ED
0150 | 0B F5 DA 72 02 FC C8 41 81 BA 74 11 17 3A F0 AB
0160 | 9D 2B EE F7 9F 21 10 33 E9 A0 68 E9 60 96 53 28
0170 | CB 9A C9 38 51 E8 D3 A0 CB 0E 90 7E F8 9C 7A C9
0180 | 55 3D 95 11 65 61 0E 41 22 DF 11 74 5C 04 45 EA
0190 | BF 5E E9 6E 0A FB 25 99 A0 8C A3 0C DB 56 FF A1
01A0 | 86 61 24 B5 75 AF F1 59 30 2B 78 6B AC 59 70 74
01B0 | BE 21 CD 35 25 41 B4 D3 B8 8A F8 78 7E 24 22 92
01C0 | CC A8 4A 5D 2B C2 EA 89 D4 23 30 6E 6C 11 BA BF
01D0 | 5C 8C AF E3 4E 46 8E 41 DE 82 2B CA 6F 93 A8 CF
01E0 | 88 63 5A 7B 9D 74 0A CF 19 6F 62 89 BA 5A 50 21
01F0 | 01 8E C7 26 DE 61 F2 53 C4 0E 6F F2 36 65 63 99
0200 | 32 70 84 37 C9 7E 83 7B 7A DD 06 74 DB 2D 9C F7
0210 | 2B 01 27 63 EF F5 7B 08 D4 C3 96 A7 EA 4B 9E E0
0220 | F4 14 1A 03 7F C6 7E 1C 69 70 E4 9F BE 7F A9 58
0230 | 6B 21 A9 66</code></pre>
0130 | 9E 57 6D A4 78 8A F1 03 ED 40 CB 49 7A 59 5E 18
0140 | 58 D9 00 1D C1 D3 A6 58 A1 3F 09 E8 EC 02 59 B2
0150 | EB 33 88 C5 39 AA 51 5E 95 D0 DB C4 B0 72 C1 76
0160 | 2E CD 34 71 5E 10 E5 6B 50 8A 85 31 1E DE AA 19
0170 | 0B D4 5E D1 E3 5B FC A8 89 DC 0B A6 0F CD 9C DC
0180 | CB 02 9C A8 21 A0 1D BF FC 27 8A 10 AF FC C2 A9
0190 | A5 9A C1 9F CE B8 28 3C C9 37 D1 97 0D 4B D9 B6
01A0 | 43 DA E1 E0 28 D0 58 22 38 C5 9B 68 BD A5 66 4B
01B0 | 52 43 88 85 AE B2 3B 0F D1 55 8E 0B F6 3C 74 59
01C0 | 5A 4D 12 8F 0C 0F 6F B6 BD 0F EB 88 02 E1 BC 25
01D0 | 17 16 A6 C8 CE 9B 33 76 68 10 69 8F BA 0B AA F0
01E0 | 4B 09 4E 50 26 97 E1 B4 B8 B9 03 A2 F2 08 44 D5
01F0 | 2F A5 57 31 3C 0C 24 F3 AB 3A 90 11 60 63 64 A4
0200 | 32 B0 B7 0D 68 8B F7 2B 05 D0 E4 48 5B C4 3B 7F
0210 | C4 CA 7F F7 4C 76 D9 1A 65 3D C4 5C 4C D7 1E 3A
0220 | 1D 25 51 A4 35 E2 43 44 46 0C 6C D2 E7 CC 8A BA
0230 | 01 B9 AB 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 = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001006F1A1A25F92E2204530154FE</code> <code>DF318B67275B2D36514352899B61C29A</code> <code>3A3BCCED0BF5DA7202FCC84181BA7411</code> <code>173AF0AB9D2BEEF79F211033E9A068E9</code> <code>60965328CB9AC93851E8D3A0CB0E907E</code> <code>F89C7AC9553D951165610E4122DF1174</code> <code>5C0445EABF5EE96E0AFB2599A08CA30C</code> <code>DB56FFA1866124B575AFF159302B786B</code> <code>AC597074BE21CD352541B4D3B88AF878</code> <code>7E242292CCA84A5D2BC2EA89D423306E</code> <code>6C11BABF5C8CAFE34E468E41DE822BCA</code> <code>6F93A8CF88635A7B9D740ACF196F6289</code> <code>BA5A5021018EC726DE61F253C40E6FF2</code> <code>3665639932708437C97E837B7ADD0674</code> <code>DB2D9CF72B012763EFF57B08D4C396A7</code> <code>EA4B9EE0F4141A037FC67E1C6970E49F</code><br> <code>BE7FA958</code></td>
<td><code>FE0001009E576DA4788AF103ED40CB49</code> <code>7A595E1858D9001DC1D3A658A13F09E8</code> <code>EC0259B2EB3388C539AA515E95D0DBC4</code> <code>B072C1762ECD34715E10E56B508A8531</code> <code>1EDEAA190BD45ED1E35BFCA889DC0BA6</code> <code>0FCD9CDCCB029CA821A01DBFFC278A10</code> <code>AFFCC2A9A59AC19FCEB8283CC937D197</code> <code>0D4BD9B643DAE1E028D0582238C59B68</code> <code>BDA5664B52438885AEB23B0FD1558E0B</code> <code>F63C74595A4D128F0C0F6FB6BD0FEB88</code> <code>02E1BC251716A6C8CE9B33766810698F</code> <code>BA0BAAF04B094E502697E1B4B8B903A2</code> <code>F20844D52FA557313C0C24F3AB3A9011</code> <code>606364A432B0B70D688BF72B05D0E448</code> <code>5BC43B7FC4CA7FF74C76D91A653DC45C</code> <code>4CD71E3A1D2551A435E24344460C6CD2</code><br> <code>E7CC8ABA</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>6B21A966</code> (1722360171 in decimal)</td>
<td><code>01B9AB66</code> (1722530049 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
<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 = 73B57F2EF891BA8F663689A4A9E8EAFECCCF27FC3ACE87415B6E97F91D204B54E99EA2194570A0C0EECB589F43BA77FE2CE828A00372A5FF533491D2003AA199A99ED2D43CAF12BD4FD2520CB221B6EEAB614EF5F785690491907A858D5B9609719BDF7719E98C6983EC6C6BAC5D0776E96251C96CA7FDB62943F62A3D511949B612AA5711CBBAC8FAA4C1F2E2D1048578198756148709CF5B0297E127B2DE1E10A967385ACA8BD89BD40D530C48136B88C455F0547DE8E526618ADA7E40C62BD8860F741DFDDD536636A9295704FA4093605EA808ACB23A00A121602ACAD38C17AF06983B287DF8296E68EB6450F645FB92BD50F05350006727EB5E614F39C3</code></pre>
<pre><code>b = 6AB4D768658E8532C19DAF62622423922FBA72EACBC50849C94EB9ADF846ECE963D5FCD4C949934A50EC013776D81E8AD4F89E6CBB1780F3A9D9CE330A5334D2162C68DA5D2EB2802E126EFDE2A130200CD41E9893CD7C562531B047B141013F15579E27437D5838AF42D68FA7DC43EE562366D4EE2F0B800C1C053CA90664438E3608BA18FBBDDF83B0DA7FA347BECBB2E6281AEC730FD6FDB69326854A9C70E13D0C34104A81DC26178155FBB502D82414A7EE8BF8B572E779A7FBE9E44FA2C66684B87438DF426B23FE3342CBE64E86244C07EE7DAAAD3B9E5D4EC1884773C2DFBAB6E565A254F7DE6E9340C7C772B6C0D2CB1F555F59ADC546205D1D7414</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 = 4821714C863B074C59ADF5A68974A4520DD5C7A322E17B39EC5E14A55DF13FA46802DB781867285251C7FA6250ECFA2FECD842DAAC02B0898BEACFB85FF1B80BDF1A0A6923E5CAE410B67F897B0333BEC09695E64563ABFD9E40712B3A5F2013343AE46876464CA0516F67BD4749579368F444EC83D125BB4DC8D9A9E907E66F8033C913045B072CF2769F06D3F4207E753525F0DF3E97812A4AD34ABBBE72D02949D52B5975E49CB2EC086FF93583C529A39449C35A4E3ED8C455DF2559D807E9B20B171B0FF26666DF1FCE451B396DB75EF20470118C35D3B70B8836AC18D32D7C31F7C2AB497B2ED88F1EADC269ECEC42984FAE17CE49C31B364473725FA4</code></pre>
<pre><code>g_b = F4DD39A1882D3797A05F76A66535388FABE5E8767EAA2C1E27A484DE070F49F90278DF4D77345802D7D36230B12687E46D5C8C372D3856FE2FA79819688697187D056321C224CFC48ED308B2F055D8F06A7E6EDE33DD2EF0C86D4D423132440F67A32A263EC794724165E1FF2922B5CA19EBBF9BDA71242FC0A6427D6BB6B62F80EA293B972F889A68C70FD8F8A763D80725516A3FF81513143038DB59E0788E12BF812F9D7235FA1D91DBDE451165E0EF24226922B63D6C9A03AD09209B339816261949917C8CA55E3231A105042DD683A404DB6A271B95A0D61341675F340CAD420DED46BA0089F93CC14CFB6D264A1D16C59D61F98F5ABA5EDC80637753</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 12 C3 06 4D DC AA 11 9F 34 EB 28 26
0010 | C7 82 24 D9 BB EB 55 8F 3B 71 35 7F 86 21 B7 12
0020 | 51 B2 70 D2 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 48 21 71 4C 86 3B 07 4C 59 AD F5 A6 89 74 A4 52
0040 | 0D D5 C7 A3 22 E1 7B 39 EC 5E 14 A5 5D F1 3F A4
0050 | 68 02 DB 78 18 67 28 52 51 C7 FA 62 50 EC FA 2F
0060 | EC D8 42 DA AC 02 B0 89 8B EA CF B8 5F F1 B8 0B
0070 | DF 1A 0A 69 23 E5 CA E4 10 B6 7F 89 7B 03 33 BE
0080 | C0 96 95 E6 45 63 AB FD 9E 40 71 2B 3A 5F 20 13
0090 | 34 3A E4 68 76 46 4C A0 51 6F 67 BD 47 49 57 93
00A0 | 68 F4 44 EC 83 D1 25 BB 4D C8 D9 A9 E9 07 E6 6F
00B0 | 80 33 C9 13 04 5B 07 2C F2 76 9F 06 D3 F4 20 7E
00C0 | 75 35 25 F0 DF 3E 97 81 2A 4A D3 4A BB BE 72 D0
00D0 | 29 49 D5 2B 59 75 E4 9C B2 EC 08 6F F9 35 83 C5
00E0 | 29 A3 94 49 C3 5A 4E 3E D8 C4 55 DF 25 59 D8 07
00F0 | E9 B2 0B 17 1B 0F F2 66 66 DF 1F CE 45 1B 39 6D
0100 | B7 5E F2 04 70 11 8C 35 D3 B7 0B 88 36 AC 18 D3
0110 | 2D 7C 31 F7 C2 AB 49 7B 2E D8 8F 1E AD C2 69 EC
0120 | EC 42 98 4F AE 17 CE 49 C3 1B 36 44 73 72 5F A4</code></pre>
<pre><code>0000 | 54 B6 43 66 A7 DE B1 F0 60 93 B2 7E 6E 98 40 24
0010 | 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3 3B 8E D0 94
0020 | 91 64 C4 44 00 00 00 00 00 00 00 00 FE FF 00 00
0030 | F4 DD 39 A1 88 2D 37 97 A0 5F 76 A6 65 35 38 8F
0040 | AB E5 E8 76 7E AA 2C 1E 27 A4 84 DE 07 0F 49 F9
0050 | 02 78 DF 4D 77 34 58 02 D7 D3 62 30 B1 26 87 E4
0060 | 6D 5C 8C 37 2D 38 56 FE 2F A7 98 19 68 86 97 18
0070 | 7D 05 63 21 C2 24 CF C4 8E D3 08 B2 F0 55 D8 F0
0080 | 6A 7E 6E DE 33 DD 2E F0 C8 6D 4D 42 31 32 44 0F
0090 | 67 A3 2A 26 3E C7 94 72 41 65 E1 FF 29 22 B5 CA
00A0 | 19 EB BF 9B DA 71 24 2F C0 A6 42 7D 6B B6 B6 2F
00B0 | 80 EA 29 3B 97 2F 88 9A 68 C7 0F D8 F8 A7 63 D8
00C0 | 07 25 51 6A 3F F8 15 13 14 30 38 DB 59 E0 78 8E
00D0 | 12 BF 81 2F 9D 72 35 FA 1D 91 DB DE 45 11 65 E0
00E0 | EF 24 22 69 22 B6 3D 6C 9A 03 AD 09 20 9B 33 98
00F0 | 16 26 19 49 91 7C 8C A5 5E 32 31 A1 05 04 2D D6
0100 | 83 A4 04 DB 6A 27 1B 95 A0 D6 13 41 67 5F 34 0C
0110 | AD 42 0D ED 46 BA 00 89 F9 3C C1 4C FB 6D 26 4A
0120 | 1D 16 C5 9D 61 F9 8F 5A BA 5E DC 80 63 77 53 00</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 = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001004821714C863B074C59ADF5A6</code> <code>8974A4520DD5C7A322E17B39EC5E14A5</code> <code>5DF13FA46802DB781867285251C7FA62</code> <code>50ECFA2FECD842DAAC02B0898BEACFB8</code> <code>5FF1B80BDF1A0A6923E5CAE410B67F89</code> <code>7B0333BEC09695E64563ABFD9E40712B</code> <code>3A5F2013343AE46876464CA0516F67BD</code> <code>4749579368F444EC83D125BB4DC8D9A9</code> <code>E907E66F8033C913045B072CF2769F06</code> <code>D3F4207E753525F0DF3E97812A4AD34A</code> <code>BBBE72D02949D52B5975E49CB2EC086F</code> <code>F93583C529A39449C35A4E3ED8C455DF</code> <code>2559D807E9B20B171B0FF26666DF1FCE</code> <code>451B396DB75EF20470118C35D3B70B88</code> <code>36AC18D32D7C31F7C2AB497B2ED88F1E</code> <code>ADC269ECEC42984FAE17CE49C31B3644</code><br> <code>73725FA4</code></td>
<td><code>FEFF0000F4DD39A1882D3797A05F76A6</code> <code>6535388FABE5E8767EAA2C1E27A484DE</code> <code>070F49F90278DF4D77345802D7D36230</code> <code>B12687E46D5C8C372D3856FE2FA79819</code> <code>688697187D056321C224CFC48ED308B2</code> <code>F055D8F06A7E6EDE33DD2EF0C86D4D42</code> <code>3132440F67A32A263EC794724165E1FF</code> <code>2922B5CA19EBBF9BDA71242FC0A6427D</code> <code>6BB6B62F80EA293B972F889A68C70FD8</code> <code>F8A763D80725516A3FF81513143038DB</code> <code>59E0788E12BF812F9D7235FA1D91DBDE</code> <code>451165E0EF24226922B63D6C9A03AD09</code> <code>209B339816261949917C8CA55E3231A1</code> <code>05042DD683A404DB6A271B95A0D61341</code> <code>675F340CAD420DED46BA0089F93CC14C</code> <code>FB6D264A1D16C59D61F98F5ABA5EDC80</code><br> <code>63775300</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 = BA0D89B512C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D
<!-- 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 = 54B6436612C3064DDCAA119F34EB2826C78224D9BBEB558F3B71357F8621B71251B270D20000000000000000FE0001004821714C863B074C59ADF5A68974A4520DD5C7A322E17B39EC5E14A55DF13FA46802DB781867285251C7FA6250ECFA2FECD842DAAC02B0898BEACFB85FF1B80BDF1A0A6923E5CAE410B67F897B0333BEC09695E64563ABFD9E40712B3A5F2013343AE46876464CA0516F67BD4749579368F444EC83D125BB4DC8D9A9E907E66F8033C913045B072CF2769F06D3F4207E753525F0DF3E97812A4AD34ABBBE72D02949D52B5975E49CB2EC086FF93583C529A39449C35A4E3ED8C455DF2559D807E9B20B171B0FF26666DF1FCE451B396DB75EF20470118C35D3B70B8836AC18D32D7C31F7C2AB497B2ED88F1EADC269ECEC42984FAE17CE49C31B364473725FA4
padding = AB14EBA0A63497D4168238D2
tmp_aes_key = 98173694F80A3DEA8E6E1237B317DC8EA983D7B180F7152E25F461CCA059CA25
tmp_aes_iv = C6DC6366725C19455CDCD47707D1843FF21BBFE2B9B17ED018930B13C7C0982D</code></pre>
<pre><code>data = 54B64366A7DEB1F06093B27E6E9840249BD3CC00796D6C2F9379BDC33B8ED0949164C4440000000000000000FEFF0000F4DD39A1882D3797A05F76A66535388FABE5E8767EAA2C1E27A484DE070F49F90278DF4D77345802D7D36230B12687E46D5C8C372D3856FE2FA79819688697187D056321C224CFC48ED308B2F055D8F06A7E6EDE33DD2EF0C86D4D423132440F67A32A263EC794724165E1FF2922B5CA19EBBF9BDA71242FC0A6427D6BB6B62F80EA293B972F889A68C70FD8F8A763D80725516A3FF81513143038DB59E0788E12BF812F9D7235FA1D91DBDE451165E0EF24226922B63D6C9A03AD09209B339816261949917C8CA55E3231A105042DD683A404DB6A271B95A0D61341675F340CAD420DED46BA0089F93CC14CFB6D264A1D16C59D61F98F5ABA5EDC8063775300
padding = D484187F9FB4A72524CE5E91
tmp_aes_key = 2C99D95C8A6F7256F976E8EC2DE74F7FA48A1D1BBD2C3CE21040B45A0C9FF10C
tmp_aes_iv = FFC0644F47C406AAFC9F41386ADE90487D82EEB7F2C5DEAD4BC0294D25022BC0</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 = C4A12345DED287DEE264A3EF414AA4641360E00F32995965A00828E474694E1946573C813ED74CE6D5484E9ABBB3A3186B04FAA5F8D0C4274C0C3E3DC7DDE478461DF42831809E386489E941BC9F073AE45ECB1158FFE601283775D7FB39ABF44D196971B961C24EC2A5F5299316239393D6248742D2708A0F67F378261944D1FBDC00BD7EE71FCDD0DF294730D88D8012F7B4F27199A44A5A54989063F95E717651EAF704141DF80450A1949F1A175884A7FB08F39A7980C43D30E9E7F8255D78F84653C244072DD13EE9E19E7FE6B9F1B3759F959349E23EB97B0A1C16CF314E24D8E32A76053494E0054B81B2A342CC2510D88AE7E8376EC69F72A260BF4A024F6A854BD8D04747DAECEC66B7370C08267583011C859BFF4422699F5EA83C22AB09810B16217F8824C871023D224A03B50B3DA3418D199DBDD57E986F5140035978DC57F7AA98BD46C927B94A36D6</code></pre>
<pre><code>encrypted_data = E32444EE858E03DD56CCD7DDC77B709FE16A919EA9208BA61BA3B94988932AD5AA7B71912006DE6E76B431BA59B464A0FD31D920E4834DD86A04BE1283187A5E3E740D895534E8FBCA9B388E32DADBF191F2D58F98BD74EAD27171A34700825D7FA1D5E996D8BDBCC791005A4188A6B99EC7F404B2D652D27CD4A27E96E4E81C832777B97679FB3826DB1C88CAF77805382A1B142A0AC983C0E56DCEDC34E894E04E6C7D9A8DCCAB1FF963A6626A930577B778B364F38A8BB21629E6C1DCF8B2D1AE719D5D030264E2BFFBF07310032DADB4DB477E7C953C2C1BFFAAB9DDF368A00BB8DEFCFDF08D277F656A32B08E9510EC7D3D5D34900C6BD0EFE67EF28B062380C6F245F5A6D38537E370FE7E015D0BD259FC972336ADE50E8B415821301A95CDE79A843B50F9A6996F3D54BD7BD33401A99253D188BA21E06B4A4675B657399F06D7AE0BE867590CB69665E3AED5</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 94 5D 0C 00 6B 21 A9 66
0010 | 78 01 00 00 1F 5F 04 F5 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9 BB EB 55 8F 3B 71 35 7F
0030 | 86 21 B7 12 51 B2 70 D2 FE 50 01 00 C4 A1 23 45
0040 | DE D2 87 DE E2 64 A3 EF 41 4A A4 64 13 60 E0 0F
0050 | 32 99 59 65 A0 08 28 E4 74 69 4E 19 46 57 3C 81
0060 | 3E D7 4C E6 D5 48 4E 9A BB B3 A3 18 6B 04 FA A5
0070 | F8 D0 C4 27 4C 0C 3E 3D C7 DD E4 78 46 1D F4 28
0080 | 31 80 9E 38 64 89 E9 41 BC 9F 07 3A E4 5E CB 11
0090 | 58 FF E6 01 28 37 75 D7 FB 39 AB F4 4D 19 69 71
00A0 | B9 61 C2 4E C2 A5 F5 29 93 16 23 93 93 D6 24 87
00B0 | 42 D2 70 8A 0F 67 F3 78 26 19 44 D1 FB DC 00 BD
00C0 | 7E E7 1F CD D0 DF 29 47 30 D8 8D 80 12 F7 B4 F2
00D0 | 71 99 A4 4A 5A 54 98 90 63 F9 5E 71 76 51 EA F7
00E0 | 04 14 1D F8 04 50 A1 94 9F 1A 17 58 84 A7 FB 08
00F0 | F3 9A 79 80 C4 3D 30 E9 E7 F8 25 5D 78 F8 46 53
0100 | C2 44 07 2D D1 3E E9 E1 9E 7F E6 B9 F1 B3 75 9F
0110 | 95 93 49 E2 3E B9 7B 0A 1C 16 CF 31 4E 24 D8 E3
0120 | 2A 76 05 34 94 E0 05 4B 81 B2 A3 42 CC 25 10 D8
0130 | 8A E7 E8 37 6E C6 9F 72 A2 60 BF 4A 02 4F 6A 85
0140 | 4B D8 D0 47 47 DA EC EC 66 B7 37 0C 08 26 75 83
0150 | 01 1C 85 9B FF 44 22 69 9F 5E A8 3C 22 AB 09 81
0160 | 0B 16 21 7F 88 24 C8 71 02 3D 22 4A 03 B5 0B 3D
0170 | A3 41 8D 19 9D BD D5 7E 98 6F 51 40 03 59 78 DC
0180 | 57 F7 AA 98 BD 46 C9 27 B9 4A 36 D6</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 B8 7C 0C 00 01 B9 AB 66
0010 | 78 01 00 00 1F 5F 04 F5 A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3
0030 | 3B 8E D0 94 91 64 C4 44 FE 50 01 00 E3 24 44 EE
0040 | 85 8E 03 DD 56 CC D7 DD C7 7B 70 9F E1 6A 91 9E
0050 | A9 20 8B A6 1B A3 B9 49 88 93 2A D5 AA 7B 71 91
0060 | 20 06 DE 6E 76 B4 31 BA 59 B4 64 A0 FD 31 D9 20
0070 | E4 83 4D D8 6A 04 BE 12 83 18 7A 5E 3E 74 0D 89
0080 | 55 34 E8 FB CA 9B 38 8E 32 DA DB F1 91 F2 D5 8F
0090 | 98 BD 74 EA D2 71 71 A3 47 00 82 5D 7F A1 D5 E9
00A0 | 96 D8 BD BC C7 91 00 5A 41 88 A6 B9 9E C7 F4 04
00B0 | B2 D6 52 D2 7C D4 A2 7E 96 E4 E8 1C 83 27 77 B9
00C0 | 76 79 FB 38 26 DB 1C 88 CA F7 78 05 38 2A 1B 14
00D0 | 2A 0A C9 83 C0 E5 6D CE DC 34 E8 94 E0 4E 6C 7D
00E0 | 9A 8D CC AB 1F F9 63 A6 62 6A 93 05 77 B7 78 B3
00F0 | 64 F3 8A 8B B2 16 29 E6 C1 DC F8 B2 D1 AE 71 9D
0100 | 5D 03 02 64 E2 BF FB F0 73 10 03 2D AD B4 DB 47
0110 | 7E 7C 95 3C 2C 1B FF AA B9 DD F3 68 A0 0B B8 DE
0120 | FC FD F0 8D 27 7F 65 6A 32 B0 8E 95 10 EC 7D 3D
0130 | 5D 34 90 0C 6B D0 EF E6 7E F2 8B 06 23 80 C6 F2
0140 | 45 F5 A6 D3 85 37 E3 70 FE 7E 01 5D 0B D2 59 FC
0150 | 97 23 36 AD E5 0E 8B 41 58 21 30 1A 95 CD E7 9A
0160 | 84 3B 50 F9 A6 99 6F 3D 54 BD 7B D3 34 01 A9 92
0170 | 53 D1 88 BA 21 E0 6B 4A 46 75 B6 57 39 9F 06 D7
0180 | AE 0B E8 67 59 0C B6 96 65 E3 AE D5</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>945D0C006B21A966</code></td>
<td><code>B87C0C0001B9AB66</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>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100C4A12345DED287DEE264A3EF</code> <code>414AA4641360E00F32995965A00828E4</code> <code>74694E1946573C813ED74CE6D5484E9A</code> <code>BBB3A3186B04FAA5F8D0C4274C0C3E3D</code> <code>C7DDE478461DF42831809E386489E941</code> <code>BC9F073AE45ECB1158FFE601283775D7</code> <code>FB39ABF44D196971B961C24EC2A5F529</code> <code>9316239393D6248742D2708A0F67F378</code> <code>261944D1FBDC00BD7EE71FCDD0DF2947</code> <code>30D88D8012F7B4F27199A44A5A549890</code> <code>63F95E717651EAF704141DF80450A194</code> <code>9F1A175884A7FB08F39A7980C43D30E9</code> <code>E7F8255D78F84653C244072DD13EE9E1</code> <code>9E7FE6B9F1B3759F959349E23EB97B0A</code> <code>1C16CF314E24D8E32A76053494E0054B</code> <code>81B2A342CC2510D88AE7E8376EC69F72</code> <code>A260BF4A024F6A854BD8D04747DAECEC</code> <code>66B7370C08267583011C859BFF442269</code> <code>9F5EA83C22AB09810B16217F8824C871</code> <code>023D224A03B50B3DA3418D199DBDD57E</code> <code>986F5140035978DC57F7AA98BD46C927</code><br> <code>B94A36D6</code></td>
<td><code>FE500100E32444EE858E03DD56CCD7DD</code> <code>C77B709FE16A919EA9208BA61BA3B949</code> <code>88932AD5AA7B71912006DE6E76B431BA</code> <code>59B464A0FD31D920E4834DD86A04BE12</code> <code>83187A5E3E740D895534E8FBCA9B388E</code> <code>32DADBF191F2D58F98BD74EAD27171A3</code> <code>4700825D7FA1D5E996D8BDBCC791005A</code> <code>4188A6B99EC7F404B2D652D27CD4A27E</code> <code>96E4E81C832777B97679FB3826DB1C88</code> <code>CAF77805382A1B142A0AC983C0E56DCE</code> <code>DC34E894E04E6C7D9A8DCCAB1FF963A6</code> <code>626A930577B778B364F38A8BB21629E6</code> <code>C1DCF8B2D1AE719D5D030264E2BFFBF0</code> <code>7310032DADB4DB477E7C953C2C1BFFAA</code> <code>B9DDF368A00BB8DEFCFDF08D277F656A</code> <code>32B08E9510EC7D3D5D34900C6BD0EFE6</code> <code>7EF28B062380C6F245F5A6D38537E370</code> <code>FE7E015D0BD259FC972336ADE50E8B41</code> <code>5821301A95CDE79A843B50F9A6996F3D</code> <code>54BD7BD33401A99253D188BA21E06B4A</code> <code>4675B657399F06D7AE0BE867590CB696</code><br> <code>65E3AED5</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 = 17AB568F50C050FABED921F5E69FF238119C0A0F06E5F61E005ADF81C467B697222F6C78EAB35045C67EB6EFB473AFF77A7C4CDDFAA900C1DDF6CAA114A4495D1A011AA83FAA7478626DF5269A5706F67E5F7BFE9FD6CE5F30C8E7B8AB4E84D03BB07EFE3779B0DC3EC101212D9D47E9AC717E95403A9AEF196DFC5C92968D1FB1853C6CAC9D80B5ACC1A920EEE5614B6686D05E77865E8CA163B4113CD0C23F499AF615BC62F25799E7946BF3ED9630E6F77F0995ECDA6E11A8D6B36288F7F1C763CE27BF4BD224658695B5ADB81D9291CCAA0E2D7CD9713851F69040FE945E3D6770983DA1EF13B6715CDF070262DC61A002A057765BFECDD62ED4FCDF5CB3</code></pre>
<pre><code>auth_key = 76E9AEB229641A756F4CC3F012011621DD75CD92DDCDEF6532030F476E6C704524E40BB9B3DD8699099525F3292B47C688060F027097CE6C31A41FF02F68ADB1A76713F34D5C01A713FAD782E1789B6F27D0C577257DE3100BE9104A8E7E3FFB6EAA06BDD4594463151D5D2F87D044DCED14A1DA9A0603903726698A34ABBB5EA5053DE2AAC42D1F81A4432063B424821053A8CFF6E55290D9C2DA18FD0393FDB20147FDA2F52346C17EDF64499ABB0FB7B6BF0AC4B5BB99A4E4F5C53429C5756A6177674B884F99054B34FC7957E187D05C76B1096080ADB4B018A4A310FF150C5976E6C2EF062B660A5745A47E6B08A16BF88D207439EFFE9B3B89C2F15E71</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 9C 46 F8 6B 21 A9 66
0010 | 80 00 00 00 34 F7 CB 3B 12 C3 06 4D DC AA 11 9F
0020 | 34 EB 28 26 C7 82 24 D9 BB EB 55 8F 3B 71 35 7F
0030 | 86 21 B7 12 51 B2 70 D2 DA F7 CC 4B 8E 84 63 55
0040 | 66 CC 78 20 D6 81 0D 79</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 7C 7B 95 02 B9 AB 66
0010 | AC 00 00 00 34 F7 CB 3B A7 DE B1 F0 60 93 B2 7E
0020 | 6E 98 40 24 9B D3 CC 00 79 6D 6C 2F 93 79 BD C3
0030 | 3B 8E D0 94 91 64 C4 44 73 0B AF C8 1C 16 7E D8
0040 | 51 2D 2F 4A 89 E2 53 F4</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>019C46F86B21A966</code></td>
<td><code>017C7B9502B9AB66</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>80000000</code> (128 in decimal)</td>
<td><code>AC000000</code> (172 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>12C3064DDCAA119F34EB2826C78224D9</code></td>
<td><code>A7DEB1F06093B27E6E9840249BD3CC00</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>BBEB558F3B71357F8621B71251B270D2</code></td>
<td><code>796D6C2F9379BDC33B8ED0949164C444</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>DAF7CC4B8E84635566CC7820D6810D79</code></td>
<td><code>730BAFC81C167ED8512D2F4A89E253F4</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>