Update content of files

This commit is contained in:
GitHub Action 2023-12-23 19:17:48 +00:00
parent 8d6956b979
commit d2f9292d07
3 changed files with 306 additions and 238 deletions

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 60 20 0B 00 69 28 87 65
0010 | 14 00 00 00 F1 8E 7E BE AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 F0 E6 05 00 1C 31 87 65
0010 | 14 00 00 00 F1 8E 7E BE FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB</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>60200B0069288765</code></td>
<td><code>F0E605001C318765</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>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</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 18 77 ED 69 28 87 65
0010 | 64 00 00 00 63 24 16 05 AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6
0030 | D8 4D 0B BE 3A A0 17 2D 08 1A 5F FA 29 ED E0 ED
0040 | 4F 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 3C 50 77 1C 31 87 65
0010 | 90 00 00 00 63 24 16 05 FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
0030 | 55 7D 76 EB A3 4A 6C 3E 08 19 6C 8A AD 08 45 5B
0040 | A1 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>011877ED69288765</code></td>
<td><code>013C50771C318765</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>64000000</code> (100 in decimal)</td>
<td><code>90000000</code> (144 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>081A5FFA29EDE0ED4F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1900512625765182799</td>
<td><code>08196C8AAD08455BA1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1831991624205687713</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 = 1900512625765182799</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1900512625765182799 = 1286953519 * 1476753121</code></p>
<pre><code>p = 1286953519
q = 1476753121</code></pre>
<pre><code>pq = 1831991624205687713</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1831991624205687713 = 1001004743 * 1830152791</code></p>
<pre><code>p = 1001004743
q = 1830152791</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 1A 5F FA 29 ED E0 ED 4F 00 00 00
0010 | 04 4C B5 5A 2F 00 00 00 04 58 05 76 E1 00 00 00
0020 | AE E3 68 33 0D 08 E5 0D 8A DF C5 39 8A FB C2 A3
0030 | B8 AB F0 5D E7 C6 35 F6 D8 4D 0B BE 3A A0 17 2D
0040 | 47 43 75 83 F4 0F AB AB 65 89 C5 FF 27 AF 57 9B
0050 | DA 75 10 97 A2 93 BC F8 9F CC 35 AB D5 F1 A9 BD
<pre><code>0000 | 95 5F F5 A9 08 19 6C 8A AD 08 45 5B A1 00 00 00
0010 | 04 3B AA 1E C7 00 00 00 04 6D 15 EA 57 00 00 00
0020 | FB E9 D8 14 18 04 88 D9 D5 41 F4 89 59 74 00 FB
0030 | C8 49 6E 59 A0 44 46 E9 55 7D 76 EB A3 4A 6C 3E
0040 | AC DE 69 ED A8 E4 F6 E0 B3 5E 32 C5 30 2C 28 F5
0050 | EB 29 FB 0C 57 6B 4E 77 C3 BB 73 64 36 79 A3 38
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 = 1476753121</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>081A5FFA29EDE0ED4F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1900512625765182799</td>
<td><code>08196C8AAD08455BA1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1831991624205687713</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>044CB55A2F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1286953519</td>
<td><code>043BAA1EC7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001004743</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>04580576E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1476753121</td>
<td><code>046D15EA57000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1830152791</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>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>47437583F40FABAB6589C5FF27AF579B</code> <code>DA751097A293BCF89FCC35ABD5F1A9BD</code></td>
<td><code>ACDE69EDA8E4F6E0B35E32C5302C28F5</code> <code>EB29FB0C576B4E77C3BB73643679A338</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1476753121</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 = 955FF5A9081A5FFA29EDE0ED4F000000044CB55A2F00000004580576E1000000AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172D47437583F40FABAB6589C5FF27AF579BDA751097A293BCF89FCC35ABD5F1A9BD02000000
random_padding_bytes = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E3EAA11DC61C4AE6E8A8EE2F7035B41B7BA44C1735A2A7408364138CE44ED5827BEEF0D55BB44CDC01A8FA8B8BE476A6F50D9F4412DF71655F2190D768267C4B</code></pre>
<pre><code>data = 955FF5A908196C8AAD08455BA1000000043BAA1EC7000000046D15EA57000000FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3EACDE69EDA8E4F6E0B35E32C5302C28F5EB29FB0C576B4E77C3BB73643679A33802000000
random_padding_bytes = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B4D93E34443AB4DD1830729A6DF2431F7E8A5E5A3B0533F511F15E793291F1C8D5EAC6450878A84F6407B21B6708A0928672893AEC2F4CEED863CE1DA1FD0251</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 = 14CE18567E07E7B0A2221FC69B4CA3ABEA9FD4C64D3C112B52422F02A04372C4BE10BF2734BFFA5E1D8AE2712B9C2D07085AEF79F5E878CFDFD6187DE7276D375C501A738982DA2778880AAAF6D32912D6AFF1AA160EBDF37DF3E8D3BF244C51CF9464B3A2EEFEA79C41622DA8E044633D5617BC5B0AE18398E427F8BC24E31356D8F4CC839C4BA2FA09D098A8A8D605602F68181BD1F2666B32D4239AAD17A6340FF236C400BB378814F4FC1E3B92CD24C353B911D0B2ECAE55A91CB4C9ACF5DEE2A14D0255B9A0C0DDAE82C3005E803FE9905253F881ACD830A0D2926E9D970793657F9B5CE0344F596D14967557488CA3CDF8B4EFF6C817513B9BAFB73A72</code></pre>
<pre><code>encrypted_data = 561AFBEC48FFDE4F2B4B0B5BCE8E6A48854D09FFF124AFFA9524A321901FDB58B79E090CE4576EF26567C5CF82DA204F1FA04A64576124569577230F60FD00C81C89F8BB9257AEF7417F729CC44304D3B8AB0006801952A9C399166DDC1EE3FBD910D982582A9FD27A4D53696EB925B245A4249128FE9B3F5B0DB5E1B615E5E300EA7F3B26F358A92B10DEBCB40371E20797E3161F4F1D93D17F4C08A7523AB6F3B85F25EFB05A35667272002BA7FFAEF8D4A7AD34D1C5545C0B14EEF3CFC2F7E724D9BFC616E628827FB63BBC7CD79DE39FF6F695121A0409149A8F4FC6E8C776A5AEF16C9A8E08E91C70877FC6706DCC39A0C84872143CDB51AEC7EDCC3391</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 5B 09 00 6A 28 87 65
0010 | 40 01 00 00 BE E4 12 D7 AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6
0030 | D8 4D 0B BE 3A A0 17 2D 04 4C B5 5A 2F 00 00 00
0040 | 04 58 05 76 E1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 14 CE 18 56 7E 07 E7 B0 A2 22 1F C6
0060 | 9B 4C A3 AB EA 9F D4 C6 4D 3C 11 2B 52 42 2F 02
0070 | A0 43 72 C4 BE 10 BF 27 34 BF FA 5E 1D 8A E2 71
0080 | 2B 9C 2D 07 08 5A EF 79 F5 E8 78 CF DF D6 18 7D
0090 | E7 27 6D 37 5C 50 1A 73 89 82 DA 27 78 88 0A AA
00A0 | F6 D3 29 12 D6 AF F1 AA 16 0E BD F3 7D F3 E8 D3
00B0 | BF 24 4C 51 CF 94 64 B3 A2 EE FE A7 9C 41 62 2D
00C0 | A8 E0 44 63 3D 56 17 BC 5B 0A E1 83 98 E4 27 F8
00D0 | BC 24 E3 13 56 D8 F4 CC 83 9C 4B A2 FA 09 D0 98
00E0 | A8 A8 D6 05 60 2F 68 18 1B D1 F2 66 6B 32 D4 23
00F0 | 9A AD 17 A6 34 0F F2 36 C4 00 BB 37 88 14 F4 FC
0100 | 1E 3B 92 CD 24 C3 53 B9 11 D0 B2 EC AE 55 A9 1C
0110 | B4 C9 AC F5 DE E2 A1 4D 02 55 B9 A0 C0 DD AE 82
0120 | C3 00 5E 80 3F E9 90 52 53 F8 81 AC D8 30 A0 D2
0130 | 92 6E 9D 97 07 93 65 7F 9B 5C E0 34 4F 59 6D 14
0140 | 96 75 57 48 8C A3 CD F8 B4 EF F6 C8 17 51 3B 9B
0150 | AF B7 3A 72</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 1C AA 09 00 1C 31 87 65
0010 | 40 01 00 00 BE E4 12 D7 FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
0030 | 55 7D 76 EB A3 4A 6C 3E 04 3B AA 1E C7 00 00 00
0040 | 04 6D 15 EA 57 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 56 1A FB EC 48 FF DE 4F 2B 4B 0B 5B
0060 | CE 8E 6A 48 85 4D 09 FF F1 24 AF FA 95 24 A3 21
0070 | 90 1F DB 58 B7 9E 09 0C E4 57 6E F2 65 67 C5 CF
0080 | 82 DA 20 4F 1F A0 4A 64 57 61 24 56 95 77 23 0F
0090 | 60 FD 00 C8 1C 89 F8 BB 92 57 AE F7 41 7F 72 9C
00A0 | C4 43 04 D3 B8 AB 00 06 80 19 52 A9 C3 99 16 6D
00B0 | DC 1E E3 FB D9 10 D9 82 58 2A 9F D2 7A 4D 53 69
00C0 | 6E B9 25 B2 45 A4 24 91 28 FE 9B 3F 5B 0D B5 E1
00D0 | B6 15 E5 E3 00 EA 7F 3B 26 F3 58 A9 2B 10 DE BC
00E0 | B4 03 71 E2 07 97 E3 16 1F 4F 1D 93 D1 7F 4C 08
00F0 | A7 52 3A B6 F3 B8 5F 25 EF B0 5A 35 66 72 72 00
0100 | 2B A7 FF AE F8 D4 A7 AD 34 D1 C5 54 5C 0B 14 EE
0110 | F3 CF C2 F7 E7 24 D9 BF C6 16 E6 28 82 7F B6 3B
0120 | BC 7C D7 9D E3 9F F6 F6 95 12 1A 04 09 14 9A 8F
0130 | 4F C6 E8 C7 76 A5 AE F1 6C 9A 8E 08 E9 1C 70 87
0140 | 7F C6 70 6D CC 39 A0 C8 48 72 14 3C DB 51 AE C7
0150 | ED CC 33 91</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 = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>785B09006A288765</code></td>
<td><code>1CAA09001C318765</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 = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>044CB55A2F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1286953519</td>
<td><code>043BAA1EC7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1001004743</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>04580576E1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1476753121</td>
<td><code>046D15EA57000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1830152791</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 = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010014CE18567E07E7B0A2221FC6</code> <code>9B4CA3ABEA9FD4C64D3C112B52422F02</code> <code>A04372C4BE10BF2734BFFA5E1D8AE271</code> <code>2B9C2D07085AEF79F5E878CFDFD6187D</code> <code>E7276D375C501A738982DA2778880AAA</code> <code>F6D32912D6AFF1AA160EBDF37DF3E8D3</code> <code>BF244C51CF9464B3A2EEFEA79C41622D</code> <code>A8E044633D5617BC5B0AE18398E427F8</code> <code>BC24E31356D8F4CC839C4BA2FA09D098</code> <code>A8A8D605602F68181BD1F2666B32D423</code> <code>9AAD17A6340FF236C400BB378814F4FC</code> <code>1E3B92CD24C353B911D0B2ECAE55A91C</code> <code>B4C9ACF5DEE2A14D0255B9A0C0DDAE82</code> <code>C3005E803FE9905253F881ACD830A0D2</code> <code>926E9D970793657F9B5CE0344F596D14</code> <code>967557488CA3CDF8B4EFF6C817513B9B</code><br> <code>AFB73A72</code></td>
<td><code>FE000100561AFBEC48FFDE4F2B4B0B5B</code> <code>CE8E6A48854D09FFF124AFFA9524A321</code> <code>901FDB58B79E090CE4576EF26567C5CF</code> <code>82DA204F1FA04A64576124569577230F</code> <code>60FD00C81C89F8BB9257AEF7417F729C</code> <code>C44304D3B8AB0006801952A9C399166D</code> <code>DC1EE3FBD910D982582A9FD27A4D5369</code> <code>6EB925B245A4249128FE9B3F5B0DB5E1</code> <code>B615E5E300EA7F3B26F358A92B10DEBC</code> <code>B40371E20797E3161F4F1D93D17F4C08</code> <code>A7523AB6F3B85F25EFB05A3566727200</code> <code>2BA7FFAEF8D4A7AD34D1C5545C0B14EE</code> <code>F3CFC2F7E724D9BFC616E628827FB63B</code> <code>BC7CD79DE39FF6F695121A0409149A8F</code> <code>4FC6E8C776A5AEF16C9A8E08E91C7087</code> <code>7FC6706DCC39A0C84872143CDB51AEC7</code><br> <code>EDCC3391</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<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 44 FB A7 6A 28 87 65
0010 | A8 02 00 00 5C 07 E8 D0 AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6
0030 | D8 4D 0B BE 3A A0 17 2D FE 50 02 00 DC 6E 86 DB
0040 | 59 1C C0 85 6A 72 3D 94 7E EF 1F 71 5B 12 26 6B
0050 | 01 9D 50 17 0A 0C F0 57 2C 15 C5 FE 74 55 E4 1E
0060 | 84 C8 AE A3 13 24 6E 77 8D 72 0E 35 A4 B0 22 54
0070 | E3 E0 4A 28 9D D7 5A 07 E4 B4 61 41 B1 F0 19 0A
0080 | C1 BC 85 FC 92 32 60 52 65 F1 E3 4E EE 1B D8 6E
0090 | 5D 43 40 B0 36 1F B4 09 0E 40 1A 63 46 46 3A 25
00A0 | 52 58 8E 68 5C C1 26 55 B6 A6 5F 79 77 8A 07 43
00B0 | 2A 5A 90 46 7E 8C EF E6 25 EA A5 02 B1 59 23 A7
00C0 | 09 26 06 C8 04 11 9B C2 34 F7 07 32 57 A5 B5 61
00D0 | F4 C6 98 BD E5 5A 43 6E 39 ED B2 9B 6C B8 2B 2A
00E0 | 7C 60 CE 41 6B C1 59 D5 BF C2 C7 85 4A D3 16 48
00F0 | A5 44 99 88 3B 4C 3E 9A D2 BE 56 96 B6 A7 F0 BD
0100 | D8 EC 6F 66 40 B4 42 B0 C6 2A C1 B3 96 8E 47 43
0110 | 6A 21 63 77 C5 64 9D E0 C7 2C 78 AE 3B 84 54 80
0120 | 32 9A 78 68 F6 D0 26 0B 90 67 04 DB 42 54 74 E0
0130 | B8 B1 E7 32 74 DE F5 36 15 C7 49 55 10 F2 DB 4A
0140 | 60 61 24 D0 B1 92 A8 28 2F 85 03 65 92 58 6A DC
0150 | BF CD CF B1 D8 DE D9 7C 5D 4A A1 B6 8F C2 D7 8B
0160 | 32 EE 70 77 9C 96 A0 4C 68 BF 70 BD 83 76 03 00
0170 | 92 C3 48 17 B3 37 37 D7 59 76 5E 05 82 7C A2 D4
0180 | F4 77 44 6B 5A E9 5A FF CE 02 FA 77 17 B9 5F CD
0190 | 50 6D F8 EE 8A 31 72 25 6B 5D 21 2F 88 79 9C C6
01A0 | 77 3F A9 B7 08 4D FD DB B6 3D 3D 94 73 41 61 D8
01B0 | 6D 0A AB 75 DE 83 8E 68 C5 DB 31 B0 E5 4D D9 6D
01C0 | 98 D5 4B 3B CF FE 32 37 AD 8C 1C E9 A0 06 9A 26
01D0 | C6 60 88 64 CA ED 67 6F CD 92 27 8A F7 53 F3 C5
01E0 | F1 21 EA 87 37 6C 63 F6 0C CE D5 42 95 DA 28 A1
01F0 | 36 FC AC C5 3C 32 91 1C A8 61 5B 93 1A 7C 97 3C
0200 | 97 6E 39 93 81 15 7F 12 03 C2 77 F7 01 03 58 E5
0210 | 4E EA 91 78 E0 A7 1A AC F9 9D 74 89 51 85 C7 F8
0220 | B6 06 B3 15 20 F1 9E 27 AD D1 CA 2C 33 63 4D 9B
0230 | 5A FA 02 F3 11 60 0A 0D F4 A7 5D C9 87 84 B9 0C
0240 | 73 FC 93 EE 54 F5 34 8B EA 2D 06 27 CB 7A FA 15
0250 | D7 22 08 EB 89 3C 60 49 02 A4 81 5C 10 22 C5 F6
0260 | 3C 5F 0B C9 41 9A 58 11 41 41 A2 69 87 7D F0 0E
0270 | 03 90 37 BB 18 06 16 5E 19 67 56 F7 F4 12 A8 40
0280 | 85 23 7A AA 8D 90 A7 D5 D2 5A 6A 14</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 8C A7 2D 1D 31 87 65
0010 | D8 02 00 00 5C 07 E8 D0 FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
0030 | 55 7D 76 EB A3 4A 6C 3E FE 50 02 00 CD CA 52 C6
0040 | 8F 39 51 2A 6E C7 85 01 7C 6E BD D1 B2 3B 9E C8
0050 | 04 8A 73 A5 FB EA 8D F4 86 18 19 9D E0 E9 E5 A3
0060 | 07 AD B8 3F D3 65 46 61 28 75 F2 39 7E A8 96 B2
0070 | 4F D3 63 A8 F9 A2 98 20 27 E4 51 D0 F3 0F 99 C6
0080 | 81 FD 69 8E 80 BF 8D DA A1 3A 43 ED C4 E1 0A 55
0090 | CE 4F 29 BB 7D DE 64 40 05 51 EB 5F D4 9E 2D 11
00A0 | 8D CA E8 F4 23 47 32 89 57 59 C0 3A D9 43 08 E6
00B0 | 0E 60 DC 32 9B 0A 18 28 9A 68 E3 FF 9F 92 38 51
00C0 | 5E AA C1 93 1A F3 90 13 49 7B 6D 46 F6 AE 8F BC
00D0 | 20 22 11 27 9D F4 7C 88 67 41 B3 91 60 E6 D4 C5
00E0 | 52 8C 05 C9 83 38 E2 6E A0 8D A0 AB ED D2 19 D0
00F0 | 44 3D FB 2E C9 8F D1 95 51 EB AF 1A 1C 26 33 3B
0100 | 40 16 29 EF BD 83 3B 5F 53 99 17 35 4C 28 06 0C
0110 | 9D 87 96 D0 80 1F 04 BD 05 89 3A 0C B0 84 9E CF
0120 | 29 ED 8B 00 39 56 9C 9E 1C 1A 42 3A A0 88 3D 98
0130 | 73 E7 8B 61 52 EB 7D AC 25 A4 84 17 36 23 2F 74
0140 | 92 F1 D0 17 80 B1 09 6B 31 22 5F ED CE AA D9 5C
0150 | FB A6 4F 03 25 D7 24 DC 62 22 B5 C3 BD 52 E6 81
0160 | 67 59 66 81 E8 0E D0 7B 3B 9E 58 17 F3 0D 30 F0
0170 | CD BE 20 08 F7 78 67 1A DC 4E C6 35 88 C5 7C F6
0180 | D4 E1 42 28 58 14 10 D3 79 E1 3F DB E7 69 01 3B
0190 | 48 10 6B F7 4B EA 66 8C F3 0C 3B 89 28 25 20 BD
01A0 | 44 57 72 B9 43 AC 32 0C 6C 69 37 E7 CE 7E E5 37
01B0 | 84 FD A5 A7 A9 96 7E 1B DB 73 04 30 51 E6 F6 FD
01C0 | 80 4D 49 97 89 BD C0 1E 72 FC F6 AD AD DA 26 F0
01D0 | D8 3C 43 F4 32 F1 8A 6C 14 D0 49 1E B2 B4 FF 35
01E0 | F7 93 D0 23 94 DA D1 F3 C6 2D 9E 90 F2 11 CA A6
01F0 | E9 3C 55 BE 22 44 29 4C 97 C6 97 37 6E F7 B2 BB
0200 | 09 C9 4C 26 8E 69 F2 54 3F 5C EF 20 40 3D FD 2D
0210 | 9F E6 4A 71 84 C6 D0 96 FA 64 E9 32 84 05 79 75
0220 | 0A CF C7 6A A8 FD 79 66 69 E1 1B 88 AC 69 64 F6
0230 | 95 E4 96 9B 96 15 4E F1 8F D1 D0 79 5E B8 50 F7
0240 | ED 99 2A ED B9 4B E7 0F 18 81 03 40 74 4A 47 36
0250 | 9E 11 AF 11 46 18 6F EB 6F 17 F3 B5 49 59 49 68
0260 | 00 E9 BD 97 AD 05 DA CF 78 8E BB DD 85 A5 14 68
0270 | 4D A7 14 30 90 EF 56 04 AE D2 C5 BB EF F8 6F 7A
0280 | 4A 0B 09 D2 28 5B E9 F8 5C B8 79 E5</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 = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0144FBA76A288765</code></td>
<td><code>018CA72D1D318765</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>A8020000</code> (680 in decimal)</td>
<td><code>D8020000</code> (728 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200DC6E86DB591CC0856A723D94</code> <code>7EEF1F715B12266B019D50170A0CF057</code> <code>2C15C5FE7455E41E84C8AEA313246E77</code> <code>8D720E35A4B02254E3E04A289DD75A07</code> <code>E4B46141B1F0190AC1BC85FC92326052</code> <code>65F1E34EEE1BD86E5D4340B0361FB409</code> <code>0E401A6346463A2552588E685CC12655</code> <code>B6A65F79778A07432A5A90467E8CEFE6</code> <code>25EAA502B15923A7092606C804119BC2</code> <code>34F7073257A5B561F4C698BDE55A436E</code> <code>39EDB29B6CB82B2A7C60CE416BC159D5</code> <code>BFC2C7854AD31648A54499883B4C3E9A</code> <code>D2BE5696B6A7F0BDD8EC6F6640B442B0</code> <code>C62AC1B3968E47436A216377C5649DE0</code> <code>C72C78AE3B845480329A7868F6D0260B</code> <code>906704DB425474E0B8B1E73274DEF536</code> <code>15C7495510F2DB4A606124D0B192A828</code> <code>2F85036592586ADCBFCDCFB1D8DED97C</code> <code>5D4AA1B68FC2D78B32EE70779C96A04C</code> <code>68BF70BD8376030092C34817B33737D7</code> <code>59765E05827CA2D4F477446B5AE95AFF</code> <code>CE02FA7717B95FCD506DF8EE8A317225</code> <code>6B5D212F88799CC6773FA9B7084DFDDB</code> <code>B63D3D94734161D86D0AAB75DE838E68</code> <code>C5DB31B0E54DD96D98D54B3BCFFE3237</code> <code>AD8C1CE9A0069A26C6608864CAED676F</code> <code>CD92278AF753F3C5F121EA87376C63F6</code> <code>0CCED54295DA28A136FCACC53C32911C</code> <code>A8615B931A7C973C976E399381157F12</code> <code>03C277F7010358E54EEA9178E0A71AAC</code> <code>F99D74895185C7F8B606B31520F19E27</code> <code>ADD1CA2C33634D9B5AFA02F311600A0D</code> <code>F4A75DC98784B90C73FC93EE54F5348B</code> <code>EA2D0627CB7AFA15D72208EB893C6049</code> <code>02A4815C1022C5F63C5F0BC9419A5811</code> <code>4141A269877DF00E039037BB1806165E</code> <code>196756F7F412A84085237AAA8D90A7D5</code><br> <code>D25A6A14</code></td>
<td><code>FE500200CDCA52C68F39512A6EC78501</code> <code>7C6EBDD1B23B9EC8048A73A5FBEA8DF4</code> <code>8618199DE0E9E5A307ADB83FD3654661</code> <code>2875F2397EA896B24FD363A8F9A29820</code> <code>27E451D0F30F99C681FD698E80BF8DDA</code> <code>A13A43EDC4E10A55CE4F29BB7DDE6440</code> <code>0551EB5FD49E2D118DCAE8F423473289</code> <code>5759C03AD94308E60E60DC329B0A1828</code> <code>9A68E3FF9F9238515EAAC1931AF39013</code> <code>497B6D46F6AE8FBC202211279DF47C88</code> <code>6741B39160E6D4C5528C05C98338E26E</code> <code>A08DA0ABEDD219D0443DFB2EC98FD195</code> <code>51EBAF1A1C26333B401629EFBD833B5F</code> <code>539917354C28060C9D8796D0801F04BD</code> <code>05893A0CB0849ECF29ED8B0039569C9E</code> <code>1C1A423AA0883D9873E78B6152EB7DAC</code> <code>25A4841736232F7492F1D01780B1096B</code> <code>31225FEDCEAAD95CFBA64F0325D724DC</code> <code>6222B5C3BD52E68167596681E80ED07B</code> <code>3B9E5817F30D30F0CDBE2008F778671A</code> <code>DC4EC63588C57CF6D4E14228581410D3</code> <code>79E13FDBE769013B48106BF74BEA668C</code> <code>F30C3B89282520BD445772B943AC320C</code> <code>6C6937E7CE7EE53784FDA5A7A9967E1B</code> <code>DB73043051E6F6FD804D499789BDC01E</code> <code>72FCF6ADADDA26F0D83C43F432F18A6C</code> <code>14D0491EB2B4FF35F793D02394DAD1F3</code> <code>C62D9E90F211CAA6E93C55BE2244294C</code> <code>97C697376EF7B2BB09C94C268E69F254</code> <code>3F5CEF20403DFD2D9FE64A7184C6D096</code> <code>FA64E932840579750ACFC76AA8FD7966</code> <code>69E11B88AC6964F695E4969B96154EF1</code> <code>8FD1D0795EB850F7ED992AEDB94BE70F</code> <code>18810340744A47369E11AF1146186FEB</code> <code>6F17F3B54959496800E9BD97AD05DACF</code> <code>788EBBDD85A514684DA7143090EF5604</code> <code>AED2C5BBEFF86F7A4A0B09D2285BE9F8</code><br> <code>5CB879E5</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 2908A6605A3DB526D5984C4221B6B5675DCEA7B249B29CA437471CB5E
<!-- 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 = DC6E86DB591CC0856A723D947EEF1F715B12266B019D50170A0CF0572C15C5FE7455E41E84C8AEA313246E778D720E35A4B02254E3E04A289DD75A07E4B46141B1F0190AC1BC85FC9232605265F1E34EEE1BD86E5D4340B0361FB4090E401A6346463A2552588E685CC12655B6A65F79778A07432A5A90467E8CEFE625EAA502B15923A7092606C804119BC234F7073257A5B561F4C698BDE55A436E39EDB29B6CB82B2A7C60CE416BC159D5BFC2C7854AD31648A54499883B4C3E9AD2BE5696B6A7F0BDD8EC6F6640B442B0C62AC1B3968E47436A216377C5649DE0C72C78AE3B845480329A7868F6D0260B906704DB425474E0B8B1E73274DEF53615C7495510F2DB4A606124D0B192A8282F85036592586ADCBFCDCFB1D8DED97C5D4AA1B68FC2D78B32EE70779C96A04C68BF70BD8376030092C34817B33737D759765E05827CA2D4F477446B5AE95AFFCE02FA7717B95FCD506DF8EE8A3172256B5D212F88799CC6773FA9B7084DFDDBB63D3D94734161D86D0AAB75DE838E68C5DB31B0E54DD96D98D54B3BCFFE3237AD8C1CE9A0069A26C6608864CAED676FCD92278AF753F3C5F121EA87376C63F60CCED54295DA28A136FCACC53C32911CA8615B931A7C973C976E399381157F1203C277F7010358E54EEA9178E0A71AACF99D74895185C7F8B606B31520F19E27ADD1CA2C33634D9B5AFA02F311600A0DF4A75DC98784B90C73FC93EE54F5348BEA2D0627CB7AFA15D72208EB893C604902A4815C1022C5F63C5F0BC9419A58114141A269877DF00E039037BB1806165E196756F7F412A84085237AAA8D90A7D5D25A6A14
tmp_aes_key = E22B38C451C5CAAD463303B485C7E600941F2C9CC4707A08024C1CEF4A830DCA
tmp_aes_iv = 527793E83B9AB7FB8C8F70BD977F382287996678B1CA4491600094AF47437583</code></pre>
<pre><code>encrypted_answer = CDCA52C68F39512A6EC785017C6EBDD1B23B9EC8048A73A5FBEA8DF48618199DE0E9E5A307ADB83FD36546612875F2397EA896B24FD363A8F9A2982027E451D0F30F99C681FD698E80BF8DDAA13A43EDC4E10A55CE4F29BB7DDE64400551EB5FD49E2D118DCAE8F4234732895759C03AD94308E60E60DC329B0A18289A68E3FF9F9238515EAAC1931AF39013497B6D46F6AE8FBC202211279DF47C886741B39160E6D4C5528C05C98338E26EA08DA0ABEDD219D0443DFB2EC98FD19551EBAF1A1C26333B401629EFBD833B5F539917354C28060C9D8796D0801F04BD05893A0CB0849ECF29ED8B0039569C9E1C1A423AA0883D9873E78B6152EB7DAC25A4841736232F7492F1D01780B1096B31225FEDCEAAD95CFBA64F0325D724DC6222B5C3BD52E68167596681E80ED07B3B9E5817F30D30F0CDBE2008F778671ADC4EC63588C57CF6D4E14228581410D379E13FDBE769013B48106BF74BEA668CF30C3B89282520BD445772B943AC320C6C6937E7CE7EE53784FDA5A7A9967E1BDB73043051E6F6FD804D499789BDC01E72FCF6ADADDA26F0D83C43F432F18A6C14D0491EB2B4FF35F793D02394DAD1F3C62D9E90F211CAA6E93C55BE2244294C97C697376EF7B2BB09C94C268E69F2543F5CEF20403DFD2D9FE64A7184C6D096FA64E932840579750ACFC76AA8FD796669E11B88AC6964F695E4969B96154EF18FD1D0795EB850F7ED992AEDB94BE70F18810340744A47369E11AF1146186FEB6F17F3B54959496800E9BD97AD05DACF788EBBDD85A514684DA7143090EF5604AED2C5BBEFF86F7A4A0B09D2285BE9F85CB879E5
tmp_aes_key = 050071522CD4EC58F1029B6A0DED20B8DEB6DB3D988487B3D57073640A5509ED
tmp_aes_iv = 44744AEF8CA0A04940257D3E1D792720CBAFD0A13FFD92BE33D77071ACDE69ED</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 58B93B7E6389D04EB04F9A364F84B1827A7D91E7BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010097B45C13074C36BD49796FFDE5830CBA658EBB755A31FEDB1FCC8E57B2EADF64A41EA6B9FA9769D12AFEC403CF043FA1BA747164B609802E9429F81A76C89B1CCD77E753298A41AF787D71111865636F1168285A7321678DBFA99F775C760F215F0917F11975271232BB201DD6FAB340D199E71F56EDF5943FED916B73A87EB7AE77AA062E07D10A270D2EF808494546CE863765E311BEA5D7F8E45D163910963E051B501D5D73496A373D08B9528D0461E28CF753326683F898BAC91AF8D78042BBD01D0D49BF98468CF3BCA895B87885C6FBF852ADD8069D93C6ACB74B192EAEAC689059074B5201B1E42AC505DDD765C5DB8FBD7B6D918EBCE67A17BE23016A288765F0C5EEB395B10347
answer = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010097B45C13074C36BD49796FFDE5830CBA658EBB755A31FEDB1FCC8E57B2EADF64A41EA6B9FA9769D12AFEC403CF043FA1BA747164B609802E9429F81A76C89B1CCD77E753298A41AF787D71111865636F1168285A7321678DBFA99F775C760F215F0917F11975271232BB201DD6FAB340D199E71F56EDF5943FED916B73A87EB7AE77AA062E07D10A270D2EF808494546CE863765E311BEA5D7F8E45D163910963E051B501D5D73496A373D08B9528D0461E28CF753326683F898BAC91AF8D78042BBD01D0D49BF98468CF3BCA895B87885C6FBF852ADD8069D93C6ACB74B192EAEAC689059074B5201B1E42AC505DDD765C5DB8FBD7B6D918EBCE67A17BE23016A288765F0C5EEB395B10347</code></pre>
<pre><code>answer_with_hash = B78BBC01EF7F1928AB5FEDF5711DDA3B7DDD74E2BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EBECA4AB9A6BD13C5469948B1587CD0BB5D994F5B3D982246AD4C518BA1E0E0EC627F5EC0F35816EED57ABAF2A6976C675DF84E2B7D36ED78EF66C355D88505947D59EF5A3458852D00E6431D4642597CACF0544C7522E62E58F55DC07D1DE01A0B603AC209A3D87B9DB4030813061C6D45604ABF3B3B605593BEAE6EDDFDB21E8DF4F9A81A89BA3E6E3A8F22ED0FBE08EAA492BF82C403C8E077BBF817C31324C6557D9AEC745FF2435A779B0DCB320AC591774FB10137DE81E65F75591A06399A3FAC28778F17A2B986AB3A8F4122B2CB404073AC80D27DA4699E02C5BC250EDF6B45A3612585576B95B9A7B0214A248EA3A0A267B34832BA10E53CFF3AFC1D3187650453E427FFAC57B7
answer = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EBECA4AB9A6BD13C5469948B1587CD0BB5D994F5B3D982246AD4C518BA1E0E0EC627F5EC0F35816EED57ABAF2A6976C675DF84E2B7D36ED78EF66C355D88505947D59EF5A3458852D00E6431D4642597CACF0544C7522E62E58F55DC07D1DE01A0B603AC209A3D87B9DB4030813061C6D45604ABF3B3B605593BEAE6EDDFDB21E8DF4F9A81A89BA3E6E3A8F22ED0FBE08EAA492BF82C403C8E077BBF817C31324C6557D9AEC745FF2435A779B0DCB320AC591774FB10137DE81E65F75591A06399A3FAC28778F17A2B986AB3A8F4122B2CB404073AC80D27DA4699E02C5BC250EDF6B45A3612585576B95B9A7B0214A248EA3A0A267B34832BA10E53CFF3AFC1D3187650453E427FFAC57B7</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 AE E3 68 33 0D 08 E5 0D 8A DF C5 39
0010 | 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6 D8 4D 0B BE
0020 | 3A A0 17 2D 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 FB E9 D8 14 18 04 88 D9 D5 41 F4 89
0010 | 59 74 00 FB C8 49 6E 59 A0 44 46 E9 55 7D 76 EB
0020 | A3 4A 6C 3E 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 = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
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 | 97 B4 5C 13 07 4C 36 BD 49 79 6F FD E5 83 0C BA
0140 | 65 8E BB 75 5A 31 FE DB 1F CC 8E 57 B2 EA DF 64
0150 | A4 1E A6 B9 FA 97 69 D1 2A FE C4 03 CF 04 3F A1
0160 | BA 74 71 64 B6 09 80 2E 94 29 F8 1A 76 C8 9B 1C
0170 | CD 77 E7 53 29 8A 41 AF 78 7D 71 11 18 65 63 6F
0180 | 11 68 28 5A 73 21 67 8D BF A9 9F 77 5C 76 0F 21
0190 | 5F 09 17 F1 19 75 27 12 32 BB 20 1D D6 FA B3 40
01A0 | D1 99 E7 1F 56 ED F5 94 3F ED 91 6B 73 A8 7E B7
01B0 | AE 77 AA 06 2E 07 D1 0A 27 0D 2E F8 08 49 45 46
01C0 | CE 86 37 65 E3 11 BE A5 D7 F8 E4 5D 16 39 10 96
01D0 | 3E 05 1B 50 1D 5D 73 49 6A 37 3D 08 B9 52 8D 04
01E0 | 61 E2 8C F7 53 32 66 83 F8 98 BA C9 1A F8 D7 80
01F0 | 42 BB D0 1D 0D 49 BF 98 46 8C F3 BC A8 95 B8 78
0200 | 85 C6 FB F8 52 AD D8 06 9D 93 C6 AC B7 4B 19 2E
0210 | AE AC 68 90 59 07 4B 52 01 B1 E4 2A C5 05 DD D7
0220 | 65 C5 DB 8F BD 7B 6D 91 8E BC E6 7A 17 BE 23 01
0230 | 6A 28 87 65</code></pre>
0130 | 0E BE CA 4A B9 A6 BD 13 C5 46 99 48 B1 58 7C D0
0140 | BB 5D 99 4F 5B 3D 98 22 46 AD 4C 51 8B A1 E0 E0
0150 | EC 62 7F 5E C0 F3 58 16 EE D5 7A BA F2 A6 97 6C
0160 | 67 5D F8 4E 2B 7D 36 ED 78 EF 66 C3 55 D8 85 05
0170 | 94 7D 59 EF 5A 34 58 85 2D 00 E6 43 1D 46 42 59
0180 | 7C AC F0 54 4C 75 22 E6 2E 58 F5 5D C0 7D 1D E0
0190 | 1A 0B 60 3A C2 09 A3 D8 7B 9D B4 03 08 13 06 1C
01A0 | 6D 45 60 4A BF 3B 3B 60 55 93 BE AE 6E DD FD B2
01B0 | 1E 8D F4 F9 A8 1A 89 BA 3E 6E 3A 8F 22 ED 0F BE
01C0 | 08 EA A4 92 BF 82 C4 03 C8 E0 77 BB F8 17 C3 13
01D0 | 24 C6 55 7D 9A EC 74 5F F2 43 5A 77 9B 0D CB 32
01E0 | 0A C5 91 77 4F B1 01 37 DE 81 E6 5F 75 59 1A 06
01F0 | 39 9A 3F AC 28 77 8F 17 A2 B9 86 AB 3A 8F 41 22
0200 | B2 CB 40 40 73 AC 80 D2 7D A4 69 9E 02 C5 BC 25
0210 | 0E DF 6B 45 A3 61 25 85 57 6B 95 B9 A7 B0 21 4A
0220 | 24 8E A3 A0 A2 67 B3 48 32 BA 10 E5 3C FF 3A FC
0230 | 1D 31 87 65</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE00010097B45C13074C36BD49796FFD</code> <code>E5830CBA658EBB755A31FEDB1FCC8E57</code> <code>B2EADF64A41EA6B9FA9769D12AFEC403</code> <code>CF043FA1BA747164B609802E9429F81A</code> <code>76C89B1CCD77E753298A41AF787D7111</code> <code>1865636F1168285A7321678DBFA99F77</code> <code>5C760F215F0917F11975271232BB201D</code> <code>D6FAB340D199E71F56EDF5943FED916B</code> <code>73A87EB7AE77AA062E07D10A270D2EF8</code> <code>08494546CE863765E311BEA5D7F8E45D</code> <code>163910963E051B501D5D73496A373D08</code> <code>B9528D0461E28CF753326683F898BAC9</code> <code>1AF8D78042BBD01D0D49BF98468CF3BC</code> <code>A895B87885C6FBF852ADD8069D93C6AC</code> <code>B74B192EAEAC689059074B5201B1E42A</code> <code>C505DDD765C5DB8FBD7B6D918EBCE67A</code><br> <code>17BE2301</code></td>
<td><code>FE0001000EBECA4AB9A6BD13C5469948</code> <code>B1587CD0BB5D994F5B3D982246AD4C51</code> <code>8BA1E0E0EC627F5EC0F35816EED57ABA</code> <code>F2A6976C675DF84E2B7D36ED78EF66C3</code> <code>55D88505947D59EF5A3458852D00E643</code> <code>1D4642597CACF0544C7522E62E58F55D</code> <code>C07D1DE01A0B603AC209A3D87B9DB403</code> <code>0813061C6D45604ABF3B3B605593BEAE</code> <code>6EDDFDB21E8DF4F9A81A89BA3E6E3A8F</code> <code>22ED0FBE08EAA492BF82C403C8E077BB</code> <code>F817C31324C6557D9AEC745FF2435A77</code> <code>9B0DCB320AC591774FB10137DE81E65F</code> <code>75591A06399A3FAC28778F17A2B986AB</code> <code>3A8F4122B2CB404073AC80D27DA4699E</code> <code>02C5BC250EDF6B45A3612585576B95B9</code> <code>A7B0214A248EA3A0A267B34832BA10E5</code><br> <code>3CFF3AFC</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>6A288765</code> (1703356522 in decimal)</td>
<td><code>1D318765</code> (1703358749 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
<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 = CD1D19B18C3F7C89246A9086F56C4321CF136B5D4ABE202952EE25BFEB0B718CEEB87C94BE2E4FB392ED6857BCCEAB4DFAB49E099BEDC809AE21E541E75700DD1225D0BD1E50792AF42D48752E8EB673FFC35DF8B55FA51E87ED8ACDBDF72B9EB0F624D484BE4585EA5AEB8C01DC49453029861B738D8D52383478C5A24D9E3CC1E8CD93AFC86C4C2D08624B9EFC8D1DCB9619032D489FC6F98A0AC75428C96ED3C3177BCD5002FEA409F81DDE313A43868A9D41E0E81779C40100957DA88EC7BE73ABF8FFA8EA85FDF15E2A3C58E088A0D279CACC8590FC596DAA3933F7AC63B5557387998B42C41EF34522A394DE886D7D7D1F8AD3A3A03C1C7827D5A66D9E</code></pre>
<pre><code>b = A200BEC0B512C01DA3F2C4ECFF032337678B18CD181F71C09DCBA4D7B8606794203779F5AD80C02DDF09B7C775E6E73B69EC44BB280F61F8081AFDDC5EBD5EDB636F5410DA4CF1F35B69895189606E068C3AB401DEFA54C3D0F9706264E30229F51F92A9CECA5AEB65354E23679E4DE180A45ECB8B55A239CC4A8D50831F27824419036C1CE5D21A1E38FC7C9074C4350618D55537C95FE44AA143757C73A80ECEEEAC7309E87C00A83C005FAE22C5899AE4F101D21C1455924746D04F8CACE16ACC853A13C23F8DA02CC24300B680E9B911DB212EFD70946E0DE782C38D2D38BDA6627FDBFE2A424A6A3A484BB7308FF952D5A8831A80592F9463AEBAAF7733</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 = 9B04F50FDBA9644330F26411B11045029F7DA63F7B06163F841745BD88170643C8444F81E7E3B35B2B31E5F78D4ABC4FAEBB9942F2D785BD98D5EF8F806D92A949E7C2E533192059CEEBE23AEC3334CB517580CA026B5245704D15139E2CF96F83BFFB40A6FE1934BE0B74438D9326B317ACCAF520B4B2F695650A12E5C56FDE4F1CFFA9172E7991E6F6E100D90AB29004E9AB4CC00399A922AFFA842373EA54D2C8888737C3EF8CA5F123A9291BAE01999DA91BC98E6656C11EA5DA88C3B01222C1CA8EF114613F44966A73214102F9D0880CC3466101D6E0EC6AA27E3BD081BE0690A39F1D0407E77F1AE6C4C9342D65D6A3AAA6D7274D01D8CA455C8A4B15</code></pre>
<pre><code>g_b = 9F61A8A79723EC5735659D63236CC4170AD5FEB7AC7F1B1539B7A3E75BF1288BF3DBD7493D22F650BB0A8B17BA5F2A7EF7CBE1EE148C73520653C1E9AB627929962C4606B4BE4724D121084268873775029C1A34D3F70455018CC599D09EC02EEB4625B804FE34E42B8F26AD5F87675202CD7CCAC9964CF1D925558BA1540DAB0ACBA68FE752C776A5659CDFB802451F359F4F7B24A8A19527C4B62813AC9DAA0D368633E1D1EE2A697166C5C9000ABD8998FC1AE3FFD9A739952E9503BC676D7E0C9C329E61C3C0255C0A5A45F39F9234190EE37027F53207FB068DD3A918F738E216C0B4A57A6E5DB01691F43D2B0F7197D8CDA45733D7420E3AD9D4C932AA</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 AE E3 68 33 0D 08 E5 0D 8A DF C5 39
0010 | 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6 D8 4D 0B BE
0020 | 3A A0 17 2D 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 9B 04 F5 0F DB A9 64 43 30 F2 64 11 B1 10 45 02
0040 | 9F 7D A6 3F 7B 06 16 3F 84 17 45 BD 88 17 06 43
0050 | C8 44 4F 81 E7 E3 B3 5B 2B 31 E5 F7 8D 4A BC 4F
0060 | AE BB 99 42 F2 D7 85 BD 98 D5 EF 8F 80 6D 92 A9
0070 | 49 E7 C2 E5 33 19 20 59 CE EB E2 3A EC 33 34 CB
0080 | 51 75 80 CA 02 6B 52 45 70 4D 15 13 9E 2C F9 6F
0090 | 83 BF FB 40 A6 FE 19 34 BE 0B 74 43 8D 93 26 B3
00A0 | 17 AC CA F5 20 B4 B2 F6 95 65 0A 12 E5 C5 6F DE
00B0 | 4F 1C FF A9 17 2E 79 91 E6 F6 E1 00 D9 0A B2 90
00C0 | 04 E9 AB 4C C0 03 99 A9 22 AF FA 84 23 73 EA 54
00D0 | D2 C8 88 87 37 C3 EF 8C A5 F1 23 A9 29 1B AE 01
00E0 | 99 9D A9 1B C9 8E 66 56 C1 1E A5 DA 88 C3 B0 12
00F0 | 22 C1 CA 8E F1 14 61 3F 44 96 6A 73 21 41 02 F9
0100 | D0 88 0C C3 46 61 01 D6 E0 EC 6A A2 7E 3B D0 81
0110 | BE 06 90 A3 9F 1D 04 07 E7 7F 1A E6 C4 C9 34 2D
0120 | 65 D6 A3 AA A6 D7 27 4D 01 D8 CA 45 5C 8A 4B 15</code></pre>
<pre><code>0000 | 54 B6 43 66 FB E9 D8 14 18 04 88 D9 D5 41 F4 89
0010 | 59 74 00 FB C8 49 6E 59 A0 44 46 E9 55 7D 76 EB
0020 | A3 4A 6C 3E 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 9F 61 A8 A7 97 23 EC 57 35 65 9D 63 23 6C C4 17
0040 | 0A D5 FE B7 AC 7F 1B 15 39 B7 A3 E7 5B F1 28 8B
0050 | F3 DB D7 49 3D 22 F6 50 BB 0A 8B 17 BA 5F 2A 7E
0060 | F7 CB E1 EE 14 8C 73 52 06 53 C1 E9 AB 62 79 29
0070 | 96 2C 46 06 B4 BE 47 24 D1 21 08 42 68 87 37 75
0080 | 02 9C 1A 34 D3 F7 04 55 01 8C C5 99 D0 9E C0 2E
0090 | EB 46 25 B8 04 FE 34 E4 2B 8F 26 AD 5F 87 67 52
00A0 | 02 CD 7C CA C9 96 4C F1 D9 25 55 8B A1 54 0D AB
00B0 | 0A CB A6 8F E7 52 C7 76 A5 65 9C DF B8 02 45 1F
00C0 | 35 9F 4F 7B 24 A8 A1 95 27 C4 B6 28 13 AC 9D AA
00D0 | 0D 36 86 33 E1 D1 EE 2A 69 71 66 C5 C9 00 0A BD
00E0 | 89 98 FC 1A E3 FF D9 A7 39 95 2E 95 03 BC 67 6D
00F0 | 7E 0C 9C 32 9E 61 C3 C0 25 5C 0A 5A 45 F3 9F 92
0100 | 34 19 0E E3 70 27 F5 32 07 FB 06 8D D3 A9 18 F7
0110 | 38 E2 16 C0 B4 A5 7A 6E 5D B0 16 91 F4 3D 2B 0F
0120 | 71 97 D8 CD A4 57 33 D7 42 0E 3A D9 D4 C9 32 AA</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 = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001009B04F50FDBA9644330F26411</code> <code>B11045029F7DA63F7B06163F841745BD</code> <code>88170643C8444F81E7E3B35B2B31E5F7</code> <code>8D4ABC4FAEBB9942F2D785BD98D5EF8F</code> <code>806D92A949E7C2E533192059CEEBE23A</code> <code>EC3334CB517580CA026B5245704D1513</code> <code>9E2CF96F83BFFB40A6FE1934BE0B7443</code> <code>8D9326B317ACCAF520B4B2F695650A12</code> <code>E5C56FDE4F1CFFA9172E7991E6F6E100</code> <code>D90AB29004E9AB4CC00399A922AFFA84</code> <code>2373EA54D2C8888737C3EF8CA5F123A9</code> <code>291BAE01999DA91BC98E6656C11EA5DA</code> <code>88C3B01222C1CA8EF114613F44966A73</code> <code>214102F9D0880CC3466101D6E0EC6AA2</code> <code>7E3BD081BE0690A39F1D0407E77F1AE6</code> <code>C4C9342D65D6A3AAA6D7274D01D8CA45</code><br> <code>5C8A4B15</code></td>
<td><code>FE0001009F61A8A79723EC5735659D63</code> <code>236CC4170AD5FEB7AC7F1B1539B7A3E7</code> <code>5BF1288BF3DBD7493D22F650BB0A8B17</code> <code>BA5F2A7EF7CBE1EE148C73520653C1E9</code> <code>AB627929962C4606B4BE4724D1210842</code> <code>68873775029C1A34D3F70455018CC599</code> <code>D09EC02EEB4625B804FE34E42B8F26AD</code> <code>5F87675202CD7CCAC9964CF1D925558B</code> <code>A1540DAB0ACBA68FE752C776A5659CDF</code> <code>B802451F359F4F7B24A8A19527C4B628</code> <code>13AC9DAA0D368633E1D1EE2A697166C5</code> <code>C9000ABD8998FC1AE3FFD9A739952E95</code> <code>03BC676D7E0C9C329E61C3C0255C0A5A</code> <code>45F39F9234190EE37027F53207FB068D</code> <code>D3A918F738E216C0B4A57A6E5DB01691</code> <code>F43D2B0F7197D8CDA45733D7420E3AD9</code><br> <code>D4C932AA</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 = BA0D89B5AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172
<!-- 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 = 54B64366AEE368330D08E50D8ADFC5398AFBC2A3B8ABF05DE7C635F6D84D0BBE3AA0172D0000000000000000FE0001009B04F50FDBA9644330F26411B11045029F7DA63F7B06163F841745BD88170643C8444F81E7E3B35B2B31E5F78D4ABC4FAEBB9942F2D785BD98D5EF8F806D92A949E7C2E533192059CEEBE23AEC3334CB517580CA026B5245704D15139E2CF96F83BFFB40A6FE1934BE0B74438D9326B317ACCAF520B4B2F695650A12E5C56FDE4F1CFFA9172E7991E6F6E100D90AB29004E9AB4CC00399A922AFFA842373EA54D2C8888737C3EF8CA5F123A9291BAE01999DA91BC98E6656C11EA5DA88C3B01222C1CA8EF114613F44966A73214102F9D0880CC3466101D6E0EC6AA27E3BD081BE0690A39F1D0407E77F1AE6C4C9342D65D6A3AAA6D7274D01D8CA455C8A4B15
padding = A86DBE9E5537F60097E490DF
tmp_aes_key = E22B38C451C5CAAD463303B485C7E600941F2C9CC4707A08024C1CEF4A830DCA
tmp_aes_iv = 527793E83B9AB7FB8C8F70BD977F382287996678B1CA4491600094AF47437583</code></pre>
<pre><code>data = 54B64366FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E0000000000000000FE0001009F61A8A79723EC5735659D63236CC4170AD5FEB7AC7F1B1539B7A3E75BF1288BF3DBD7493D22F650BB0A8B17BA5F2A7EF7CBE1EE148C73520653C1E9AB627929962C4606B4BE4724D121084268873775029C1A34D3F70455018CC599D09EC02EEB4625B804FE34E42B8F26AD5F87675202CD7CCAC9964CF1D925558BA1540DAB0ACBA68FE752C776A5659CDFB802451F359F4F7B24A8A19527C4B62813AC9DAA0D368633E1D1EE2A697166C5C9000ABD8998FC1AE3FFD9A739952E9503BC676D7E0C9C329E61C3C0255C0A5A45F39F9234190EE37027F53207FB068DD3A918F738E216C0B4A57A6E5DB01691F43D2B0F7197D8CDA45733D7420E3AD9D4C932AA
padding = 8567AEC2B46C93B00DBFE546
tmp_aes_key = 050071522CD4EC58F1029B6A0DED20B8DEB6DB3D988487B3D57073640A5509ED
tmp_aes_iv = 44744AEF8CA0A04940257D3E1D792720CBAFD0A13FFD92BE33D77071ACDE69ED</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 = 2F876FE34BFA63A85077F6A6385EDC8F6A329B7154F86593B466F41EBF6571E4F3BE1564651BB0B9F2755A8C44D8E682730F0AED528BA703F0800B788E656AD901DDD5D587C325B601320E6878A158D4877699D3A41F50F3A237FE5AA3551B1B28A5002C37D5E3AF0BDAE3EADD93A8167E2C98F2228A32233E47639CFFCD64C50653C8B3FF59F5E0736E4E5BE407DF6C716D672E0DB3487EA8CFA2A835013587B39CF7979DD07823841D19EBC43FEF8A994952D710DFA5EE5129BE13FE451A55E487661AF90D396CF38A574FDDC3A4BEA38D13054147ADD7119DBCD5A6B6048EBEB57ADE7E2D70EEBE1758BCF11F62440469B7BE80594BBB95AFA90496587577A2FE26B891A2D231B4D9D3A945E4DBE01CC6024B0F5FCED00304355515A9F3567C723A2164F31E4EDCB0DBE52F76F4A93D649543DFAE9349A1F65108E8DB09AF5BE8EE042771816B9A148694BCD6997D</code></pre>
<pre><code>encrypted_data = 1B6EAFDA50DB20640D6D3532C120E7A1F1017D23E9BD6C1FA6CBE7A2F0EAA37167BFB3D02DB03B3497F046C2E802DB613BADE6DFEBE27CE0458451D7A84E0F643FDAB28C545C9826F6D765F58B2CC54CC1DA23E850619597C0E1896BA0FB1945A8F38AEA063D0AE633382DEB77DA5BF87BAEB8911314C0BDE1FD85803CF69FC16B834A1315629D06868B39D3C8C57BDACF830051072ACAD79EC9FAA05EA7FB85EBD0F36BC7C900958466CB3CFF15C2674275483DC47252D3611943AFA33DC4A45FAB2A206650E5766A6A83B6AB695D484ADDE406BDFC3216739E78AA3D05F0B5A2F1E92B2DA1D80DCB64B0A51B33FC85D9A6AAC1171477219187EFB13167CD8F64F34EBFBFB2F1A421FBD7A1EB2D43116AD63BAE95D0B15C4355FDC044338102CA0068A4D884CC6A84CA65FD5673248B71994EF4B0D7890C00C3CE7CADB16C709F25C67E5EBEE012BE0FA1EEE6A9EB05</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 7C 5B 09 00 6A 28 87 65
0010 | 78 01 00 00 1F 5F 04 F5 AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6
0030 | D8 4D 0B BE 3A A0 17 2D FE 50 01 00 2F 87 6F E3
0040 | 4B FA 63 A8 50 77 F6 A6 38 5E DC 8F 6A 32 9B 71
0050 | 54 F8 65 93 B4 66 F4 1E BF 65 71 E4 F3 BE 15 64
0060 | 65 1B B0 B9 F2 75 5A 8C 44 D8 E6 82 73 0F 0A ED
0070 | 52 8B A7 03 F0 80 0B 78 8E 65 6A D9 01 DD D5 D5
0080 | 87 C3 25 B6 01 32 0E 68 78 A1 58 D4 87 76 99 D3
0090 | A4 1F 50 F3 A2 37 FE 5A A3 55 1B 1B 28 A5 00 2C
00A0 | 37 D5 E3 AF 0B DA E3 EA DD 93 A8 16 7E 2C 98 F2
00B0 | 22 8A 32 23 3E 47 63 9C FF CD 64 C5 06 53 C8 B3
00C0 | FF 59 F5 E0 73 6E 4E 5B E4 07 DF 6C 71 6D 67 2E
00D0 | 0D B3 48 7E A8 CF A2 A8 35 01 35 87 B3 9C F7 97
00E0 | 9D D0 78 23 84 1D 19 EB C4 3F EF 8A 99 49 52 D7
00F0 | 10 DF A5 EE 51 29 BE 13 FE 45 1A 55 E4 87 66 1A
0100 | F9 0D 39 6C F3 8A 57 4F DD C3 A4 BE A3 8D 13 05
0110 | 41 47 AD D7 11 9D BC D5 A6 B6 04 8E BE B5 7A DE
0120 | 7E 2D 70 EE BE 17 58 BC F1 1F 62 44 04 69 B7 BE
0130 | 80 59 4B BB 95 AF A9 04 96 58 75 77 A2 FE 26 B8
0140 | 91 A2 D2 31 B4 D9 D3 A9 45 E4 DB E0 1C C6 02 4B
0150 | 0F 5F CE D0 03 04 35 55 15 A9 F3 56 7C 72 3A 21
0160 | 64 F3 1E 4E DC B0 DB E5 2F 76 F4 A9 3D 64 95 43
0170 | DF AE 93 49 A1 F6 51 08 E8 DB 09 AF 5B E8 EE 04
0180 | 27 71 81 6B 9A 14 86 94 BC D6 99 7D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 4C F9 03 00 1D 31 87 65
0010 | 78 01 00 00 1F 5F 04 F5 FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
0030 | 55 7D 76 EB A3 4A 6C 3E FE 50 01 00 1B 6E AF DA
0040 | 50 DB 20 64 0D 6D 35 32 C1 20 E7 A1 F1 01 7D 23
0050 | E9 BD 6C 1F A6 CB E7 A2 F0 EA A3 71 67 BF B3 D0
0060 | 2D B0 3B 34 97 F0 46 C2 E8 02 DB 61 3B AD E6 DF
0070 | EB E2 7C E0 45 84 51 D7 A8 4E 0F 64 3F DA B2 8C
0080 | 54 5C 98 26 F6 D7 65 F5 8B 2C C5 4C C1 DA 23 E8
0090 | 50 61 95 97 C0 E1 89 6B A0 FB 19 45 A8 F3 8A EA
00A0 | 06 3D 0A E6 33 38 2D EB 77 DA 5B F8 7B AE B8 91
00B0 | 13 14 C0 BD E1 FD 85 80 3C F6 9F C1 6B 83 4A 13
00C0 | 15 62 9D 06 86 8B 39 D3 C8 C5 7B DA CF 83 00 51
00D0 | 07 2A CA D7 9E C9 FA A0 5E A7 FB 85 EB D0 F3 6B
00E0 | C7 C9 00 95 84 66 CB 3C FF 15 C2 67 42 75 48 3D
00F0 | C4 72 52 D3 61 19 43 AF A3 3D C4 A4 5F AB 2A 20
0100 | 66 50 E5 76 6A 6A 83 B6 AB 69 5D 48 4A DD E4 06
0110 | BD FC 32 16 73 9E 78 AA 3D 05 F0 B5 A2 F1 E9 2B
0120 | 2D A1 D8 0D CB 64 B0 A5 1B 33 FC 85 D9 A6 AA C1
0130 | 17 14 77 21 91 87 EF B1 31 67 CD 8F 64 F3 4E BF
0140 | BF B2 F1 A4 21 FB D7 A1 EB 2D 43 11 6A D6 3B AE
0150 | 95 D0 B1 5C 43 55 FD C0 44 33 81 02 CA 00 68 A4
0160 | D8 84 CC 6A 84 CA 65 FD 56 73 24 8B 71 99 4E F4
0170 | B0 D7 89 0C 00 C3 CE 7C AD B1 6C 70 9F 25 C6 7E
0180 | 5E BE E0 12 BE 0F A1 EE E6 A9 EB 05</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>7C5B09006A288765</code></td>
<td><code>4CF903001D318765</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>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE5001002F876FE34BFA63A85077F6A6</code> <code>385EDC8F6A329B7154F86593B466F41E</code> <code>BF6571E4F3BE1564651BB0B9F2755A8C</code> <code>44D8E682730F0AED528BA703F0800B78</code> <code>8E656AD901DDD5D587C325B601320E68</code> <code>78A158D4877699D3A41F50F3A237FE5A</code> <code>A3551B1B28A5002C37D5E3AF0BDAE3EA</code> <code>DD93A8167E2C98F2228A32233E47639C</code> <code>FFCD64C50653C8B3FF59F5E0736E4E5B</code> <code>E407DF6C716D672E0DB3487EA8CFA2A8</code> <code>35013587B39CF7979DD07823841D19EB</code> <code>C43FEF8A994952D710DFA5EE5129BE13</code> <code>FE451A55E487661AF90D396CF38A574F</code> <code>DDC3A4BEA38D13054147ADD7119DBCD5</code> <code>A6B6048EBEB57ADE7E2D70EEBE1758BC</code> <code>F11F62440469B7BE80594BBB95AFA904</code> <code>96587577A2FE26B891A2D231B4D9D3A9</code> <code>45E4DBE01CC6024B0F5FCED003043555</code> <code>15A9F3567C723A2164F31E4EDCB0DBE5</code> <code>2F76F4A93D649543DFAE9349A1F65108</code> <code>E8DB09AF5BE8EE042771816B9A148694</code><br> <code>BCD6997D</code></td>
<td><code>FE5001001B6EAFDA50DB20640D6D3532</code> <code>C120E7A1F1017D23E9BD6C1FA6CBE7A2</code> <code>F0EAA37167BFB3D02DB03B3497F046C2</code> <code>E802DB613BADE6DFEBE27CE0458451D7</code> <code>A84E0F643FDAB28C545C9826F6D765F5</code> <code>8B2CC54CC1DA23E850619597C0E1896B</code> <code>A0FB1945A8F38AEA063D0AE633382DEB</code> <code>77DA5BF87BAEB8911314C0BDE1FD8580</code> <code>3CF69FC16B834A1315629D06868B39D3</code> <code>C8C57BDACF830051072ACAD79EC9FAA0</code> <code>5EA7FB85EBD0F36BC7C900958466CB3C</code> <code>FF15C2674275483DC47252D3611943AF</code> <code>A33DC4A45FAB2A206650E5766A6A83B6</code> <code>AB695D484ADDE406BDFC3216739E78AA</code> <code>3D05F0B5A2F1E92B2DA1D80DCB64B0A5</code> <code>1B33FC85D9A6AAC1171477219187EFB1</code> <code>3167CD8F64F34EBFBFB2F1A421FBD7A1</code> <code>EB2D43116AD63BAE95D0B15C4355FDC0</code> <code>44338102CA0068A4D884CC6A84CA65FD</code> <code>5673248B71994EF4B0D7890C00C3CE7C</code> <code>ADB16C709F25C67E5EBEE012BE0FA1EE</code><br> <code>E6A9EB05</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 = A48179538AE9C4E366097F7632DCD3F62A295013E858BCAA18846662A67C2F9551B0E45E226ACE6CE7FBE2998B5C53CFA57F498E0609844F120EABD838FA3D468836F77C59AE10DEFEC9CA7105A80E574FDB14255659782B4A29654DC76FFBB29939FDC68F22402A2A98464E6F36909514B58F024964AFBE19235CCF10EC30D2DD387F82786DE4BAF48A055DF934A60AF3CB406FCCE6E2933B8BBC2E7C212716B8A86D05FCC136110FB5C95199505B248235D534A8D65EA6017CB7399A7C2A138D3571FBB31C05D5C911E2F851342FC763E2D22F375EB716EFA7BFC8AE4DD257B90E08F19376BC598E5C9CF5DA60A368234621E307F5C543811F2988FD8CAB54</code></pre>
<pre><code>auth_key = 569A656776A6357CC732BD9AEDF557BF8481443211786900DE82A3125665375E802D58FAA460D710890D160DA7AF2B7A8B801B1644A3F1E394C44A857CC81425D86D397BBE987F32AC379F68FB6CA532F5CC4959F30E0E805BA080EBA19E278E6AE116FBBD3E65448B2A1F7FE99B7032DF9E5B0294A4EDD5CAD0536EDEB86996B93985B2CCBA62A25BD94CD6AB3BE97EF8A3BD5BFBAA8540AC563BEE779C1184009E51B340939F11811236A07B459987AF9E6F0B82EEB3278D5AD462326D5911463FCD51A89BFF2DFB6161C6A7F777A826633B95D3DA023BC78252829AF0AA7D4B14142689F7B318BBEDF7ABB3D0367BD2EEF4EC36E7E110B481F47406E97941</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 D4 31 F9 6A 28 87 65
0010 | A8 00 00 00 34 F7 CB 3B AE E3 68 33 0D 08 E5 0D
0020 | 8A DF C5 39 8A FB C2 A3 B8 AB F0 5D E7 C6 35 F6
0030 | D8 4D 0B BE 3A A0 17 2D 19 EB 72 6C 93 38 C8 0C
0040 | BB 45 F8 31 03 2A F8 E5</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC 5C 81 1D 31 87 65
0010 | 40 00 00 00 34 F7 CB 3B FB E9 D8 14 18 04 88 D9
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
0030 | 55 7D 76 EB A3 4A 6C 3E 77 7B 06 DC FD 38 23 46
0040 | B3 28 05 FB 01 AA 9D 80</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>01D431F96A288765</code></td>
<td><code>01BC5C811D318765</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>A8000000</code> (168 in decimal)</td>
<td><code>40000000</code> (64 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>AEE368330D08E50D8ADFC5398AFBC2A3</code></td>
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B8ABF05DE7C635F6D84D0BBE3AA0172D</code></td>
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>19EB726C9338C80CBB45F831032AF8E5</code></td>
<td><code>777B06DCFD382346B32805FB01AA9D80</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>

View file

@ -44,13 +44,14 @@ Receipt of virtually all messages (with the exception of some purely service one
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/mtproto" >Mobile Protocol</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/mtproto/service_messages" >Service messages</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/mtproto/service_messages_about_messages" >Service Messages about Messages</a></li></ul></div>
<h1 id="dev_page_title">Service Messages about Messages</h1>
<div id="dev_page_content"><h4><a class="anchor" name="acknowledgment-of-receipt" href="#acknowledgment-of-receipt"><i class="anchor-icon"></i></a>Acknowledgment of Receipt</h4>
<p>Receipt of virtually all messages (with the exception of some purely service ones as well as the plain-text messages used in the protocol for creating an authorization key) must be acknowledged.<br>This requires the use of the following service message (not requiring an acknowledgment):</p>
<div id="dev_page_content"><h4><a class="anchor" href="#acknowledgment-of-receipt" id="acknowledgment-of-receipt" name="acknowledgment-of-receipt"><i class="anchor-icon"></i></a>Acknowledgment of Receipt</h4>
<p>Receipt of virtually all messages (with the exception of some purely service ones as well as the plain-text messages used in the protocol for creating an authorization key) must be acknowledged.
This requires the use of the following service message (not requiring an acknowledgment):</p>
<pre><code>msgs_ack#62d6b459 msg_ids:Vector&lt;long&gt; = MsgsAck;</code></pre>
<p>A server usually acknowledges the receipt of a message from a client (normally, an RPC query) using an RPC response. If a response is a long time coming, a server may first send a receipt acknowledgment, and somewhat later, the RPC response itself.</p>
<p>A client normally acknowledges the receipt of a message from a server (usually, an RPC response) by adding an acknowledgment to the next RPC query if it is not transmitted too late (if it is generated, say, 60-120 seconds following the receipt of a message from the server). However, if for a long period of time there is no reason to send messages to the server or if there is a large number of unacknowledged messages from the server (say, over 16), the client transmits a stand-alone acknowledgment. </p>
<p>Max 8192 IDs are allowed per constructor. </p>
<h4><a class="anchor" name="notice-of-ignored-error-message" href="#notice-of-ignored-error-message"><i class="anchor-icon"></i></a>Notice of Ignored Error Message</h4>
<h4><a class="anchor" href="#notice-of-ignored-error-message" id="notice-of-ignored-error-message" name="notice-of-ignored-error-message"><i class="anchor-icon"></i></a>Notice of Ignored Error Message</h4>
<p>In certain cases, a server may notify a client that its incoming message was ignored for whatever reason. Note that such a notification cannot be generated unless a message is correctly decoded by the server.</p>
<pre><code>bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;
bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;</code></pre>
@ -70,14 +71,14 @@ bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_se
</ul>
<p>The intention is that error_code values are grouped (error_code &gt;&gt; 4): for example, the codes 0x40 - 0x4f correspond to errors in container decomposition.</p>
<p>Notifications of an ignored message do not require acknowledgment (i.e., are irrelevant).</p>
<p><strong>Important:</strong> if server_salt has changed on the server or if client time is incorrect, any query will result in a notification in the above format. The client must check that it has, in fact, recently sent a message with the specified msg_id, and if that is the case, update its time correction value (the difference between the client&#39;s and the server&#39;s clocks) and the server salt based on msg_id and the server_salt notification, so as to use these to (re)send future messages. In the meantime, the original message (the one that caused the error message to be returned) must also be re-sent with a better msg_id and/or server_salt.</p>
<p><strong>Important:</strong> if server_salt has changed on the server or if client time is incorrect, any query will result in a notification in the above format. The client must check that it has, in fact, recently sent a message with the specified msg_id, and if that is the case, update its time correction value (the difference between the client's and the server's clocks) and the server salt based on msg_id and the server_salt notification, so as to use these to (re)send future messages. In the meantime, the original message (the one that caused the error message to be returned) must also be re-sent with a better msg_id and/or server_salt.</p>
<p>In addition, the client can update the server_salt value used to send messages to the server, based on the values of RPC responses or containers carrying an RPC response, provided that this RPC response is actually a match for the query sent recently. (If there is doubt, it is best not to update since there is risk of a replay attack).</p>
<h4><a class="anchor" name="request-for-message-status-information" href="#request-for-message-status-information"><i class="anchor-icon"></i></a>Request for Message Status Information</h4>
<h4><a class="anchor" href="#request-for-message-status-information" id="request-for-message-status-information" name="request-for-message-status-information"><i class="anchor-icon"></i></a>Request for Message Status Information</h4>
<p>If either party has not received information on the status of its outgoing messages for a while, it may explicitly request it from the other party:</p>
<pre><code>msgs_state_req#da69fb52 msg_ids:Vector long = MsgsStateReq;</code></pre>
<p>Max 8192 IDs are allowed per constructor. </p>
<p>The response to the query contains the following information:</p>
<h4><a class="anchor" name="informational-message-regarding-status-of-messages" href="#informational-message-regarding-status-of-messages"><i class="anchor-icon"></i></a>Informational Message regarding Status of Messages</h4>
<h4><a class="anchor" href="#informational-message-regarding-status-of-messages" id="informational-message-regarding-status-of-messages" name="informational-message-regarding-status-of-messages"><i class="anchor-icon"></i></a>Informational Message regarding Status of Messages</h4>
<pre><code>msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;</code></pre>
<p>Here, <code>info</code> is a string that contains exactly one byte of message status for each message from the incoming msg_ids list:</p>
<ul>
@ -92,23 +93,23 @@ bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_se
<li>+128 = other party knows for a fact that message is already received</li>
</ul>
<p>This response does not require an acknowledgment. It is an acknowledgment of the relevant msgs_state_req, in and of itself.</p>
<p>Note that if it turns out suddenly that the other party is missing a message that appears to have been sent to it, the message must not be re-sent on its own with the same msg_id. Instead, it can be either wrapped in a container, or the status of the message can be checked using msgs_state_req and if the message wasn&#39;t received, then it must be re-sent with a new msg_id.</p>
<h4><a class="anchor" name="voluntary-communication-of-status-of-messages" href="#voluntary-communication-of-status-of-messages"><i class="anchor-icon"></i></a>Voluntary Communication of Status of Messages</h4>
<p>Note that if it turns out suddenly that the other party is missing a message that appears to have been sent to it, the message must not be re-sent on its own with the same msg_id. Instead, it can be either wrapped in a container, or the status of the message can be checked using msgs_state_req and if the message wasn't received, then it must be re-sent with a new msg_id.</p>
<h4><a class="anchor" href="#voluntary-communication-of-status-of-messages" id="voluntary-communication-of-status-of-messages" name="voluntary-communication-of-status-of-messages"><i class="anchor-icon"></i></a>Voluntary Communication of Status of Messages</h4>
<p>Either party may voluntarily inform the other party of the status of the messages transmitted by the other party.</p>
<pre><code>msgs_all_info#8cc0d131 msg_ids:Vector long info:string = MsgsAllInfo</code></pre>
<p>All message codes known to this party are enumerated, with the exception of those for which the +128 and the +16 flags are set. However, if the +32 flag is set but not +64, then the message status will still be communicated.</p>
<p>This message does not require an acknowledgment.</p>
<h4><a class="anchor" name="extended-voluntary-communication-of-status-of-one-message" href="#extended-voluntary-communication-of-status-of-one-message"><i class="anchor-icon"></i></a>Extended Voluntary Communication of Status of One Message</h4>
<h4><a class="anchor" href="#extended-voluntary-communication-of-status-of-one-message" id="extended-voluntary-communication-of-status-of-one-message" name="extended-voluntary-communication-of-status-of-one-message"><i class="anchor-icon"></i></a>Extended Voluntary Communication of Status of One Message</h4>
<p>Normally used by the server to respond to the receipt of a duplicate msg_id, especially if a response to the message has already been generated and the response is large. If the response is small, the server may re-send the answer itself instead. This message can also be used as a notification instead of resending a large message.</p>
<pre><code>msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;
msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;</code></pre>
<p>The second version is used to notify of messages that were created on the server not in response to an RPC query (such as notifications of new messages) and were transmitted to the client some time ago, but not acknowledged.</p>
<p>Currently, <code>status</code> is always zero. This may change in future.</p>
<p>This message does not require an acknowledgment.</p>
<h4><a class="anchor" name="explicit-request-to-re-send-messages" href="#explicit-request-to-re-send-messages"><i class="anchor-icon"></i></a>Explicit Request to Re-Send Messages</h4>
<h4><a class="anchor" href="#explicit-request-to-re-send-messages" id="explicit-request-to-re-send-messages" name="explicit-request-to-re-send-messages"><i class="anchor-icon"></i></a>Explicit Request to Re-Send Messages</h4>
<pre><code>msg_resend_req#7d861a08 msg_ids:Vector long = MsgResendReq;</code></pre>
<p>The remote party immediately responds by re-sending the requested messages, normally using the same connection that was used to transmit the query. If at least one message with requested msg_id does not exist or has already been forgotten, or has been sent by the requesting party (known from parity), MsgsStateInfo is returned for all messages requested as if the MsgResendReq query had been a MsgsStateReq query as well.<br>Max 8192 IDs are allowed per constructor. </p>
</div>
<p>The remote party immediately responds by re-sending the requested messages, normally using the same connection that was used to transmit the query. If at least one message with requested msg_id does not exist or has already been forgotten, or has been sent by the requesting party (known from parity), MsgsStateInfo is returned for all messages requested as if the MsgResendReq query had been a MsgsStateReq query as well.<br>
Max 8192 IDs are allowed per constructor.</p></div>
</div>

View file

@ -401,6 +401,7 @@ var Ads = {
}
},
onBlur: function(value) {
options.onBlur && options.onBlur(field, options.getDataOpts);
options.onEnter && options.onEnter(field, value);
},
onEnter: function(value) {
@ -496,6 +497,7 @@ var NewAd = {
field: selectData.field,
c_field: selectData.c_field,
},
onBlur: NewAd.onLocationSelectBlur,
onUpdate: NewAd.onSelectUpdate,
onChange: NewAd.onLocationSelectChange
});
@ -527,10 +529,14 @@ var NewAd = {
state.targetTypeField.fieldEl().on('change.curPage', NewAd.onTargetTypeChange);
state.pictureCheckbox = state.$form.field('picture');
state.pictureCheckbox.on('change.curPage', NewAd.onPictureChange);
state.intersectTopicsCheckbox = state.$form.field('intersect_topics');
state.intersectTopicsCheckbox.on('change.curPage', NewAd.onIntersectTopicsChange);
state.excludePoliticCheckbox = state.$form.field('exclude_politic');
state.excludePoliticCheckbox.on('change.curPage', NewAd.onExcludePoliticChange);
state.onlyPoliticCheckbox = state.$form.field('only_politic');
state.onlyPoliticCheckbox.on('change.curPage', NewAd.onOnlyPoliticChange);
state.deviceField = state.$form.field('device');
state.deviceField.on('ddchange.curPage', NewAd.onDeviceChange);
state.confirmedCheckbox = state.$form.field('confirmed');
state.confirmedCheckbox.on('change.curPage', NewAd.onConfirmedChange);
NewAd.updateAdPreview(state.$form, state.previewData);
@ -567,8 +573,10 @@ var NewAd = {
state.targetTypeField.fieldEl().off('.curPage');
state.confirmedCheckbox.off('.curPage');
state.pictureCheckbox.off('.curPage');
state.intersectTopicsCheckbox.off('.curPage');
state.excludePoliticCheckbox.off('.curPage');
state.onlyPoliticCheckbox.off('.curPage');
state.deviceField.off('.curPage');
for (var i = 0; i < state.selectList.length; i++) {
var selectData = state.selectList[i];
if (selectData.location_search) {
@ -597,6 +605,10 @@ var NewAd = {
var $form = $(this.form);
NewAd.adPostCheck($form);
},
onIntersectTopicsChange: function() {
NewAd.updateAdTargetOverview();
NewAd.saveDraftAuto(true);
},
onExcludePoliticChange: function() {
if ($(this).prop('checked')) {
Aj.state.onlyPoliticCheckbox.prop('checked', false);
@ -660,6 +672,13 @@ var NewAd = {
Ads.hideFieldError(buttonField);
NewAd.adPostCheck($form);
},
onDeviceChange: function() {
var $form = $(this).parents('form');
var devideField = $form.field('devide');
Ads.hideFieldError(devideField);
NewAd.updateAdTargetOverview();
NewAd.saveDraftAuto(true);
},
adPostCheck: function($form, try_index) {
var textField = $form.field('text');
var promoteUrlField = $form.field('promote_url');
@ -667,6 +686,7 @@ var NewAd = {
var websiteNameField = $form.field('website_name');
var websitePhotoField = $form.field('website_photo');
var cpmField = $form.field('cpm');
var deviceField = $form.field('device');
var text = textField.value();
var promote_url = promoteUrlField.value();
var button = buttonField.data('value');
@ -674,6 +694,7 @@ var NewAd = {
var website_photo = websitePhotoField.value();
var $formGroup = promoteUrlField.fieldEl().parents('.form-group');
var $cpmFormGroup = cpmField.fieldEl().parents('.form-group');
var device = deviceField.data('value');
if (!text && !promote_url) {
return false;
}
@ -683,7 +704,8 @@ var NewAd = {
promote_url: promote_url,
button: button,
website_name: website_name,
website_photo: website_photo
website_photo: website_photo,
device: device
};
if (Aj.state.adId) {
params.ad_id = Aj.state.adId;
@ -912,6 +934,17 @@ var NewAd = {
});
return false;
},
onLocationSelectBlur: function(field, opts) {
var $form = Aj.state.$form;
var $cFieldEl = $form.field(opts.c_field);
var c_value = $cFieldEl.data('value');
if (c_value.join) {
if (c_value.length > 1) {
Ads.hideFieldError($cFieldEl);
return false;
}
}
},
onLocationSelectChange: function(field, value, valueFull) {
var $fieldEl = Aj.state.$form.field(field);
Ads.hideFieldError($fieldEl);
@ -919,11 +952,12 @@ var NewAd = {
onSelectUpdate: function(field, value, valueFull) {
var $fieldEl = Aj.state.$form.field(field);
if (field == 'user_topics') {
var has_user_topics = $fieldEl.data('value').length > 0;
if (has_user_topics) {
Aj.state.onlyPoliticCheckbox.prop('checked', false);
var user_topics_cnt = $fieldEl.data('value').length;
if (user_topics_cnt > 1) {
$('.js-intersect-topics-wrap', Aj.state.$form).slideShow();
} else {
$('.js-intersect-topics-wrap', Aj.state.$form).slideHide();
}
Aj.state.onlyPoliticCheckbox.prop('disabled', has_user_topics);
}
var selOpts = $fieldEl.data('selOpts');
var paired_field = selOpts.pairedField;
@ -1192,6 +1226,18 @@ var NewAd = {
updateAdTargetOverview: function() {
var len = {}, lang_params = {}, need_outside_cb = false;
var target_type = Aj.state.$form.field('target_type').value();
var joinTargets = function(list, or, repeat) {
var lk = or ? 'WEB_AD_TARGET_OR' : 'WEB_AD_TARGET_AND';
if (repeat && list.length > 2) {
var last_item = list.pop();
return l(lk, {item1: joinTargets(list, or, repeat), item2: last_item});
}
if (list.length > 1) {
var last_item = list.pop();
list[list.length - 1] = l(lk, {item1: list[list.length - 1], item2: last_item});
}
return list.join(', ');
};
for (var i = 0; i < Aj.state.selectList.length; i++) {
var selectData = Aj.state.selectList[i];
var field = selectData.field;
@ -1208,16 +1254,16 @@ var NewAd = {
need_outside_cb = true;
}
}
if (list.length > 1) {
var last_item = list.pop();
list[list.length - 1] = l('WEB_AD_TARGET_AND', {item1: list[list.length - 1], item2: last_item});
}
lang_params[field] = list.join(', ');
var list_or = (field == 'langs' || field == 'topics' || field == 'countries' || field == 'locations' || field == 'user_langs' || field == 'user_topics' && !Aj.state.intersectTopicsCheckbox.prop('checked') || field == 'user_channels' || field == 'audiences')
lang_params[field] = joinTargets(list, list_or);
} else {
lang_params[field] = '';
}
Ads.hideFieldError($field);
}
len.device = Aj.state.$form.field('device').data('value');
lang_params.device = '<span class="value" dir="auto">' + Aj.state.$form.field('device').html() + '</span>';
var overview = '';
if (target_type == 'channels') {
if ((len.langs || len.topics) && len.channels) {
@ -1270,27 +1316,33 @@ var NewAd = {
if (len.user_topics > 0) {
user_targets.push(l('WEB_AD_TARGET_USER_TOPICS', lang_params));
}
if (len.user_channels > 0) {
user_targets.push(l('WEB_AD_TARGET_USER_CHANNELS', lang_params));
}
if (len.audiences > 0) {
user_targets.push(l('WEB_AD_TARGET_AUDIENCES', lang_params));
}
if (user_targets.length > 1) {
var last_user_target = user_targets.pop();
user_targets[user_targets.length - 1] = l('WEB_AD_TARGET_AND', {item1: user_targets[user_targets.length - 1], item2: last_user_target});
if (len.device) {
user_targets.push(l('WEB_AD_TARGET_DEVICE', lang_params));
}
user_targets = joinTargets(user_targets, false, true);
if (Aj.state.onlyPoliticCheckbox.prop('checked')) {
overview += '<div class="pr-form-info-block plus">' + l('WEB_AD_TARGET_USERS_ONLY_POLITIC', {target: user_targets.join(', ')}) + '</div>';
overview += '<div class="pr-form-info-block plus">' + l('WEB_AD_TARGET_USERS_ONLY_POLITIC', {target: user_targets}) + '</div>';
} else {
overview += '<div class="pr-form-info-block plus">' + l('WEB_AD_TARGET_USERS', {target: user_targets.join(', ')}) + '</div>';
overview += '<div class="pr-form-info-block plus">' + l('WEB_AD_TARGET_USERS', {target: user_targets}) + '</div>';
}
if (len.exclude_user_topics > 0) {
overview += '<div class="pr-form-info-block minus">' + l('WEB_AD_TARGET_USER_EXCLUDE_TOPICS', lang_params) + '</div>';
}
if (Aj.state.excludePoliticCheckbox.prop('checked')) {
overview += '<div class="pr-form-info-block minus">' + l('WEB_AD_TARGET_EXCLUDE_POLITIC') + '</div>';
if (len.exclude_user_channels > 0) {
overview += '<div class="pr-form-info-block minus">' + l('WEB_AD_TARGET_USER_EXCLUDE_CHANNELS', lang_params) + '</div>';
}
if (len.exclude_audiences > 0) {
overview += '<div class="pr-form-info-block minus">' + l('WEB_AD_TARGET_EXCLUDE_AUDIENCES', lang_params) + '</div>';
}
if (Aj.state.excludePoliticCheckbox.prop('checked')) {
overview += '<div class="pr-form-info-block minus">' + l('WEB_AD_TARGET_EXCLUDE_POLITIC') + '</div>';
}
}
$('.js-exclude-outside').addClass('hide');
} else {
@ -1312,7 +1364,8 @@ var NewAd = {
$form.field('cpm').value(),
$form.field('views_per_user').value(),
$form.field('budget').value(),
$form.field('target_type').value()
$form.field('target_type').value(),
$form.field('device').data('value')
];
if ($form.field('picture').prop('checked')) {
values.push('picture');
@ -1322,6 +1375,9 @@ var NewAd = {
var vals = $form.field(selectData.field).data('value') || [];
values.push(vals.join(';'));
}
if ($form.field('intersect_topics').prop('checked')) {
values.push('intersect_topics');
}
if ($form.field('exclude_politic').prop('checked')) {
values.push('exclude_politic');
}
@ -1367,6 +1423,7 @@ var NewAd = {
var views_per_user = $form.field('views_per_user').value();
var budget = Ads.amountFieldValue($form, 'budget');
var target_type = $form.field('target_type').value();
var device = $form.field('device').data('value');
if (!title.length) {
$form.field('title').focus();
@ -1400,7 +1457,8 @@ var NewAd = {
cpm: cpm,
views_per_user: views_per_user,
budget: budget,
target_type: target_type
target_type: target_type,
device: device
};
if ($form.field('picture').prop('checked')) {
params.picture = 1;
@ -1410,6 +1468,9 @@ var NewAd = {
var values = $form.field(selectData.field).data('value') || [];
params[selectData.field] = values.join(';');
}
if ($form.field('intersect_topics').prop('checked')) {
params.intersect_topics = 1;
}
if ($form.field('exclude_politic').prop('checked')) {
params.exclude_politic = 1;
}
@ -1465,6 +1526,7 @@ var NewAd = {
var views_per_user = $form.field('views_per_user').value();
var budget = Ads.amountFieldValue($form, 'budget');
var target_type = $form.field('target_type').value();
var device = $form.field('device').data('value');
var curFormData = NewAd.getFormData($form);
if (Aj.state.initFormData == curFormData) {
@ -1482,7 +1544,8 @@ var NewAd = {
cpm: cpm,
views_per_user: views_per_user,
budget: budget,
target_type: target_type
target_type: target_type,
device: device
};
if ($form.field('picture').prop('checked')) {
params.picture = 1;
@ -1492,6 +1555,9 @@ var NewAd = {
var values = $form.field(selectData.field).data('value') || [];
params[selectData.field] = values.join(';');
}
if ($form.field('intersect_topics').prop('checked')) {
params.intersect_topics = 1;
}
if ($form.field('exclude_politic').prop('checked')) {
params.exclude_politic = 1;
}
@ -1534,6 +1600,7 @@ var NewAd = {
$form.field('exclude_politic').prop('checked', false);
$form.field('only_politic').prop('checked', false);
$form.field('exclude_outside').prop('checked', false);
$form.field('device').trigger('selectval', ['']);
Aj.state.titleField.focusAndSelect();
NewAd.updateAdPreview(Aj.state.$form, false);
var curFormData = NewAd.getFormData($form);