Update content of files

This commit is contained in:
GitHub Action 2024-11-16 10:31:16 +00:00
parent dde214e42d
commit cb5bcb9be8
9 changed files with 216 additions and 217 deletions

View file

@ -722,8 +722,7 @@ A full list of these parameters can be seen in the <a href="#client-configuratio
<li><code>"PREMIUM_CHRISTMAS"</code> - Suggests the user to <a href="/api/premium#gifting-telegram-premium">gift Telegram Premium</a> subscriptions to friends for Christmas.</li>
<li><code>"PREMIUM_GRACE"</code> - Suggests the user to extend their expiring Telegram Premium subscription</li>
<li><code>"BIRTHDAY_SETUP"</code> - Suggests the user to set a <a href="/api/profile#birthday">birthday »</a>.</li>
<li><code>"STARS_SUBSCRIPTION_LOW_BALANCE"</code> - Suggests the user to extend their expiring <a href="/api/stars#subscriptions">Telegram Star subscriptions</a>.
Invoke <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a> with the <code>missing_balance</code> flag set to get the number of expiring subscriptions and the number of required to buy Telegram Stars</li>
<li><code>"STARS_SUBSCRIPTION_LOW_BALANCE"</code> - When we get close to the end of the subscription period of one or more active subscriptions, and the current <a href="/api/stars">Telegram Star balance</a> is not high enough to autorenew at least one of them, this suggestion will be activated: when the user clicks on the suggestion, the client should fetch and display the list of expiring subscriptions by invoking <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a>, passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code> and setting the <code>missing_balance</code> flag: the returned subscriptions may be renewed by <a href="/api/stars">filling up the current Telegram Star balance</a> with at least <a href="/constructor/payments.starsStatus">payments.starsStatus</a>.<code>subscriptions_missing_balance</code> stars.</li>
</ul>
</li>
</ul>

View file

@ -140,7 +140,7 @@ Currently the only allowed subscription period is <code>30*24*60*60</code>, i.e.
<p>If the user decides to leave the channel without cancelling the subscription (or before the end of the current cancelled subscription period), subsequent calls to <a href="/method/messages.checkChatInvite">messages.checkChatInvite</a> will return a <a href="/constructor/chatInvite">chatInvite</a> with the <code>can_refulfill_subscription</code> flag set, indicating that they may re-join the channel using <a href="/method/payments.fulfillStarsSubscription">payments.fulfillStarsSubscription</a> (passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code> and the <a href="/constructor/starsSubscription">starsSubscription</a>.<code>id</code> to <code>subscription_id</code>) without repeating the payment; the <code>subscription_pricing</code> will also be returned, but no <code>subscription_form_id</code> will be returned. </p>
<p>To obtain a list of all active and cancelled subscriptions invoke <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a>, passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code>: this will return a vector of <a href="/constructor/starsSubscription">starsSubscription</a> constructors, containing info about each subscription. </p>
<p>To cancel an active subscription, invoke <a href="/method/payments.changeStarsSubscription">payments.changeStarsSubscription</a> passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code>, the <a href="/constructor/starsSubscription">starsSubscription</a>.<code>id</code> to <code>subscription_id</code> and <a href="/constructor/boolTrue">boolTrue</a> to <code>canceled</code>; to resubscribe, invoke the same method passing <a href="/constructor/boolFalse">boolFalse</a> to <code>canceled</code>. </p>
<p>When we get close to the end of the subscription period of an active subscription, the <a href="/api/config#suggestions">"STARS_SUBSCRIPTION_LOW_BALANCE" suggestion »</a> will be activated: when the user clicks on the suggestion, the client should fetch and display the list of expiring subscriptions by invoking <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a>, passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code> and setting the <code>missing_balance</code> flag: the returned subscriptions may be renewed by following the payment flow described above, using the <code>chat_invite_hash</code>es from the returned <a href="/constructor/starsSubscription">starsSubscription</a>s. </p>
<p>When we get close to the end of the subscription period of one or more active subscriptions, and the current Telegram Star balance is not high enough to autorenew at least one of them, the <a href="/api/config#suggestions">"STARS_SUBSCRIPTION_LOW_BALANCE" suggestion »</a> will be activated: when the user clicks on the suggestion, the client should fetch and display the list of expiring subscriptions by invoking <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a>, passing <a href="/constructor/inputPeerSelf">inputPeerSelf</a> to <code>peer</code> and setting the <code>missing_balance</code> flag: the returned subscriptions may be renewed by <a href="/api/stars">filling up the current Telegram Star balance</a> with at least <a href="/constructor/payments.starsStatus">payments.starsStatus</a>.<code>subscriptions_missing_balance</code> stars.</p>
<h3><a class="anchor" href="#join-requests" id="join-requests" name="join-requests"><i class="anchor-icon"></i></a>Join requests</h3>
<pre><code><a href='/constructor/channel'>channel</a>#fe4478bd flags:<a href='/type/%23'>#</a> creator:flags.0?<a href='/constructor/true'>true</a> left:flags.2?<a href='/constructor/true'>true</a> broadcast:flags.5?<a href='/constructor/true'>true</a> verified:flags.7?<a href='/constructor/true'>true</a> megagroup:flags.8?<a href='/constructor/true'>true</a> restricted:flags.9?<a href='/constructor/true'>true</a> signatures:flags.11?<a href='/constructor/true'>true</a> min:flags.12?<a href='/constructor/true'>true</a> scam:flags.19?<a href='/constructor/true'>true</a> has_link:flags.20?<a href='/constructor/true'>true</a> has_geo:flags.21?<a href='/constructor/true'>true</a> slowmode_enabled:flags.22?<a href='/constructor/true'>true</a> call_active:flags.23?<a href='/constructor/true'>true</a> call_not_empty:flags.24?<a href='/constructor/true'>true</a> fake:flags.25?<a href='/constructor/true'>true</a> gigagroup:flags.26?<a href='/constructor/true'>true</a> noforwards:flags.27?<a href='/constructor/true'>true</a> join_to_send:flags.28?<a href='/constructor/true'>true</a> join_request:flags.29?<a href='/constructor/true'>true</a> forum:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> stories_hidden:flags2.1?<a href='/constructor/true'>true</a> stories_hidden_min:flags2.2?<a href='/constructor/true'>true</a> stories_unavailable:flags2.3?<a href='/constructor/true'>true</a> signature_profiles:flags2.12?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:flags.13?<a href='/type/long'>long</a> title:<a href='/type/string'>string</a> username:flags.6?<a href='/type/string'>string</a> photo:<a href='/type/ChatPhoto'>ChatPhoto</a> date:<a href='/type/int'>int</a> restriction_reason:flags.9?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; admin_rights:flags.14?<a href='/type/ChatAdminRights'>ChatAdminRights</a> banned_rights:flags.15?<a href='/type/ChatBannedRights'>ChatBannedRights</a> default_banned_rights:flags.18?<a href='/type/ChatBannedRights'>ChatBannedRights</a> participants_count:flags.17?<a href='/type/int'>int</a> usernames:flags2.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Username'>Username</a>&gt; stories_max_id:flags2.4?<a href='/type/int'>int</a> color:flags2.7?<a href='/type/PeerColor'>PeerColor</a> profile_color:flags2.8?<a href='/type/PeerColor'>PeerColor</a> emoji_status:flags2.9?<a href='/type/EmojiStatus'>EmojiStatus</a> level:flags2.10?<a href='/type/int'>int</a> subscription_until_date:flags2.11?<a href='/type/int'>int</a> = <a href='/type/Chat'>Chat</a>;

View file

@ -244,7 +244,7 @@
<h4><a class="anchor" href="#schema-changes" id="schema-changes" name="schema-changes"><i class="anchor-icon"></i></a>Schema changes</h4>
<h5><a class="anchor" href="#new-methods" id="new-methods" name="new-methods"><i class="anchor-icon"></i></a>New Methods</h5>
<ul>
<li>Added <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a> - Obtain a list of active, expiring or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</li>
<li>Added <a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a> - Obtain a list of active, expired or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</li>
<li>Added <a href="/method/payments.changeStarsSubscription">payments.changeStarsSubscription</a> - Activate or deactivate a <a href="/api/invites#paid-invite-links">Telegram Star subscription »</a>.</li>
<li>Added <a href="/method/payments.fulfillStarsSubscription">payments.fulfillStarsSubscription</a> - Re-join a private channel associated to an active <a href="/api/invites#paid-invite-links">Telegram Star subscription »</a>.</li>
<li>Added <a href="/method/messages.sendPaidReaction">messages.sendPaidReaction</a> - </li>

View file

@ -89,7 +89,7 @@
<tr>
<td><strong>subscriptions_missing_balance</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/long">long</a></td>
<td>The number of Telegram Stars the user should buy to be able to extend subscriptions expiring soon (i.e. the current balance is not enough to extend all expiring subscriptions).</td>
<td>The number of Telegram Stars the user should buy to be able to extend expired subscriptions soon (i.e. the current balance is not enough to extend all expired subscriptions).</td>
</tr>
<tr>
<td><strong>history</strong></td>
@ -120,7 +120,7 @@
<p>Fetch <a href="/api/stars#balance-and-transaction-history">Telegram Stars transactions</a>.</p>
<p>The <code>inbound</code> and <code>outbound</code> flags are mutually exclusive: if none of the two are set, both incoming and outgoing transactions are fetched.</p>
<h4><a class="anchor" href="#paymentsgetstarssubscriptions" id="paymentsgetstarssubscriptions" name="paymentsgetstarssubscriptions"><i class="anchor-icon"></i></a><a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a></h4>
<p>Obtain a list of active, expiring or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</p>
<p>Obtain a list of active, expired or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</p>
<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 virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.</p></div>

View file

