Update content of files

This commit is contained in:
GitHub Action 2024-06-21 18:58:15 +00:00
parent bf60f0a641
commit a27478b18a
4 changed files with 225 additions and 257 deletions

View file

@ -4,34 +4,10 @@
<meta charset="utf-8">
<title>messages.getSavedReactionTags</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
peer
flags.0?InputPeer
 
hash
long
Hash for pagination…">
<meta property="description" content="Fetch the full list of saved message tags created by the user.">
<meta property="og:title" content="messages.getSavedReactionTags">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
peer
flags.0?InputPeer
 
hash
long
Hash for pagination…">
<meta property="og:description" content="Fetch the full list of saved message tags created by the user.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -66,7 +42,8 @@ Hash for pagination…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.getSavedReactionTags" >messages.getSavedReactionTags</a></li></ul></div>
<h1 id="dev_page_title">messages.getSavedReactionTags</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Fetch the full list of <a href="/api/saved-messages#tags">saved message tags</a> created by the user.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a>
@ -100,7 +77,7 @@ Hash for pagination…">
<tr>
<td><strong>peer</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/InputPeer">InputPeer</a></td>
<td> </td>
<td>If set, returns tags only used in the specified <a href="/api/saved-messages#saved-message-dialogs">saved message dialog</a>.</td>
</tr>
<tr>
<td><strong>hash</strong></td>
@ -113,7 +90,9 @@ Hash for pagination…">
<p><a href="/type/messages.SavedReactionTags">messages.SavedReactionTags</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#pagination-in-the-api" id="pagination-in-the-api" name="pagination-in-the-api"><i class="anchor-icon"></i></a><a href="/api/offsets">Pagination in the API</a></h4>
<p>How to fetch results from large lists of objects.</p></div>
<p>How to fetch results from large lists of objects.</p>
<h4><a class="anchor" href="#saved-messages" id="saved-messages" name="saved-messages"><i class="anchor-icon"></i></a><a href="/api/saved-messages">Saved messages</a></h4>
<p>The Saved Messages chat allows users to bookmark messages and media: it's a personal cloud storage for any messages or media you may want to send or forward there.</p></div>
</div>

View file

@ -4,36 +4,24 @@
<meta charset="utf-8">
<title>messages.updateSavedReactionTag</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
<meta property="description" content="Update the description of a saved message tag.
Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
reaction
Reaction
 
title
flags.0?string
 
Result…">
Flags, see TL conditional fields…">
<meta property="og:title" content="messages.updateSavedReactionTag">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
<meta property="og:description" content="Update the description of a saved message tag.
Parameters
Name
Type
Description
flags
#
Flags, see TL conditional fields
reaction
Reaction
 
title
flags.0?string
 
