Update content of files

This commit is contained in:
GitHub Action 2024-08-03 17:00:08 +00:00
parent 4d9e41c6ba
commit f0d31af6cf
8 changed files with 223 additions and 519 deletions

View file

@ -675,7 +675,7 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
<h4><a class="anchor" href="#stars-purchase-blocked" id="stars-purchase-blocked" name="stars-purchase-blocked"><i class="anchor-icon"></i></a><code>stars_purchase_blocked</code></h4>
<p>If false, indicates that <a href="/api/stars">Telegram Stars may be used in the current region</a>; otherwise, all Star-related UI options should be hidden from the user. (boolean)</p>
<h4><a class="anchor" href="#stars-revenue-withdrawal-min" id="stars-revenue-withdrawal-min" name="stars-revenue-withdrawal-min"><i class="anchor-icon"></i></a><code>stars_revenue_withdrawal_min</code></h4>
<p>Minimum required amount of <a href="/api/stars">Telegram Stars</a> on a channel or bot's balance to allow <a href="/api/stars#withdrawal">withdrawal »</a>. (integer)</p>
<p>Minimum required amount of <a href="/api/stars">Telegram Stars</a> on a channel or bot's balance to allow <a href="/api/stars#withdrawing-revenue">withdrawal »</a>. (integer)</p>
<h4><a class="anchor" href="#stars-paid-post-amount-max" id="stars-paid-post-amount-max" name="stars-paid-post-amount-max"><i class="anchor-icon"></i></a><code>stars_paid_post_amount_max</code></h4>
<p>Maximum price in <a href="/api/stars">Telegram Stars</a> for posted <a href="/api/paid-media">paid media</a>. (integer)</p>
<h4><a class="anchor" href="#web-app-allowed-protocols" id="web-app-allowed-protocols" name="web-app-allowed-protocols"><i class="anchor-icon"></i></a><code>web_app_allowed_protocols</code></h4>

View file

@ -159,6 +159,7 @@
<h3><a class="anchor" href="#layer-183" id="layer-183" name="layer-183"><i class="anchor-icon"></i></a><a href="/schema?layer=183">Layer 183</a></h3>
<p>This layer introduces the following features:</p>
<ul>
<li><a href="/api/paid-media">Paid media »</a></li>
<li><a href="/method/payments.getStarsTransactionsByID">Fetch info about specific Telegram Star transactions »</a></li>
<li><a href="/api/stars#paying-for-ads">Pay for advertisements using Telegram Stars »</a></li>
<li><a href="/api/bots/webapps">Mini Apps</a> may now be opened directly in compact mode by passing the <code>compact</code> flag to <a href="/method/messages.requestWebView">messages.requestWebView</a>, <a href="/method/messages.requestSimpleWebView">messages.requestSimpleWebView</a>, <a href="/method/messages.requestAppWebView">messages.requestAppWebView</a>.<br>
@ -182,7 +183,7 @@ If the returned <a href="/constructor/webViewResultUrl">webViewResultUrl</a> doe
</ul>
<h5><a class="anchor" href="#new-constructors" id="new-constructors" name="new-constructors"><i class="anchor-icon"></i></a>New Constructors</h5>
<ul>
<li>Added <a href="/constructor/inputMediaPaidMedia">inputMediaPaidMedia</a> - </li>
<li>Added <a href="/constructor/inputMediaPaidMedia">inputMediaPaidMedia</a> - <a href="/api/paid-media">Paid media, see here »</a> for more info.</li>
<li>Added <a href="/constructor/messageMediaPaidMedia">messageMediaPaidMedia</a> - <a href="/api/paid-media">Paid media, see here »</a> for more info.</li>
<li>Added <a href="/constructor/starsTransactionPeerAds">starsTransactionPeerAds</a> - Describes a <a href="/api/stars">Telegram Star</a> transaction used to pay for <a href="/api/stars#paying-for-ads">Telegram ads as specified here »</a>.</li>
<li>Added <a href="/constructor/payments.starsRevenueAdsAccountUrl">payments.starsRevenueAdsAccountUrl</a> - Contains a URL leading to a page where the user will be able to place ads for the channel/bot, paying using <a href="/api/stars#paying-for-ads">Telegram Stars</a>.</li>

View file

@ -57,7 +57,7 @@
<p><a href="/api/channel">Channel</a> administrators may forward or post paid media if the <a href="/constructor/channelFull">channelFull</a>.<code>paid_media_allowed</code> flag is set. </p>
<p>To post paid media, use <a href="/method/messages.sendMedia">messages.sendMedia</a>, passing an <a href="/constructor/inputMediaPaidMedia">inputMediaPaidMedia</a> constructor, containing:</p>
<ul>
<li>In <code>stars_amount</code>, the amount of <a href="/api/stars#stars-paid-post-amount-max">Telegram Stars</a> users must pay to obtain access to the media.<br>
<li>In <code>stars_amount</code>, the amount of <a href="/api/stars">Telegram Stars</a> users must pay to obtain access to the media.<br>
The maximum value that can be passed here is specified in the <a href="/api/config#stars-paid-post-amount-max">stars_paid_post_amount_max client configuration value »</a>.</li>
<li>In <code>extended_media</code>, the actual media files (currently only photos and videos are supported).
To send albums, do <strong>not</strong> use <a href="/method/messages.sendMultiMedia">messages.sendMultiMedia</a>, but rather pass all the medias in the <code>extended_media</code> array. </li>

View file

@ -4,32 +4,10 @@
<meta charset="utf-8">
<title>inputMediaPaidMedia</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Parameters
Name
Type
Description
stars_amount
long
 
extended_media
Vector&lt;InputMedia&gt;
 
Type
InputMedia">
<meta property="description" content="Paid media, see here » for more info.">
<meta property="og:title" content="inputMediaPaidMedia">
<meta property="og:image" content="">
<meta property="og:description" content="Parameters
Name
Type
Description
stars_amount
long
 
extended_media
Vector&lt;InputMedia&gt;
 
Type
InputMedia">
<meta property="og:description" content="Paid media, see here » for more info.">
<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">
@ -64,7 +42,8 @@ InputMedia">
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/inputMediaPaidMedia" >inputMediaPaidMedia</a></li></ul></div>
<h1 id="dev_page_title">inputMediaPaidMedia</h1>
<div id="dev_page_content"><p><div class="clearfix">
<div id="dev_page_content"><p><a href="/api/paid-media">Paid media, see here »</a> for more info.</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 185 <b class="caret"></b></a>
@ -90,17 +69,22 @@ InputMedia">
<tr>
<td><strong>stars_amount</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td> </td>
<td>The price of the media in <a href="/api/stars">Telegram Stars</a>.</td>
</tr>
<tr>
<td><strong>extended_media</strong></td>
<td style="text-align: center;"><a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/InputMedia">InputMedia</a>&gt;</td>
<td> </td>
<td>Photos or videos.</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/InputMedia">InputMedia</a></p></div>
<p><a href="/type/InputMedia">InputMedia</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="#telegram-stars" id="telegram-stars" name="telegram-stars"><i class="anchor-icon"></i></a><a href="/api/stars">Telegram Stars</a></h4>
<p>Telegram Stars are an in-app currency that allows the user to pay for digital goods and services offered by Telegram bots or Telegram channels.</p>
<h4><a class="anchor" href="#paid-media" id="paid-media" name="paid-media"><i class="anchor-icon"></i></a><a href="/api/paid-media">Paid media</a></h4>
<p>Content creators can accept <a href="/api/stars">Stars</a> by publishing <strong>paid photos or videos</strong> on their channels. Subscribers will be allowed to view such posts only after paying the author to unlock them.</p></div>
</div>