@ -84,7 +84,7 @@
<tr>
<td><strong>missing_balance</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Whether this subscription has expired because there are not enough stars on the user's balance to extend it.</td>
</tr>
<tr>
<td><strong>id</strong></td>
@ -109,7 +109,7 @@
<tr>
<td><strong>chat_invite_hash</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/string">string</a></td>
<td>Invitation link, used to renew the subscription.</td>
<td>Invitation link, used to renew the subscription after cancellation or expiration.</td>
</tr>
</tbody>
</table>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>payments.getStarsSubscriptions</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Obtain a list of active, expiring or cancelled Telegram Star subscriptions ».">
<meta property="description" content="Obtain a list of active, expired or cancelled Telegram Star subscriptions ».">
<meta property="og:title" content="payments.getStarsSubscriptions">
<meta property="og:image" content="">
<meta property="og:description" content="Obtain a list of active, expiring or cancelled Telegram Star subscriptions ».">
<meta property="og:description" content="Obtain a list of active, expired or cancelled Telegram Star subscriptions ».">
<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">
@ -42,7 +42,7 @@
<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/payments.getStarsSubscriptions" >payments.getStarsSubscriptions</a></li></ul></div>
<h1 id="dev_page_title">payments.getStarsSubscriptions</h1>
<div id="dev_page_content"><p>Obtain a list of active, expiring or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</p>
<div id="dev_page_content"><p>Obtain a list of active, expired or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -76,7 +76,7 @@
<tr>
<td><strong>missing_balance</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/constructor/true">true</a></td>
<td>Whether to return only expiring subscriptions.</td>
<td>Whether to return only expired subscriptions due to an excessively low Telegram Star balance.</td>
</tr>
<tr>
<td><strong>peer</strong></td>

View file