Result…">
Flags, see TL conditional fields…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -68,7 +56,8 @@ Result…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/messages.updateSavedReactionTag" >messages.updateSavedReactionTag</a></li></ul></div>
<h1 id="dev_page_title">messages.updateSavedReactionTag</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p>Update the <a href="/api/saved-messages#tags">description of a saved message tag</a>. </p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 181 <b class="caret"></b></a>
@ -102,12 +91,12 @@ Result…">
<tr>
<td><strong>reaction</strong></td>
<td style="text-align: center;"><a href="/type/Reaction">Reaction</a></td>
<td> </td>
<td><a href="/api/reactions">Reaction</a> associated to the tag</td>
</tr>
<tr>
<td><strong>title</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/string">string</a></td>
<td> </td>
<td>Tag description, max 12 UTF-8 characters; to remove the description call the method without setting this flag.</td>
</tr>
</tbody>
</table>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 6C B5 02 00 0B 64 70 66
0010 | 14 00 00 00 F1 8E 7E BE 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 D0 C6 00 00 29 CB 75 66
0010 | 14 00 00 00 F1 8E 7E BE 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F</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>6CB502000B647066</code></td>
<td><code>D0C6000029CB7566</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>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</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 84 15 7C 0B 64 70 66
0010 | C8 00 00 00 63 24 16 05 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E B2 70 60 7F 52 AD 68 D1
0030 | 56 29 8C 9D DC 64 5F 70 08 24 94 4C C1 89 C8 19
0040 | 35 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 44 F2 B3 29 CB 75 66
0010 | A8 00 00 00 63 24 16 05 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3
0030 | D8 F1 42 DB F1 78 B0 D9 08 15 6D 6A B1 2F 5F D6
0040 | 55 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>0184157C0B647066</code></td>
<td><code>0144F2B329CB7566</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>C8000000</code> (200 in decimal)</td>
<td><code>A8000000</code> (168 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0824944CC189C81935000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2635816076042574133</td>
<td><code>08156D6AB12F5FD655000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1544007556494513749</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 = 2635816076042574133</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2635816076042574133 = 1483259383 * 1777043251</code></p>
<pre><code>p = 1483259383
q = 1777043251</code></pre>
<pre><code>pq = 1544007556494513749</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1544007556494513749 = 1237375147 * 1247808767</code></p>
<pre><code>p = 1237375147
q = 1247808767</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 24 94 4C C1 89 C8 19 35 00 00 00
0010 | 04 58 68 BD F7 00 00 00 04 69 EB 87 33 00 00 00
0020 | 17 62 E3 D8 C2 13 A8 FA C5 F4 12 25 E3 60 13 1E
0030 | B2 70 60 7F 52 AD 68 D1 56 29 8C 9D DC 64 5F 70
0040 | C2 50 D3 66 BC D2 3A F7 90 B2 10 E6 A0 28 2F 21
0050 | 53 41 D4 F8 F0 DA 17 FB 19 CC 86 ED 4E 88 42 8E
<pre><code>0000 | 95 5F F5 A9 08 15 6D 6A B1 2F 5F D6 55 00 00 00
0010 | 04 49 C0 D8 AB 00 00 00 04 4A 60 0C FF 00 00 00
0020 | 46 EB 07 1F 8D C7 CB 46 EC BA B6 10 48 F0 E8 6F
0030 | 65 45 4C 9B E6 2C B4 D3 D8 F1 42 DB F1 78 B0 D9
0040 | F4 4F 47 4B E3 B7 EC 63 6C 33 AF 62 46 D4 94 19
0050 | 28 F4 78 9F 68 31 FD BC 95 10 C4 8F 3D 06 C9 86
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 = 1777043251</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0824944CC189C81935000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2635816076042574133</td>
<td><code>08156D6AB12F5FD655000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1544007556494513749</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>045868BDF7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1483259383</td>
<td><code>0449C0D8AB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1237375147</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>0469EB8733000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1777043251</td>
<td><code>044A600CFF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1247808767</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>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>C250D366BCD23AF790B210E6A0282F21</code> <code>5341D4F8F0DA17FB19CC86ED4E88428E</code></td>
<td><code>F44F474BE3B7EC636C33AF6246D49419</code> <code>28F4789F6831FDBC9510C48F3D06C986</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1777043251</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 = 955FF5A90824944CC189C81935000000045868BDF70000000469EB87330000001762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F70C250D366BCD23AF790B210E6A0282F215341D4F8F0DA17FB19CC86ED4E88428E02000000
random_padding_bytes = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A9348814AB223D786762F142BDF503FA2CCD238D35EB42FCE3A4E25DC3792884979375C1140E889FB5100A16622665BFA428462B23AA146DEA7CE09E56C94C90CA</code></pre>
<pre><code>data = 955FF5A908156D6AB12F5FD6550000000449C0D8AB000000044A600CFF00000046EB071F8DC7CB46ECBAB61048F0E86F65454C9BE62CB4D3D8F142DBF178B0D9F44F474BE3B7EC636C33AF6246D4941928F4789F6831FDBC9510C48F3D06C98602000000
random_padding_bytes = 07614048C43C914A5B32162582ECBEB31F8795C4070C13AAA3A69CEAE2CF0E4963312415606B89A1D70E1503576388ECC0A5265D7F766C866B29753AAAC6EA78D8B1C6EE01D462EA2CC77294622CDBCED936FC80FB0D53F980FC7ED7</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 = 3EEF398E2F83E13916B2C845F347C16F06255E8BB779C8F35F7DD834842B88735F8199A5603755DBD12F7A9232DCC9C0E00E8A6AA42515C93AC245AC29DB1888C74F2523BC387F37FC602158617AB0F8CCF27FAF12A199683CD4829AB14FE94FDB27181BF46D178B1CCC705BDF7FB8A6496FEBA611DE84B689F7A0E7C6E0F1D307E4ABEF1B7E30E46A1335EE7E98A4FD69EB6F0CA7356B64509AF68196F57586D81DE5CEB9321E36E63D626DEF496AE9560C0ABDF11EE71C915D71C889F161DBCA905728DC6F52C942C82785F6C854B71B0E853773174E922F48B51E968D90DE22DE605CDF3E1BD1BDD9C5E1D351640C6373A0821ABB1D8F42988368734F602D</code></pre>
<pre><code>encrypted_data = 41461D5CDB4DF1BAFB18AEE272639E81FE154591029C86DBF55835F5043C01C497777558E67052D2F23D2C5018D54A12C09BE9C0A98D6F9E33C720F56808B995D40D289DCBA0E25A3F71827069520EE9A84BC11E530A573BFFACFE3FEE4FFC73774DBD804591CC59F5711B3522A0C9FEAD5C92BC64C5FE7A8A66B6023BE768E81DFFADFB6AC6524A478521D0619A802D1167A5FEAC646B14434D7C7A89D2E4E966559482C89FACD19B7228687B542DD0A0CDF59AE4E1402802DE315A6D79F970897EB4A49E69A23F610127DC8F79554E64E9B68A7EAB80235901CDA8F4F6EC783B0209EAA2D96A4644BA05604B8F0A998EF0061208DEED67596D72BCE3E1B472</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 08 A3 06 00 0B 64 70 66
0010 | 40 01 00 00 BE E4 12 D7 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E B2 70 60 7F 52 AD 68 D1
0030 | 56 29 8C 9D DC 64 5F 70 04 58 68 BD F7 00 00 00
0040 | 04 69 EB 87 33 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 3E EF 39 8E 2F 83 E1 39 16 B2 C8 45
0060 | F3 47 C1 6F 06 25 5E 8B B7 79 C8 F3 5F 7D D8 34
0070 | 84 2B 88 73 5F 81 99 A5 60 37 55 DB D1 2F 7A 92
0080 | 32 DC C9 C0 E0 0E 8A 6A A4 25 15 C9 3A C2 45 AC
0090 | 29 DB 18 88 C7 4F 25 23 BC 38 7F 37 FC 60 21 58
00A0 | 61 7A B0 F8 CC F2 7F AF 12 A1 99 68 3C D4 82 9A
00B0 | B1 4F E9 4F DB 27 18 1B F4 6D 17 8B 1C CC 70 5B
00C0 | DF 7F B8 A6 49 6F EB A6 11 DE 84 B6 89 F7 A0 E7
00D0 | C6 E0 F1 D3 07 E4 AB EF 1B 7E 30 E4 6A 13 35 EE
00E0 | 7E 98 A4 FD 69 EB 6F 0C A7 35 6B 64 50 9A F6 81
00F0 | 96 F5 75 86 D8 1D E5 CE B9 32 1E 36 E6 3D 62 6D
0100 | EF 49 6A E9 56 0C 0A BD F1 1E E7 1C 91 5D 71 C8
0110 | 89 F1 61 DB CA 90 57 28 DC 6F 52 C9 42 C8 27 85
0120 | F6 C8 54 B7 1B 0E 85 37 73 17 4E 92 2F 48 B5 1E
0130 | 96 8D 90 DE 22 DE 60 5C DF 3E 1B D1 BD D9 C5 E1
0140 | D3 51 64 0C 63 73 A0 82 1A BB 1D 8F 42 98 83 68
0150 | 73 4F 60 2D</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 02 07 00 29 CB 75 66
0010 | 40 01 00 00 BE E4 12 D7 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3
0030 | D8 F1 42 DB F1 78 B0 D9 04 49 C0 D8 AB 00 00 00
0040 | 04 4A 60 0C FF 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 41 46 1D 5C DB 4D F1 BA FB 18 AE E2
0060 | 72 63 9E 81 FE 15 45 91 02 9C 86 DB F5 58 35 F5
0070 | 04 3C 01 C4 97 77 75 58 E6 70 52 D2 F2 3D 2C 50
0080 | 18 D5 4A 12 C0 9B E9 C0 A9 8D 6F 9E 33 C7 20 F5
0090 | 68 08 B9 95 D4 0D 28 9D CB A0 E2 5A 3F 71 82 70
00A0 | 69 52 0E E9 A8 4B C1 1E 53 0A 57 3B FF AC FE 3F
00B0 | EE 4F FC 73 77 4D BD 80 45 91 CC 59 F5 71 1B 35
00C0 | 22 A0 C9 FE AD 5C 92 BC 64 C5 FE 7A 8A 66 B6 02
00D0 | 3B E7 68 E8 1D FF AD FB 6A C6 52 4A 47 85 21 D0
00E0 | 61 9A 80 2D 11 67 A5 FE AC 64 6B 14 43 4D 7C 7A
00F0 | 89 D2 E4 E9 66 55 94 82 C8 9F AC D1 9B 72 28 68
0100 | 7B 54 2D D0 A0 CD F5 9A E4 E1 40 28 02 DE 31 5A
0110 | 6D 79 F9 70 89 7E B4 A4 9E 69 A2 3F 61 01 27 DC
0120 | 8F 79 55 4E 64 E9 B6 8A 7E AB 80 23 59 01 CD A8
0130 | F4 F6 EC 78 3B 02 09 EA A2 D9 6A 46 44 BA 05 60
0140 | 4B 8F 0A 99 8E F0 06 12 08 DE ED 67 59 6D 72 BC
0150 | E3 E1 B4 72</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 = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>08A306000B647066</code></td>
<td><code>1802070029CB7566</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 = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045868BDF7000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1483259383</td>
<td><code>0449C0D8AB000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1237375147</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>0469EB8733000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1777043251</td>
<td><code>044A600CFF000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1247808767</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 = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001003EEF398E2F83E13916B2C845</code> <code>F347C16F06255E8BB779C8F35F7DD834</code> <code>842B88735F8199A5603755DBD12F7A92</code> <code>32DCC9C0E00E8A6AA42515C93AC245AC</code> <code>29DB1888C74F2523BC387F37FC602158</code> <code>617AB0F8CCF27FAF12A199683CD4829A</code> <code>B14FE94FDB27181BF46D178B1CCC705B</code> <code>DF7FB8A6496FEBA611DE84B689F7A0E7</code> <code>C6E0F1D307E4ABEF1B7E30E46A1335EE</code> <code>7E98A4FD69EB6F0CA7356B64509AF681</code> <code>96F57586D81DE5CEB9321E36E63D626D</code> <code>EF496AE9560C0ABDF11EE71C915D71C8</code> <code>89F161DBCA905728DC6F52C942C82785</code> <code>F6C854B71B0E853773174E922F48B51E</code> <code>968D90DE22DE605CDF3E1BD1BDD9C5E1</code> <code>D351640C6373A0821ABB1D8F42988368</code><br> <code>734F602D</code></td>
<td><code>FE00010041461D5CDB4DF1BAFB18AEE2</code> <code>72639E81FE154591029C86DBF55835F5</code> <code>043C01C497777558E67052D2F23D2C50</code> <code>18D54A12C09BE9C0A98D6F9E33C720F5</code> <code>6808B995D40D289DCBA0E25A3F718270</code> <code>69520EE9A84BC11E530A573BFFACFE3F</code> <code>EE4FFC73774DBD804591CC59F5711B35</code> <code>22A0C9FEAD5C92BC64C5FE7A8A66B602</code> <code>3BE768E81DFFADFB6AC6524A478521D0</code> <code>619A802D1167A5FEAC646B14434D7C7A</code> <code>89D2E4E966559482C89FACD19B722868</code> <code>7B542DD0A0CDF59AE4E1402802DE315A</code> <code>6D79F970897EB4A49E69A23F610127DC</code> <code>8F79554E64E9B68A7EAB80235901CDA8</code> <code>F4F6EC783B0209EAA2D96A4644BA0560</code> <code>4B8F0A998EF0061208DEED67596D72BC</code><br> <code>E3E1B472</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<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 68 7D 3D 0C 64 70 66
0010 | E8 02 00 00 5C 07 E8 D0 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E B2 70 60 7F 52 AD 68 D1
0030 | 56 29 8C 9D DC 64 5F 70 FE 50 02 00 E1 E2 B2 FC
0040 | 85 EB 30 7F 56 AC 3A A1 09 FB 02 65 93 E0 84 6C
0050 | BB B7 06 E7 25 0A 6B C5 CE 72 39 BE 64 D8 00 F5
0060 | 8D D6 27 37 24 37 0A B5 4F 1E CD B9 4D 9C 9A 03
0070 | DA 0F C1 85 E1 E7 72 9B 4A DE 2C 6A B5 09 1D 14
0080 | E3 31 00 9A 27 0D D2 22 A5 FC E8 22 10 22 04 01
0090 | A1 C2 B1 9D DF 21 48 D6 44 3B D6 B6 CC B4 0E 15
00A0 | BC 49 BD B3 AC 6B 72 49 E2 AD 51 97 80 CF 03 3A
00B0 | 0A E8 F4 EB BC 59 78 9D 80 30 4E 51 D5 80 9B 05
00C0 | A6 58 EF 1E 12 D8 90 DA 2E AF 6E 21 9D F2 7C EC
00D0 | 1C 76 05 A5 53 84 62 A9 5F D1 59 7C 79 EF E8 A5
00E0 | F4 1F 11 AE E7 59 75 18 06 9A 9F EA 54 0E 63 CA
00F0 | A1 CA 39 62 C0 A8 88 3B 9D C3 AA B1 67 8F FD CC
0100 | B0 78 10 6C 57 B4 E5 1C 1D D7 5A A8 2A FD EC 25
0110 | 0B 9C 6E 73 71 21 4A 64 BE 6A CF 23 C9 7E 4B 04
0120 | B6 D4 40 26 04 5E B8 0F B6 DC 7E 42 C0 34 92 11
0130 | 5F 0F 39 D5 7E 8D 71 81 B7 08 6E 90 E1 71 BC 3A
0140 | D5 C5 DD 3D 2E 37 FD 14 9D 9D F1 95 87 17 97 4A
0150 | 8B 5B 9F 7C 52 03 18 07 94 54 6F 77 50 03 E8 0C
0160 | 6E 38 F9 66 64 1C 4F A3 77 BE 42 E4 27 4B C4 45
0170 | DE 19 71 5A 36 CE 2F 30 99 3A 29 86 10 4D 71 62
0180 | 46 C5 4D 4A D8 B9 CA 2C 3B 00 8F F1 1B B0 AE ED
0190 | A5 A7 03 61 2B DF CB 09 AD FE 26 F8 44 6C 86 10
01A0 | 42 A4 79 AF 15 27 27 B0 22 00 BB 04 70 12 57 3E
01B0 | 59 36 44 E4 58 65 0B 03 EB E3 8C B3 B8 D0 1B AE
01C0 | EF FD 2B 74 4F A2 06 B0 1E D7 E1 9B 49 95 63 25
01D0 | A3 04 13 3C 8E 0A 09 F5 EE 4F B9 A9 C1 42 D2 33
01E0 | F3 5E 19 6A 30 14 9F 5D 07 06 F1 41 E9 64 C1 39
01F0 | A6 13 BF 84 55 75 3E 57 99 50 9A 40 7E AD 06 9E
0200 | E5 D8 0C 29 23 70 57 05 9B B6 C7 70 E0 4B 3B E8
0210 | 3F 76 F6 2C 5D 01 35 92 08 4B 7F 9D D4 04 44 CE
0220 | 87 33 53 CE 57 E3 24 AE 3B EA 2A A7 49 39 37 C0
0230 | 8B 7B 3B 5A 2E 68 31 FB F6 A5 13 96 9F A5 DE 85
0240 | 30 69 FA 45 B8 5E 81 43 0D 09 21 23 31 4C 39 C3
0250 | E8 12 B9 32 BB 93 94 8F 33 1E CA 54 DC 5C 74 FA
0260 | E3 0C FB 4B 8F 60 89 14 0D 26 B5 EB 14 F2 43 B0
0270 | 88 75 23 CE 45 69 82 F0 A4 12 01 38 52 F9 EC AE
0280 | 5C 96 2A 89 D0 F5 DC 53 F0 88 6C 27</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 67 86 2A CB 75 66
0010 | 88 02 00 00 5C 07 E8 D0 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3
0030 | D8 F1 42 DB F1 78 B0 D9 FE 50 02 00 95 33 3B 66
0040 | 37 DB 67 C2 6F 3F 98 10 E6 71 01 1C 18 B9 4B AB
0050 | 67 A3 E4 93 97 F4 66 6A 40 61 98 F1 0C 67 29 13
0060 | 46 BA 1A 9C 71 96 9C 44 F5 61 3E F0 23 75 53 F1
0070 | 4D 18 A5 29 7A 58 C4 E7 A2 68 C9 5C D5 9B 0F 4C
0080 | 57 10 28 63 DA 1F B2 7D B9 38 7E 1F 85 11 0B 4E
0090 | A7 2F 43 FA 16 6E 62 0E 6E 78 09 EE 27 C2 14 6F
00A0 | 2F A7 BB E5 5F 78 F6 BD E9 6F 86 76 FB B0 47 A3
00B0 | 07 3F 8B 58 6E A2 3A BF 99 D1 BD 78 34 9A 42 D9
00C0 | EC D8 61 64 96 9D 4D CF 7E B5 59 87 41 D9 29 06
00D0 | AA 68 67 4F 6C 86 24 83 6A 3B B7 D1 2A 87 0B 26
00E0 | 42 54 68 19 12 58 B9 89 76 9F 4C BB 6D 95 8E 92
00F0 | 42 2F 6A CA 72 EE 0F F7 23 34 FE 1D A1 86 6B F3
0100 | 33 1A 08 A9 34 77 FB F2 8B AE 43 CD E7 07 08 FD
0110 | FA AB 42 24 E0 10 DF D1 62 24 31 8A 55 8E 52 82
0120 | 2E 9D 0A 99 C0 20 28 C7 7A E3 9B FF EC DE 61 8A
0130 | 78 3D EA D6 17 BA DB 03 A6 47 B3 CD 48 85 57 8E
0140 | BE 80 60 82 E4 78 47 61 D2 E4 A0 E5 7A E2 94 DA
0150 | 4C B7 4E 0A A1 F0 5F 3C 5F 0E 46 D9 71 79 1D 57
0160 | 69 33 84 66 71 F0 FC 22 F9 7E F1 AD 0B 7E 9B 39
0170 | FA 4C C9 43 3F D0 87 E1 68 C7 FF 06 1A 83 41 F5
0180 | 6E A4 4C 1C 14 7C D2 6D DC 55 5F 6F 0E AF F6 CD
0190 | 75 07 4C 3B 61 E5 B4 53 1A 0D 30 95 EA 88 EA CE
01A0 | 84 40 03 8D 9C 9F 6A 38 26 C8 97 61 4F 37 2D 7E
01B0 | 8E 11 2C 73 31 7B EC B9 6A 0F 9D AD D8 13 2A 51
01C0 | 77 DE 7F 6D A7 98 48 82 62 B6 FB 8F 89 9B A9 BF
01D0 | A5 95 9B F1 66 D8 6C B2 D7 4F B1 77 D1 17 20 A3
01E0 | 75 63 76 29 AC A7 08 3D AA 1E 4D 96 1E F6 19 ED
01F0 | 06 23 43 88 9A C5 05 DF BF C4 09 7C 7E 11 CD D3
0200 | B9 D9 7B EA 9D 83 0F CF 9B 9C 33 FB 5F 85 0B 63
0210 | 25 9E EC AB DA 6C D5 1A A7 C0 68 1F FE 76 29 28
0220 | 38 2D 4B 2F 23 D2 DE A7 36 EF AC 1B 77 16 B5 ED
0230 | D7 C0 F1 0C 45 73 9E F4 70 1F 04 53 A2 B8 4E 65
0240 | 28 D7 98 C4 35 F3 F8 64 BE 91 52 53 9B 9F 98 53
0250 | 74 8E 50 5A E8 BF 5F 5B 19 27 42 93 C6 B0 A7 6E
0260 | 26 E7 99 09 EF AE CD EB 6B 53 A8 49 0E 57 27 67
0270 | EA E7 50 08 66 36 10 7C 9A FC D4 5F C0 92 43 13
0280 | 45 B2 E9 8D 40 3D C9 36 BE 01 5D 99</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 = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01687D3D0C647066</code></td>
<td><code>01E067862ACB7566</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>E8020000</code> (744 in decimal)</td>
<td><code>88020000</code> (648 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200E1E2B2FC85EB307F56AC3AA1</code> <code>09FB026593E0846CBBB706E7250A6BC5</code> <code>CE7239BE64D800F58DD6273724370AB5</code> <code>4F1ECDB94D9C9A03DA0FC185E1E7729B</code> <code>4ADE2C6AB5091D14E331009A270DD222</code> <code>A5FCE82210220401A1C2B19DDF2148D6</code> <code>443BD6B6CCB40E15BC49BDB3AC6B7249</code> <code>E2AD519780CF033A0AE8F4EBBC59789D</code> <code>80304E51D5809B05A658EF1E12D890DA</code> <code>2EAF6E219DF27CEC1C7605A5538462A9</code> <code>5FD1597C79EFE8A5F41F11AEE7597518</code> <code>069A9FEA540E63CAA1CA3962C0A8883B</code> <code>9DC3AAB1678FFDCCB078106C57B4E51C</code> <code>1DD75AA82AFDEC250B9C6E7371214A64</code> <code>BE6ACF23C97E4B04B6D44026045EB80F</code> <code>B6DC7E42C03492115F0F39D57E8D7181</code> <code>B7086E90E171BC3AD5C5DD3D2E37FD14</code> <code>9D9DF1958717974A8B5B9F7C52031807</code> <code>94546F775003E80C6E38F966641C4FA3</code> <code>77BE42E4274BC445DE19715A36CE2F30</code> <code>993A2986104D716246C54D4AD8B9CA2C</code> <code>3B008FF11BB0AEEDA5A703612BDFCB09</code> <code>ADFE26F8446C861042A479AF152727B0</code> <code>2200BB047012573E593644E458650B03</code> <code>EBE38CB3B8D01BAEEFFD2B744FA206B0</code> <code>1ED7E19B49956325A304133C8E0A09F5</code> <code>EE4FB9A9C142D233F35E196A30149F5D</code> <code>0706F141E964C139A613BF8455753E57</code> <code>99509A407EAD069EE5D80C2923705705</code> <code>9BB6C770E04B3BE83F76F62C5D013592</code> <code>084B7F9DD40444CE873353CE57E324AE</code> <code>3BEA2AA7493937C08B7B3B5A2E6831FB</code> <code>F6A513969FA5DE853069FA45B85E8143</code> <code>0D092123314C39C3E812B932BB93948F</code> <code>331ECA54DC5C74FAE30CFB4B8F608914</code> <code>0D26B5EB14F243B0887523CE456982F0</code> <code>A412013852F9ECAE5C962A89D0F5DC53</code><br> <code>F0886C27</code></td>
<td><code>FE50020095333B6637DB67C26F3F9810</code> <code>E671011C18B94BAB67A3E49397F4666A</code> <code>406198F10C67291346BA1A9C71969C44</code> <code>F5613EF0237553F14D18A5297A58C4E7</code> <code>A268C95CD59B0F4C57102863DA1FB27D</code> <code>B9387E1F85110B4EA72F43FA166E620E</code> <code>6E7809EE27C2146F2FA7BBE55F78F6BD</code> <code>E96F8676FBB047A3073F8B586EA23ABF</code> <code>99D1BD78349A42D9ECD86164969D4DCF</code> <code>7EB5598741D92906AA68674F6C862483</code> <code>6A3BB7D12A870B26425468191258B989</code> <code>769F4CBB6D958E92422F6ACA72EE0FF7</code> <code>2334FE1DA1866BF3331A08A93477FBF2</code> <code>8BAE43CDE70708FDFAAB4224E010DFD1</code> <code>6224318A558E52822E9D0A99C02028C7</code> <code>7AE39BFFECDE618A783DEAD617BADB03</code> <code>A647B3CD4885578EBE806082E4784761</code> <code>D2E4A0E57AE294DA4CB74E0AA1F05F3C</code> <code>5F0E46D971791D576933846671F0FC22</code> <code>F97EF1AD0B7E9B39FA4CC9433FD087E1</code> <code>68C7FF061A8341F56EA44C1C147CD26D</code> <code>DC555F6F0EAFF6CD75074C3B61E5B453</code> <code>1A0D3095EA88EACE8440038D9C9F6A38</code> <code>26C897614F372D7E8E112C73317BECB9</code> <code>6A0F9DADD8132A5177DE7F6DA7984882</code> <code>62B6FB8F899BA9BFA5959BF166D86CB2</code> <code>D74FB177D11720A375637629ACA7083D</code> <code>AA1E4D961EF619ED062343889AC505DF</code> <code>BFC4097C7E11CDD3B9D97BEA9D830FCF</code> <code>9B9C33FB5F850B63259EECABDA6CD51A</code> <code>A7C0681FFE762928382D4B2F23D2DEA7</code> <code>36EFAC1B7716B5EDD7C0F10C45739EF4</code> <code>701F0453A2B84E6528D798C435F3F864</code> <code>BE9152539B9F9853748E505AE8BF5F5B</code> <code>19274293C6B0A76E26E79909EFAECDEB</code> <code>6B53A8490E572767EAE750086636107C</code> <code>9AFCD45FC092431345B2E98D403DC936</code><br> <code>BE015D99</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = AE894413AD56A8DB9DFDCC19CB18DD30032C25DFCD9E780E7974F4A93
<!-- 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 = E1E2B2FC85EB307F56AC3AA109FB026593E0846CBBB706E7250A6BC5CE7239BE64D800F58DD6273724370AB54F1ECDB94D9C9A03DA0FC185E1E7729B4ADE2C6AB5091D14E331009A270DD222A5FCE82210220401A1C2B19DDF2148D6443BD6B6CCB40E15BC49BDB3AC6B7249E2AD519780CF033A0AE8F4EBBC59789D80304E51D5809B05A658EF1E12D890DA2EAF6E219DF27CEC1C7605A5538462A95FD1597C79EFE8A5F41F11AEE7597518069A9FEA540E63CAA1CA3962C0A8883B9DC3AAB1678FFDCCB078106C57B4E51C1DD75AA82AFDEC250B9C6E7371214A64BE6ACF23C97E4B04B6D44026045EB80FB6DC7E42C03492115F0F39D57E8D7181B7086E90E171BC3AD5C5DD3D2E37FD149D9DF1958717974A8B5B9F7C5203180794546F775003E80C6E38F966641C4FA377BE42E4274BC445DE19715A36CE2F30993A2986104D716246C54D4AD8B9CA2C3B008FF11BB0AEEDA5A703612BDFCB09ADFE26F8446C861042A479AF152727B02200BB047012573E593644E458650B03EBE38CB3B8D01BAEEFFD2B744FA206B01ED7E19B49956325A304133C8E0A09F5EE4FB9A9C142D233F35E196A30149F5D0706F141E964C139A613BF8455753E5799509A407EAD069EE5D80C29237057059BB6C770E04B3BE83F76F62C5D013592084B7F9DD40444CE873353CE57E324AE3BEA2AA7493937C08B7B3B5A2E6831FBF6A513969FA5DE853069FA45B85E81430D092123314C39C3E812B932BB93948F331ECA54DC5C74FAE30CFB4B8F6089140D26B5EB14F243B0887523CE456982F0A412013852F9ECAE5C962A89D0F5DC53F0886C27
tmp_aes_key = B0B3A3AAB2040BDFDACC0ED2FDF2D766E3FAA894B9E3DBE96430E6C2794C9B1D
tmp_aes_iv = 0C4B1363835D9408D10AA3D134F1E30010658955718C19A6FDEA3EC7C250D366</code></pre>
<pre><code>encrypted_answer = 95333B6637DB67C26F3F9810E671011C18B94BAB67A3E49397F4666A406198F10C67291346BA1A9C71969C44F5613EF0237553F14D18A5297A58C4E7A268C95CD59B0F4C57102863DA1FB27DB9387E1F85110B4EA72F43FA166E620E6E7809EE27C2146F2FA7BBE55F78F6BDE96F8676FBB047A3073F8B586EA23ABF99D1BD78349A42D9ECD86164969D4DCF7EB5598741D92906AA68674F6C8624836A3BB7D12A870B26425468191258B989769F4CBB6D958E92422F6ACA72EE0FF72334FE1DA1866BF3331A08A93477FBF28BAE43CDE70708FDFAAB4224E010DFD16224318A558E52822E9D0A99C02028C77AE39BFFECDE618A783DEAD617BADB03A647B3CD4885578EBE806082E4784761D2E4A0E57AE294DA4CB74E0AA1F05F3C5F0E46D971791D576933846671F0FC22F97EF1AD0B7E9B39FA4CC9433FD087E168C7FF061A8341F56EA44C1C147CD26DDC555F6F0EAFF6CD75074C3B61E5B4531A0D3095EA88EACE8440038D9C9F6A3826C897614F372D7E8E112C73317BECB96A0F9DADD8132A5177DE7F6DA798488262B6FB8F899BA9BFA5959BF166D86CB2D74FB177D11720A375637629ACA7083DAA1E4D961EF619ED062343889AC505DFBFC4097C7E11CDD3B9D97BEA9D830FCF9B9C33FB5F850B63259EECABDA6CD51AA7C0681FFE762928382D4B2F23D2DEA736EFAC1B7716B5EDD7C0F10C45739EF4701F0453A2B84E6528D798C435F3F864BE9152539B9F9853748E505AE8BF5F5B19274293C6B0A76E26E79909EFAECDEB6B53A8490E572767EAE750086636107C9AFCD45FC092431345B2E98D403DC936BE015D99
tmp_aes_key = 37C14AF907BD46B39A8FF94D067CBAF3EE6FCC3B43F6D89E7C44148668CA52FE
tmp_aes_iv = E919CBC84320D9FB6680478C7AF2FE5E8B2DC15C97281EC31EF108B1F44F474B</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 88903DE3A32E750A262EF1F40C7B6DA1D935DABFBA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100410090887964CEE17E9C053A404F9F241CCF1605B68150C675CB248E4E35D41F82C6ED283660A7482F1DFF41853FB6E570A30666B6350393641A9C87B2EE65D1A13118C083282D631CECC7281D29E94E426BA1AC357CC7732D6AB9DCA77CC93BB6020407F2C78B4B1FE7BB12F45DE24B530F500803B860AC5DA0791CE8F30C60E7F0A15CC5CC48C51FA02AF87E6D240FD70C3A8CD490CE0A4FB2C5F70A99851CFBB1764A9DD1F458A3407B70E457BAD41D21D763F321258D3669479C63638C789C3816D731155C209E87D10A573FE3D061BAA4D7CA7CFFDADC10976498347C7A0230E1708F9777A3F64D66871975BA3C0C1A06E171FF3B4D4BF15653607E02580C64706697FA2829946E9345
answer = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100410090887964CEE17E9C053A404F9F241CCF1605B68150C675CB248E4E35D41F82C6ED283660A7482F1DFF41853FB6E570A30666B6350393641A9C87B2EE65D1A13118C083282D631CECC7281D29E94E426BA1AC357CC7732D6AB9DCA77CC93BB6020407F2C78B4B1FE7BB12F45DE24B530F500803B860AC5DA0791CE8F30C60E7F0A15CC5CC48C51FA02AF87E6D240FD70C3A8CD490CE0A4FB2C5F70A99851CFBB1764A9DD1F458A3407B70E457BAD41D21D763F321258D3669479C63638C789C3816D731155C209E87D10A573FE3D061BAA4D7CA7CFFDADC10976498347C7A0230E1708F9777A3F64D66871975BA3C0C1A06E171FF3B4D4BF15653607E02580C64706697FA2829946E9345</code></pre>
<pre><code>answer_with_hash = 988F2D6BD584CA36CB0A786E73DB6FE4CC8734B2BA0D89B546EB071F8DC7CB46ECBAB61048F0E86F65454C9BE62CB4D3D8F142DBF178B0D903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A3A3525CD4B273DD126F2C17194620DFBEA8027476988BD6D6D782AE218A8DE7BD89ECC6AEF9EB289203A65D0A4373FFDB19E013AC768AB0A07153AAFCCE7EDF663D3A9D3D4172581AA3DA791769F85100731E2B84092E24BF6E3B92BA9862A73E44895569E2C9084B339E2B63DD3319CCD620775730C3E02E04C740E20B5605A6B9F41F136D69F2A4C542CDE192681CC3244083059908E1CAFD112239BE233C84CAC384998C31A627EC086807001317B92748B454E5AB34033F0294B10DA539299E896D188449AF2A4C62779F9FDA493342B6C563ED25B95CC3A996E766E431D922625A1E14A674752637AF4A4462DA27F3554573BF12443ACB401BB2D8FC82ACB7566ED76BF1E3A83230A
answer = BA0D89B546EB071F8DC7CB46ECBAB61048F0E86F65454C9BE62CB4D3D8F142DBF178B0D903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000A3A3525CD4B273DD126F2C17194620DFBEA8027476988BD6D6D782AE218A8DE7BD89ECC6AEF9EB289203A65D0A4373FFDB19E013AC768AB0A07153AAFCCE7EDF663D3A9D3D4172581AA3DA791769F85100731E2B84092E24BF6E3B92BA9862A73E44895569E2C9084B339E2B63DD3319CCD620775730C3E02E04C740E20B5605A6B9F41F136D69F2A4C542CDE192681CC3244083059908E1CAFD112239BE233C84CAC384998C31A627EC086807001317B92748B454E5AB34033F0294B10DA539299E896D188449AF2A4C62779F9FDA493342B6C563ED25B95CC3A996E766E431D922625A1E14A674752637AF4A4462DA27F3554573BF12443ACB401BB2D8FC82ACB7566ED76BF1E3A83230A</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 17 62 E3 D8 C2 13 A8 FA C5 F4 12 25
0010 | E3 60 13 1E B2 70 60 7F 52 AD 68 D1 56 29 8C 9D
0020 | DC 64 5F 70 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 46 EB 07 1F 8D C7 CB 46 EC BA B6 10
0010 | 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3 D8 F1 42 DB
0020 | F1 78 B0 D9 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 = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
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 | 41 00 90 88 79 64 CE E1 7E 9C 05 3A 40 4F 9F 24
0140 | 1C CF 16 05 B6 81 50 C6 75 CB 24 8E 4E 35 D4 1F
0150 | 82 C6 ED 28 36 60 A7 48 2F 1D FF 41 85 3F B6 E5
0160 | 70 A3 06 66 B6 35 03 93 64 1A 9C 87 B2 EE 65 D1
0170 | A1 31 18 C0 83 28 2D 63 1C EC C7 28 1D 29 E9 4E
0180 | 42 6B A1 AC 35 7C C7 73 2D 6A B9 DC A7 7C C9 3B
0190 | B6 02 04 07 F2 C7 8B 4B 1F E7 BB 12 F4 5D E2 4B
01A0 | 53 0F 50 08 03 B8 60 AC 5D A0 79 1C E8 F3 0C 60
01B0 | E7 F0 A1 5C C5 CC 48 C5 1F A0 2A F8 7E 6D 24 0F
01C0 | D7 0C 3A 8C D4 90 CE 0A 4F B2 C5 F7 0A 99 85 1C
01D0 | FB B1 76 4A 9D D1 F4 58 A3 40 7B 70 E4 57 BA D4
01E0 | 1D 21 D7 63 F3 21 25 8D 36 69 47 9C 63 63 8C 78
01F0 | 9C 38 16 D7 31 15 5C 20 9E 87 D1 0A 57 3F E3 D0
0200 | 61 BA A4 D7 CA 7C FF DA DC 10 97 64 98 34 7C 7A
0210 | 02 30 E1 70 8F 97 77 A3 F6 4D 66 87 19 75 BA 3C
0220 | 0C 1A 06 E1 71 FF 3B 4D 4B F1 56 53 60 7E 02 58
0230 | 0C 64 70 66</code></pre>
0130 | 0A 3A 35 25 CD 4B 27 3D D1 26 F2 C1 71 94 62 0D
0140 | FB EA 80 27 47 69 88 BD 6D 6D 78 2A E2 18 A8 DE
0150 | 7B D8 9E CC 6A EF 9E B2 89 20 3A 65 D0 A4 37 3F
0160 | FD B1 9E 01 3A C7 68 AB 0A 07 15 3A AF CC E7 ED
0170 | F6 63 D3 A9 D3 D4 17 25 81 AA 3D A7 91 76 9F 85
0180 | 10 07 31 E2 B8 40 92 E2 4B F6 E3 B9 2B A9 86 2A
0190 | 73 E4 48 95 56 9E 2C 90 84 B3 39 E2 B6 3D D3 31
01A0 | 9C CD 62 07 75 73 0C 3E 02 E0 4C 74 0E 20 B5 60
01B0 | 5A 6B 9F 41 F1 36 D6 9F 2A 4C 54 2C DE 19 26 81
01C0 | CC 32 44 08 30 59 90 8E 1C AF D1 12 23 9B E2 33
01D0 | C8 4C AC 38 49 98 C3 1A 62 7E C0 86 80 70 01 31
01E0 | 7B 92 74 8B 45 4E 5A B3 40 33 F0 29 4B 10 DA 53
01F0 | 92 99 E8 96 D1 88 44 9A F2 A4 C6 27 79 F9 FD A4
0200 | 93 34 2B 6C 56 3E D2 5B 95 CC 3A 99 6E 76 6E 43
0210 | 1D 92 26 25 A1 E1 4A 67 47 52 63 7A F4 A4 46 2D
0220 | A2 7F 35 54 57 3B F1 24 43 AC B4 01 BB 2D 8F C8
0230 | 2A CB 75 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 = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE000100410090887964CEE17E9C053A</code> <code>404F9F241CCF1605B68150C675CB248E</code> <code>4E35D41F82C6ED283660A7482F1DFF41</code> <code>853FB6E570A30666B6350393641A9C87</code> <code>B2EE65D1A13118C083282D631CECC728</code> <code>1D29E94E426BA1AC357CC7732D6AB9DC</code> <code>A77CC93BB6020407F2C78B4B1FE7BB12</code> <code>F45DE24B530F500803B860AC5DA0791C</code> <code>E8F30C60E7F0A15CC5CC48C51FA02AF8</code> <code>7E6D240FD70C3A8CD490CE0A4FB2C5F7</code> <code>0A99851CFBB1764A9DD1F458A3407B70</code> <code>E457BAD41D21D763F321258D3669479C</code> <code>63638C789C3816D731155C209E87D10A</code> <code>573FE3D061BAA4D7CA7CFFDADC109764</code> <code>98347C7A0230E1708F9777A3F64D6687</code> <code>1975BA3C0C1A06E171FF3B4D4BF15653</code><br> <code>607E0258</code></td>
<td><code>FE0001000A3A3525CD4B273DD126F2C1</code> <code>7194620DFBEA8027476988BD6D6D782A</code> <code>E218A8DE7BD89ECC6AEF9EB289203A65</code> <code>D0A4373FFDB19E013AC768AB0A07153A</code> <code>AFCCE7EDF663D3A9D3D4172581AA3DA7</code> <code>91769F85100731E2B84092E24BF6E3B9</code> <code>2BA9862A73E44895569E2C9084B339E2</code> <code>B63DD3319CCD620775730C3E02E04C74</code> <code>0E20B5605A6B9F41F136D69F2A4C542C</code> <code>DE192681CC3244083059908E1CAFD112</code> <code>239BE233C84CAC384998C31A627EC086</code> <code>807001317B92748B454E5AB34033F029</code> <code>4B10DA539299E896D188449AF2A4C627</code> <code>79F9FDA493342B6C563ED25B95CC3A99</code> <code>6E766E431D922625A1E14A674752637A</code> <code>F4A4462DA27F3554573BF12443ACB401</code><br> <code>BB2D8FC8</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>0C647066</code> (1718641676 in decimal)</td>
<td><code>2ACB7566</code> (1718995754 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
<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 = 4798CB6F6A65840C28E623B5CEF94D35A74CB5CBE9EDCDC07F6E8630DE340B31C5A766CD377880FF163D403F74263EECEDFCFB9287D9CE2AED99834DE1B748879AADCB4F9DDDDB1F2E9B14952C3607C787D47E8396817E30C9BD7E1AB67B82343BC9F3C38F0D805ECCAC31002A305594398F7DE51A66AC3AFF1B547F7E7098EB26D17D8F9E9AABD77B98663372A5B5CC182F5754E942BE126A43EE7F6E5F71CD077E40DBA1332869EAC345DC1F368B9BF5A570C936F469580287FB3E82CC81338200BC94BAB88DA41BC565B9B0BA170BC2E99CAE401877D8B8C2E2C68C606AAC4D29DA845F6C3C3E6CB85D299DB4D9BCE26136CE15EEFBB1172064FB84D28AAE</code></pre>
<pre><code>b = 5134482124796576F73071FACC3B6893B084FBA0445D4FC320613BE19428284BB99247000A30E7F6132181E0B68C9AE0AC66189120E758CF664B1AB76427291A8B23EBEB232627E63ADE944585EE305047D46017300D848BC17FDAE6C83F6494B9DB1E07750E3D9EB39ADFB1AD3C8FDCA6AE5B835551924F6A205FE63C48EF8C007BE2948F4C3A9CB26AFCF56BB165999F8908084CACDF61DEF66DE8525F07A32C0E14A88CC23E36E2F99A082F3710EE2B67E1C43A75C11DA2D9F451D36DB00938AF2E11672CCA3DBFCAC349482B3F1D7EC121726994D618B55BBF496D4D94FB08370AE9E3619962B66A3D75460CF1D72BCA56FBAC713169A48E7570DCBFCCCC</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 = 4DAC03C2027F002773D10312FEB1215DF466B228B1E35F9D714A36CCA17376D03E983B0CBD1A7F7BE5C6643CEBA0933A1BD927143ED737406B0876CEEDC7E3C6E746021EC64DB9BECFBC48022B562437FAF5B4F89252FEB7C5FD9AF05A92FC745CAF17123613352E21D369BB1C39B4177C6E75898E86756E1638096917E7CB33945A6B53A13E6B009BFFD3925791EC4B20EAD489EDDB530F511DC35FB9C3638817728DF7C234F14AFCE39C5912FC6303483CA5344E944AE52336884DE9243A27F6E292304E3E96F98DD7C14DA89C89A7B247CC2E95754FA3B60D87BD6CA8A3B25812CC018C85EAEBBE44E134C4EED6FFC1E7E536D005FF9A68482ECEC853058A</code></pre>
<pre><code>g_b = 1399E6A25C7C8C3F90C2BF8E9BF174CBD6DAFA79963E9274B9D56E9B72D226225ED1D74C985E52E04844362ACFC90CF6899363CFA6C57A525C05585D5BE0AAC39999EE5ED24B3A425F406353FC78AB5613EC7C63590917737A842C66BED98B2FBFC95E0CF6A74467495255B3F95DD0ED50EE4E7F98AA75A6E92924BB71369E77EB9AB0E52D2FDCB8E351E340F5781914D549B828F7D07C003A0BD487F24D43008E83A9DE572945B4E8E8A9D3A83686DB0305FE8A513870111CEE63C05B159B6D0F591B7305E9F68DCE95047B111E76B8C82AD173FE5BE1C30F9CE0624354670D671EDDE524A3E6D31AB8AF8568ED7D8BCE4C07E13F6F7544977F6A5B256B3D16</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 17 62 E3 D8 C2 13 A8 FA C5 F4 12 25
0010 | E3 60 13 1E B2 70 60 7F 52 AD 68 D1 56 29 8C 9D
0020 | DC 64 5F 70 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 4D AC 03 C2 02 7F 00 27 73 D1 03 12 FE B1 21 5D
0040 | F4 66 B2 28 B1 E3 5F 9D 71 4A 36 CC A1 73 76 D0
0050 | 3E 98 3B 0C BD 1A 7F 7B E5 C6 64 3C EB A0 93 3A
0060 | 1B D9 27 14 3E D7 37 40 6B 08 76 CE ED C7 E3 C6
0070 | E7 46 02 1E C6 4D B9 BE CF BC 48 02 2B 56 24 37
0080 | FA F5 B4 F8 92 52 FE B7 C5 FD 9A F0 5A 92 FC 74
0090 | 5C AF 17 12 36 13 35 2E 21 D3 69 BB 1C 39 B4 17
00A0 | 7C 6E 75 89 8E 86 75 6E 16 38 09 69 17 E7 CB 33
00B0 | 94 5A 6B 53 A1 3E 6B 00 9B FF D3 92 57 91 EC 4B
00C0 | 20 EA D4 89 ED DB 53 0F 51 1D C3 5F B9 C3 63 88
00D0 | 17 72 8D F7 C2 34 F1 4A FC E3 9C 59 12 FC 63 03
00E0 | 48 3C A5 34 4E 94 4A E5 23 36 88 4D E9 24 3A 27
00F0 | F6 E2 92 30 4E 3E 96 F9 8D D7 C1 4D A8 9C 89 A7
0100 | B2 47 CC 2E 95 75 4F A3 B6 0D 87 BD 6C A8 A3 B2
0110 | 58 12 CC 01 8C 85 EA EB BE 44 E1 34 C4 EE D6 FF
0120 | C1 E7 E5 36 D0 05 FF 9A 68 48 2E CE C8 53 05 8A</code></pre>
<pre><code>0000 | 54 B6 43 66 46 EB 07 1F 8D C7 CB 46 EC BA B6 10
0010 | 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3 D8 F1 42 DB
0020 | F1 78 B0 D9 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 13 99 E6 A2 5C 7C 8C 3F 90 C2 BF 8E 9B F1 74 CB
0040 | D6 DA FA 79 96 3E 92 74 B9 D5 6E 9B 72 D2 26 22
0050 | 5E D1 D7 4C 98 5E 52 E0 48 44 36 2A CF C9 0C F6
0060 | 89 93 63 CF A6 C5 7A 52 5C 05 58 5D 5B E0 AA C3
0070 | 99 99 EE 5E D2 4B 3A 42 5F 40 63 53 FC 78 AB 56
0080 | 13 EC 7C 63 59 09 17 73 7A 84 2C 66 BE D9 8B 2F
0090 | BF C9 5E 0C F6 A7 44 67 49 52 55 B3 F9 5D D0 ED
00A0 | 50 EE 4E 7F 98 AA 75 A6 E9 29 24 BB 71 36 9E 77
00B0 | EB 9A B0 E5 2D 2F DC B8 E3 51 E3 40 F5 78 19 14
00C0 | D5 49 B8 28 F7 D0 7C 00 3A 0B D4 87 F2 4D 43 00
00D0 | 8E 83 A9 DE 57 29 45 B4 E8 E8 A9 D3 A8 36 86 DB
00E0 | 03 05 FE 8A 51 38 70 11 1C EE 63 C0 5B 15 9B 6D
00F0 | 0F 59 1B 73 05 E9 F6 8D CE 95 04 7B 11 1E 76 B8
0100 | C8 2A D1 73 FE 5B E1 C3 0F 9C E0 62 43 54 67 0D
0110 | 67 1E DD E5 24 A3 E6 D3 1A B8 AF 85 68 ED 7D 8B
0120 | CE 4C 07 E1 3F 6F 75 44 97 7F 6A 5B 25 6B 3D 16</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 = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001004DAC03C2027F002773D10312</code> <code>FEB1215DF466B228B1E35F9D714A36CC</code> <code>A17376D03E983B0CBD1A7F7BE5C6643C</code> <code>EBA0933A1BD927143ED737406B0876CE</code> <code>EDC7E3C6E746021EC64DB9BECFBC4802</code> <code>2B562437FAF5B4F89252FEB7C5FD9AF0</code> <code>5A92FC745CAF17123613352E21D369BB</code> <code>1C39B4177C6E75898E86756E16380969</code> <code>17E7CB33945A6B53A13E6B009BFFD392</code> <code>5791EC4B20EAD489EDDB530F511DC35F</code> <code>B9C3638817728DF7C234F14AFCE39C59</code> <code>12FC6303483CA5344E944AE52336884D</code> <code>E9243A27F6E292304E3E96F98DD7C14D</code> <code>A89C89A7B247CC2E95754FA3B60D87BD</code> <code>6CA8A3B25812CC018C85EAEBBE44E134</code> <code>C4EED6FFC1E7E536D005FF9A68482ECE</code><br> <code>C853058A</code></td>
<td><code>FE0001001399E6A25C7C8C3F90C2BF8E</code> <code>9BF174CBD6DAFA79963E9274B9D56E9B</code> <code>72D226225ED1D74C985E52E04844362A</code> <code>CFC90CF6899363CFA6C57A525C05585D</code> <code>5BE0AAC39999EE5ED24B3A425F406353</code> <code>FC78AB5613EC7C63590917737A842C66</code> <code>BED98B2FBFC95E0CF6A74467495255B3</code> <code>F95DD0ED50EE4E7F98AA75A6E92924BB</code> <code>71369E77EB9AB0E52D2FDCB8E351E340</code> <code>F5781914D549B828F7D07C003A0BD487</code> <code>F24D43008E83A9DE572945B4E8E8A9D3</code> <code>A83686DB0305FE8A513870111CEE63C0</code> <code>5B159B6D0F591B7305E9F68DCE95047B</code> <code>111E76B8C82AD173FE5BE1C30F9CE062</code> <code>4354670D671EDDE524A3E6D31AB8AF85</code> <code>68ED7D8BCE4C07E13F6F7544977F6A5B</code><br> <code>256B3D16</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 = BA0D89B51762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F7
<!-- 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 = 54B643661762E3D8C213A8FAC5F41225E360131EB270607F52AD68D156298C9DDC645F700000000000000000FE0001004DAC03C2027F002773D10312FEB1215DF466B228B1E35F9D714A36CCA17376D03E983B0CBD1A7F7BE5C6643CEBA0933A1BD927143ED737406B0876CEEDC7E3C6E746021EC64DB9BECFBC48022B562437FAF5B4F89252FEB7C5FD9AF05A92FC745CAF17123613352E21D369BB1C39B4177C6E75898E86756E1638096917E7CB33945A6B53A13E6B009BFFD3925791EC4B20EAD489EDDB530F511DC35FB9C3638817728DF7C234F14AFCE39C5912FC6303483CA5344E944AE52336884DE9243A27F6E292304E3E96F98DD7C14DA89C89A7B247CC2E95754FA3B60D87BD6CA8A3B25812CC018C85EAEBBE44E134C4EED6FFC1E7E536D005FF9A68482ECEC853058A
padding = B428DCF3654A51121F6AD091
tmp_aes_key = B0B3A3AAB2040BDFDACC0ED2FDF2D766E3FAA894B9E3DBE96430E6C2794C9B1D
tmp_aes_iv = 0C4B1363835D9408D10AA3D134F1E30010658955718C19A6FDEA3EC7C250D366</code></pre>
<pre><code>data = 54B6436646EB071F8DC7CB46ECBAB61048F0E86F65454C9BE62CB4D3D8F142DBF178B0D90000000000000000FE0001001399E6A25C7C8C3F90C2BF8E9BF174CBD6DAFA79963E9274B9D56E9B72D226225ED1D74C985E52E04844362ACFC90CF6899363CFA6C57A525C05585D5BE0AAC39999EE5ED24B3A425F406353FC78AB5613EC7C63590917737A842C66BED98B2FBFC95E0CF6A74467495255B3F95DD0ED50EE4E7F98AA75A6E92924BB71369E77EB9AB0E52D2FDCB8E351E340F5781914D549B828F7D07C003A0BD487F24D43008E83A9DE572945B4E8E8A9D3A83686DB0305FE8A513870111CEE63C05B159B6D0F591B7305E9F68DCE95047B111E76B8C82AD173FE5BE1C30F9CE0624354670D671EDDE524A3E6D31AB8AF8568ED7D8BCE4C07E13F6F7544977F6A5B256B3D16
padding = 3F5A178B1BAEF997E1221898
tmp_aes_key = 37C14AF907BD46B39A8FF94D067CBAF3EE6FCC3B43F6D89E7C44148668CA52FE
tmp_aes_iv = E919CBC84320D9FB6680478C7AF2FE5E8B2DC15C97281EC31EF108B1F44F474B</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 = 85EF8FF898129E4AE01F89B80922CC1EF0C8C0813AFC2DE57F003D98C87AC318FE5825B613A967BA99026BF4AC55C3FCC93E007A451FFFB535C382F5D3A0D0FDBC193ADEABD061194A6C8B498E7AEC3FE3EDAF036E665DD3BFC11FA43FDD45A79C4FDCC11EF5AF9FFA9A149E846DA415195B856B08F0B7CC4EC337D32220C6DA9EBC3B05F5EEBA8685E5AB389079D377AE7F6AFB9E6F82CEB02856065B301EC0E93D4AFA400BB65E66815BCEC15486B5C62DAC9222D4DC60859FF765AF1EAA3397841F3443C41081FA106B5345F5881104ADBC9A87CFCB9DD63E671B8DF63F49B216A5BB1B017BB950555BE235F48080AF90D75C4961D8758752D0FDCBB189649A8BC729DB8D9F76E8B119D84644EFFD034BDD772C7FA7A68617475B8A762358628E9BDDD18D73A4DDA6351559AC91FD375483A06A7E12641ECF5B3A43050E5F05FD1F50E876B7A34008568F7DEF5BD1</code></pre>
<pre><code>encrypted_data = C37243D40D8F45CA1B1FFF735DDAF3E193E8EEB941D70F8EB604D48D6E13CD14667ED6FC8EB07CE9EFE0E77E952E89F509FE623C738C37C2DE983130876B267D075FE5B1A321366D3BE1CA391D6EABF6A84C528F9E16988650295C49663382110FE0D3F4B0252A3E87CD54C7B28B56B19ED4F92900B6B52EAD68EC152970BAD18172D696D2D4B1B92EB93534A29334BEC19F4DD1A5A967DB4BD2B246803A50016B630FE34BC24F5D81C09804335737448B93240A78C753AEADFE8E39F18AC8013D123E8C1EB6C2634A4590E92BB92FB079E57F57B888CED472B84FDFCFB4A577EE06E2ECC46B8C2B59E52FFE5DBE3A03B130B7ABC6CCCC64FDEF301ACD3581A4E3072FE1EDCF36DE032C5E39ACD1846F1B4D104C28A9FFD00194ED21EF7D9D1229463BF0874C122A494E0199AACA7490CF673898CFC565DAFD9A28B86F3353D46BC1922BFF930A2C18A0DD3A07265CE5</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 78 17 0F 00 0C 64 70 66
0010 | 78 01 00 00 1F 5F 04 F5 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E B2 70 60 7F 52 AD 68 D1
0030 | 56 29 8C 9D DC 64 5F 70 FE 50 01 00 85 EF 8F F8
0040 | 98 12 9E 4A E0 1F 89 B8 09 22 CC 1E F0 C8 C0 81
0050 | 3A FC 2D E5 7F 00 3D 98 C8 7A C3 18 FE 58 25 B6
0060 | 13 A9 67 BA 99 02 6B F4 AC 55 C3 FC C9 3E 00 7A
0070 | 45 1F FF B5 35 C3 82 F5 D3 A0 D0 FD BC 19 3A DE
0080 | AB D0 61 19 4A 6C 8B 49 8E 7A EC 3F E3 ED AF 03
0090 | 6E 66 5D D3 BF C1 1F A4 3F DD 45 A7 9C 4F DC C1
00A0 | 1E F5 AF 9F FA 9A 14 9E 84 6D A4 15 19 5B 85 6B
00B0 | 08 F0 B7 CC 4E C3 37 D3 22 20 C6 DA 9E BC 3B 05
00C0 | F5 EE BA 86 85 E5 AB 38 90 79 D3 77 AE 7F 6A FB
00D0 | 9E 6F 82 CE B0 28 56 06 5B 30 1E C0 E9 3D 4A FA
00E0 | 40 0B B6 5E 66 81 5B CE C1 54 86 B5 C6 2D AC 92
00F0 | 22 D4 DC 60 85 9F F7 65 AF 1E AA 33 97 84 1F 34
0100 | 43 C4 10 81 FA 10 6B 53 45 F5 88 11 04 AD BC 9A
0110 | 87 CF CB 9D D6 3E 67 1B 8D F6 3F 49 B2 16 A5 BB
0120 | 1B 01 7B B9 50 55 5B E2 35 F4 80 80 AF 90 D7 5C
0130 | 49 61 D8 75 87 52 D0 FD CB B1 89 64 9A 8B C7 29
0140 | DB 8D 9F 76 E8 B1 19 D8 46 44 EF FD 03 4B DD 77
0150 | 2C 7F A7 A6 86 17 47 5B 8A 76 23 58 62 8E 9B DD
0160 | D1 8D 73 A4 DD A6 35 15 59 AC 91 FD 37 54 83 A0
0170 | 6A 7E 12 64 1E CF 5B 3A 43 05 0E 5F 05 FD 1F 50
0180 | E8 76 B7 A3 40 08 56 8F 7D EF 5B D1</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 3C B4 09 00 2A CB 75 66
0010 | 78 01 00 00 1F 5F 04 F5 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3
0030 | D8 F1 42 DB F1 78 B0 D9 FE 50 01 00 C3 72 43 D4
0040 | 0D 8F 45 CA 1B 1F FF 73 5D DA F3 E1 93 E8 EE B9
0050 | 41 D7 0F 8E B6 04 D4 8D 6E 13 CD 14 66 7E D6 FC
0060 | 8E B0 7C E9 EF E0 E7 7E 95 2E 89 F5 09 FE 62 3C
0070 | 73 8C 37 C2 DE 98 31 30 87 6B 26 7D 07 5F E5 B1
0080 | A3 21 36 6D 3B E1 CA 39 1D 6E AB F6 A8 4C 52 8F
0090 | 9E 16 98 86 50 29 5C 49 66 33 82 11 0F E0 D3 F4
00A0 | B0 25 2A 3E 87 CD 54 C7 B2 8B 56 B1 9E D4 F9 29
00B0 | 00 B6 B5 2E AD 68 EC 15 29 70 BA D1 81 72 D6 96
00C0 | D2 D4 B1 B9 2E B9 35 34 A2 93 34 BE C1 9F 4D D1
00D0 | A5 A9 67 DB 4B D2 B2 46 80 3A 50 01 6B 63 0F E3
00E0 | 4B C2 4F 5D 81 C0 98 04 33 57 37 44 8B 93 24 0A
00F0 | 78 C7 53 AE AD FE 8E 39 F1 8A C8 01 3D 12 3E 8C
0100 | 1E B6 C2 63 4A 45 90 E9 2B B9 2F B0 79 E5 7F 57
0110 | B8 88 CE D4 72 B8 4F DF CF B4 A5 77 EE 06 E2 EC
0120 | C4 6B 8C 2B 59 E5 2F FE 5D BE 3A 03 B1 30 B7 AB
0130 | C6 CC CC 64 FD EF 30 1A CD 35 81 A4 E3 07 2F E1
0140 | ED CF 36 DE 03 2C 5E 39 AC D1 84 6F 1B 4D 10 4C
0150 | 28 A9 FF D0 01 94 ED 21 EF 7D 9D 12 29 46 3B F0
0160 | 87 4C 12 2A 49 4E 01 99 AA CA 74 90 CF 67 38 98
0170 | CF C5 65 DA FD 9A 28 B8 6F 33 53 D4 6B C1 92 2B
0180 | FF 93 0A 2C 18 A0 DD 3A 07 26 5C E5</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>78170F000C647066</code></td>
<td><code>3CB409002ACB7566</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>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE50010085EF8FF898129E4AE01F89B8</code> <code>0922CC1EF0C8C0813AFC2DE57F003D98</code> <code>C87AC318FE5825B613A967BA99026BF4</code> <code>AC55C3FCC93E007A451FFFB535C382F5</code> <code>D3A0D0FDBC193ADEABD061194A6C8B49</code> <code>8E7AEC3FE3EDAF036E665DD3BFC11FA4</code> <code>3FDD45A79C4FDCC11EF5AF9FFA9A149E</code> <code>846DA415195B856B08F0B7CC4EC337D3</code> <code>2220C6DA9EBC3B05F5EEBA8685E5AB38</code> <code>9079D377AE7F6AFB9E6F82CEB0285606</code> <code>5B301EC0E93D4AFA400BB65E66815BCE</code> <code>C15486B5C62DAC9222D4DC60859FF765</code> <code>AF1EAA3397841F3443C41081FA106B53</code> <code>45F5881104ADBC9A87CFCB9DD63E671B</code> <code>8DF63F49B216A5BB1B017BB950555BE2</code> <code>35F48080AF90D75C4961D8758752D0FD</code> <code>CBB189649A8BC729DB8D9F76E8B119D8</code> <code>4644EFFD034BDD772C7FA7A68617475B</code> <code>8A762358628E9BDDD18D73A4DDA63515</code> <code>59AC91FD375483A06A7E12641ECF5B3A</code> <code>43050E5F05FD1F50E876B7A34008568F</code><br> <code>7DEF5BD1</code></td>
<td><code>FE500100C37243D40D8F45CA1B1FFF73</code> <code>5DDAF3E193E8EEB941D70F8EB604D48D</code> <code>6E13CD14667ED6FC8EB07CE9EFE0E77E</code> <code>952E89F509FE623C738C37C2DE983130</code> <code>876B267D075FE5B1A321366D3BE1CA39</code> <code>1D6EABF6A84C528F9E16988650295C49</code> <code>663382110FE0D3F4B0252A3E87CD54C7</code> <code>B28B56B19ED4F92900B6B52EAD68EC15</code> <code>2970BAD18172D696D2D4B1B92EB93534</code> <code>A29334BEC19F4DD1A5A967DB4BD2B246</code> <code>803A50016B630FE34BC24F5D81C09804</code> <code>335737448B93240A78C753AEADFE8E39</code> <code>F18AC8013D123E8C1EB6C2634A4590E9</code> <code>2BB92FB079E57F57B888CED472B84FDF</code> <code>CFB4A577EE06E2ECC46B8C2B59E52FFE</code> <code>5DBE3A03B130B7ABC6CCCC64FDEF301A</code> <code>CD3581A4E3072FE1EDCF36DE032C5E39</code> <code>ACD1846F1B4D104C28A9FFD00194ED21</code> <code>EF7D9D1229463BF0874C122A494E0199</code> <code>AACA7490CF673898CFC565DAFD9A28B8</code> <code>6F3353D46BC1922BFF930A2C18A0DD3A</code><br> <code>07265CE5</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 = 8427AB3AF255694313082C5B064784AB927738A5187BC8FC4C5FED395BF3B0B6CAF69630F2338F8CAB3C5D1421054D29FACAE91E3618F9A80026D91B7F4AD916D2D477284CAC9D543572FA534DAA24BC59E4CF0A1361BA1A696E2DAF3FD7974E6000A803B9D70BE51089C1179D6743E23657F05CE361378834C12CD8ED362AE7F77F91932D8FFF15FA8C9170B3BFB664F2BF5D1D95E214DA518B11D4F17A78602143BF3352F33CB66D9E83EC1C1F1EB970F9AF92D7FC37BF5D126216C8B47F5C13D8F69957B850AB6FBD4B3E33E291FC1EBFF00FE8E422A054F7FF6CACBC7CE8605DEC4CACD9143B166CB9904D11AD1EC9246BADECA8D6CF0AEF0A2B809BA7B4</code></pre>
<pre><code>auth_key = 185605C9D297A7D1B678B978EB1E3B080D27D8B32BA6A9552CA454C40BB51B3CA1008A09FC99A9940E3FF2857B39DCB686031A29FCCF52751FC6D8DBCC9C3689F291DF01E9C670F4FC464329080E6DFFBFE1044637E48D6B7E2DC34D7A5444C53F390B77B8A1E8360DC22DF3867929D0A0FC6C888D6ECC288694F568E47D15A724DFB25124C00B976851F790C6285CA32A01A543AA85EE84D3BB7BEDE7234BF0E7068C329C0AECD70A636A0059CC3BEAC8EC3470E81B034CFB549BAFF782D9AA23C57BC92A3A9ECA17D9D7DF4D3EB9841D80826D80D080843E92C0908CDE7C557449824D18D702899442F7664460FBA8636CCC6E1145D31FE49C631042AA57C7</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 38 CA A5 0C 64 70 66
0010 | 74 00 00 00 34 F7 CB 3B 17 62 E3 D8 C2 13 A8 FA
0020 | C5 F4 12 25 E3 60 13 1E B2 70 60 7F 52 AD 68 D1
0030 | 56 29 8C 9D DC 64 5F 70 28 31 CF ED AB 09 96 CF
0040 | 21 F7 63 44 B0 93 B2 AB</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B0 E4 05 2B CB 75 66
0010 | 44 00 00 00 34 F7 CB 3B 46 EB 07 1F 8D C7 CB 46
0020 | EC BA B6 10 48 F0 E8 6F 65 45 4C 9B E6 2C B4 D3
0030 | D8 F1 42 DB F1 78 B0 D9 41 54 BD 94 89 5F 6A DD
0040 | A0 2F 9F 0A FB 9B A2 A4</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>0138CAA50C647066</code></td>
<td><code>01B0E4052BCB7566</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>74000000</code> (116 in decimal)</td>
<td><code>44000000</code> (68 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>1762E3D8C213A8FAC5F41225E360131E</code></td>
<td><code>46EB071F8DC7CB46ECBAB61048F0E86F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>B270607F52AD68D156298C9DDC645F70</code></td>
<td><code>65454C9BE62CB4D3D8F142DBF178B0D9</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>2831CFEDAB0996CF21F76344B093B2AB</code></td>
<td><code>4154BD94895F6ADDA02F9F0AFB9BA2A4</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

@ -106,7 +106,7 @@ Method…">
<tbody>
<tr>
<td><a href="/method/messages.getSavedReactionTags">messages.getSavedReactionTags</a></td>
<td> </td>
<td>Fetch the full list of <a href="/api/saved-messages#tags">saved message tags</a> created by the user.</td>
</tr>
</tbody>
</table></div>