File diff suppressed because one or more lines are too long

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 E0 E3 01 00 EB 5C AE 66
0010 | 14 00 00 00 F1 8E 7E BE BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 48 04 00 BE 5F AE 66
0010 | 14 00 00 00 F1 8E 7E BE FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60</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>E0E30100EB5CAE66</code></td>
<td><code>88480400BE5FAE66</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>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</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 98 53 DE EB 5C AE 66
0010 | 98 00 00 00 63 24 16 05 BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98 34 02 67 DD 74 CB D3 B1
0030 | 86 5D 93 7E 50 84 4B 4D 08 18 4F FF 40 E2 49 1F
0040 | 1D 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 04 2E E3 BE 5F AE 66
0010 | B0 00 00 00 63 24 16 05 FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60 F3 43 1A F7 D8 96 00 09
0030 | E9 F2 AB 7A AA 49 96 19 08 1E 19 19 46 D2 C9 07
0040 | 49 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>019853DEEB5CAE66</code></td>
<td><code>01042EE3BE5FAE66</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr>
<tr>
<td>message_length</td>
<td>16, 4</td>
<td><code>98000000</code> (152 in decimal)</td>
<td><code>B0000000</code> (176 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08184FFF40E2491F1D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1751899434209845021</td>
<td><code>081E191946D2C90749000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2168792487530399561</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 = 1751899434209845021</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1751899434209845021 = 1088711201 * 1609149821</code></p>
<pre><code>p = 1088711201
q = 1609149821</code></pre>
<pre><code>pq = 2168792487530399561</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2168792487530399561 = 1088326117 * 1992778133</code></p>
<pre><code>p = 1088326117
q = 1992778133</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 18 4F FF 40 E2 49 1F 1D 00 00 00
0010 | 04 40 E4 6A 21 00 00 00 04 5F E9 AD 7D 00 00 00
0020 | BC 56 DD DA 98 00 AC EE E3 56 92 3D 3B D5 D4 98
0030 | 34 02 67 DD 74 CB D3 B1 86 5D 93 7E 50 84 4B 4D
0040 | FE 9D 9D B1 64 20 81 78 72 5E 81 D9 E0 55 91 91
0050 | 8F 8F 3D A1 1E B8 5D E6 64 F0 37 5D 4B 26 36 BE
<pre><code>0000 | 95 5F F5 A9 08 1E 19 19 46 D2 C9 07 49 00 00 00
0010 | 04 40 DE 89 E5 00 00 00 04 76 C7 61 95 00 00 00
0020 | FF BF 89 C2 AF 61 6F 9E 59 46 CF 8B 1D C6 7A 60
0030 | F3 43 1A F7 D8 96 00 09 E9 F2 AB 7A AA 49 96 19
0040 | FC 1B D4 88 E2 3F DC 45 75 8A 4B 6C C4 3F AC 79
0050 | 18 BC AD 25 84 01 F2 6A C5 F5 64 DF 7A DA 35 06
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 = 1609149821</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08184FFF40E2491F1D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1751899434209845021</td>
<td><code>081E191946D2C90749000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2168792487530399561</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>0440E46A21000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1088711201</td>
<td><code>0440DE89E5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1088326117</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>045FE9AD7D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1609149821</td>
<td><code>0476C76195000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1992778133</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>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>FE9D9DB164208178725E81D9E0559191</code> <code>8F8F3DA11EB85DE664F0375D4B2636BE</code></td>
<td><code>FC1BD488E23FDC45758A4B6CC43FAC79</code> <code>18BCAD258401F26AC5F564DF7ADA3506</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1609149821</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 = 955FF5A908184FFF40E2491F1D0000000440E46A21000000045FE9AD7D000000BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4DFE9D9DB164208178725E81D9E05591918F8F3DA11EB85DE664F0375D4B2636BE02000000
random_padding_bytes = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB77091BEC9D2839723E73F06DAD52B2C8D0420C31827BEF7D7040F817568F6E16BFE0C931409C70C5A5EF3AAD142DCCC46E2E91D303FAA374F47ED9D890AF1F98B45</code></pre>
<pre><code>data = 955FF5A9081E191946D2C907490000000440DE89E50000000476C76195000000FFBF89C2AF616F9E5946CF8B1DC67A60F3431AF7D8960009E9F2AB7AAA499619FC1BD488E23FDC45758A4B6CC43FAC7918BCAD258401F26AC5F564DF7ADA350602000000
random_padding_bytes = C3CAAB0D9CA763A9968A1CB0D5EB78AE9ADA553A5A10D1078FE23865EE7E2EEDCC5C8BC7DC54205B464C414C4A8FE0F21625319E98029DCC572091218198167D510520198972517A1FA8FFBD6AC20E8A9435E62910CF795153111314</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 = 7F81800360F41487F9532BF5E28842D05478A5754553F15B2F05BA994D1A13D5F1D0FFE69731B79E660B227E5CE8EF7339DEC134F1BE9751BFA62B1D369E6742D6FF2D6B47C1E19390829D306C75794ED39DF76768E0C8E322197F55F6331009F2AFEC9ACBE0CC937E98327B51576B3482F2583419E5CDD0BAB9E4262160602883433DA875AC35B92EBF2BD9A28DC16152AF84A1C57F5394025EB20E992476CDD4ACB5632F6D65EEA16BE55FB7D1A5B4359A3D60B9605B2F5F249BB9DE6E83948532775394B92ED12E8786E324AC3196C4941BC122527175A2908DEB6FD880F32E83CBAE21EC1B75979EB5E7BE625DE587C7E5887ACA5E4EECB988204983DC00</code></pre>
<pre><code>encrypted_data = 0F1A3FF0BD8C4B5A153F935A3EB891E9A2144A4C38FD87A52A974BB058FE6DD7464C9A8174A537126FF8F6C13E18C96CE787D398A2E9EC9A6040887AEB9C69BF1B77BB37C9B65D7436A8F3D9122EC41B1A9D950528CD70CDCF49B660570C7E55E3F17E00ABD3C0FBE33E5D8F08D7656B5E8AF458DF9BEC3E76EC835DEAB3599110B063F746CD50E643C03BF2AAC9BB682CDBD8D0FDCBB88DCC5C3A3599A99B08D0B9408E1862CD5B6F9BD2A0571490F312AA4ECCCCDEC6EE9A4C8E3FA87AB6713C4F86F452FCE82DBA247F7B695471B74D20F1A764369D4197FA176A0BC1D85FF121BCCD224529DC9D96A7F55316F968D795B2D5FB8BA26267840CE9DE24918A</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 BC CB 0A 00 EC 5C AE 66
0010 | 40 01 00 00 BE E4 12 D7 BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98 34 02 67 DD 74 CB D3 B1
0030 | 86 5D 93 7E 50 84 4B 4D 04 40 E4 6A 21 00 00 00
0040 | 04 5F E9 AD 7D 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 7F 81 80 03 60 F4 14 87 F9 53 2B F5
0060 | E2 88 42 D0 54 78 A5 75 45 53 F1 5B 2F 05 BA 99
0070 | 4D 1A 13 D5 F1 D0 FF E6 97 31 B7 9E 66 0B 22 7E
0080 | 5C E8 EF 73 39 DE C1 34 F1 BE 97 51 BF A6 2B 1D
0090 | 36 9E 67 42 D6 FF 2D 6B 47 C1 E1 93 90 82 9D 30
00A0 | 6C 75 79 4E D3 9D F7 67 68 E0 C8 E3 22 19 7F 55
00B0 | F6 33 10 09 F2 AF EC 9A CB E0 CC 93 7E 98 32 7B
00C0 | 51 57 6B 34 82 F2 58 34 19 E5 CD D0 BA B9 E4 26
00D0 | 21 60 60 28 83 43 3D A8 75 AC 35 B9 2E BF 2B D9
00E0 | A2 8D C1 61 52 AF 84 A1 C5 7F 53 94 02 5E B2 0E
00F0 | 99 24 76 CD D4 AC B5 63 2F 6D 65 EE A1 6B E5 5F
0100 | B7 D1 A5 B4 35 9A 3D 60 B9 60 5B 2F 5F 24 9B B9
0110 | DE 6E 83 94 85 32 77 53 94 B9 2E D1 2E 87 86 E3
0120 | 24 AC 31 96 C4 94 1B C1 22 52 71 75 A2 90 8D EB
0130 | 6F D8 80 F3 2E 83 CB AE 21 EC 1B 75 97 9E B5 E7
0140 | BE 62 5D E5 87 C7 E5 88 7A CA 5E 4E EC B9 88 20
0150 | 49 83 DC 00</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 2C A2 0D 00 BF 5F AE 66
0010 | 40 01 00 00 BE E4 12 D7 FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60 F3 43 1A F7 D8 96 00 09
0030 | E9 F2 AB 7A AA 49 96 19 04 40 DE 89 E5 00 00 00
0040 | 04 76 C7 61 95 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 0F 1A 3F F0 BD 8C 4B 5A 15 3F 93 5A
0060 | 3E B8 91 E9 A2 14 4A 4C 38 FD 87 A5 2A 97 4B B0
0070 | 58 FE 6D D7 46 4C 9A 81 74 A5 37 12 6F F8 F6 C1
0080 | 3E 18 C9 6C E7 87 D3 98 A2 E9 EC 9A 60 40 88 7A
0090 | EB 9C 69 BF 1B 77 BB 37 C9 B6 5D 74 36 A8 F3 D9
00A0 | 12 2E C4 1B 1A 9D 95 05 28 CD 70 CD CF 49 B6 60
00B0 | 57 0C 7E 55 E3 F1 7E 00 AB D3 C0 FB E3 3E 5D 8F
00C0 | 08 D7 65 6B 5E 8A F4 58 DF 9B EC 3E 76 EC 83 5D
00D0 | EA B3 59 91 10 B0 63 F7 46 CD 50 E6 43 C0 3B F2
00E0 | AA C9 BB 68 2C DB D8 D0 FD CB B8 8D CC 5C 3A 35
00F0 | 99 A9 9B 08 D0 B9 40 8E 18 62 CD 5B 6F 9B D2 A0
0100 | 57 14 90 F3 12 AA 4E CC CC DE C6 EE 9A 4C 8E 3F
0110 | A8 7A B6 71 3C 4F 86 F4 52 FC E8 2D BA 24 7F 7B
0120 | 69 54 71 B7 4D 20 F1 A7 64 36 9D 41 97 FA 17 6A
0130 | 0B C1 D8 5F F1 21 BC CD 22 45 29 DC 9D 96 A7 F5
0140 | 53 16 F9 68 D7 95 B2 D5 FB 8B A2 62 67 84 0C E9
0150 | DE 24 91 8A</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 = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>BCCB0A00EC5CAE66</code></td>
<td><code>2CA20D00BF5FAE66</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 = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>0440E46A21000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1088711201</td>
<td><code>0440DE89E5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1088326117</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>045FE9AD7D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1609149821</td>
<td><code>0476C76195000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1992778133</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 = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001007F81800360F41487F9532BF5</code> <code>E28842D05478A5754553F15B2F05BA99</code> <code>4D1A13D5F1D0FFE69731B79E660B227E</code> <code>5CE8EF7339DEC134F1BE9751BFA62B1D</code> <code>369E6742D6FF2D6B47C1E19390829D30</code> <code>6C75794ED39DF76768E0C8E322197F55</code> <code>F6331009F2AFEC9ACBE0CC937E98327B</code> <code>51576B3482F2583419E5CDD0BAB9E426</code> <code>2160602883433DA875AC35B92EBF2BD9</code> <code>A28DC16152AF84A1C57F5394025EB20E</code> <code>992476CDD4ACB5632F6D65EEA16BE55F</code> <code>B7D1A5B4359A3D60B9605B2F5F249BB9</code> <code>DE6E83948532775394B92ED12E8786E3</code> <code>24AC3196C4941BC122527175A2908DEB</code> <code>6FD880F32E83CBAE21EC1B75979EB5E7</code> <code>BE625DE587C7E5887ACA5E4EECB98820</code><br> <code>4983DC00</code></td>
<td><code>FE0001000F1A3FF0BD8C4B5A153F935A</code> <code>3EB891E9A2144A4C38FD87A52A974BB0</code> <code>58FE6DD7464C9A8174A537126FF8F6C1</code> <code>3E18C96CE787D398A2E9EC9A6040887A</code> <code>EB9C69BF1B77BB37C9B65D7436A8F3D9</code> <code>122EC41B1A9D950528CD70CDCF49B660</code> <code>570C7E55E3F17E00ABD3C0FBE33E5D8F</code> <code>08D7656B5E8AF458DF9BEC3E76EC835D</code> <code>EAB3599110B063F746CD50E643C03BF2</code> <code>AAC9BB682CDBD8D0FDCBB88DCC5C3A35</code> <code>99A99B08D0B9408E1862CD5B6F9BD2A0</code> <code>571490F312AA4ECCCCDEC6EE9A4C8E3F</code> <code>A87AB6713C4F86F452FCE82DBA247F7B</code> <code>695471B74D20F1A764369D4197FA176A</code> <code>0BC1D85FF121BCCD224529DC9D96A7F5</code> <code>5316F968D795B2D5FB8BA26267840CE9</code><br> <code>DE24918A</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<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 00 67 BC EC 5C AE 66
0010 | B0 02 00 00 5C 07 E8 D0 BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98 34 02 67 DD 74 CB D3 B1
0030 | 86 5D 93 7E 50 84 4B 4D FE 50 02 00 4C EE 7B 14
0040 | 58 DC 2B 34 66 10 85 59 CA C3 66 BE D3 48 FE 19
0050 | B2 87 F2 72 03 C1 1B 2C 7B 92 0D 35 BD 3F B9 5F
0060 | 53 CC F6 31 60 1A 6E 32 CD 4A 75 0E 24 F7 BD D6
0070 | 40 AD 95 5B 7E 9D D8 87 CA 99 8B 5C 38 9F B6 63
0080 | 4C 0C 42 7A 7C 0E 15 2E 60 9A AF E1 AC 0E 18 EC
0090 | 41 57 20 85 B8 EA 93 68 9F 26 D4 9C 68 02 D8 BB
00A0 | C1 17 86 EF 53 D0 7B 61 35 FE F1 C1 2E 74 D8 42
00B0 | D1 B7 EB 7E 72 71 F0 C7 07 D8 8B 69 32 AB A5 9B
00C0 | BC 1C BC AF B5 D6 9E 97 26 C0 D3 23 75 17 1A 5A
00D0 | 19 4D EE 96 67 82 62 F0 E8 B9 67 C0 4C F1 3C E3
00E0 | 84 80 06 E8 EE 89 97 68 2C D6 A3 CF C0 4F C9 56
00F0 | A1 13 91 64 BB 66 39 21 F4 D5 04 17 28 92 64 93
0100 | B3 E7 BD 73 E4 32 05 AD 60 5F C8 C0 0F B2 1F 2E
0110 | 5A 4E F3 81 32 10 22 56 0C C5 A4 83 52 B0 22 14
0120 | 58 D2 F8 63 41 C2 8B 9D EA EB 09 1B 84 31 F5 01
0130 | 43 EB A0 88 5A C1 6C 86 89 AA B3 CB CB 0E 96 2D
0140 | 08 A6 7F B3 8D 26 64 3F 71 74 DB E3 2B C8 BA 84
0150 | B1 91 BB 5B A8 A5 35 55 8C 70 7D 1D 53 39 86 60
0160 | D1 8D A0 D4 21 C4 4E EE FF 36 3D 22 F2 20 FC E0
0170 | 21 88 62 7F 3F A7 B3 99 24 69 4C 2A 7F 49 16 05
0180 | 68 FD 8C 7E 88 4B 4B 3F 14 A2 EA 27 77 A5 44 6C
0190 | 9B C1 6D A3 CD 94 83 43 CA F5 1D 27 9C 87 F3 AB
01A0 | F5 C6 EE 50 B3 46 8D 8B 99 18 0C 73 94 AC CB 33
01B0 | C0 23 D9 B4 2A F4 57 AB D8 63 B6 7B 08 60 97 B0
01C0 | EE 26 F3 89 C4 33 1C 42 51 74 83 57 54 E5 DE 88
01D0 | BE 10 50 4C 5E 4F 86 10 AA 56 63 B0 09 6F CA DC
01E0 | 5A 9C 8A 6F 8B A6 2C 89 16 0E DF A5 CC B7 3D 85
01F0 | 9C 58 92 AD C7 74 BC C9 1E A7 85 F0 53 C2 5D 5C
0200 | 6F E2 7F 17 AE 07 7E C3 57 26 07 D1 EE B8 04 5E
0210 | F1 84 A8 06 01 B5 7E D8 96 92 42 5C 5B 02 25 B3
0220 | EA E6 4F 08 7B A4 69 27 61 F7 91 5C 54 9D FD 44
0230 | 1D 9A E1 5E 1F 15 C9 EE 4B 11 BF 8F 8B 83 B0 BB
0240 | EF 32 CB AE 75 CD 91 86 53 30 87 64 A4 61 78 61
0250 | 85 61 D7 1E 37 8E C0 64 F9 77 AD 94 17 B8 EC 55
0260 | 62 AA 2E 55 ED 01 F4 A1 71 91 58 92 2D BE 32 9E
0270 | F4 C0 00 C6 A3 3B EF 0E E0 80 D3 D1 66 08 22 5A
0280 | 40 54 54 A4 0C A8 99 D4 C9 0A 8E 1A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC 33 C1 BF 5F AE 66
0010 | E8 02 00 00 5C 07 E8 D0 FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60 F3 43 1A F7 D8 96 00 09
0030 | E9 F2 AB 7A AA 49 96 19 FE 50 02 00 A5 33 9E 32
0040 | F5 A1 46 2D FC 5C 1D 83 67 20 B8 59 8D 2D 15 C7
0050 | 70 B8 00 28 E7 0F 91 13 8E EC 21 EE 01 93 54 D5
0060 | 18 2C A6 D3 E3 9A E8 06 FC AF 14 26 EC E9 56 BA
0070 | F3 DD F5 53 9D 68 EA 82 7B 66 7E C0 4A 0F 8F A6
0080 | 6C 4F 36 AD AE 01 30 0C 80 2B 09 FC 27 E2 4B 24
0090 | DE 64 D0 E6 CA 76 21 9A E2 C5 47 28 6A C6 AB 66
00A0 | 4E BF B4 36 EF 50 C7 EC 6B 25 87 A2 D8 A8 96 DF
00B0 | 8C 52 52 C5 B6 05 1F CA 45 38 41 65 8E 06 53 33
00C0 | 94 74 71 88 25 8C 5E 04 FB 79 E9 FD 28 C5 6A 32
00D0 | BD C3 27 FA 3B 3A B4 74 43 58 BC A6 74 3A 67 66
00E0 | 88 92 EA 35 AA 88 55 A9 D2 3D 8B 65 D1 CA 90 12
00F0 | E3 E8 59 92 B1 92 93 5E CB 0F F2 72 4C 11 D5 22
0100 | FB 35 B8 88 1D F3 F5 04 77 11 48 20 B2 DC 61 1F
0110 | 1E 61 0B F9 64 ED E2 14 3B BB 2A 2A C9 E6 84 F6
0120 | 2C FF 06 95 31 5B EA C2 A0 CB F8 B5 62 AE 05 51
0130 | C2 D2 51 FA 7B 96 26 8F B0 AD 4F 20 A4 2E B0 EB
0140 | 72 44 74 17 C7 BD C2 2B 58 90 AA 16 B2 DB 6F 38
0150 | EB B7 08 A6 CF 82 B4 AF 9B 2F E2 A8 67 C9 DD 29
0160 | 24 20 61 64 AB 99 93 2B 5C E3 58 70 44 D5 53 E4
0170 | 39 06 A6 27 4C A8 9D 72 CF BE 29 67 9A 4E 21 54
0180 | C9 01 4F F5 85 D8 10 61 9C D9 69 60 C6 3B BF E6
0190 | 0A BC 15 50 E9 0C 61 90 0C 28 EA 34 48 86 1C 8C
01A0 | 4B 1C 4E 27 A4 DC 5D 2E B4 83 79 90 5B F8 17 1C
01B0 | 34 16 72 BB F9 CA E0 03 BA F4 4A 6A 0C C7 15 8C
01C0 | E0 5C CD AA 48 15 2B 6F D8 5B 71 32 8E 44 10 B8
01D0 | 87 5A 9C 26 03 C6 30 86 C2 79 A8 87 4A E8 8A F2
01E0 | 5B 9F 82 04 B4 5D FF 3A 26 D7 49 D4 3D 15 A7 D8
01F0 | E3 3F 69 E4 5D 2B 04 4F 8E F5 E8 F7 C9 1C 79 DA
0200 | 51 F6 E3 D7 94 E3 D2 6F 8F 77 2C 23 80 EA D6 0E
0210 | E9 CC 3B D1 73 13 9A A1 B6 82 AA A2 19 44 5B 64
0220 | 3C 11 38 50 73 97 9B 45 24 4E 65 D9 88 3D EA 0E
0230 | 42 0D 30 D7 4B DF 5F CD EE 9F AF FE 7C AE 51 1E
0240 | 6A 15 23 18 C9 4E 6F 65 48 7E 2D 2D B8 39 6E D0
0250 | 8F 05 A0 36 6B 2A CF FB D1 7C 5A F5 BC 46 10 6C
0260 | 13 93 02 9B 44 4D F7 15 B2 73 5B 50 FC 57 9B DC
0270 | 73 41 02 67 54 7A 61 E2 4E 82 38 E7 1C 85 3E FF
0280 | 0E 6C B2 AA B3 C8 A4 A4 A0 EC 8A 9F</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 = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>010067BCEC5CAE66</code></td>
<td><code>01BC33C1BF5FAE66</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>B0020000</code> (688 in decimal)</td>
<td><code>E8020000</code> (744 in decimal)</td>
<td>Message body length</td>
</tr>
<tr>
@ -482,19 +482,19 @@ random_padding_bytes = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE5002004CEE7B1458DC2B3466108559</code> <code>CAC366BED348FE19B287F27203C11B2C</code> <code>7B920D35BD3FB95F53CCF631601A6E32</code> <code>CD4A750E24F7BDD640AD955B7E9DD887</code> <code>CA998B5C389FB6634C0C427A7C0E152E</code> <code>609AAFE1AC0E18EC41572085B8EA9368</code> <code>9F26D49C6802D8BBC11786EF53D07B61</code> <code>35FEF1C12E74D842D1B7EB7E7271F0C7</code> <code>07D88B6932ABA59BBC1CBCAFB5D69E97</code> <code>26C0D32375171A5A194DEE96678262F0</code> <code>E8B967C04CF13CE3848006E8EE899768</code> <code>2CD6A3CFC04FC956A1139164BB663921</code> <code>F4D5041728926493B3E7BD73E43205AD</code> <code>605FC8C00FB21F2E5A4EF38132102256</code> <code>0CC5A48352B0221458D2F86341C28B9D</code> <code>EAEB091B8431F50143EBA0885AC16C86</code> <code>89AAB3CBCB0E962D08A67FB38D26643F</code> <code>7174DBE32BC8BA84B191BB5BA8A53555</code> <code>8C707D1D53398660D18DA0D421C44EEE</code> <code>FF363D22F220FCE02188627F3FA7B399</code> <code>24694C2A7F49160568FD8C7E884B4B3F</code> <code>14A2EA2777A5446C9BC16DA3CD948343</code> <code>CAF51D279C87F3ABF5C6EE50B3468D8B</code> <code>99180C7394ACCB33C023D9B42AF457AB</code> <code>D863B67B086097B0EE26F389C4331C42</code> <code>5174835754E5DE88BE10504C5E4F8610</code> <code>AA5663B0096FCADC5A9C8A6F8BA62C89</code> <code>160EDFA5CCB73D859C5892ADC774BCC9</code> <code>1EA785F053C25D5C6FE27F17AE077EC3</code> <code>572607D1EEB8045EF184A80601B57ED8</code> <code>9692425C5B0225B3EAE64F087BA46927</code> <code>61F7915C549DFD441D9AE15E1F15C9EE</code> <code>4B11BF8F8B83B0BBEF32CBAE75CD9186</code> <code>53308764A46178618561D71E378EC064</code> <code>F977AD9417B8EC5562AA2E55ED01F4A1</code> <code>719158922DBE329EF4C000C6A33BEF0E</code> <code>E080D3D16608225A405454A40CA899D4</code><br> <code>C90A8E1A</code></td>
<td><code>FE500200A5339E32F5A1462DFC5C1D83</code> <code>6720B8598D2D15C770B80028E70F9113</code> <code>8EEC21EE019354D5182CA6D3E39AE806</code> <code>FCAF1426ECE956BAF3DDF5539D68EA82</code> <code>7B667EC04A0F8FA66C4F36ADAE01300C</code> <code>802B09FC27E24B24DE64D0E6CA76219A</code> <code>E2C547286AC6AB664EBFB436EF50C7EC</code> <code>6B2587A2D8A896DF8C5252C5B6051FCA</code> <code>453841658E06533394747188258C5E04</code> <code>FB79E9FD28C56A32BDC327FA3B3AB474</code> <code>4358BCA6743A67668892EA35AA8855A9</code> <code>D23D8B65D1CA9012E3E85992B192935E</code> <code>CB0FF2724C11D522FB35B8881DF3F504</code> <code>77114820B2DC611F1E610BF964EDE214</code> <code>3BBB2A2AC9E684F62CFF0695315BEAC2</code> <code>A0CBF8B562AE0551C2D251FA7B96268F</code> <code>B0AD4F20A42EB0EB72447417C7BDC22B</code> <code>5890AA16B2DB6F38EBB708A6CF82B4AF</code> <code>9B2FE2A867C9DD2924206164AB99932B</code> <code>5CE3587044D553E43906A6274CA89D72</code> <code>CFBE29679A4E2154C9014FF585D81061</code> <code>9CD96960C63BBFE60ABC1550E90C6190</code> <code>0C28EA3448861C8C4B1C4E27A4DC5D2E</code> <code>B48379905BF8171C341672BBF9CAE003</code> <code>BAF44A6A0CC7158CE05CCDAA48152B6F</code> <code>D85B71328E4410B8875A9C2603C63086</code> <code>C279A8874AE88AF25B9F8204B45DFF3A</code> <code>26D749D43D15A7D8E33F69E45D2B044F</code> <code>8EF5E8F7C91C79DA51F6E3D794E3D26F</code> <code>8F772C2380EAD60EE9CC3BD173139AA1</code> <code>B682AAA219445B643C11385073979B45</code> <code>244E65D9883DEA0E420D30D74BDF5FCD</code> <code>EE9FAFFE7CAE511E6A152318C94E6F65</code> <code>487E2D2DB8396ED08F05A0366B2ACFFB</code> <code>D17C5AF5BC46106C1393029B444DF715</code> <code>B2735B50FC579BDC73410267547A61E2</code> <code>4E8238E71C853EFF0E6CB2AAB3C8A4A4</code><br> <code>A0EC8A9F</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 62B6355DF25ED7620587E05B96924C6A1568A5DE6C9DB344E02CB7709
<!-- 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 = 4CEE7B1458DC2B3466108559CAC366BED348FE19B287F27203C11B2C7B920D35BD3FB95F53CCF631601A6E32CD4A750E24F7BDD640AD955B7E9DD887CA998B5C389FB6634C0C427A7C0E152E609AAFE1AC0E18EC41572085B8EA93689F26D49C6802D8BBC11786EF53D07B6135FEF1C12E74D842D1B7EB7E7271F0C707D88B6932ABA59BBC1CBCAFB5D69E9726C0D32375171A5A194DEE96678262F0E8B967C04CF13CE3848006E8EE8997682CD6A3CFC04FC956A1139164BB663921F4D5041728926493B3E7BD73E43205AD605FC8C00FB21F2E5A4EF381321022560CC5A48352B0221458D2F86341C28B9DEAEB091B8431F50143EBA0885AC16C8689AAB3CBCB0E962D08A67FB38D26643F7174DBE32BC8BA84B191BB5BA8A535558C707D1D53398660D18DA0D421C44EEEFF363D22F220FCE02188627F3FA7B39924694C2A7F49160568FD8C7E884B4B3F14A2EA2777A5446C9BC16DA3CD948343CAF51D279C87F3ABF5C6EE50B3468D8B99180C7394ACCB33C023D9B42AF457ABD863B67B086097B0EE26F389C4331C425174835754E5DE88BE10504C5E4F8610AA5663B0096FCADC5A9C8A6F8BA62C89160EDFA5CCB73D859C5892ADC774BCC91EA785F053C25D5C6FE27F17AE077EC3572607D1EEB8045EF184A80601B57ED89692425C5B0225B3EAE64F087BA4692761F7915C549DFD441D9AE15E1F15C9EE4B11BF8F8B83B0BBEF32CBAE75CD918653308764A46178618561D71E378EC064F977AD9417B8EC5562AA2E55ED01F4A1719158922DBE329EF4C000C6A33BEF0EE080D3D16608225A405454A40CA899D4C90A8E1A
tmp_aes_key = A1484E0939FC4D1323ADA4C191556735B8946957EE87CD82226F0176D7B27591
tmp_aes_iv = E2A113E17B14FEAE1BD1D541DA6BB815F371D9E6D66C7B3AEA8BD5F2FE9D9DB1</code></pre>
<pre><code>encrypted_answer = A5339E32F5A1462DFC5C1D836720B8598D2D15C770B80028E70F91138EEC21EE019354D5182CA6D3E39AE806FCAF1426ECE956BAF3DDF5539D68EA827B667EC04A0F8FA66C4F36ADAE01300C802B09FC27E24B24DE64D0E6CA76219AE2C547286AC6AB664EBFB436EF50C7EC6B2587A2D8A896DF8C5252C5B6051FCA453841658E06533394747188258C5E04FB79E9FD28C56A32BDC327FA3B3AB4744358BCA6743A67668892EA35AA8855A9D23D8B65D1CA9012E3E85992B192935ECB0FF2724C11D522FB35B8881DF3F50477114820B2DC611F1E610BF964EDE2143BBB2A2AC9E684F62CFF0695315BEAC2A0CBF8B562AE0551C2D251FA7B96268FB0AD4F20A42EB0EB72447417C7BDC22B5890AA16B2DB6F38EBB708A6CF82B4AF9B2FE2A867C9DD2924206164AB99932B5CE3587044D553E43906A6274CA89D72CFBE29679A4E2154C9014FF585D810619CD96960C63BBFE60ABC1550E90C61900C28EA3448861C8C4B1C4E27A4DC5D2EB48379905BF8171C341672BBF9CAE003BAF44A6A0CC7158CE05CCDAA48152B6FD85B71328E4410B8875A9C2603C63086C279A8874AE88AF25B9F8204B45DFF3A26D749D43D15A7D8E33F69E45D2B044F8EF5E8F7C91C79DA51F6E3D794E3D26F8F772C2380EAD60EE9CC3BD173139AA1B682AAA219445B643C11385073979B45244E65D9883DEA0E420D30D74BDF5FCDEE9FAFFE7CAE511E6A152318C94E6F65487E2D2DB8396ED08F05A0366B2ACFFBD17C5AF5BC46106C1393029B444DF715B2735B50FC579BDC73410267547A61E24E8238E71C853EFF0E6CB2AAB3C8A4A4A0EC8A9F
tmp_aes_key = B025233C2D0BE415F2D978000429D04908F4107759FED43ED2572C802894A431
tmp_aes_iv = 857BAC258C90E735067828AB3249FF945DFAA7CF4E582BD785742656FC1BD488</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 074264019923A63EC0C88F7E6928C760F334B9D7BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C52E1F6A98640987FC3954D183ECBC7AFD932396183A4E1536BD39BC8290F095F84368B4BD1D3A50A9FBF0CAAFB97A034F02A99ADF4EA977996291E1EAF7BC07982406EB1266E92BA0DD5935CD555670430AA5A3A73259ABC1ECBEBB30527C58DB4C73141CF75A90734F1E490E45FCFA4673C1FBA0F766FD018416F805741DF384AD5AE485C3B9A9493A5103B388EAAAF6353D08FD70FB143C0E8328CF8E829A9368641189DC20318D4080850083CA41CC1028EDAA0E6B9A1F3E650C58353347555008F83562E5401A86318BF0C9FCD2B3486CF4D8747FE6204903192C903C9EB31F7E615B1C41C0F5831625744EF1E424EABF06574C789A7F0665549AB84E44EC5CAE6613AB53F334801CC9
answer = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C52E1F6A98640987FC3954D183ECBC7AFD932396183A4E1536BD39BC8290F095F84368B4BD1D3A50A9FBF0CAAFB97A034F02A99ADF4EA977996291E1EAF7BC07982406EB1266E92BA0DD5935CD555670430AA5A3A73259ABC1ECBEBB30527C58DB4C73141CF75A90734F1E490E45FCFA4673C1FBA0F766FD018416F805741DF384AD5AE485C3B9A9493A5103B388EAAAF6353D08FD70FB143C0E8328CF8E829A9368641189DC20318D4080850083CA41CC1028EDAA0E6B9A1F3E650C58353347555008F83562E5401A86318BF0C9FCD2B3486CF4D8747FE6204903192C903C9EB31F7E615B1C41C0F5831625744EF1E424EABF06574C789A7F0665549AB84E44EC5CAE6613AB53F334801CC9</code></pre>
<pre><code>answer_with_hash = 057EA9A2DFB071DFDCB8757F3BC4CFB0AC8024D1BA0D89B5FFBF89C2AF616F9E5946CF8B1DC67A60F3431AF7D8960009E9F2AB7AAA49961903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004776BC37BB62C99645DEAF4B851D25AE5D50422C362E5765012369F6EF34734A201E843E1B49917264842F5D2F61C5BB087EC9AC8AB5907DB3BDEA778C911D84F9B4D329AA543D0162C7F35060196BD50B0E4A02F47DED2BCB982B1F40BD8477851152F76C172D3EA7E82574304C2E3E51E259A6449BCFC9FEAEFFA51150EFFBFEB12231741C5ABD7C871732D853C6E5103F247B194CB266665B20A51CE1F66103E244685F2EA3E3A9C3CCE467665E15F194787BE3F9D53C876BDDD1D40C05696B68AE0D8416042BDEBB284A7D767F093CB1B2352D38D4BC7609DC37C250EBD7843247071CA590BD1FC03D517867A91EC64A9D5601D6D1AF43A216F67C75F5C8BF5FAE66FE206CD76AA6241B
answer = BA0D89B5FFBF89C2AF616F9E5946CF8B1DC67A60F3431AF7D8960009E9F2AB7AAA49961903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004776BC37BB62C99645DEAF4B851D25AE5D50422C362E5765012369F6EF34734A201E843E1B49917264842F5D2F61C5BB087EC9AC8AB5907DB3BDEA778C911D84F9B4D329AA543D0162C7F35060196BD50B0E4A02F47DED2BCB982B1F40BD8477851152F76C172D3EA7E82574304C2E3E51E259A6449BCFC9FEAEFFA51150EFFBFEB12231741C5ABD7C871732D853C6E5103F247B194CB266665B20A51CE1F66103E244685F2EA3E3A9C3CCE467665E15F194787BE3F9D53C876BDDD1D40C05696B68AE0D8416042BDEBB284A7D767F093CB1B2352D38D4BC7609DC37C250EBD7843247071CA590BD1FC03D517867A91EC64A9D5601D6D1AF43A216F67C75F5C8BF5FAE66FE206CD76AA6241B</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 BC 56 DD DA 98 00 AC EE E3 56 92 3D
0010 | 3B D5 D4 98 34 02 67 DD 74 CB D3 B1 86 5D 93 7E
0020 | 50 84 4B 4D 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 FF BF 89 C2 AF 61 6F 9E 59 46 CF 8B
0010 | 1D C6 7A 60 F3 43 1A F7 D8 96 00 09 E9 F2 AB 7A
0020 | AA 49 96 19 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 = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
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 | C5 2E 1F 6A 98 64 09 87 FC 39 54 D1 83 EC BC 7A
0140 | FD 93 23 96 18 3A 4E 15 36 BD 39 BC 82 90 F0 95
0150 | F8 43 68 B4 BD 1D 3A 50 A9 FB F0 CA AF B9 7A 03
0160 | 4F 02 A9 9A DF 4E A9 77 99 62 91 E1 EA F7 BC 07
0170 | 98 24 06 EB 12 66 E9 2B A0 DD 59 35 CD 55 56 70
0180 | 43 0A A5 A3 A7 32 59 AB C1 EC BE BB 30 52 7C 58
0190 | DB 4C 73 14 1C F7 5A 90 73 4F 1E 49 0E 45 FC FA
01A0 | 46 73 C1 FB A0 F7 66 FD 01 84 16 F8 05 74 1D F3
01B0 | 84 AD 5A E4 85 C3 B9 A9 49 3A 51 03 B3 88 EA AA
01C0 | F6 35 3D 08 FD 70 FB 14 3C 0E 83 28 CF 8E 82 9A
01D0 | 93 68 64 11 89 DC 20 31 8D 40 80 85 00 83 CA 41
01E0 | CC 10 28 ED AA 0E 6B 9A 1F 3E 65 0C 58 35 33 47
01F0 | 55 50 08 F8 35 62 E5 40 1A 86 31 8B F0 C9 FC D2
0200 | B3 48 6C F4 D8 74 7F E6 20 49 03 19 2C 90 3C 9E
0210 | B3 1F 7E 61 5B 1C 41 C0 F5 83 16 25 74 4E F1 E4
0220 | 24 EA BF 06 57 4C 78 9A 7F 06 65 54 9A B8 4E 44
0230 | EC 5C AE 66</code></pre>
0130 | 47 76 BC 37 BB 62 C9 96 45 DE AF 4B 85 1D 25 AE
0140 | 5D 50 42 2C 36 2E 57 65 01 23 69 F6 EF 34 73 4A
0150 | 20 1E 84 3E 1B 49 91 72 64 84 2F 5D 2F 61 C5 BB
0160 | 08 7E C9 AC 8A B5 90 7D B3 BD EA 77 8C 91 1D 84
0170 | F9 B4 D3 29 AA 54 3D 01 62 C7 F3 50 60 19 6B D5
0180 | 0B 0E 4A 02 F4 7D ED 2B CB 98 2B 1F 40 BD 84 77
0190 | 85 11 52 F7 6C 17 2D 3E A7 E8 25 74 30 4C 2E 3E
01A0 | 51 E2 59 A6 44 9B CF C9 FE AE FF A5 11 50 EF FB
01B0 | FE B1 22 31 74 1C 5A BD 7C 87 17 32 D8 53 C6 E5
01C0 | 10 3F 24 7B 19 4C B2 66 66 5B 20 A5 1C E1 F6 61
01D0 | 03 E2 44 68 5F 2E A3 E3 A9 C3 CC E4 67 66 5E 15
01E0 | F1 94 78 7B E3 F9 D5 3C 87 6B DD D1 D4 0C 05 69
01F0 | 6B 68 AE 0D 84 16 04 2B DE BB 28 4A 7D 76 7F 09
0200 | 3C B1 B2 35 2D 38 D4 BC 76 09 DC 37 C2 50 EB D7
0210 | 84 32 47 07 1C A5 90 BD 1F C0 3D 51 78 67 A9 1E
0220 | C6 4A 9D 56 01 D6 D1 AF 43 A2 16 F6 7C 75 F5 C8
0230 | BF 5F AE 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 = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE000100C52E1F6A98640987FC3954D1</code> <code>83ECBC7AFD932396183A4E1536BD39BC</code> <code>8290F095F84368B4BD1D3A50A9FBF0CA</code> <code>AFB97A034F02A99ADF4EA977996291E1</code> <code>EAF7BC07982406EB1266E92BA0DD5935</code> <code>CD555670430AA5A3A73259ABC1ECBEBB</code> <code>30527C58DB4C73141CF75A90734F1E49</code> <code>0E45FCFA4673C1FBA0F766FD018416F8</code> <code>05741DF384AD5AE485C3B9A9493A5103</code> <code>B388EAAAF6353D08FD70FB143C0E8328</code> <code>CF8E829A9368641189DC20318D408085</code> <code>0083CA41CC1028EDAA0E6B9A1F3E650C</code> <code>58353347555008F83562E5401A86318B</code> <code>F0C9FCD2B3486CF4D8747FE620490319</code> <code>2C903C9EB31F7E615B1C41C0F5831625</code> <code>744EF1E424EABF06574C789A7F066554</code><br> <code>9AB84E44</code></td>
<td><code>FE0001004776BC37BB62C99645DEAF4B</code> <code>851D25AE5D50422C362E5765012369F6</code> <code>EF34734A201E843E1B49917264842F5D</code> <code>2F61C5BB087EC9AC8AB5907DB3BDEA77</code> <code>8C911D84F9B4D329AA543D0162C7F350</code> <code>60196BD50B0E4A02F47DED2BCB982B1F</code> <code>40BD8477851152F76C172D3EA7E82574</code> <code>304C2E3E51E259A6449BCFC9FEAEFFA5</code> <code>1150EFFBFEB12231741C5ABD7C871732</code> <code>D853C6E5103F247B194CB266665B20A5</code> <code>1CE1F66103E244685F2EA3E3A9C3CCE4</code> <code>67665E15F194787BE3F9D53C876BDDD1</code> <code>D40C05696B68AE0D8416042BDEBB284A</code> <code>7D767F093CB1B2352D38D4BC7609DC37</code> <code>C250EBD7843247071CA590BD1FC03D51</code> <code>7867A91EC64A9D5601D6D1AF43A216F6</code><br> <code>7C75F5C8</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>EC5CAE66</code> (1722703084 in decimal)</td>
<td><code>BF5FAE66</code> (1722703807 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
<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 = E082394F176FB16DD59C7533CECF7751E200786AF2C21AC5A907E3CB40360512F04639037DEF10A4AEC8B6A18398CDC913EA520FEBC95473F002216B51051674FBF935AF414B286D2DF101702ADFE8429D92938DE77C3F19258F688030F9DC21EF2C64010629BD426AC8EE59DD58C7BCE74E20EB06919D3DBF953607A9EF68BF9C7CC4F8E5564779DB105BF61442615D5CAD3FD326225854F22BECFEAA3C96D013A939D8CA9652BAE7FC9E826C3F24C9977A4CD03AB21EA1D72E83CAA230FDCB4E379328398DC773804638F0DB9F25FFAF8B3CE2F0E64FDF1B497A14B5B6BCFA6F19A0F3F66BF1AEEDA9E773A2AA95A2B22E8F032D8BC49DEDC0CDB61812E2FD</code></pre>
<pre><code>b = 091BF72733ACD769D90FD22C62B0A5274BFE05C91163521A43FBB747F66D38768821629CD6800E0B74D56A4229E2E70F00ED12E5CB0FAE35376B4DDBE5D38143C655B466043980213992A3D2C8AE0810FC81E7AB80E6C13D1B02F5D2062030E0D67C9F165511805F8E5E9129EE08FD2D710E946473ECAF37CC9F372F1C649CE03DEFD2EDC79F146428D6C3F675A19C84229000EE666E634D778E915F2E2ADEFF3C194715BB530A1C2185AC5C431641E85F61CB85DC34AF92D3627663DC603EF5B02F6C4C1849842E68BE4F185E6FD47DB479261BD4DA3DA525B879C5D3A7B6293531F462AD19F386A42515621774EBCC8E329C185575005561D0B1DB924B6446</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 = 6AB83A58EF9282B06A4AB8931BB38ED6575E8DA0141CB85ED468050DE5834D72BFC4834860B24F0A02B0204910B358CAF3CD78B35332DE5D3C77842F98A0755EA3FBD27CC20761C252AAEF0FE3F8AF2E374CC8BC49E3CC1877926F21AD10AF82E314FAC7FAAFFC997D92EAB639733CD7648934080BE086766CFCA3DD1D4AA31DAA7C5DA7D3C4127D4E088A478520205978987B23628CE5BF00C44D10D52B61A4752307A4C8E326C6899F22E0275333CD60568789E89A977E5905EBCBF8AB9AF1DA2806C0B6B34F7EEDA1730C142F0DB58862E3AA29E7A85BCAABF1B06816B441091CCBD45A352C1F8290091D3A84FE95B3C3A587AAAA1B5242291BAD0BCAEE5D</code></pre>
<pre><code>g_b = 70F24CC44C13D7EB184E0459D1FE5FCCA24CFA9CAE9CCE27BA49A4FD01986BCD8C5C8ECBB51D68259267AC3AF181D5C6DD52ED8E88C6B2952851A33FB8A9BF6810EE664422D4B82FCB4B24B460A62BFB075A6A6D0A00083A28BABF071906BCD96418A68EB2983B946B552F0341C75A4179EE786DD05DD668928B73F906076BED2E94360A70599FDBA6C2FEC1D6616C869233C386B9C3F3E2977E7E9DD68B27A0FB054FD62AE69C68FD6FB00E0BA5EF4521107504FBCA20D69F65FEBD518993594841B8B83B3144B99D02BB9D5F30490C626AA3672DA54A9FF27FF213D042A280D3EAEB8388CAB7D88A422533BCB646C24CCF692F41B34680A642A16C9134887A</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 BC 56 DD DA 98 00 AC EE E3 56 92 3D
0010 | 3B D5 D4 98 34 02 67 DD 74 CB D3 B1 86 5D 93 7E
0020 | 50 84 4B 4D 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 6A B8 3A 58 EF 92 82 B0 6A 4A B8 93 1B B3 8E D6
0040 | 57 5E 8D A0 14 1C B8 5E D4 68 05 0D E5 83 4D 72
0050 | BF C4 83 48 60 B2 4F 0A 02 B0 20 49 10 B3 58 CA
0060 | F3 CD 78 B3 53 32 DE 5D 3C 77 84 2F 98 A0 75 5E
0070 | A3 FB D2 7C C2 07 61 C2 52 AA EF 0F E3 F8 AF 2E
0080 | 37 4C C8 BC 49 E3 CC 18 77 92 6F 21 AD 10 AF 82
0090 | E3 14 FA C7 FA AF FC 99 7D 92 EA B6 39 73 3C D7
00A0 | 64 89 34 08 0B E0 86 76 6C FC A3 DD 1D 4A A3 1D
00B0 | AA 7C 5D A7 D3 C4 12 7D 4E 08 8A 47 85 20 20 59
00C0 | 78 98 7B 23 62 8C E5 BF 00 C4 4D 10 D5 2B 61 A4
00D0 | 75 23 07 A4 C8 E3 26 C6 89 9F 22 E0 27 53 33 CD
00E0 | 60 56 87 89 E8 9A 97 7E 59 05 EB CB F8 AB 9A F1
00F0 | DA 28 06 C0 B6 B3 4F 7E ED A1 73 0C 14 2F 0D B5
0100 | 88 62 E3 AA 29 E7 A8 5B CA AB F1 B0 68 16 B4 41
0110 | 09 1C CB D4 5A 35 2C 1F 82 90 09 1D 3A 84 FE 95
0120 | B3 C3 A5 87 AA AA 1B 52 42 29 1B AD 0B CA EE 5D</code></pre>
<pre><code>0000 | 54 B6 43 66 FF BF 89 C2 AF 61 6F 9E 59 46 CF 8B
0010 | 1D C6 7A 60 F3 43 1A F7 D8 96 00 09 E9 F2 AB 7A
0020 | AA 49 96 19 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 70 F2 4C C4 4C 13 D7 EB 18 4E 04 59 D1 FE 5F CC
0040 | A2 4C FA 9C AE 9C CE 27 BA 49 A4 FD 01 98 6B CD
0050 | 8C 5C 8E CB B5 1D 68 25 92 67 AC 3A F1 81 D5 C6
0060 | DD 52 ED 8E 88 C6 B2 95 28 51 A3 3F B8 A9 BF 68
0070 | 10 EE 66 44 22 D4 B8 2F CB 4B 24 B4 60 A6 2B FB
0080 | 07 5A 6A 6D 0A 00 08 3A 28 BA BF 07 19 06 BC D9
0090 | 64 18 A6 8E B2 98 3B 94 6B 55 2F 03 41 C7 5A 41
00A0 | 79 EE 78 6D D0 5D D6 68 92 8B 73 F9 06 07 6B ED
00B0 | 2E 94 36 0A 70 59 9F DB A6 C2 FE C1 D6 61 6C 86
00C0 | 92 33 C3 86 B9 C3 F3 E2 97 7E 7E 9D D6 8B 27 A0
00D0 | FB 05 4F D6 2A E6 9C 68 FD 6F B0 0E 0B A5 EF 45
00E0 | 21 10 75 04 FB CA 20 D6 9F 65 FE BD 51 89 93 59
00F0 | 48 41 B8 B8 3B 31 44 B9 9D 02 BB 9D 5F 30 49 0C
0100 | 62 6A A3 67 2D A5 4A 9F F2 7F F2 13 D0 42 A2 80
0110 | D3 EA EB 83 88 CA B7 D8 8A 42 25 33 BC B6 46 C2
0120 | 4C CF 69 2F 41 B3 46 80 A6 42 A1 6C 91 34 88 7A</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 = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE0001006AB83A58EF9282B06A4AB893</code> <code>1BB38ED6575E8DA0141CB85ED468050D</code> <code>E5834D72BFC4834860B24F0A02B02049</code> <code>10B358CAF3CD78B35332DE5D3C77842F</code> <code>98A0755EA3FBD27CC20761C252AAEF0F</code> <code>E3F8AF2E374CC8BC49E3CC1877926F21</code> <code>AD10AF82E314FAC7FAAFFC997D92EAB6</code> <code>39733CD7648934080BE086766CFCA3DD</code> <code>1D4AA31DAA7C5DA7D3C4127D4E088A47</code> <code>8520205978987B23628CE5BF00C44D10</code> <code>D52B61A4752307A4C8E326C6899F22E0</code> <code>275333CD60568789E89A977E5905EBCB</code> <code>F8AB9AF1DA2806C0B6B34F7EEDA1730C</code> <code>142F0DB58862E3AA29E7A85BCAABF1B0</code> <code>6816B441091CCBD45A352C1F8290091D</code> <code>3A84FE95B3C3A587AAAA1B5242291BAD</code><br> <code>0BCAEE5D</code></td>
<td><code>FE00010070F24CC44C13D7EB184E0459</code> <code>D1FE5FCCA24CFA9CAE9CCE27BA49A4FD</code> <code>01986BCD8C5C8ECBB51D68259267AC3A</code> <code>F181D5C6DD52ED8E88C6B2952851A33F</code> <code>B8A9BF6810EE664422D4B82FCB4B24B4</code> <code>60A62BFB075A6A6D0A00083A28BABF07</code> <code>1906BCD96418A68EB2983B946B552F03</code> <code>41C75A4179EE786DD05DD668928B73F9</code> <code>06076BED2E94360A70599FDBA6C2FEC1</code> <code>D6616C869233C386B9C3F3E2977E7E9D</code> <code>D68B27A0FB054FD62AE69C68FD6FB00E</code> <code>0BA5EF4521107504FBCA20D69F65FEBD</code> <code>518993594841B8B83B3144B99D02BB9D</code> <code>5F30490C626AA3672DA54A9FF27FF213</code> <code>D042A280D3EAEB8388CAB7D88A422533</code> <code>BCB646C24CCF692F41B34680A642A16C</code><br> <code>9134887A</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 = BA0D89B5BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4
<!-- 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 = 54B64366BC56DDDA9800ACEEE356923D3BD5D498340267DD74CBD3B1865D937E50844B4D0000000000000000FE0001006AB83A58EF9282B06A4AB8931BB38ED6575E8DA0141CB85ED468050DE5834D72BFC4834860B24F0A02B0204910B358CAF3CD78B35332DE5D3C77842F98A0755EA3FBD27CC20761C252AAEF0FE3F8AF2E374CC8BC49E3CC1877926F21AD10AF82E314FAC7FAAFFC997D92EAB639733CD7648934080BE086766CFCA3DD1D4AA31DAA7C5DA7D3C4127D4E088A478520205978987B23628CE5BF00C44D10D52B61A4752307A4C8E326C6899F22E0275333CD60568789E89A977E5905EBCBF8AB9AF1DA2806C0B6B34F7EEDA1730C142F0DB58862E3AA29E7A85BCAABF1B06816B441091CCBD45A352C1F8290091D3A84FE95B3C3A587AAAA1B5242291BAD0BCAEE5D
padding = 3AFC393534D0482E0070F29C
tmp_aes_key = A1484E0939FC4D1323ADA4C191556735B8946957EE87CD82226F0176D7B27591
tmp_aes_iv = E2A113E17B14FEAE1BD1D541DA6BB815F371D9E6D66C7B3AEA8BD5F2FE9D9DB1</code></pre>
<pre><code>data = 54B64366FFBF89C2AF616F9E5946CF8B1DC67A60F3431AF7D8960009E9F2AB7AAA4996190000000000000000FE00010070F24CC44C13D7EB184E0459D1FE5FCCA24CFA9CAE9CCE27BA49A4FD01986BCD8C5C8ECBB51D68259267AC3AF181D5C6DD52ED8E88C6B2952851A33FB8A9BF6810EE664422D4B82FCB4B24B460A62BFB075A6A6D0A00083A28BABF071906BCD96418A68EB2983B946B552F0341C75A4179EE786DD05DD668928B73F906076BED2E94360A70599FDBA6C2FEC1D6616C869233C386B9C3F3E2977E7E9DD68B27A0FB054FD62AE69C68FD6FB00E0BA5EF4521107504FBCA20D69F65FEBD518993594841B8B83B3144B99D02BB9D5F30490C626AA3672DA54A9FF27FF213D042A280D3EAEB8388CAB7D88A422533BCB646C24CCF692F41B34680A642A16C9134887A
padding = 33D6693D06443AA59C4211E3
tmp_aes_key = B025233C2D0BE415F2D978000429D04908F4107759FED43ED2572C802894A431
tmp_aes_iv = 857BAC258C90E735067828AB3249FF945DFAA7CF4E582BD785742656FC1BD488</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 = AA4868A4612CCB34624534DB0C6E29C132661A4B9A637F96D88BA71B92A8C4947247B521F8FB5A7234C1DB657FE58667D50059B8CF6A952BACC95CBAD0F924F968C988B5EF737A076696C0067E2588D014C3A1CA987773C552C7B4E079B4EFD1D616F51C1D3BE28DB77369DF874F1821F9A8415B5BD9087DA53B19A9B4F111CF05F03D8993AD51C1EEB51A8CC8EB644785FAB108C59652EC859B33AC6EB8982F833620F1C2FC69EEA301D86C838B6559626EDDA8EC0AFD3503B59CF2324061CDA4DFC7CC138C9E815366693493066093C720639DBB291CDF4AC5CE3EEEEAB9D6A22744E682A570ED6E7381D13F90E251AEFD09998FC070E485C308ACA87F3A77957442277B0603D2874B59FFB5B12D2851BE9606CBEC0909F817BD2DFC929E92D7AE074DAFAFAAE7CE816E9AB8A8FD1777A49222482CD8F2CC0ED86E43946BF0CF41C1E2E37582CAF98525F286505DF5</code></pre>
<pre><code>encrypted_data = EB96A87DE7B9691D064FB262D606C3A2659ACEB875F559AA887202F6E76B20D3280A532034D341AF4B14A93272725C16C40A7C62CA59A54476D0654ADFA2BD50411E8E4A0C8AE5BD9E3A0B03943FF3E3654F81ED12BCFF434369D795E668929D6040AF67BBBFBAF9D2AF4ABD987ED10B60091392502534051095D613AF3A4A821AF4AFB7CDE91E4CB082F520E178195AF43E2FDD55E05369C13ADC797018351B45280B9CAA960A28B572587761D0A70E66CEB1F61D2F8550BB64798060B45823988E5CD52EFC8BF01E342FD5F0509AB3E97D3CF5FEA08A8A4A74B5BE9DD94C08FAB59E311D5C80700486C9B2623530D94D67A81EFEEEC8E0EC48B31F8B6C97D2D3EF375F7752ACE2E7C1CBD9B3DF1F52FC94AECEE66CF15812D4E2D134F3083A35785FA15CFE0D83F602E837EBE44C6980A6122B62B552EE981AC7EFD708A2E5AC74B087717B1079CFCBE1273AC18EA1</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 40 90 02 00 ED 5C AE 66
0010 | 78 01 00 00 1F 5F 04 F5 BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98 34 02 67 DD 74 CB D3 B1
0030 | 86 5D 93 7E 50 84 4B 4D FE 50 01 00 AA 48 68 A4
0040 | 61 2C CB 34 62 45 34 DB 0C 6E 29 C1 32 66 1A 4B
0050 | 9A 63 7F 96 D8 8B A7 1B 92 A8 C4 94 72 47 B5 21
0060 | F8 FB 5A 72 34 C1 DB 65 7F E5 86 67 D5 00 59 B8
0070 | CF 6A 95 2B AC C9 5C BA D0 F9 24 F9 68 C9 88 B5
0080 | EF 73 7A 07 66 96 C0 06 7E 25 88 D0 14 C3 A1 CA
0090 | 98 77 73 C5 52 C7 B4 E0 79 B4 EF D1 D6 16 F5 1C
00A0 | 1D 3B E2 8D B7 73 69 DF 87 4F 18 21 F9 A8 41 5B
00B0 | 5B D9 08 7D A5 3B 19 A9 B4 F1 11 CF 05 F0 3D 89
00C0 | 93 AD 51 C1 EE B5 1A 8C C8 EB 64 47 85 FA B1 08
00D0 | C5 96 52 EC 85 9B 33 AC 6E B8 98 2F 83 36 20 F1
00E0 | C2 FC 69 EE A3 01 D8 6C 83 8B 65 59 62 6E DD A8
00F0 | EC 0A FD 35 03 B5 9C F2 32 40 61 CD A4 DF C7 CC
0100 | 13 8C 9E 81 53 66 69 34 93 06 60 93 C7 20 63 9D
0110 | BB 29 1C DF 4A C5 CE 3E EE EA B9 D6 A2 27 44 E6
0120 | 82 A5 70 ED 6E 73 81 D1 3F 90 E2 51 AE FD 09 99
0130 | 8F C0 70 E4 85 C3 08 AC A8 7F 3A 77 95 74 42 27
0140 | 7B 06 03 D2 87 4B 59 FF B5 B1 2D 28 51 BE 96 06
0150 | CB EC 09 09 F8 17 BD 2D FC 92 9E 92 D7 AE 07 4D
0160 | AF AF AA E7 CE 81 6E 9A B8 A8 FD 17 77 A4 92 22
0170 | 48 2C D8 F2 CC 0E D8 6E 43 94 6B F0 CF 41 C1 E2
0180 | E3 75 82 CA F9 85 25 F2 86 50 5D F5</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 30 A2 0D 00 BF 5F AE 66
0010 | 78 01 00 00 1F 5F 04 F5 FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60 F3 43 1A F7 D8 96 00 09
0030 | E9 F2 AB 7A AA 49 96 19 FE 50 01 00 EB 96 A8 7D
0040 | E7 B9 69 1D 06 4F B2 62 D6 06 C3 A2 65 9A CE B8
0050 | 75 F5 59 AA 88 72 02 F6 E7 6B 20 D3 28 0A 53 20
0060 | 34 D3 41 AF 4B 14 A9 32 72 72 5C 16 C4 0A 7C 62
0070 | CA 59 A5 44 76 D0 65 4A DF A2 BD 50 41 1E 8E 4A
0080 | 0C 8A E5 BD 9E 3A 0B 03 94 3F F3 E3 65 4F 81 ED
0090 | 12 BC FF 43 43 69 D7 95 E6 68 92 9D 60 40 AF 67
00A0 | BB BF BA F9 D2 AF 4A BD 98 7E D1 0B 60 09 13 92
00B0 | 50 25 34 05 10 95 D6 13 AF 3A 4A 82 1A F4 AF B7
00C0 | CD E9 1E 4C B0 82 F5 20 E1 78 19 5A F4 3E 2F DD
00D0 | 55 E0 53 69 C1 3A DC 79 70 18 35 1B 45 28 0B 9C
00E0 | AA 96 0A 28 B5 72 58 77 61 D0 A7 0E 66 CE B1 F6
00F0 | 1D 2F 85 50 BB 64 79 80 60 B4 58 23 98 8E 5C D5
0100 | 2E FC 8B F0 1E 34 2F D5 F0 50 9A B3 E9 7D 3C F5
0110 | FE A0 8A 8A 4A 74 B5 BE 9D D9 4C 08 FA B5 9E 31
0120 | 1D 5C 80 70 04 86 C9 B2 62 35 30 D9 4D 67 A8 1E
0130 | FE EE C8 E0 EC 48 B3 1F 8B 6C 97 D2 D3 EF 37 5F
0140 | 77 52 AC E2 E7 C1 CB D9 B3 DF 1F 52 FC 94 AE CE
0150 | E6 6C F1 58 12 D4 E2 D1 34 F3 08 3A 35 78 5F A1
0160 | 5C FE 0D 83 F6 02 E8 37 EB E4 4C 69 80 A6 12 2B
0170 | 62 B5 52 EE 98 1A C7 EF D7 08 A2 E5 AC 74 B0 87
0180 | 71 7B 10 79 CF CB E1 27 3A C1 8E A1</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>40900200ED5CAE66</code></td>
<td><code>30A20D00BF5FAE66</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>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100AA4868A4612CCB34624534DB</code> <code>0C6E29C132661A4B9A637F96D88BA71B</code> <code>92A8C4947247B521F8FB5A7234C1DB65</code> <code>7FE58667D50059B8CF6A952BACC95CBA</code> <code>D0F924F968C988B5EF737A076696C006</code> <code>7E2588D014C3A1CA987773C552C7B4E0</code> <code>79B4EFD1D616F51C1D3BE28DB77369DF</code> <code>874F1821F9A8415B5BD9087DA53B19A9</code> <code>B4F111CF05F03D8993AD51C1EEB51A8C</code> <code>C8EB644785FAB108C59652EC859B33AC</code> <code>6EB8982F833620F1C2FC69EEA301D86C</code> <code>838B6559626EDDA8EC0AFD3503B59CF2</code> <code>324061CDA4DFC7CC138C9E8153666934</code> <code>93066093C720639DBB291CDF4AC5CE3E</code> <code>EEEAB9D6A22744E682A570ED6E7381D1</code> <code>3F90E251AEFD09998FC070E485C308AC</code> <code>A87F3A77957442277B0603D2874B59FF</code> <code>B5B12D2851BE9606CBEC0909F817BD2D</code> <code>FC929E92D7AE074DAFAFAAE7CE816E9A</code> <code>B8A8FD1777A49222482CD8F2CC0ED86E</code> <code>43946BF0CF41C1E2E37582CAF98525F2</code><br> <code>86505DF5</code></td>
<td><code>FE500100EB96A87DE7B9691D064FB262</code> <code>D606C3A2659ACEB875F559AA887202F6</code> <code>E76B20D3280A532034D341AF4B14A932</code> <code>72725C16C40A7C62CA59A54476D0654A</code> <code>DFA2BD50411E8E4A0C8AE5BD9E3A0B03</code> <code>943FF3E3654F81ED12BCFF434369D795</code> <code>E668929D6040AF67BBBFBAF9D2AF4ABD</code> <code>987ED10B60091392502534051095D613</code> <code>AF3A4A821AF4AFB7CDE91E4CB082F520</code> <code>E178195AF43E2FDD55E05369C13ADC79</code> <code>7018351B45280B9CAA960A28B5725877</code> <code>61D0A70E66CEB1F61D2F8550BB647980</code> <code>60B45823988E5CD52EFC8BF01E342FD5</code> <code>F0509AB3E97D3CF5FEA08A8A4A74B5BE</code> <code>9DD94C08FAB59E311D5C80700486C9B2</code> <code>623530D94D67A81EFEEEC8E0EC48B31F</code> <code>8B6C97D2D3EF375F7752ACE2E7C1CBD9</code> <code>B3DF1F52FC94AECEE66CF15812D4E2D1</code> <code>34F3083A35785FA15CFE0D83F602E837</code> <code>EBE44C6980A6122B62B552EE981AC7EF</code> <code>D708A2E5AC74B087717B1079CFCBE127</code><br> <code>3AC18EA1</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 = 1091807488E1D8ABAD12265760F521FC8971716BC3EBAEA665C84025B5B308CD09AC3036614651228DB20FC95E36769EF2B258B1F34DD95CD1E8B35C837ADAE8C362B1CD1A1129BCF818CFB4718C01F97BE7EEF4DF2B8BEEE7EF8878060C46BF985099626ECFFDA0454ABA84F2E006EEDFEB5ED9164BADE21505DCBCE61C659C199A9B11AFE796408C40498E99C4D4DF8BB8C14F911AD4543E7332D5D0978981D8EB9EC0DF845BC58E43CE96ADA4B657338B4E1762AF26692B00D1B56CD3BF2FAAB4436447E26363C00CB6A03EA7381509280168D6835A9294184CD6829560FE79116171EF8FD026C743537C00D7306C0BC06203BD757A536612C06B38F84CB5</code></pre>
<pre><code>auth_key = 9ECD53C772EF30454E5F0E591AB8A9CBA5543176A4A1993F9F17D23AFC6D75317AEDA29D9AFD3B6A8DBAEE205E370D892533B11601DC581F52CA51CBCE8AB8C40938A68715F3857AE36F5C82870A5025C6835804E7AC75B6F173EB9DBA9DB115439C7101B563725F7EE6DE19A9977C22DC193DE6E8FB98B1AD392FCD4547A077F74ED6D50233154A2141762FC263CA1BA01A9C5F7D224D140CCF35AF78DA44D7951A73B58110E0735A7A2230AB9A4599B2A693BFAAD55FC428EBF9BC282B99025DCD1F5D95DE69FF35DAC5E111B8852868D6E4193E733699D476434C6556B9826D0E286FAF308792CE9125D6118B614EDE9365F7BB2128C98E1C89571F8CF736</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 A8 B8 B2 EE 5C AE 66
0010 | 94 00 00 00 34 F7 CB 3B BC 56 DD DA 98 00 AC EE
0020 | E3 56 92 3D 3B D5 D4 98 34 02 67 DD 74 CB D3 B1
0030 | 86 5D 93 7E 50 84 4B 4D 6E 6C 08 74 7B 15 BB BF
0040 | D5 7C 08 CC 46 5A 7B F4</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 AC 23 29 C0 5F AE 66
0010 | 8C 00 00 00 34 F7 CB 3B FF BF 89 C2 AF 61 6F 9E
0020 | 59 46 CF 8B 1D C6 7A 60 F3 43 1A F7 D8 96 00 09
0030 | E9 F2 AB 7A AA 49 96 19 49 74 0A 0F B8 56 B1 3F
0040 | 16 95 62 66 95 06 35 B1</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>01A8B8B2EE5CAE66</code></td>
<td><code>01AC2329C05FAE66</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>94000000</code> (148 in decimal)</td>
<td><code>8C000000</code> (140 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>BC56DDDA9800ACEEE356923D3BD5D498</code></td>
<td><code>FFBF89C2AF616F9E5946CF8B1DC67A60</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>340267DD74CBD3B1865D937E50844B4D</code></td>
<td><code>F3431AF7D8960009E9F2AB7AAA499619</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>6E6C08747B15BBBFD57C08CC465A7BF4</code></td>
<td><code>49740A0FB856B13F16956266950635B1</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

@ -152,7 +152,7 @@
</tr>
<tr>
<td><a href="/constructor/inputMediaPaidMedia">inputMediaPaidMedia</a></td>
<td> </td>
<td><a href="/api/paid-media">Paid media, see here »</a> for more info.</td>
</tr>
</tbody>
</table></div>

File diff suppressed because one or more lines are too long