@ -3698,7 +3698,7 @@ Look for updates of telegram&#39;s terms of service…">
<tbody>
<tr>
<td><a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a></td>
<td>Obtain a list of active, expiring or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</td>
<td>Obtain a list of active, expired or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</td>
</tr>
<tr>
<td><a href="/method/payments.changeStarsSubscription">payments.changeStarsSubscription</a></td>

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 08 73 02 00 12 AA 37 67
0010 | 14 00 00 00 F1 8E 7E BE C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 C4 6A 0E 00 34 73 38 67
0010 | 14 00 00 00 F1 8E 7E BE DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 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>0873020012AA3767</code></td>
<td><code>C46A0E0034733867</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>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</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 A8 30 BE 12 AA 37 67
0010 | 50 00 00 00 63 24 16 05 C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A ED 2B F6 47 79 20 E8 B6
0030 | 96 30 62 79 4A 66 FE 44 08 26 AE 58 C1 C8 74 B2
0040 | B5 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 30 E5 2E 34 73 38 67
0010 | 50 00 00 00 63 24 16 05 DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 6F 18 06 1D 83 76 1E 28 ED
0030 | AC CD 4E 30 98 C2 6D 38 08 20 FF A8 83 F7 7C 42
0040 | 6D 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
0050 | 85 1D 9D D0 A5 B7 F7 09 35 5F C3 0B 21 6B E8 6C
0060 | 02 2B B4 C3</code></pre>
<p>Payload (de)serialization:</p>
@ -132,7 +132,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01A830BE12AA3767</code></td>
<td><code>0130E52E34733867</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>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>0826AE58C1C874B2B5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2787262808703939253</td>
<td><code>0820FFA883F77C426D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2377804413021209197</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 = 2787262808703939253</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2787262808703939253 = 1450368581 * 1921761713</code></p>
<pre><code>p = 1450368581
q = 1921761713</code></pre>
<pre><code>pq = 2377804413021209197</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2377804413021209197 = 1445298703 * 1645199299</code></p>
<pre><code>p = 1445298703
q = 1645199299</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 26 AE 58 C1 C8 74 B2 B5 00 00 00
0010 | 04 56 72 DE 45 00 00 00 04 72 8B C1 B1 00 00 00
0020 | C7 C4 6E 4A 29 12 7F 79 40 49 0E 28 C9 41 A2 1A
0030 | ED 2B F6 47 79 20 E8 B6 96 30 62 79 4A 66 FE 44
0040 | 09 95 FD 0F 06 C5 FB D2 39 3D 94 EE 3A 15 FE B4
0050 | B0 0B 2D 7D 23 29 6B D7 42 2A 44 8B 00 38 35 49
<pre><code>0000 | 95 5F F5 A9 08 20 FF A8 83 F7 7C 42 6D 00 00 00
0010 | 04 56 25 82 0F 00 00 00 04 62 0F BF C3 00 00 00
0020 | DA 8F 30 4B DA 3E 14 CF 4C C1 C3 A4 5A 90 15 6F
0030 | 18 06 1D 83 76 1E 28 ED AC CD 4E 30 98 C2 6D 38
0040 | 15 4B B5 D0 14 B0 F2 74 5F 04 74 1B B5 7D 9F 8B
0050 | D7 B1 F9 76 C8 47 DE 78 BB 2A 2D 8B 84 30 FF 4C
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 = 1921761713</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>0826AE58C1C874B2B5000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2787262808703939253</td>
<td><code>0820FFA883F77C426D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2377804413021209197</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>045672DE45000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1450368581</td>
<td><code>045625820F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1445298703</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>04728BC1B1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1921761713</td>
<td><code>04620FBFC3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1645199299</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>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>0995FD0F06C5FBD2393D94EE3A15FEB4</code> <code>B00B2D7D23296BD7422A448B00383549</code></td>
<td><code>154BB5D014B0F2745F04741BB57D9F8B</code> <code>D7B1F976C847DE78BB2A2D8B8430FF4C</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1921761713</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 = 955FF5A90826AE58C1C874B2B5000000045672DE4500000004728BC1B1000000C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE440995FD0F06C5FBD2393D94EE3A15FEB4B00B2D7D23296BD7422A448B0038354902000000
random_padding_bytes = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD19ABB562617075ACE1625C8F7E05FFCE367DBE200AD929FE2C6E5B356AFFB908AF78FEEE6CFADAB816358CF555E408E6F661384A1D95DAA35F1B1A295BEE615F</code></pre>
<pre><code>data = 955FF5A90820FFA883F77C426D000000045625820F00000004620FBFC3000000DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D38154BB5D014B0F2745F04741BB57D9F8BD7B1F976C847DE78BB2A2D8B8430FF4C02000000
random_padding_bytes = 23485C6EE6125CB871296A117C5581AAB1D4427DCF9549BE5E1405D3A72D79F66F029CF1C17532F29741C7FB5836471919A8B0F29539DC40CD4D5C8DE31CC1B2DEDEFEFF07BCCB459DDCF9898914107E72B5597048B61BBED0A18819</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 = 46DC148CC676BA899D8904E22D1BAC60EB4B65C9AB322DD7D492D6B1FF17D6700F7660585148141972F2C39486F10925FB2AAA7E07596C6C23081238331C49D29AC715A8F1CEF36C4DA39AAE317223A1553D4C1BE83832245B2B1918AC8EF373F6E600DBC79D10C362C2BFEAA52C8B71613DFEFDE71FAB84EC0DDFE0316A97FB933BB1F9E63225166E4517BD6462AB174C3C79B38521C31997433B256252E21B884BFF2E50CADD9B5A5F71B47195AF9A4CA71F203AD549FFC8CB9BF81D5D8696BB97F909ADB0C95500C7D032B1D53EE783E03FE8AF34CF04F99F33E49A040408082110FE3DA9F52A7B83D1ED1331CED70336C01EC78409FC456559BECDA829C2</code></pre>
<pre><code>encrypted_data = D194799E424FF5B0B22D56A6832B1FBB1766C9DEE939C714EEBD67F80EBB2C3F2DC4FCF45B9385DE07CBA6D83003C1305C7AFFBF22F0F86D94F47E9EE988048B0483409E15B7FB70860D4EDA946CCE5C325E67162BA79902A8F65AD3F497F2B94E5E7358D3ADB901EED594E59976A8CCE988C623A6734FAB2A04CA698C1A940483252F07593798546E0AA9E5D9EC4A9704729E0CDE060276398E7EA42B430ED9D6ACD6E3E2920E641978F88E4401F504D6461D2D98B1913B572657DDCA9BC9CE99273301E9D1FE403254D9669F8D361492CE1BF0B8E36E51467222F2A4D1788CDBDE1BAEBC1442A561A6046C8D7E223786DFA3A6EC05104B18650B4BD72E43AB</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 B8 81 0B 00 12 AA 37 67
0010 | 40 01 00 00 BE E4 12 D7 C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A ED 2B F6 47 79 20 E8 B6
0030 | 96 30 62 79 4A 66 FE 44 04 56 72 DE 45 00 00 00
0040 | 04 72 8B C1 B1 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 46 DC 14 8C C6 76 BA 89 9D 89 04 E2
0060 | 2D 1B AC 60 EB 4B 65 C9 AB 32 2D D7 D4 92 D6 B1
0070 | FF 17 D6 70 0F 76 60 58 51 48 14 19 72 F2 C3 94
0080 | 86 F1 09 25 FB 2A AA 7E 07 59 6C 6C 23 08 12 38
0090 | 33 1C 49 D2 9A C7 15 A8 F1 CE F3 6C 4D A3 9A AE
00A0 | 31 72 23 A1 55 3D 4C 1B E8 38 32 24 5B 2B 19 18
00B0 | AC 8E F3 73 F6 E6 00 DB C7 9D 10 C3 62 C2 BF EA
00C0 | A5 2C 8B 71 61 3D FE FD E7 1F AB 84 EC 0D DF E0
00D0 | 31 6A 97 FB 93 3B B1 F9 E6 32 25 16 6E 45 17 BD
00E0 | 64 62 AB 17 4C 3C 79 B3 85 21 C3 19 97 43 3B 25
00F0 | 62 52 E2 1B 88 4B FF 2E 50 CA DD 9B 5A 5F 71 B4
0100 | 71 95 AF 9A 4C A7 1F 20 3A D5 49 FF C8 CB 9B F8
0110 | 1D 5D 86 96 BB 97 F9 09 AD B0 C9 55 00 C7 D0 32
0120 | B1 D5 3E E7 83 E0 3F E8 AF 34 CF 04 F9 9F 33 E4
0130 | 9A 04 04 08 08 21 10 FE 3D A9 F5 2A 7B 83 D1 ED
0140 | 13 31 CE D7 03 36 C0 1E C7 84 09 FC 45 65 59 BE
0150 | CD A8 29 C2</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 C8 6A 0E 00 34 73 38 67
0010 | 40 01 00 00 BE E4 12 D7 DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 6F 18 06 1D 83 76 1E 28 ED
0030 | AC CD 4E 30 98 C2 6D 38 04 56 25 82 0F 00 00 00
0040 | 04 62 0F BF C3 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 D1 94 79 9E 42 4F F5 B0 B2 2D 56 A6
0060 | 83 2B 1F BB 17 66 C9 DE E9 39 C7 14 EE BD 67 F8
0070 | 0E BB 2C 3F 2D C4 FC F4 5B 93 85 DE 07 CB A6 D8
0080 | 30 03 C1 30 5C 7A FF BF 22 F0 F8 6D 94 F4 7E 9E
0090 | E9 88 04 8B 04 83 40 9E 15 B7 FB 70 86 0D 4E DA
00A0 | 94 6C CE 5C 32 5E 67 16 2B A7 99 02 A8 F6 5A D3
00B0 | F4 97 F2 B9 4E 5E 73 58 D3 AD B9 01 EE D5 94 E5
00C0 | 99 76 A8 CC E9 88 C6 23 A6 73 4F AB 2A 04 CA 69
00D0 | 8C 1A 94 04 83 25 2F 07 59 37 98 54 6E 0A A9 E5
00E0 | D9 EC 4A 97 04 72 9E 0C DE 06 02 76 39 8E 7E A4
00F0 | 2B 43 0E D9 D6 AC D6 E3 E2 92 0E 64 19 78 F8 8E
0100 | 44 01 F5 04 D6 46 1D 2D 98 B1 91 3B 57 26 57 DD
0110 | CA 9B C9 CE 99 27 33 01 E9 D1 FE 40 32 54 D9 66
0120 | 9F 8D 36 14 92 CE 1B F0 B8 E3 6E 51 46 72 22 F2
0130 | A4 D1 78 8C DB DE 1B AE BC 14 42 A5 61 A6 04 6C
0140 | 8D 7E 22 37 86 DF A3 A6 EC 05 10 4B 18 65 0B 4B
0150 | D7 2E 43 AB</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 = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>B8810B0012AA3767</code></td>
<td><code>C86A0E0034733867</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 = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>045672DE45000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1450368581</td>
<td><code>045625820F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1445298703</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>04728BC1B1000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1921761713</td>
<td><code>04620FBFC3000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1645199299</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 = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE00010046DC148CC676BA899D8904E2</code> <code>2D1BAC60EB4B65C9AB322DD7D492D6B1</code> <code>FF17D6700F7660585148141972F2C394</code> <code>86F10925FB2AAA7E07596C6C23081238</code> <code>331C49D29AC715A8F1CEF36C4DA39AAE</code> <code>317223A1553D4C1BE83832245B2B1918</code> <code>AC8EF373F6E600DBC79D10C362C2BFEA</code> <code>A52C8B71613DFEFDE71FAB84EC0DDFE0</code> <code>316A97FB933BB1F9E63225166E4517BD</code> <code>6462AB174C3C79B38521C31997433B25</code> <code>6252E21B884BFF2E50CADD9B5A5F71B4</code> <code>7195AF9A4CA71F203AD549FFC8CB9BF8</code> <code>1D5D8696BB97F909ADB0C95500C7D032</code> <code>B1D53EE783E03FE8AF34CF04F99F33E4</code> <code>9A040408082110FE3DA9F52A7B83D1ED</code> <code>1331CED70336C01EC78409FC456559BE</code><br> <code>CDA829C2</code></td>
<td><code>FE000100D194799E424FF5B0B22D56A6</code> <code>832B1FBB1766C9DEE939C714EEBD67F8</code> <code>0EBB2C3F2DC4FCF45B9385DE07CBA6D8</code> <code>3003C1305C7AFFBF22F0F86D94F47E9E</code> <code>E988048B0483409E15B7FB70860D4EDA</code> <code>946CCE5C325E67162BA79902A8F65AD3</code> <code>F497F2B94E5E7358D3ADB901EED594E5</code> <code>9976A8CCE988C623A6734FAB2A04CA69</code> <code>8C1A940483252F07593798546E0AA9E5</code> <code>D9EC4A9704729E0CDE060276398E7EA4</code> <code>2B430ED9D6ACD6E3E2920E641978F88E</code> <code>4401F504D6461D2D98B1913B572657DD</code> <code>CA9BC9CE99273301E9D1FE403254D966</code> <code>9F8D361492CE1BF0B8E36E51467222F2</code> <code>A4D1788CDBDE1BAEBC1442A561A6046C</code> <code>8D7E223786DFA3A6EC05104B18650B4B</code><br> <code>D72E43AB</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<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 78 B4 D0 12 AA 37 67
0010 | 78 02 00 00 5C 07 E8 D0 C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A ED 2B F6 47 79 20 E8 B6
0030 | 96 30 62 79 4A 66 FE 44 FE 50 02 00 FB 0C A6 EE
0040 | 99 22 3E 03 49 C9 D1 58 84 27 86 A4 87 5D 51 B7
0050 | 93 5C C1 48 D9 0B F9 A4 2A FD C2 B0 E5 44 96 EF
0060 | B5 23 96 9E E6 DB 37 6D 45 0B 4C 58 85 F4 5F 5B
0070 | 25 5C 89 91 12 80 57 DF 84 99 0D E0 DC 36 3F 63
0080 | 6B C5 66 82 55 FE C3 3C B1 DA 02 01 4A 46 7C 0D
0090 | 0B CC 1B 7E 36 91 74 03 06 93 32 A4 B5 6C AD E1
00A0 | 60 91 93 B5 77 83 BA A9 27 8B 1F C6 16 27 32 07
00B0 | 10 EC 39 0C 09 39 A7 16 91 70 FF C1 FA C6 EF 15
00C0 | 2A B8 32 DA 6A 4B 49 A7 23 CA 0F 65 7A 52 D5 15
00D0 | 12 73 2A 9A 88 60 52 56 AB 9C DA 34 46 BA 06 7D
00E0 | A2 93 AD DF 0C 51 10 D3 D1 0B 5C 8E DB 55 BD FB
00F0 | A2 EB 9A 9C 52 14 41 CF 11 6B 4A 69 18 0E 28 BF
0100 | 31 3C 15 47 81 70 8A 51 96 CC 8F 34 F8 1C 6A AA
0110 | C7 0A 3D 66 65 7C 45 FF 1C C1 E8 67 F6 F7 57 80
0120 | A1 6A 3E A1 67 44 05 DA 20 32 19 2A 7C D8 9D 57
0130 | D0 DF 73 24 3A FA 2A 9E 26 D9 2D 8B 32 7A AE 28
0140 | 02 83 14 89 B9 5D 22 A0 31 CC 44 D9 68 9A F4 B6
0150 | E8 1E 36 DF 61 DB 1D CB D4 09 77 CF 7D 4E 23 42
0160 | 67 2C 75 56 4C D9 76 48 07 B7 63 91 AC 47 C1 FB
0170 | 8D 85 6A 86 30 17 D0 F7 4A 94 CC 0A BC 70 8C FD
0180 | 87 1D 41 73 C9 48 96 31 9B FE D5 E5 7B CC 7D 35
0190 | 67 C8 45 93 C2 57 A9 D9 CC 3F 5C 9B B3 18 0A 19
01A0 | 7D B1 50 3F 84 2C D4 B7 BC F3 89 47 35 C4 6C 1C
01B0 | C9 7A EE 85 CE 54 2E 64 F5 C1 CE 65 CA 0F 69 47
01C0 | 6D FB CB 1B 06 1C 26 9C AA FE 66 65 54 24 BD 0B
01D0 | 58 B7 D7 B7 A9 0C 9D 00 C1 77 7B 34 80 2F 2E E2
01E0 | A8 54 1E 71 2C D9 ED 46 A6 1D B7 FD BC 13 15 A2
01F0 | F1 CB C9 4A F2 95 74 81 C3 76 AD F0 7E 09 28 47
0200 | 26 B0 88 7E E6 3A 3A A1 A7 68 FF 35 4D 8A 37 76
0210 | AC 3B 05 73 1C 0F 47 ED 50 5F A9 D8 16 B1 A9 0F
0220 | 3A F2 71 9E 78 37 09 84 A1 53 9B 07 74 41 6D 2E
0230 | 9B 97 41 35 D0 54 73 77 6D 34 88 F0 3A 55 B2 D8
0240 | F2 E4 5B D8 A2 1E 8F 4E 85 B6 D4 C5 89 8E 28 72
0250 | 83 94 00 30 81 A5 52 09 63 20 64 8A 0B 34 7E 5F
0260 | C1 F3 C3 24 D5 56 4F CD 1C 3E 05 7B C2 18 60 35
0270 | 6A DA CB A2 C1 06 56 49 6D 36 6B 8B A8 B9 3C 7D
0280 | 9C 12 9C AC EF 33 67 58 F9 3F 08 06</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 3C D2 50 34 73 38 67
0010 | 78 02 00 00 5C 07 E8 D0 DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 6F 18 06 1D 83 76 1E 28 ED
0030 | AC CD 4E 30 98 C2 6D 38 FE 50 02 00 17 4A 12 EC
0040 | 3C 20 57 85 01 34 1F 4E CF CA 98 5F 17 E7 41 90
0050 | E5 03 75 2D 68 34 CB E2 F1 28 45 2C E4 1C AB 83
0060 | 9B 6A 27 0E C8 57 1A 19 D9 5D 23 57 9E 16 59 6B
0070 | 20 D7 35 47 1B EF 72 8E 94 67 6F 75 7F E3 6A FE
0080 | D4 25 99 30 93 58 0B 36 74 28 22 EF DA 76 56 C9
0090 | 5A 94 B3 A8 7A 42 44 40 04 81 49 4E 8F A3 6B 5D
00A0 | 52 B6 B5 C8 D6 D3 27 0F 3F 7D 2C AB 08 47 5C FC
00B0 | BF F8 8B 93 49 FC 7D A7 99 EE 5A 8C 53 73 F2 17
00C0 | 8C 26 27 29 D9 3D 69 1A 8E 18 45 91 38 61 01 15
00D0 | 4B 29 8E CC 02 3A C7 DC CC CF 47 0A 6A C6 BF 09
00E0 | 95 02 FE D0 A2 0B D5 71 EE C6 39 B2 77 B6 FA 1F
00F0 | 0B 18 B7 12 A7 C4 9A AE 2B C5 EA 67 DD 4E 11 C3
0100 | 94 A8 6B F3 7E 67 18 E7 C2 32 F4 18 0C A2 30 25
0110 | 34 75 8A 4E 14 B4 35 68 5F 2A 36 75 0D 1C 9A D5
0120 | DD AA 0D A8 47 27 77 86 97 14 68 5D 74 D5 2D 13
0130 | 9D F9 18 67 C4 95 4B 3B 11 F1 DA E6 40 DA 2F B8
0140 | 6E C2 41 90 9C CF BF 16 48 C2 71 56 D9 2B 69 CF
0150 | 19 06 E1 E1 AB 0C 36 A4 DB 73 86 FF 9A A3 40 F6
0160 | B5 D3 54 41 2A 98 5A 54 F9 17 41 D5 EF 91 3D 24
0170 | 58 97 16 76 C8 19 E2 DB 39 18 94 8E 70 44 5E BE
0180 | 19 B4 A5 FD 75 67 CE 04 29 2A 4B F4 65 1D B8 80
0190 | D9 E2 BC 10 C4 97 14 81 2F AA CE 73 E7 28 3C C3
01A0 | DE 9D A6 75 33 C0 78 33 50 95 04 FD 1E 1A 34 9B
01B0 | 22 61 2B 7D 93 8A 78 E2 00 D5 25 F3 BD B6 0E 30
01C0 | A4 15 0C E9 2D 8D 58 89 FB D2 F2 2C CC 90 46 C6
01D0 | 2A 4C A2 7C FE 74 1B 55 9F 68 74 B6 C2 CC 5C 3F
01E0 | F2 74 A8 67 4A 23 E0 F2 B8 A6 70 D8 0F 9C 22 E4
01F0 | 0C 16 DD 99 E3 75 4B 23 C6 D3 5D D4 62 09 98 51
0200 | C4 2B A0 67 C7 5F E1 68 13 BC 9D 93 3A E8 79 E2
0210 | AD E2 32 CC 58 1F 38 50 92 53 59 CE 66 33 A4 62
0220 | B7 25 85 60 E3 B1 35 CA 8E 5A C5 ED 56 F4 F1 96
0230 | E7 BB 02 80 E2 47 CB D7 95 57 E4 43 30 D0 F4 5D
0240 | F2 82 C0 67 A8 2D B9 41 94 26 BC 54 9B F5 B4 68
0250 | F7 0E E9 C8 1E 18 3C 00 4F 7D 1B F1 F3 E2 BB D8
0260 | 85 4F 78 B8 01 92 9C 7E D8 69 BB 8A 42 01 04 CB
0270 | C4 E9 64 69 7E 9A DA 4B 55 BC 9E 8F F9 C2 C0 D7
0280 | 5F 1A 2F 4E FD 54 16 93 3D 6D B7 46</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,7 +464,7 @@ random_padding_bytes = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0178B4D012AA3767</code></td>
<td><code>013CD25034733867</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>
@ -482,19 +482,19 @@ random_padding_bytes = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE500200FB0CA6EE99223E0349C9D158</code> <code>842786A4875D51B7935CC148D90BF9A4</code> <code>2AFDC2B0E54496EFB523969EE6DB376D</code> <code>450B4C5885F45F5B255C8991128057DF</code> <code>84990DE0DC363F636BC5668255FEC33C</code> <code>B1DA02014A467C0D0BCC1B7E36917403</code> <code>069332A4B56CADE1609193B57783BAA9</code> <code>278B1FC61627320710EC390C0939A716</code> <code>9170FFC1FAC6EF152AB832DA6A4B49A7</code> <code>23CA0F657A52D51512732A9A88605256</code> <code>AB9CDA3446BA067DA293ADDF0C5110D3</code> <code>D10B5C8EDB55BDFBA2EB9A9C521441CF</code> <code>116B4A69180E28BF313C154781708A51</code> <code>96CC8F34F81C6AAAC70A3D66657C45FF</code> <code>1CC1E867F6F75780A16A3EA1674405DA</code> <code>2032192A7CD89D57D0DF73243AFA2A9E</code> <code>26D92D8B327AAE2802831489B95D22A0</code> <code>31CC44D9689AF4B6E81E36DF61DB1DCB</code> <code>D40977CF7D4E2342672C75564CD97648</code> <code>07B76391AC47C1FB8D856A863017D0F7</code> <code>4A94CC0ABC708CFD871D4173C9489631</code> <code>9BFED5E57BCC7D3567C84593C257A9D9</code> <code>CC3F5C9BB3180A197DB1503F842CD4B7</code> <code>BCF3894735C46C1CC97AEE85CE542E64</code> <code>F5C1CE65CA0F69476DFBCB1B061C269C</code> <code>AAFE66655424BD0B58B7D7B7A90C9D00</code> <code>C1777B34802F2EE2A8541E712CD9ED46</code> <code>A61DB7FDBC1315A2F1CBC94AF2957481</code> <code>C376ADF07E09284726B0887EE63A3AA1</code> <code>A768FF354D8A3776AC3B05731C0F47ED</code> <code>505FA9D816B1A90F3AF2719E78370984</code> <code>A1539B0774416D2E9B974135D0547377</code> <code>6D3488F03A55B2D8F2E45BD8A21E8F4E</code> <code>85B6D4C5898E28728394003081A55209</code> <code>6320648A0B347E5FC1F3C324D5564FCD</code> <code>1C3E057BC21860356ADACBA2C1065649</code> <code>6D366B8BA8B93C7D9C129CACEF336758</code><br> <code>F93F0806</code></td>
<td><code>FE500200174A12EC3C20578501341F4E</code> <code>CFCA985F17E74190E503752D6834CBE2</code> <code>F128452CE41CAB839B6A270EC8571A19</code> <code>D95D23579E16596B20D735471BEF728E</code> <code>94676F757FE36AFED425993093580B36</code> <code>742822EFDA7656C95A94B3A87A424440</code> <code>0481494E8FA36B5D52B6B5C8D6D3270F</code> <code>3F7D2CAB08475CFCBFF88B9349FC7DA7</code> <code>99EE5A8C5373F2178C262729D93D691A</code> <code>8E184591386101154B298ECC023AC7DC</code> <code>CCCF470A6AC6BF099502FED0A20BD571</code> <code>EEC639B277B6FA1F0B18B712A7C49AAE</code> <code>2BC5EA67DD4E11C394A86BF37E6718E7</code> <code>C232F4180CA2302534758A4E14B43568</code> <code>5F2A36750D1C9AD5DDAA0DA847277786</code> <code>9714685D74D52D139DF91867C4954B3B</code> <code>11F1DAE640DA2FB86EC241909CCFBF16</code> <code>48C27156D92B69CF1906E1E1AB0C36A4</code> <code>DB7386FF9AA340F6B5D354412A985A54</code> <code>F91741D5EF913D2458971676C819E2DB</code> <code>3918948E70445EBE19B4A5FD7567CE04</code> <code>292A4BF4651DB880D9E2BC10C4971481</code> <code>2FAACE73E7283CC3DE9DA67533C07833</code> <code>509504FD1E1A349B22612B7D938A78E2</code> <code>00D525F3BDB60E30A4150CE92D8D5889</code> <code>FBD2F22CCC9046C62A4CA27CFE741B55</code> <code>9F6874B6C2CC5C3FF274A8674A23E0F2</code> <code>B8A670D80F9C22E40C16DD99E3754B23</code> <code>C6D35DD462099851C42BA067C75FE168</code> <code>13BC9D933AE879E2ADE232CC581F3850</code> <code>925359CE6633A462B7258560E3B135CA</code> <code>8E5AC5ED56F4F196E7BB0280E247CBD7</code> <code>9557E44330D0F45DF282C067A82DB941</code> <code>9426BC549BF5B468F70EE9C81E183C00</code> <code>4F7D1BF1F3E2BBD8854F78B801929C7E</code> <code>D869BB8A420104CBC4E964697E9ADA4B</code> <code>55BC9E8FF9C2C0D75F1A2F4EFD541693</code><br> <code>3D6DB746</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = 4B013609C832EFA29ABA8C11F24ACFC03EF29EF7EE86428D3EE6A6CD1
<!-- 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 = FB0CA6EE99223E0349C9D158842786A4875D51B7935CC148D90BF9A42AFDC2B0E54496EFB523969EE6DB376D450B4C5885F45F5B255C8991128057DF84990DE0DC363F636BC5668255FEC33CB1DA02014A467C0D0BCC1B7E36917403069332A4B56CADE1609193B57783BAA9278B1FC61627320710EC390C0939A7169170FFC1FAC6EF152AB832DA6A4B49A723CA0F657A52D51512732A9A88605256AB9CDA3446BA067DA293ADDF0C5110D3D10B5C8EDB55BDFBA2EB9A9C521441CF116B4A69180E28BF313C154781708A5196CC8F34F81C6AAAC70A3D66657C45FF1CC1E867F6F75780A16A3EA1674405DA2032192A7CD89D57D0DF73243AFA2A9E26D92D8B327AAE2802831489B95D22A031CC44D9689AF4B6E81E36DF61DB1DCBD40977CF7D4E2342672C75564CD9764807B76391AC47C1FB8D856A863017D0F74A94CC0ABC708CFD871D4173C94896319BFED5E57BCC7D3567C84593C257A9D9CC3F5C9BB3180A197DB1503F842CD4B7BCF3894735C46C1CC97AEE85CE542E64F5C1CE65CA0F69476DFBCB1B061C269CAAFE66655424BD0B58B7D7B7A90C9D00C1777B34802F2EE2A8541E712CD9ED46A61DB7FDBC1315A2F1CBC94AF2957481C376ADF07E09284726B0887EE63A3AA1A768FF354D8A3776AC3B05731C0F47ED505FA9D816B1A90F3AF2719E78370984A1539B0774416D2E9B974135D05473776D3488F03A55B2D8F2E45BD8A21E8F4E85B6D4C5898E28728394003081A552096320648A0B347E5FC1F3C324D5564FCD1C3E057BC21860356ADACBA2C10656496D366B8BA8B93C7D9C129CACEF336758F93F0806
tmp_aes_key = 973E7D29702C3C5E3555C007F7D6661970A178B5DAD93A5581B7110434F1D59F
tmp_aes_iv = 92318A0458D3F63CC0401134D751DC5EDA2357860F260F0A24A44BB60995FD0F</code></pre>
<pre><code>encrypted_answer = 174A12EC3C20578501341F4ECFCA985F17E74190E503752D6834CBE2F128452CE41CAB839B6A270EC8571A19D95D23579E16596B20D735471BEF728E94676F757FE36AFED425993093580B36742822EFDA7656C95A94B3A87A4244400481494E8FA36B5D52B6B5C8D6D3270F3F7D2CAB08475CFCBFF88B9349FC7DA799EE5A8C5373F2178C262729D93D691A8E184591386101154B298ECC023AC7DCCCCF470A6AC6BF099502FED0A20BD571EEC639B277B6FA1F0B18B712A7C49AAE2BC5EA67DD4E11C394A86BF37E6718E7C232F4180CA2302534758A4E14B435685F2A36750D1C9AD5DDAA0DA8472777869714685D74D52D139DF91867C4954B3B11F1DAE640DA2FB86EC241909CCFBF1648C27156D92B69CF1906E1E1AB0C36A4DB7386FF9AA340F6B5D354412A985A54F91741D5EF913D2458971676C819E2DB3918948E70445EBE19B4A5FD7567CE04292A4BF4651DB880D9E2BC10C49714812FAACE73E7283CC3DE9DA67533C07833509504FD1E1A349B22612B7D938A78E200D525F3BDB60E30A4150CE92D8D5889FBD2F22CCC9046C62A4CA27CFE741B559F6874B6C2CC5C3FF274A8674A23E0F2B8A670D80F9C22E40C16DD99E3754B23C6D35DD462099851C42BA067C75FE16813BC9D933AE879E2ADE232CC581F3850925359CE6633A462B7258560E3B135CA8E5AC5ED56F4F196E7BB0280E247CBD79557E44330D0F45DF282C067A82DB9419426BC549BF5B468F70EE9C81E183C004F7D1BF1F3E2BBD8854F78B801929C7ED869BB8A420104CBC4E964697E9ADA4B55BC9E8FF9C2C0D75F1A2F4EFD5416933D6DB746
tmp_aes_key = C3CC8BD927F95C57F5565994829974576F927A242E37E9166F8E1464A9E290DA
tmp_aes_iv = 4607FCB9E6397C9A9F6C179F561B660532DFF53B6782FE4E563FD12A154BB5D0</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 8EDD9BE15F64C34371176303F7667FE3DEF903D9BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007C8234ABED1A1C921ADCDD0CF577096D70FFD46CFD8E899B509E77E1436B99E7D602CEFC8A138B0BDF11F9F883BB20EAEB763FC16C4A5C4C5F5B51EFF7E2E548352B489EF188686F0BDD52AF48F03839503BF0BB5064762B70018DDDCA740909E58B3A9A8BAA61E39D16B3B16CF33B84D42A05E5EE33938F6E4765B94B907218180DA0BA78E3FFB6E09E039EC4C4937D355494E4BFDEBC764DA87422F5699269F885050F9DAB18657CAFBCCEC6699C3565B77BF1462A56ABB6CE47604D1F8D05B490706D67F0B8BC8370CE32765405B6476003FFA6C55478689F98F0BA35A4C797AC6747276E5340F93C1426F75EC4CA11C730152FE24160FF8429983520F30112AA37673F9EE9A5437110F6
answer = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007C8234ABED1A1C921ADCDD0CF577096D70FFD46CFD8E899B509E77E1436B99E7D602CEFC8A138B0BDF11F9F883BB20EAEB763FC16C4A5C4C5F5B51EFF7E2E548352B489EF188686F0BDD52AF48F03839503BF0BB5064762B70018DDDCA740909E58B3A9A8BAA61E39D16B3B16CF33B84D42A05E5EE33938F6E4765B94B907218180DA0BA78E3FFB6E09E039EC4C4937D355494E4BFDEBC764DA87422F5699269F885050F9DAB18657CAFBCCEC6699C3565B77BF1462A56ABB6CE47604D1F8D05B490706D67F0B8BC8370CE32765405B6476003FFA6C55478689F98F0BA35A4C797AC6747276E5340F93C1426F75EC4CA11C730152FE24160FF8429983520F30112AA37673F9EE9A5437110F6</code></pre>
<pre><code>answer_with_hash = 1D76F54DB420019B5241F52A1B1BA1C36E1AE881BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010002E5CA08F1D3BA7137A49ED7EC7F6CB589385C5A8E90F83235B56848E31E5D4967D11D1C2F6A208086FA30017D3F218938A6640A541485ADE693C1533DE9022B4D5AEC13600BDED49CAD9E425047D50842D6AAE97360EBDB20B1C9C04FB212B48B51D44E248EB458C2EFCE4931F9FD68AE4BC85C9FF85F5F12B463191225D851F454F660436FFC5C002FA4175F585C737AADE8C770BC4CB25E942D447326913D2AA41E8AF7182CB8C21F7FC40D6B08F6BFE3D3BB1C058C1E206FAF305E1496C5762FD24E67416F3775C38F1B86BE811E589BE93C6E27AA1075E2F244BD0D1656CE0AB6EAEE8A138BC8668262644A929F8A170A3E8F9E51437760C026EAAFE9063473386722E0578FB4FFEACA
answer = BA0D89B5DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D3803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010002E5CA08F1D3BA7137A49ED7EC7F6CB589385C5A8E90F83235B56848E31E5D4967D11D1C2F6A208086FA30017D3F218938A6640A541485ADE693C1533DE9022B4D5AEC13600BDED49CAD9E425047D50842D6AAE97360EBDB20B1C9C04FB212B48B51D44E248EB458C2EFCE4931F9FD68AE4BC85C9FF85F5F12B463191225D851F454F660436FFC5C002FA4175F585C737AADE8C770BC4CB25E942D447326913D2AA41E8AF7182CB8C21F7FC40D6B08F6BFE3D3BB1C058C1E206FAF305E1496C5762FD24E67416F3775C38F1B86BE811E589BE93C6E27AA1075E2F244BD0D1656CE0AB6EAEE8A138BC8668262644A929F8A170A3E8F9E51437760C026EAAFE9063473386722E0578FB4FFEACA</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 C7 C4 6E 4A 29 12 7F 79 40 49 0E 28
0010 | C9 41 A2 1A ED 2B F6 47 79 20 E8 B6 96 30 62 79
0020 | 4A 66 FE 44 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 DA 8F 30 4B DA 3E 14 CF 4C C1 C3 A4
0010 | 5A 90 15 6F 18 06 1D 83 76 1E 28 ED AC CD 4E 30
0020 | 98 C2 6D 38 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 = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
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 | 7C 82 34 AB ED 1A 1C 92 1A DC DD 0C F5 77 09 6D
0140 | 70 FF D4 6C FD 8E 89 9B 50 9E 77 E1 43 6B 99 E7
0150 | D6 02 CE FC 8A 13 8B 0B DF 11 F9 F8 83 BB 20 EA
0160 | EB 76 3F C1 6C 4A 5C 4C 5F 5B 51 EF F7 E2 E5 48
0170 | 35 2B 48 9E F1 88 68 6F 0B DD 52 AF 48 F0 38 39
0180 | 50 3B F0 BB 50 64 76 2B 70 01 8D DD CA 74 09 09
0190 | E5 8B 3A 9A 8B AA 61 E3 9D 16 B3 B1 6C F3 3B 84
01A0 | D4 2A 05 E5 EE 33 93 8F 6E 47 65 B9 4B 90 72 18
01B0 | 18 0D A0 BA 78 E3 FF B6 E0 9E 03 9E C4 C4 93 7D
01C0 | 35 54 94 E4 BF DE BC 76 4D A8 74 22 F5 69 92 69
01D0 | F8 85 05 0F 9D AB 18 65 7C AF BC CE C6 69 9C 35
01E0 | 65 B7 7B F1 46 2A 56 AB B6 CE 47 60 4D 1F 8D 05
01F0 | B4 90 70 6D 67 F0 B8 BC 83 70 CE 32 76 54 05 B6
0200 | 47 60 03 FF A6 C5 54 78 68 9F 98 F0 BA 35 A4 C7
0210 | 97 AC 67 47 27 6E 53 40 F9 3C 14 26 F7 5E C4 CA
0220 | 11 C7 30 15 2F E2 41 60 FF 84 29 98 35 20 F3 01
0230 | 12 AA 37 67</code></pre>
0130 | 02 E5 CA 08 F1 D3 BA 71 37 A4 9E D7 EC 7F 6C B5
0140 | 89 38 5C 5A 8E 90 F8 32 35 B5 68 48 E3 1E 5D 49
0150 | 67 D1 1D 1C 2F 6A 20 80 86 FA 30 01 7D 3F 21 89
0160 | 38 A6 64 0A 54 14 85 AD E6 93 C1 53 3D E9 02 2B
0170 | 4D 5A EC 13 60 0B DE D4 9C AD 9E 42 50 47 D5 08
0180 | 42 D6 AA E9 73 60 EB DB 20 B1 C9 C0 4F B2 12 B4
0190 | 8B 51 D4 4E 24 8E B4 58 C2 EF CE 49 31 F9 FD 68
01A0 | AE 4B C8 5C 9F F8 5F 5F 12 B4 63 19 12 25 D8 51
01B0 | F4 54 F6 60 43 6F FC 5C 00 2F A4 17 5F 58 5C 73
01C0 | 7A AD E8 C7 70 BC 4C B2 5E 94 2D 44 73 26 91 3D
01D0 | 2A A4 1E 8A F7 18 2C B8 C2 1F 7F C4 0D 6B 08 F6
01E0 | BF E3 D3 BB 1C 05 8C 1E 20 6F AF 30 5E 14 96 C5
01F0 | 76 2F D2 4E 67 41 6F 37 75 C3 8F 1B 86 BE 81 1E
0200 | 58 9B E9 3C 6E 27 AA 10 75 E2 F2 44 BD 0D 16 56
0210 | CE 0A B6 EA EE 8A 13 8B C8 66 82 62 64 4A 92 9F
0220 | 8A 17 0A 3E 8F 9E 51 43 77 60 C0 26 EA AF E9 06
0230 | 34 73 38 67</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 = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001007C8234ABED1A1C921ADCDD0C</code> <code>F577096D70FFD46CFD8E899B509E77E1</code> <code>436B99E7D602CEFC8A138B0BDF11F9F8</code> <code>83BB20EAEB763FC16C4A5C4C5F5B51EF</code> <code>F7E2E548352B489EF188686F0BDD52AF</code> <code>48F03839503BF0BB5064762B70018DDD</code> <code>CA740909E58B3A9A8BAA61E39D16B3B1</code> <code>6CF33B84D42A05E5EE33938F6E4765B9</code> <code>4B907218180DA0BA78E3FFB6E09E039E</code> <code>C4C4937D355494E4BFDEBC764DA87422</code> <code>F5699269F885050F9DAB18657CAFBCCE</code> <code>C6699C3565B77BF1462A56ABB6CE4760</code> <code>4D1F8D05B490706D67F0B8BC8370CE32</code> <code>765405B6476003FFA6C55478689F98F0</code> <code>BA35A4C797AC6747276E5340F93C1426</code> <code>F75EC4CA11C730152FE24160FF842998</code><br> <code>3520F301</code></td>
<td><code>FE00010002E5CA08F1D3BA7137A49ED7</code> <code>EC7F6CB589385C5A8E90F83235B56848</code> <code>E31E5D4967D11D1C2F6A208086FA3001</code> <code>7D3F218938A6640A541485ADE693C153</code> <code>3DE9022B4D5AEC13600BDED49CAD9E42</code> <code>5047D50842D6AAE97360EBDB20B1C9C0</code> <code>4FB212B48B51D44E248EB458C2EFCE49</code> <code>31F9FD68AE4BC85C9FF85F5F12B46319</code> <code>1225D851F454F660436FFC5C002FA417</code> <code>5F585C737AADE8C770BC4CB25E942D44</code> <code>7326913D2AA41E8AF7182CB8C21F7FC4</code> <code>0D6B08F6BFE3D3BB1C058C1E206FAF30</code> <code>5E1496C5762FD24E67416F3775C38F1B</code> <code>86BE811E589BE93C6E27AA1075E2F244</code> <code>BD0D1656CE0AB6EAEE8A138BC8668262</code> <code>644A929F8A170A3E8F9E51437760C026</code><br> <code>EAAFE906</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>12AA3767</code> (1731701266 in decimal)</td>
<td><code>34733867</code> (1731752756 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
<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 = 1BD51F4EF74FFD7AE5E2898C367A8DB4A4442E7A864769CD8EADC5B3F6ABA3915DDF47A562A09D53E50175CD60B3042C544BF765970929E58F7FEF65C75FA9F3F55643EA6DE76C65B87A43992EF70B497998FD92924D2E45A98298C74660304F503B89E4C258DB8444A1320DFF33F57C23708886C896A8EED669D3A394BF7CD281167A318389C2B56CC29D3050247E995CDFD8E0A49B01B6D89B6E06D1BED386FFB8D50701A80ACA9BEC313FC4F219F5C28D54B0E91259CE96C6F252A2F21282DA850216DAECBFA861DEC2FD311303637630CD910389DDC65CD9D3E051B24CCDB4C48123326C30D3FD3AF908D327F759FAEFE0F06FA61376B69DB7FDD353F4F9</code></pre>
<pre><code>b = 8F1F0600EA228E24D523E70EF1BD9EAE4878EB9F93A7C1D6F4B58ECE228DB51B79DC14D1117C139BE25D994E8584245ED2E137E322EE6450EBD1AF9B6DC5FB44DE964F41FE8163D51C37E2B05FA3E8C35ECFB5E0427F89A5E52BBD7829CC5E20754C0BB70995D4C461F343D66D40CEA859352054BE6017296A61EF89D1AF02D90ECE13D321BF52E5F5371D6C27E79FDD1274836C63D9A7ACD6A2E56949879A0BEB3D13A0A558EB9AC61ECAB15BB31BF499EB1BB55581598653790FE157326B6184D71360861AE92E592EC3CB2AD6F3DB2E6D00F8EE680BDAD0B65A11889F09DEA9221DC602EDBB40A18ABCCCFA45A98366A5B30CA5AEE2A706297ECE8B5D2E32</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 = C2334537E645F90117D93FB61B951353B10BC60DF2D08463B53E1DCA15623BE76555F7E4F7186F02551FAD2AF95CEA006EF90B5F235A48B444EE8D9EE0457111634D7B1505ACC93BF7D9E9AE03750033CD4A3512BFFD13193BB8A716E9B42C9D0CD254EB627C9DCD722656BA71582FF9E7D9C7727ADDD9CF9F61A6A31E7016F8D778BF7366345FE987658BF78CDB16DA174283B69DF12DC2786436D99FD919E0A35D2D8DD5827A79BF8C2E99FF4BC8DA72F3DBAB62A64D13AC1DF4DFD547BD31D963D19134F455C6A96B25056A449DDDBE29E1FB7DB68D0099F00BC113A216F43AF87D8382AA178ED65A34E7104613FE96A8A703E646AA5AD10617E680D4037B</code></pre>
<pre><code>g_b = 1A5A1D23F7AA2DD9DEC1D446C76D609A55B36BDFF7BC6306258D00755DF586997D56491AA5A5D6B77DE6BF7FF733C8F8CC255ED31A13FDCA5AE71CC555255B9C767BCE8ACC5C9D729B5BC8C4F9EDA78C57C576B2018CD0E69118CC1F436F18A64A2C17DE8D0F4D5D15DF491CA0C9F660A3CE03655693269B20F95C25585744B7EC7BD50702810A6CCFB9E2B57738873DE628B1D212409A24D5C33D2BE9CC07E409A74CDFC772C5B964B18AC37F7F5B0E4CB4846C0A743522AA5ABDCA318F96007A79FA04276EFC807B445F4C62A9C3B913F7837ADBBA8072532984F768F0CE42689E1AFA318A9AB882D44750DE09F310034EE7A6A070C70E6AC09B999951311E</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 C7 C4 6E 4A 29 12 7F 79 40 49 0E 28
0010 | C9 41 A2 1A ED 2B F6 47 79 20 E8 B6 96 30 62 79
0020 | 4A 66 FE 44 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | C2 33 45 37 E6 45 F9 01 17 D9 3F B6 1B 95 13 53
0040 | B1 0B C6 0D F2 D0 84 63 B5 3E 1D CA 15 62 3B E7
0050 | 65 55 F7 E4 F7 18 6F 02 55 1F AD 2A F9 5C EA 00
0060 | 6E F9 0B 5F 23 5A 48 B4 44 EE 8D 9E E0 45 71 11
0070 | 63 4D 7B 15 05 AC C9 3B F7 D9 E9 AE 03 75 00 33
0080 | CD 4A 35 12 BF FD 13 19 3B B8 A7 16 E9 B4 2C 9D
0090 | 0C D2 54 EB 62 7C 9D CD 72 26 56 BA 71 58 2F F9
00A0 | E7 D9 C7 72 7A DD D9 CF 9F 61 A6 A3 1E 70 16 F8
00B0 | D7 78 BF 73 66 34 5F E9 87 65 8B F7 8C DB 16 DA
00C0 | 17 42 83 B6 9D F1 2D C2 78 64 36 D9 9F D9 19 E0
00D0 | A3 5D 2D 8D D5 82 7A 79 BF 8C 2E 99 FF 4B C8 DA
00E0 | 72 F3 DB AB 62 A6 4D 13 AC 1D F4 DF D5 47 BD 31
00F0 | D9 63 D1 91 34 F4 55 C6 A9 6B 25 05 6A 44 9D DD
0100 | BE 29 E1 FB 7D B6 8D 00 99 F0 0B C1 13 A2 16 F4
0110 | 3A F8 7D 83 82 AA 17 8E D6 5A 34 E7 10 46 13 FE
0120 | 96 A8 A7 03 E6 46 AA 5A D1 06 17 E6 80 D4 03 7B</code></pre>
<pre><code>0000 | 54 B6 43 66 DA 8F 30 4B DA 3E 14 CF 4C C1 C3 A4
0010 | 5A 90 15 6F 18 06 1D 83 76 1E 28 ED AC CD 4E 30
0020 | 98 C2 6D 38 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 1A 5A 1D 23 F7 AA 2D D9 DE C1 D4 46 C7 6D 60 9A
0040 | 55 B3 6B DF F7 BC 63 06 25 8D 00 75 5D F5 86 99
0050 | 7D 56 49 1A A5 A5 D6 B7 7D E6 BF 7F F7 33 C8 F8
0060 | CC 25 5E D3 1A 13 FD CA 5A E7 1C C5 55 25 5B 9C
0070 | 76 7B CE 8A CC 5C 9D 72 9B 5B C8 C4 F9 ED A7 8C
0080 | 57 C5 76 B2 01 8C D0 E6 91 18 CC 1F 43 6F 18 A6
0090 | 4A 2C 17 DE 8D 0F 4D 5D 15 DF 49 1C A0 C9 F6 60
00A0 | A3 CE 03 65 56 93 26 9B 20 F9 5C 25 58 57 44 B7
00B0 | EC 7B D5 07 02 81 0A 6C CF B9 E2 B5 77 38 87 3D
00C0 | E6 28 B1 D2 12 40 9A 24 D5 C3 3D 2B E9 CC 07 E4
00D0 | 09 A7 4C DF C7 72 C5 B9 64 B1 8A C3 7F 7F 5B 0E
00E0 | 4C B4 84 6C 0A 74 35 22 AA 5A BD CA 31 8F 96 00
00F0 | 7A 79 FA 04 27 6E FC 80 7B 44 5F 4C 62 A9 C3 B9
0100 | 13 F7 83 7A DB BA 80 72 53 29 84 F7 68 F0 CE 42
0110 | 68 9E 1A FA 31 8A 9A B8 82 D4 47 50 DE 09 F3 10
0120 | 03 4E E7 A6 A0 70 C7 0E 6A C0 9B 99 99 51 31 1E</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 = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE000100C2334537E645F90117D93FB6</code> <code>1B951353B10BC60DF2D08463B53E1DCA</code> <code>15623BE76555F7E4F7186F02551FAD2A</code> <code>F95CEA006EF90B5F235A48B444EE8D9E</code> <code>E0457111634D7B1505ACC93BF7D9E9AE</code> <code>03750033CD4A3512BFFD13193BB8A716</code> <code>E9B42C9D0CD254EB627C9DCD722656BA</code> <code>71582FF9E7D9C7727ADDD9CF9F61A6A3</code> <code>1E7016F8D778BF7366345FE987658BF7</code> <code>8CDB16DA174283B69DF12DC2786436D9</code> <code>9FD919E0A35D2D8DD5827A79BF8C2E99</code> <code>FF4BC8DA72F3DBAB62A64D13AC1DF4DF</code> <code>D547BD31D963D19134F455C6A96B2505</code> <code>6A449DDDBE29E1FB7DB68D0099F00BC1</code> <code>13A216F43AF87D8382AA178ED65A34E7</code> <code>104613FE96A8A703E646AA5AD10617E6</code><br> <code>80D4037B</code></td>
<td><code>FE0001001A5A1D23F7AA2DD9DEC1D446</code> <code>C76D609A55B36BDFF7BC6306258D0075</code> <code>5DF586997D56491AA5A5D6B77DE6BF7F</code> <code>F733C8F8CC255ED31A13FDCA5AE71CC5</code> <code>55255B9C767BCE8ACC5C9D729B5BC8C4</code> <code>F9EDA78C57C576B2018CD0E69118CC1F</code> <code>436F18A64A2C17DE8D0F4D5D15DF491C</code> <code>A0C9F660A3CE03655693269B20F95C25</code> <code>585744B7EC7BD50702810A6CCFB9E2B5</code> <code>7738873DE628B1D212409A24D5C33D2B</code> <code>E9CC07E409A74CDFC772C5B964B18AC3</code> <code>7F7F5B0E4CB4846C0A743522AA5ABDCA</code> <code>318F96007A79FA04276EFC807B445F4C</code> <code>62A9C3B913F7837ADBBA8072532984F7</code> <code>68F0CE42689E1AFA318A9AB882D44750</code> <code>DE09F310034EE7A6A070C70E6AC09B99</code><br> <code>9951311E</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 = BA0D89B5C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE4
<!-- 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 = 54B64366C7C46E4A29127F7940490E28C941A21AED2BF6477920E8B6963062794A66FE440000000000000000FE000100C2334537E645F90117D93FB61B951353B10BC60DF2D08463B53E1DCA15623BE76555F7E4F7186F02551FAD2AF95CEA006EF90B5F235A48B444EE8D9EE0457111634D7B1505ACC93BF7D9E9AE03750033CD4A3512BFFD13193BB8A716E9B42C9D0CD254EB627C9DCD722656BA71582FF9E7D9C7727ADDD9CF9F61A6A31E7016F8D778BF7366345FE987658BF78CDB16DA174283B69DF12DC2786436D99FD919E0A35D2D8DD5827A79BF8C2E99FF4BC8DA72F3DBAB62A64D13AC1DF4DFD547BD31D963D19134F455C6A96B25056A449DDDBE29E1FB7DB68D0099F00BC113A216F43AF87D8382AA178ED65A34E7104613FE96A8A703E646AA5AD10617E680D4037B
padding = FA4F1A72D69D8AAAEED9FFC0
tmp_aes_key = 973E7D29702C3C5E3555C007F7D6661970A178B5DAD93A5581B7110434F1D59F
tmp_aes_iv = 92318A0458D3F63CC0401134D751DC5EDA2357860F260F0A24A44BB60995FD0F</code></pre>
<pre><code>data = 54B64366DA8F304BDA3E14CF4CC1C3A45A90156F18061D83761E28EDACCD4E3098C26D380000000000000000FE0001001A5A1D23F7AA2DD9DEC1D446C76D609A55B36BDFF7BC6306258D00755DF586997D56491AA5A5D6B77DE6BF7FF733C8F8CC255ED31A13FDCA5AE71CC555255B9C767BCE8ACC5C9D729B5BC8C4F9EDA78C57C576B2018CD0E69118CC1F436F18A64A2C17DE8D0F4D5D15DF491CA0C9F660A3CE03655693269B20F95C25585744B7EC7BD50702810A6CCFB9E2B57738873DE628B1D212409A24D5C33D2BE9CC07E409A74CDFC772C5B964B18AC37F7F5B0E4CB4846C0A743522AA5ABDCA318F96007A79FA04276EFC807B445F4C62A9C3B913F7837ADBBA8072532984F768F0CE42689E1AFA318A9AB882D44750DE09F310034EE7A6A070C70E6AC09B999951311E
padding = 6226EC63E93464D393BEE8B0
tmp_aes_key = C3CC8BD927F95C57F5565994829974576F927A242E37E9166F8E1464A9E290DA
tmp_aes_iv = 4607FCB9E6397C9A9F6C179F561B660532DFF53B6782FE4E563FD12A154BB5D0</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 = 402587FF53281A41BBED3F28586EAA24FD640A3E39B081384A7872DEFC52D8E58C76F8DB3D2479722D920C9617C1BD6B1528051A64D448811C138B9A0BB1CA1CDD74CBBCD3579CEB5456A5DB8B1167FF618BF4FF5E789C850D027D8A60E6DD042BEDBF55AA432563D4EA147AA54B9BA6994985DE1A890E40E688DDE6866DF4E12EF7C2B54A31D9C530C1D5E5F7F189327BCF663BECAAC68E72B07BBAB09120FB56B3C740806FE988C6CCD1158DB0AC211E3ABD86B012F22AB60DB37698E7D0EAA37379FB949584CECDBBC634FE61C5B4AC7A11479710D70F22747391ED3239F48C4803B03D51197BFC6AF20517FAF953F9FD9B4128D44D4EB5C93D19DBB80C759779AA08B1EFAA435B4D9A4594449FEA203FA77A88DF024043F14B9BBBC64360A7CAC90D5B59446F19F698BABAFC90A01372E404578781FCBBC11134F37E88F97BCA3DFFF9291EE515388B0CFB971BB2</code></pre>
<pre><code>encrypted_data = C5189C9B7C88624E7CE0C220A165A05F9DA8AC40D50ED71CDCE13C990FBAEEE29DA123D967C4AB5B66FBFBB036D3F88FE8C0EF6EA31055D02F5825017EF519ACD1730350AD3CECA1208BCC3808632B0A3D7E8A83EB633E6C91660B2AB057A5EC0E365C31D10F00D98A4C33191DCB4BDF3338F85FF0EEF1663F8FB7624C50A702EDCFA984F66D3931D1CF22AC7D43DA24BF8CCB2768002221380F837EA99029B240A96747569C5AFB89AB8B5EFC158971C5E02AC124357B3E6F66DF2076512D659D7803B3853532E81EF13ECE6EABDF9517E2070DE10CE996965BADCD6B423F2D74FA56D3A1C36342550361331B761B23AB5AC04BD54278E7C8EB6F3E125FA9C1E20692F8DFC4220786FB20E1370F6B95D175894419FAFA51EE516A59F1A59C1C2BA4067C97EBF2FDD41F00EE58859FDA0AE8AF7DA0515DD87F087A15BA419868E7CF947DC07F3D92F55EFCDC3E317F98</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 BC 81 0B 00 12 AA 37 67
0010 | 78 01 00 00 1F 5F 04 F5 C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A ED 2B F6 47 79 20 E8 B6
0030 | 96 30 62 79 4A 66 FE 44 FE 50 01 00 40 25 87 FF
0040 | 53 28 1A 41 BB ED 3F 28 58 6E AA 24 FD 64 0A 3E
0050 | 39 B0 81 38 4A 78 72 DE FC 52 D8 E5 8C 76 F8 DB
0060 | 3D 24 79 72 2D 92 0C 96 17 C1 BD 6B 15 28 05 1A
0070 | 64 D4 48 81 1C 13 8B 9A 0B B1 CA 1C DD 74 CB BC
0080 | D3 57 9C EB 54 56 A5 DB 8B 11 67 FF 61 8B F4 FF
0090 | 5E 78 9C 85 0D 02 7D 8A 60 E6 DD 04 2B ED BF 55
00A0 | AA 43 25 63 D4 EA 14 7A A5 4B 9B A6 99 49 85 DE
00B0 | 1A 89 0E 40 E6 88 DD E6 86 6D F4 E1 2E F7 C2 B5
00C0 | 4A 31 D9 C5 30 C1 D5 E5 F7 F1 89 32 7B CF 66 3B
00D0 | EC AA C6 8E 72 B0 7B BA B0 91 20 FB 56 B3 C7 40
00E0 | 80 6F E9 88 C6 CC D1 15 8D B0 AC 21 1E 3A BD 86
00F0 | B0 12 F2 2A B6 0D B3 76 98 E7 D0 EA A3 73 79 FB
0100 | 94 95 84 CE CD BB C6 34 FE 61 C5 B4 AC 7A 11 47
0110 | 97 10 D7 0F 22 74 73 91 ED 32 39 F4 8C 48 03 B0
0120 | 3D 51 19 7B FC 6A F2 05 17 FA F9 53 F9 FD 9B 41
0130 | 28 D4 4D 4E B5 C9 3D 19 DB B8 0C 75 97 79 AA 08
0140 | B1 EF AA 43 5B 4D 9A 45 94 44 9F EA 20 3F A7 7A
0150 | 88 DF 02 40 43 F1 4B 9B BB C6 43 60 A7 CA C9 0D
0160 | 5B 59 44 6F 19 F6 98 BA BA FC 90 A0 13 72 E4 04
0170 | 57 87 81 FC BB C1 11 34 F3 7E 88 F9 7B CA 3D FF
0180 | F9 29 1E E5 15 38 8B 0C FB 97 1B B2</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC 6A 0E 00 34 73 38 67
0010 | 78 01 00 00 1F 5F 04 F5 DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 6F 18 06 1D 83 76 1E 28 ED
0030 | AC CD 4E 30 98 C2 6D 38 FE 50 01 00 C5 18 9C 9B
0040 | 7C 88 62 4E 7C E0 C2 20 A1 65 A0 5F 9D A8 AC 40
0050 | D5 0E D7 1C DC E1 3C 99 0F BA EE E2 9D A1 23 D9
0060 | 67 C4 AB 5B 66 FB FB B0 36 D3 F8 8F E8 C0 EF 6E
0070 | A3 10 55 D0 2F 58 25 01 7E F5 19 AC D1 73 03 50
0080 | AD 3C EC A1 20 8B CC 38 08 63 2B 0A 3D 7E 8A 83
0090 | EB 63 3E 6C 91 66 0B 2A B0 57 A5 EC 0E 36 5C 31
00A0 | D1 0F 00 D9 8A 4C 33 19 1D CB 4B DF 33 38 F8 5F
00B0 | F0 EE F1 66 3F 8F B7 62 4C 50 A7 02 ED CF A9 84
00C0 | F6 6D 39 31 D1 CF 22 AC 7D 43 DA 24 BF 8C CB 27
00D0 | 68 00 22 21 38 0F 83 7E A9 90 29 B2 40 A9 67 47
00E0 | 56 9C 5A FB 89 AB 8B 5E FC 15 89 71 C5 E0 2A C1
00F0 | 24 35 7B 3E 6F 66 DF 20 76 51 2D 65 9D 78 03 B3
0100 | 85 35 32 E8 1E F1 3E CE 6E AB DF 95 17 E2 07 0D
0110 | E1 0C E9 96 96 5B AD CD 6B 42 3F 2D 74 FA 56 D3
0120 | A1 C3 63 42 55 03 61 33 1B 76 1B 23 AB 5A C0 4B
0130 | D5 42 78 E7 C8 EB 6F 3E 12 5F A9 C1 E2 06 92 F8
0140 | DF C4 22 07 86 FB 20 E1 37 0F 6B 95 D1 75 89 44
0150 | 19 FA FA 51 EE 51 6A 59 F1 A5 9C 1C 2B A4 06 7C
0160 | 97 EB F2 FD D4 1F 00 EE 58 85 9F DA 0A E8 AF 7D
0170 | A0 51 5D D8 7F 08 7A 15 BA 41 98 68 E7 CF 94 7D
0180 | C0 7F 3D 92 F5 5E FC DC 3E 31 7F 98</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>BC810B0012AA3767</code></td>
<td><code>CC6A0E0034733867</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>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100402587FF53281A41BBED3F28</code> <code>586EAA24FD640A3E39B081384A7872DE</code> <code>FC52D8E58C76F8DB3D2479722D920C96</code> <code>17C1BD6B1528051A64D448811C138B9A</code> <code>0BB1CA1CDD74CBBCD3579CEB5456A5DB</code> <code>8B1167FF618BF4FF5E789C850D027D8A</code> <code>60E6DD042BEDBF55AA432563D4EA147A</code> <code>A54B9BA6994985DE1A890E40E688DDE6</code> <code>866DF4E12EF7C2B54A31D9C530C1D5E5</code> <code>F7F189327BCF663BECAAC68E72B07BBA</code> <code>B09120FB56B3C740806FE988C6CCD115</code> <code>8DB0AC211E3ABD86B012F22AB60DB376</code> <code>98E7D0EAA37379FB949584CECDBBC634</code> <code>FE61C5B4AC7A11479710D70F22747391</code> <code>ED3239F48C4803B03D51197BFC6AF205</code> <code>17FAF953F9FD9B4128D44D4EB5C93D19</code> <code>DBB80C759779AA08B1EFAA435B4D9A45</code> <code>94449FEA203FA77A88DF024043F14B9B</code> <code>BBC64360A7CAC90D5B59446F19F698BA</code> <code>BAFC90A01372E404578781FCBBC11134</code> <code>F37E88F97BCA3DFFF9291EE515388B0C</code><br> <code>FB971BB2</code></td>
<td><code>FE500100C5189C9B7C88624E7CE0C220</code> <code>A165A05F9DA8AC40D50ED71CDCE13C99</code> <code>0FBAEEE29DA123D967C4AB5B66FBFBB0</code> <code>36D3F88FE8C0EF6EA31055D02F582501</code> <code>7EF519ACD1730350AD3CECA1208BCC38</code> <code>08632B0A3D7E8A83EB633E6C91660B2A</code> <code>B057A5EC0E365C31D10F00D98A4C3319</code> <code>1DCB4BDF3338F85FF0EEF1663F8FB762</code> <code>4C50A702EDCFA984F66D3931D1CF22AC</code> <code>7D43DA24BF8CCB2768002221380F837E</code> <code>A99029B240A96747569C5AFB89AB8B5E</code> <code>FC158971C5E02AC124357B3E6F66DF20</code> <code>76512D659D7803B3853532E81EF13ECE</code> <code>6EABDF9517E2070DE10CE996965BADCD</code> <code>6B423F2D74FA56D3A1C3634255036133</code> <code>1B761B23AB5AC04BD54278E7C8EB6F3E</code> <code>125FA9C1E20692F8DFC4220786FB20E1</code> <code>370F6B95D175894419FAFA51EE516A59</code> <code>F1A59C1C2BA4067C97EBF2FDD41F00EE</code> <code>58859FDA0AE8AF7DA0515DD87F087A15</code> <code>BA419868E7CF947DC07F3D92F55EFCDC</code><br> <code>3E317F98</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 = A04829E380011C4B01B56A89E011574CEBF8CFF6A9BC3BFE092FE7352719449516BB5AB780DA596A1209D6C282BD84A88FDAEE91729D7F656D495E0A945A19E03E7FF7CB39EB1CF87872D4E3FA1C8A01B485AE714E9FEFFD42DCA0C1AF94544DD7B5940C072F56B5858AD350E1C7E71A6AB17E256F64815E9FE2695826A36B1DF7DF1B675DD52174528A68A243EA0FBB7541C30BAAF67DB4B696CD7FE623E21B73B9A0B3107302E55CFBCC1C25E86E5CA02EC61D8250FB4A22EE352FA4BFF32A33BAFBA8E2DAD8F2EE2FD65E4DD7952A7A2B0A9E4B50601FCD54B7401459E0A1490DEB3160E948F29EC34ABF47010B4936E07F41FC5C3879C81B42D19FF63850</code></pre>
<pre><code>auth_key = 72CCEFE497C7AD95D6FAA68228F1D91CB6B7EB9759CF87AB9C55F9177935B3F3943A266C6806AC2553690A4C1C8482D6691254885FBB9EBE200A7AD00FC17378C0D140387830B48BAE1D05B4A0EA2A9A899780E880B83F9D564285633C732D61BDDB41060C8E908643DDCAECC9D2F40025AA8AE78AE84DA39717CC86428906BFFDE1C394654EE80C3FA251858E66E1CBF8D45365AB9933178EB4FFE629F63418A1A6799EB43BBD2851C32124A27FEF6AF07600EEC15EC6B57716F92AA0DD58FF1F03C901BBF94AE73CCF2192A6CCD3D3AC2968D3CD0D7570E31ABE6170B9531BE6F9D40DE277EE0632C6397525456116A076DBF8A078B78D53E5D241F509FD8C</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 D0 41 ED 13 AA 37 67
0010 | 34 00 00 00 34 F7 CB 3B C7 C4 6E 4A 29 12 7F 79
0020 | 40 49 0E 28 C9 41 A2 1A ED 2B F6 47 79 20 E8 B6
0030 | 96 30 62 79 4A 66 FE 44 84 37 DE E3 61 E2 E2 1E
0040 | C7 1B 7D 68 E5 3B FB 81</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C4 01 50 35 73 38 67
0010 | 34 00 00 00 34 F7 CB 3B DA 8F 30 4B DA 3E 14 CF
0020 | 4C C1 C3 A4 5A 90 15 6F 18 06 1D 83 76 1E 28 ED
0030 | AC CD 4E 30 98 C2 6D 38 75 5F B4 3E 02 10 FD 88
0040 | 14 F2 BA 24 8D 98 92 BD</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,7 +817,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>01D041ED13AA3767</code></td>
<td><code>01C4015035733867</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>
@ -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>C7C46E4A29127F7940490E28C941A21A</code></td>
<td><code>DA8F304BDA3E14CF4CC1C3A45A90156F</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>ED2BF6477920E8B6963062794A66FE44</code></td>
<td><code>18061D83761E28EDACCD4E3098C26D38</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>8437DEE361E2E21EC71B7D68E53BFB81</code></td>
<td><code>755FB43E0210FD8814F2BA248D9892BD</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

@ -101,7 +101,7 @@
</tr>
<tr>
<td><a href="/method/payments.getStarsSubscriptions">payments.getStarsSubscriptions</a></td>
<td>Obtain a list of active, expiring or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</td>
<td>Obtain a list of active, expired or cancelled <a href="/api/invites#paid-invite-links">Telegram Star subscriptions »</a>.</td>
</tr>
</tbody>
</table>